haikuwebkit/Source/WebCore/ChangeLog-2019-06-05

93420 lines
4.4 MiB
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

2019-06-05 Antoine Quint <graouts@apple.com>
[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 <sbarati@apple.com>
[WHLSL] Implement loop expressions
https://bugs.webkit.org/show_bug.cgi?id=195808
<rdar://problem/50746309>
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<VariableDeclarationsStatement, Expression>.
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 <wenson_hsieh@apple.com>
Upstream content mode support into open source from WebKitAdditions
https://bugs.webkit.org/show_bug.cgi?id=198484
<rdar://problem/51355671>
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 <sbarati@apple.com>
[WHLSL] checkDuplicateFunctions() should not be O(n^2)
https://bugs.webkit.org/show_bug.cgi?id=198155
<rdar://problem/51288811>
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 <zalan@apple.com>
[LFC][IFC] LineLayout::placeInlineItems should not apply float contraint.
https://bugs.webkit.org/show_bug.cgi?id=198565
<rdar://problem/51440718>
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 <tsavell@apple.com>
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 <mcatanzaro@igalia.com>
[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 <zalan@apple.com>
[LFC][IFC] Move inline item height computation to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=198550
<rdar://problem/51424223>
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 <graouts@apple.com>
[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 <mcatanzaro@igalia.com>
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 <rniwa@webkit.org>
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 <zalan@apple.com>
[ContentChangeObserver] Gmail text editing controls require two taps
https://bugs.webkit.org/show_bug.cgi?id=198541
<rdar://problem/51375055>
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 <mcatanzaro@igalia.com>
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 <krollin@apple.com>
Fix 64-bit vs 32-bit mismatch in ISOFairPlayStreamingPsshBox.cpp
https://bugs.webkit.org/show_bug.cgi?id=198539
<rdar://problem/51410358>
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 <krollin@apple.com>
Fix 64-bit vs 32-bit mismatch in TileController.cpp
https://bugs.webkit.org/show_bug.cgi?id=198540
<rdar://problem/51410851>
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 <cdumez@apple.com>
Crash when calling XMLHttpRequest.setRequestHeader() in a worker
https://bugs.webkit.org/show_bug.cgi?id=198534
<rdar://problem/51393912>
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 <antti@apple.com>
Sticky positioning is jumpy in many overflow cases
https://bugs.webkit.org/show_bug.cgi?id=198532
<rdar://problem/51400532>
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 <Takashi.Komori@sony.com>
[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 <graouts@apple.com>
[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 <krollin@apple.com>
Fix 32-bit/64-bit mismatch in PointerCaptureController::elementWasRemoved
https://bugs.webkit.org/show_bug.cgi?id=198501
<rdar://problem/51370464>
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 <graouts@apple.com>
[Pointer Events] Expose navigator.maxTouchPoints
https://bugs.webkit.org/show_bug.cgi?id=198468
<rdar://problem/51273029>
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 <zalan@apple.com>
[LFC][IFC] Decouple float placement and line shrinking
https://bugs.webkit.org/show_bug.cgi?id=198528
<rdar://problem/51397638>
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 <zalan@apple.com>
[LFC][IFC] Add hard line break handling to LineBreaker
https://bugs.webkit.org/show_bug.cgi?id=198503
<rdar://problem/51373482>
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 <zalan@apple.com>
[LFC][IFC] Remove InlineItem::width
https://bugs.webkit.org/show_bug.cgi?id=198502
<rdar://problem/51371744>
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 <zalan@apple.com>
[LFC][IFC] Move run width measuring out of LineBreaker
https://bugs.webkit.org/show_bug.cgi?id=198491
<rdar://problem/51363554>
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 <zalan@apple.com>
[LFC][IFC] Remove redundant InlineItem::width() calls.
https://bugs.webkit.org/show_bug.cgi?id=198489
<rdar://problem/51360390>
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 <graouts@apple.com>
The "mouseenter" and "pointerenter" events are fired from the bottom up
https://bugs.webkit.org/show_bug.cgi?id=198036
<rdar://problem/50940350>
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 <cathiechen@igalia.com>
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 <aestes@apple.com>
[Apple Pay] Disable script injection when canMakePayment APIs are called and return true
https://bugs.webkit.org/show_bug.cgi?id=198448
<rdar://problem/51323694>
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 <rmorisset@apple.com>
[WHLSL] Parsing and lexing the standard library is slow
https://bugs.webkit.org/show_bug.cgi?id=192890
<rdar://problem/50746335>
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 <youenn@apple.com>
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 <wenson_hsieh@apple.com>
Implement an internal switch to turn idempotent text autosizing and viewport rules off
https://bugs.webkit.org/show_bug.cgi?id=198460
<rdar://problem/51324526>
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 <rbuis@igalia.com>
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 <aestes@apple.com>
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
<rdar://problem/50512713>
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 <timothy@apple.com>
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 <don.olmstead@sony.com>
[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 <zdobersek@igalia.com>
[Nicosia] Disable async scrolling until implemented
https://bugs.webkit.org/show_bug.cgi?id=198476
<rdar://problem/51351478>
Unreviewed follow-up to r246033.
* page/scrolling/ScrollingCoordinator.cpp:
Expand the PLATFORM(IOS) guard to IOS_FAMILY.
2019-06-03 Darin Adler <darin@apple.com>
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 <zdobersek@igalia.com>
[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 <graouts@apple.com>
[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 <simon.fraser@apple.com>
[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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <aestes@apple.com>
[Apple Pay] Every PaymentCoordinator client should explicitly decide whether they support unrestricted Apple Pay
https://bugs.webkit.org/show_bug.cgi?id=198449
<rdar://problem/51038583>
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 <youenn@apple.com>
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 <ggaren@apple.com>
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 <andresg_22@apple.com>
Inserting a newline in contenteditable causes two characters to be added instead of one
https://bugs.webkit.org/show_bug.cgi?id=197894
<rdar://problems/49700998>
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 <timothy_horton@apple.com>
Optionally respect device management restrictions when loading from the network
https://bugs.webkit.org/show_bug.cgi?id=198318
<rdar://problem/44263806>
Reviewed by Alex Christensen.
* en.lproj/Localizable.strings:
2019-05-31 Simon Fraser <simon.fraser@apple.com>
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 <sbarati@apple.com>
[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 <simon.fraser@apple.com>
[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 <ggaren@apple.com>
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 <zalan@apple.com>
[LFC][IFC] InlineFormattingContext::LineLayout::processInlineItemsForLine should create and destroy Line.
https://bugs.webkit.org/show_bug.cgi?id=198419
<rdar://problem/51300837>
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 <don.olmstead@sony.com>
[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 <jh718.park@samsung.com>
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 <ryanhaddad@apple.com>
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 <zalan@apple.com>
[LFC[IFC] Do not reuse the same Line object.
https://bugs.webkit.org/show_bug.cgi?id=198366
<rdar://problem/51250279>
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 <zalan@apple.com>
[LFC][IFC] Move final runs to a dedicated class (Line::Content)
https://bugs.webkit.org/show_bug.cgi?id=198360
<rdar://problem/51247717>
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 <jh718.park@samsung.com>
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 <ajuma@chromium.org>
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 <zdobersek@igalia.com>
Unreviewed. Suppress -Wunused-variable warnings for the unused static
mousePointerID variable by making it a constexpr.
* platform/PointerID.h:
2019-05-30 Simon Fraser <simon.fraser@apple.com>
Use an OptionSet<> for GraphicsLayerPaintingPhase
https://bugs.webkit.org/show_bug.cgi?id=198404
Reviewed by Tim Horton.
Replace GraphicsLayerPaintingPhase with OptionSet<GraphicsLayerPaintingPhase>.
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 <youenn@apple.com>
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 <jer.noble@apple.com>
Video playback in Safari should continue when CarPlay is plugged in
https://bugs.webkit.org/show_bug.cgi?id=198345
<rdar://problem/45505750>
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 <youenn@apple.com>
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 <sbarati@apple.com>
[WHLSL] Enforce variable lifetimes
https://bugs.webkit.org/show_bug.cgi?id=195794
<rdar://problem/50746293>
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 <ryanhaddad@apple.com>
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 <dino@apple.com>
Media documents on iPad are too wide in split screen
https://bugs.webkit.org/show_bug.cgi?id=198405
<rdar://problem/50974548>
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 <andresg_22@apple.com>
Inserting a newline in contenteditable causes two characters to be added instead of one
https://bugs.webkit.org/show_bug.cgi?id=197894
<rdar://problem/49700998>
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 <div>
and a <br> respectively. Then the emission code would emit a '\n' for
the empty div and another for the <br>.
- the second problem is a consequence of <rdar://problem/5192593> 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 <justin_fan@apple.com>
[Web GPU] Vertex Buffers/Input State API updates
https://bugs.webkit.org/show_bug.cgi?id=194258
<rdar://problem/47806127>
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 <zalan@apple.com>
[iOS] Do not linkify telephone numbers inside <a> 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 <a> element won't get linkified even when the <a> has no valid href attribute.
Test: fast/dom/linkify-phone-numbers.html
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::disallowTelephoneNumberParsing):
2019-05-30 Truitt Savell <tsavell@apple.com>
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 <simon.fraser@apple.com>
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 <tsavell@apple.com>
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 <jer.noble@apple.com>
ASSERTION FAILED: m_scriptExecutionContext under WebCore::AudioContext::isPlayingAudioDidChange()
https://bugs.webkit.org/show_bug.cgi?id=181597
<rdar://problem/36474088>
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 <jer.noble@apple.com>
Video playback in Safari should continue when CarPlay is plugged in
https://bugs.webkit.org/show_bug.cgi?id=198345
<rdar://problem/45505750>
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 <rmorisset@apple.com>
[WHLSL] Parsing and lexing the standard library is slow
https://bugs.webkit.org/show_bug.cgi?id=192890
<rdar://problem/50746335>
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 <jiewen_tan@apple.com>
Unreviewed, update WebAuthN to "Supported In Preview"
* features.json:
2019-05-29 Don Olmstead <don.olmstead@sony.com>
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 <youenn@apple.com>
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 <ddkilzer@apple.com>
IndexedDatabase Server thread in com.apple.WebKit.Networking process leaks objects into an autoreleasePool that's never cleared
<https://webkit.org/b/198346>
<rdar://problem/50895658>
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 <ggaren@apple.com>
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<ContainerNode>, 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<CDMInstanceSessionClient>.
* 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 <graouts@apple.com>
[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 <ryanhaddad@apple.com>
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 <krollin@apple.com>
Fix builds that don't use makeWindowFromView
https://bugs.webkit.org/show_bug.cgi?id=198342
<rdar://problem/51228563>
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 <ggaren@apple.com>
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<ContainerNode>, 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<CDMInstanceSessionClient>.
* 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 <antti@apple.com>
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 <ludovico.denittis@collabora.com>
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 <zalan@apple.com>
[LFC][IFC] Move Line class to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=198332
<rdar://problem/51221403>
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 <ludovico.denittis@collabora.com>
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 <yacine.bandou@softathome.com>
[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 <Hironori.Fujii@sony.com>
[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 <Hironori.Fujii@sony.com>
[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 <sbarati@apple.com>
[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 <wenson_hsieh@apple.com>
[iOS] Respect NSItemProvider's registered types when dropping files that are loaded in-place
https://bugs.webkit.org/show_bug.cgi?id=198315
<rdar://problem/51183762>
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 <mmaxfield@apple.com>
Move idempotent text autosizing to StyleTreeResolver
https://bugs.webkit.org/show_bug.cgi?id=197808
<rdar://problem/50283983>
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 <simon.fraser@apple.com>
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 <sroberts@apple.com>
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 <bfulgham@apple.com>
Protect frames during style and layout changes
https://bugs.webkit.org/show_bug.cgi?id=198047
<rdar://problem/50954082>
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 <antti@apple.com>
[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 <zalan@apple.com>
[LFC][Verification] Add additional inline and block checks
https://bugs.webkit.org/show_bug.cgi?id=198252
<rdar://problem/51140687>
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 <zalan@apple.com>
[LFC][IFC] Decouple line layout and processing inline runs.
https://bugs.webkit.org/show_bug.cgi?id=198282
<rdar://problem/51167954>
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 <zalan@apple.com>
[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 <zalan@apple.com>
[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
<rdar://problem/51150057>
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 <graouts@apple.com>
[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 <cgarcia@igalia.com>
[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 <Takashi.Komori@sony.com>
[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 <obrufau@igalia.com>
[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 <cdumez@apple.com>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
Fix Apple Internal builds after r245788.
* platform/PlatformScreen.h:
(WebCore::screenHasTouchDevice):
(WebCore::screenIsTouchPrimaryInputDevice):
2019-05-27 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Ignore collapsed runs when setting the width on the associated display boxes.
https://bugs.webkit.org/show_bug.cgi?id=198260
<rdar://problem/51145704>
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 <cgarcia@igalia.com>
Unreviewed. Fix GTK distcheck
Move mac headers to platform specific makefile.
* Headers.cmake:
* PlatformMac.cmake:
2019-05-27 Carlos Garcia Campos <cgarcia@igalia.com>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <wilander@apple.com>
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
<rdar://problem/51117258>
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 <zalan@apple.com>
[LFC][Verification] Add areEssentiallyEqual for LayoutRect
https://bugs.webkit.org/show_bug.cgi?id=198250
<rdar://problem/51140119>
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 <wenson_hsieh@apple.com>
[iOS] Dropped text, attachments, and images should animate into place
https://bugs.webkit.org/show_bug.cgi?id=198243
<rdar://problem/35205373>
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 <zalan@apple.com>
[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 <wenson_hsieh@apple.com>
[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 <graouts@apple.com>
Opt naver.com into simulated mouse events quirk on iOS
https://bugs.webkit.org/show_bug.cgi?id=198248
<rdar://problem/50598281>
Reviewed by Brent Fulgham.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2019-05-25 Youenn Fablet <youenn@apple.com>
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 <simon.fraser@apple.com>
[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 <simon.fraser@apple.com>
[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 <jh718.park@samsung.com>
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 <mmaxfield@apple.com>
[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 <timothy@apple.com>
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 <timothy@apple.com>
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 <youenn@apple.com>
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 <rniwa@webkit.org>
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 <sbarati@apple.com>
[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 <simon.fraser@apple.com>
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
<rdar://problem/49720087>
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 <drousso@apple.com>
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 <drousso@apple.com>
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 <sbarati@apple.com>
[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 <sbarati@apple.com>
[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 <mmaxfield@apple.com>
[WHLSL] Implement property resolver
https://bugs.webkit.org/show_bug.cgi?id=195925
<rdar://problem/48219643>
Unreviewed watchOS build fix.
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
(WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
2019-05-23 Saam barati <sbarati@apple.com>
[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 <slewis@apple.com>
release builds of webkit cannot be used to generate a dyld shared cache
https://bugs.webkit.org/show_bug.cgi?id=198150
<rdar://problem/50675982>
Reviewed by Dan Bernstein.
Restrict the -not_for_dyld_shared_cache linker flag to macosx
* Configurations/WebCore.xcconfig:
2019-05-23 Zalan Bujtas <zalan@apple.com>
[Hittest] Move hittesting from RenderView to Document
https://bugs.webkit.org/show_bug.cgi?id=198192
<rdar://problem/51077762>
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 <youenn@apple.com>
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 <youenn@apple.com>
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
<rdar://problem/47189864>
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 <sbarati@apple.com>
[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<AST::DereferenceExpression>(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 <eric.carlson@apple.com>
[macOS,iOS] Add always-on logging for AVPlayerTimeControlStatus changes
https://bugs.webkit.org/show_bug.cgi?id=197946
<rdar://problem/50627457>
Reviewed by Jon Lee.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::convertEnumerationToString):
(WTF::LogArgument<AVPlayerTimeControlStatus>::toString):
(WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
2019-05-23 Antoine Quint <graouts@apple.com>
[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 <simon.fraser@apple.com>
Build fix after r245695.
* dom/Element.cpp:
2019-05-23 Antoine Quint <graouts@apple.com>
[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 <jond@apple.com>
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 <simon.fraser@apple.com>
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 <aperez@igalia.com>
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 <cstdio> inclusion.
2019-05-23 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement property resolver
https://bugs.webkit.org/show_bug.cgi?id=195925
<rdar://problem/48219643>
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 <mmaxfield@apple.com>
font-optical-sizing applies the wrong variation value
https://bugs.webkit.org/show_bug.cgi?id=197528
<rdar://problem/50152854>
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 <antti@apple.com>
Subselectors not searched when determining property whitelist for selector
https://bugs.webkit.org/show_bug.cgi?id=198147
<rdar://problem/50405208>
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 <sbarati@apple.com>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <ryanhaddad@apple.com>
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 <dabates@apple.com>
WebKit does not generate an ESC key event for CMD+.
https://bugs.webkit.org/show_bug.cgi?id=198137
<rdar://problem/51038641>
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 <rdar://problem/46431552>).
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
2019-05-22 Ali Juma <ajuma@chromium.org>
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 <graouts@apple.com>
[iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
https://bugs.webkit.org/show_bug.cgi?id=198124
<rdar://problem/50410863>
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 <jiewen_tan@apple.com>
[WebAuthN] Support Attestation Conveyance Preference
https://bugs.webkit.org/show_bug.cgi?id=192722
<rdar://problem/49939647>
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 <zalan@apple.com>
[Paste] Add support for preferred presentation size when pasting an image
https://bugs.webkit.org/show_bug.cgi?id=198132
<rdar://problem/50886917>
Reviewed by Wenson Hsieh.
Set the pasted <img> 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 <jer.noble@apple.com>
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 <youenn@apple.com>
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 <jer.noble@apple.com>
Media controls don't show in WK2 video fullscreen sometimes
https://bugs.webkit.org/show_bug.cgi?id=198094
<rdar://problem/50970661>
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 <sbarati@apple.com>
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 <sbarati@apple.com>
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 <mmaxfield@apple.com>
font-optical-sizing applies the wrong variation value
https://bugs.webkit.org/show_bug.cgi?id=197528
<rdar://problem/50152854>
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 <simon.fraser@apple.com>
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
<rdar://problem/49403082>
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 <graouts@apple.com>
[macOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
https://bugs.webkit.org/show_bug.cgi?id=198072
<rdar://problem/50983361>
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 <antti@apple.com>
RTL/overflow scroll tests fail with async overflow enabled
https://bugs.webkit.org/show_bug.cgi?id=196013
<rdar://problem/49066649>
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 <cgarcia@igalia.com>
[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 <ross.kirsling@sony.com>
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 <jer.noble@apple.com>
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 <cdumez@apple.com>
Fix security check in ScriptController::canAccessFromCurrentOrigin()
https://bugs.webkit.org/show_bug.cgi?id=196730
<rdar://problem/49731231>
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 <glazunov@google.com>.
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 <giosia@google.com>
Range getBoundingClientRect returning zero rect on simple text node with <br> 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 <bfulgham@apple.com>
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 <bfulgham@apple.com>
Wait to get frame until after layout has been run
https://bugs.webkit.org/show_bug.cgi?id=197999
<rdar://problem/50800345>
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 <bfulgham@apple.com>
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 <graouts@apple.com>
[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
<rdar://problem/50769116>
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 <graouts@apple.com>
[Pointer Events] A pointer should be marked as primary for all of its events
https://bugs.webkit.org/show_bug.cgi?id=197909
<rdar://problem/50801608>
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 <darin@apple.com>
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 <simon.fraser@apple.com>
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 <pjh0718@gmail.com>
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 <don.olmstead@sony.com>
[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 <achristensen@webkit.org>
Enable legacy EME for iOS WKWebView
https://bugs.webkit.org/show_bug.cgi?id=197964
<rdar://problem/50625666>
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 <sihui_liu@apple.com>
ASSERTION FAILED: !m_backingStore in WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore(uint64_t)
https://bugs.webkit.org/show_bug.cgi?id=197741
<rdar://problem/50625006>
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 <graouts@apple.com>
Add a website policy to disable the legacy -webkit-overflow-scrolling:touch behavior
https://bugs.webkit.org/show_bug.cgi?id=197943
<rdar://problem/49078202>
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 <achristensen@webkit.org>
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 <youenn@apple.com>
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 <rbuis@igalia.com>
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 <krollin@apple.com>
Re-enable generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=197933
<rdar://problem/50831677>
Reviewed by Jonathan Bedard.
The following two tasks have been completed, and we can re-enable
generate-xcfilelists:
Bug 197619 <rdar://problem/50507392> Temporarily disable generate-xcfilelists (197619)
Bug 197622 <rdar://problem/50508222> Rewrite generate-xcfilelists in Python (197622)
No new tests -- no change in user-visible functionality.
* Scripts/check-xcfilelists.sh:
2019-05-17 Wenson Hsieh <wenson_hsieh@apple.com>
Fix a typo in some user agent string logic
https://bugs.webkit.org/show_bug.cgi?id=197992
<rdar://problem/50895962>
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 <simon.fraser@apple.com>
REGRESSION (r245170): gmail.com inbox table header flickers
https://bugs.webkit.org/show_bug.cgi?id=198005
<rdar://problem/50907718>
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 <simon.fraser@apple.com>
REGRESSION (r245170): gmail.com header flickers when hovering over the animating buttons
https://bugs.webkit.org/show_bug.cgi?id=197975
<rdar://problem/50865946>
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 <commit-queue@webkit.org>
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 <sabouhallawa@apple.com>
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 <eric.carlson@apple.com>
Allow sequential playback of media files when initial playback started with a user gesture
https://bugs.webkit.org/show_bug.cgi?id=197959
<rdar://problem/50655207>
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 <bfulgham@apple.com>
Hardening: Prevent FrameLoader crash due to SetForScope
https://bugs.webkit.org/show_bug.cgi?id=197458
<rdar://problem/50368338>
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 <cgarcia@igalia.com>
[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 <gr3g@apple.com>
AX: Unship some ARIA string reflectors that are to-be-replaced by element reflection
https://bugs.webkit.org/show_bug.cgi?id=197764
<rdar://problem/50649689>
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 <youenn@apple.com>
CoreAudioCaptureSource should be marked as an audio capture track
https://bugs.webkit.org/show_bug.cgi?id=197953
<rdar://problem/50552007>
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 <achristensen@webkit.org>
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 <ajuma@chromium.org>
[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 <cgarcia@igalia.com>
[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 <ghughes@apple.com>
Updated screenHasInvertedColors to use AppKit when available
https://bugs.webkit.org/show_bug.cgi?id=197935
<rdar://problem/50834405>
Reviewed by Chris Fleizach.
* platform/mac/PlatformScreenMac.mm:
(WebCore::collectScreenProperties):
(WebCore::screenHasInvertedColors):
2019-05-15 Simon Fraser <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <timothy@apple.com>
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 <drousso@apple.com>
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 <zalan@apple.com>
Do not create a shape object outside of the layout context
https://bugs.webkit.org/show_bug.cgi?id=197926
<rdar://problem/50627858>
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<FloatingObject::FloatLeft>::updateOffsetIfNeeded):
(WebCore::ComputeFloatOffsetForLineLayoutAdapter<FloatingObject::FloatRight>::updateOffsetIfNeeded):
* rendering/shapes/ShapeOutsideInfo.cpp:
(WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine):
2019-05-15 Youenn Fablet <youenn@apple.com>
Mark beacon and ping loads as low priority
https://bugs.webkit.org/show_bug.cgi?id=197919
<rdar://problem/50818286>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <youenn@apple.com>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <drousso@apple.com>
Web Automation: elements larger than the viewport have incorrect in-view center point
https://bugs.webkit.org/show_bug.cgi?id=195696
<rdar://problem/48737122>
Reviewed by Simon Fraser.
Original patch by Brian Burg <bburg@apple.com>.
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 <wenson_hsieh@apple.com>
Missing cursor/caret showing in search field on google.com
https://bugs.webkit.org/show_bug.cgi?id=197862
<rdar://problem/50291989>
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 <aestes@apple.com>
[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
<rdar://problem/50631563>
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 <rmorisset@apple.com>
[WHLSL] parseEffectfulSuffix() is never called
https://bugs.webkit.org/show_bug.cgi?id=195864
<rdar://problem/50746278>
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 <rmorisset@apple.com>
[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 <ross.kirsling@sony.com>
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 <zalan@apple.com>
Do not try to issue repaint while the render tree is being destroyed.
https://bugs.webkit.org/show_bug.cgi?id=197461
<rdar://problem/50368992>
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 <youenn@apple.com>
A service worker process should app nap when all its clients app nap
https://bugs.webkit.org/show_bug.cgi?id=185626
<rdar://problem/46785908>
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 <youenn@apple.com>
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 <obrufau@igalia.com>
[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 <antti@apple.com>
Event region computation should respect transforms
https://bugs.webkit.org/show_bug.cgi?id=197836
<rdar://problem/50762971>
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 <youenn@apple.com>
Video frame resizing should be using Trim
https://bugs.webkit.org/show_bug.cgi?id=197722
<rdar://problem/50602188>
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 <ysuzuki@apple.com>
[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 <graouts@apple.com>
[Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
https://bugs.webkit.org/show_bug.cgi?id=197881
<rdar://problem/50187657>
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 <sabouhallawa@apple.com>
[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 <rego@igalia.com>
[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 <pjh0718@gmail.com>
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 <jfernandez@igalia.com>
Implement "line-break: anywhere"
https://bugs.webkit.org/show_bug.cgi?id=181169
<rdar://problem/48507088>
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 <ysuzuki@apple.com>
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 <ysuzuki@apple.com>
[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 <ggaren@apple.com>
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 <tzagallo@apple.com>
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 <antti@apple.com>
REGRESSION (r245208): compositing/shared-backing/sharing-bounds-non-clipping-shared-layer.html asserts
https://bugs.webkit.org/show_bug.cgi?id=197818
<rdar://problem/50705762>
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 <wenson_hsieh@apple.com>
[macOS] Font formatting options don't work when composing a message in Yahoo mail
https://bugs.webkit.org/show_bug.cgi?id=197813
<rdar://problem/49382250>
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 <eric.carlson@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=197793
<rdar://problem/46429187>
Unreviewed, build fix after r245199.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
2019-05-13 Darin Adler <darin@apple.com>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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 <youenn@apple.com>
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 <youenn@apple.com>
Use the main screen for screen capture
https://bugs.webkit.org/show_bug.cgi?id=197804
<rdar://problem/47671383>
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 <Takashi.Komori@sony.com>
[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 <simon.fraser@apple.com>
Overflow scroll that becomes non-scrollable should stop being composited
https://bugs.webkit.org/show_bug.cgi?id=197817
<rdar://problem/50697290>
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 <simon.fraser@apple.com>
Layer bounds are incorrect for sharing layers that paint with transforms
https://bugs.webkit.org/show_bug.cgi?id=197768
<rdar://problem/50695493>
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 <simon.fraser@apple.com>
Translucent gradient rendering bug due to will-change transform
https://bugs.webkit.org/show_bug.cgi?id=197654
<rdar://problem/50547664>
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 <simon.fraser@apple.com>
When the scroller hosting a shared layer becomes non-scrollable, content disappears
https://bugs.webkit.org/show_bug.cgi?id=197766
<rdar://problem/50695808>
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 <simon.fraser@apple.com>
Backing-sharing layers with transforms render incorrectly
https://bugs.webkit.org/show_bug.cgi?id=197692
<rdar://problem/50652127>
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:
<div class="clipping">
<div class="sharing">
<div class="inner">
</div>
</div>
</div>
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 <youenn@apple.com>
A service worker instance should be terminated when its SWServer is destroyed
https://bugs.webkit.org/show_bug.cgi?id=197801
<rdar://problem/50587270>
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 <eric.carlson@apple.com>
[iOS] HTMLMediaElement sometimes doesn't send 'webkitplaybacktargetavailabilitychanged' event
https://bugs.webkit.org/show_bug.cgi?id=197793
<rdar://problem/46429187>
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 <ggaren@apple.com>
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 <zalan@apple.com>
[iOS] baidu.com: Synthetic bold renders too far apart, appears doubled.
https://bugs.webkit.org/show_bug.cgi?id=197781
<rdar://problem/48027412>
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 <bfulgham@apple.com>
Gracefully handle inaccessible font face data
https://bugs.webkit.org/show_bug.cgi?id=197762
<rdar://problem/50433861>
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 <simon.fraser@apple.com>
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 <mcatanzaro@igalia.com>
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 <antti@apple.com>
Event region generation needs to know about backing-sharing
https://bugs.webkit.org/show_bug.cgi?id=197694
<rdar://problem/50584991>
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 <mcatanzaro@igalia.com>
[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 <simon.fraser@apple.com>
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
<rdar://problem/50445998>
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 <dabates@apple.com>
[iOS] Right command key has wrong value for property code
https://bugs.webkit.org/show_bug.cgi?id=193876
<rdar://problem/47577308>
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 <dabates@apple.com>
[iOS] Numpad comma key has incorrect keyIdentifier property
https://bugs.webkit.org/show_bug.cgi?id=197753
<rdar://problem/50636274>
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 <zalan@apple.com>
Do not mix inline and block level boxes.
https://bugs.webkit.org/show_bug.cgi?id=197462
<rdar://problem/50369362>
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 <eric.carlson@apple.com>
Refine AudioSession route sharing policy
https://bugs.webkit.org/show_bug.cgi?id=197742
<rdar://problem/50590818>
Reviewed by Darin Adler.
No new tests, updated AVAudioSessionRouteSharingPolicy API test.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::updateSessionState):
2019-05-09 Simon Fraser <simon.fraser@apple.com>
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 <bfulgham@apple.com>
Correct delayed load event handling
https://bugs.webkit.org/show_bug.cgi?id=197679
<rdar://problem/50423334>
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 <antti@apple.com>
Elements with "display: inline-block" don't have a touch-action region
https://bugs.webkit.org/show_bug.cgi?id=197281
<rdar://problem/50535081>
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 <cgarcia@igalia.com>
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 <achristensen@webkit.org>
Fix WPE build.
* CMakeLists.txt:
Bots wanted a "PUBLIC" or "PRIVATE" keyword here.
2019-05-08 Alex Christensen <achristensen@webkit.org>
Try to fix Linux build
* platform/graphics/ANGLEWebKitBridge.h:
Include headers consistently on all platforms.
2019-05-08 Don Olmstead <don.olmstead@sony.com>
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 <cdumez@apple.com>
[iOS Debug] ASSERTION FAILED: !m_originalNode in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget &)
https://bugs.webkit.org/show_bug.cgi?id=197696
<rdar://problem/50586956>
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 <rdar://problem/24314027>. 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 <ryanhaddad@apple.com>
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 <ryanhaddad@apple.com>
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 <megan_gardner@apple.com>
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 <don.olmstead@sony.com>
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 <timothy@apple.com>
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 <rmorisset@apple.com>
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 <don.olmstead@sony.com>
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 <wenson_hsieh@apple.com>
[iOS] Add a quirk to synthesize mouse events when modifying the selection
https://bugs.webkit.org/show_bug.cgi?id=197683
<rdar://problem/48003980>
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 <simon.fraser@apple.com>
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
<rdar://problem/50445998>
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 <bfulgham@apple.com>
Correct delayed load event handling
https://bugs.webkit.org/show_bug.cgi?id=197679
<rdar://problem/50423334>
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 <pnormand@igalia.com>
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 <rbuis@igalia.com>
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 <don.olmstead@sony.com>
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 <ryanhaddad@apple.com>
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 <jiewen_tan@apple.com>
[WebAuthN] A new request should always suppress the pending request if any
https://bugs.webkit.org/show_bug.cgi?id=191517
<rdar://problem/46888222>
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 <eric.carlson@apple.com>
Define media buffering policy
https://bugs.webkit.org/show_bug.cgi?id=196979
<rdar://problem/28383861>
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<WebCore::MediaPlayerEnums::BufferingPolicy>::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 <achristensen@webkit.org>
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 <aestes@apple.com>
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 <youenn@apple.com>
Video stream freeze on front camera orientation changing
https://bugs.webkit.org/show_bug.cgi?id=197227
<rdar://problem/50175498>
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 <youenn@apple.com>
getUserMedia framerate unusable under low light in iOS 12.2
https://bugs.webkit.org/show_bug.cgi?id=196214
<rdar://problem/49232193>
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 <rmorisset@apple.com>
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 <wilander@apple.com>
Storage Access API: Make two changes requested by developers and complete refactoring and cleanup
https://bugs.webkit.org/show_bug.cgi?id=197648
<rdar://problem/50527493>
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 <graouts@apple.com>
[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 <ryanhaddad@apple.com>
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 <antti@apple.com>
<body> with overflow:hidden CSS is scrollable on iOS
https://bugs.webkit.org/show_bug.cgi?id=153852
<rdar://problem/38715356>
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 <graouts@apple.com>
Mouse event simulation should be limited to the graphing calculator on Desmos.com
https://bugs.webkit.org/show_bug.cgi?id=197652
<rdar://problem/47068176>
Reviewed by Antti Koivisto.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2019-05-06 James Savage <james.savage@apple.com>
Improve coordination for creating UIWindow instances.
https://bugs.webkit.org/show_bug.cgi?id=197578.
<rdar://problem/50456965>.
Reviewed by Wenson Hsieh.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(makeWindowFromView): Pull out window creation.
(VideoFullscreenInterfaceAVKit::doSetup): Call new helper function.
2019-05-06 Tim Horton <timothy_horton@apple.com>
_overrideViewportWithArguments does not work when called before loading
https://bugs.webkit.org/show_bug.cgi?id=197638
<rdar://problem/50505111>
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 <cdumez@apple.com>
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 <rdar://problem/24314027>.
* 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 <pvollan@apple.com>
-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=197510
<rdar://problem/50372338>
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 <krollin@apple.com>
Temporarily disable generate-xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=197619
<rdar://problem/50507392>
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 <andresg_22@apple.com>
Hitpoint for link which spans two lines in web content is incorrect
https://bugs.webkit.org/show_bug.cgi?id=197511
<rdar://problem/49971483>
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 <jer.noble@apple.com>
Adopt AVStreamDataParser.audiovisualMIMETypes
https://bugs.webkit.org/show_bug.cgi?id=197581
<rdar://problem/50458981>
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 <youenn@apple.com>
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 <dabates@apple.com>
Google Docs & Yahoo! Japan: Cant compose characters with Chinese or Japanese keyboard
https://bugs.webkit.org/show_bug.cgi?id=197474
<rdar://problem/47219324>
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 <cdumez@apple.com>
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 <zdobersek@igalia.com>
[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 <wenson_hsieh@apple.com>
fast/attachment/attachment-folder-icon.html is an Image Only failure on recent macOS builds
https://bugs.webkit.org/show_bug.cgi?id=197593
<rdar://problem/50379267>
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 <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <youenn@apple.com>
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 <simon.fraser@apple.com>
[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 <zalan@apple.com>
[iOS] outlook.live.com: Compose email frame not fully visible and not scrollable
https://bugs.webkit.org/show_bug.cgi?id=197573
<rdar://problem/48008441>
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 <jiewen_tan@apple.com>
[WebAuthN] A focused document should be required
https://bugs.webkit.org/show_bug.cgi?id=197543
<rdar://problem/50430989>
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 <drousso@apple.com>
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 <dabates@apple.com>
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 <cdumez@apple.com>
[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
<rdar://problem/50448285>
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 <cdumez@apple.com>
Use WeakPtr for JSLazyEventListener::m_originalNode for safety
https://bugs.webkit.org/show_bug.cgi?id=197576
<rdar://problem/24314027>
Reviewed by Alex Christensen.
* bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::JSLazyEventListener):
(WebCore::JSLazyEventListener::create):
* bindings/js/JSLazyEventListener.h:
2019-05-03 Eric Carlson <eric.carlson@apple.com>
AVFoundation framework isn't always installed
https://bugs.webkit.org/show_bug.cgi?id=197577
<rdar://problem/50447841>
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 <sihui_liu@apple.com>
Add assertion to check whether shm files have maximum FileProtection of CompleteUnlessOpen
https://bugs.webkit.org/show_bug.cgi?id=197390
<rdar://problem/42685773>
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 <youenn@apple.com>
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 <Tomoki.Imai@sony.com>
[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 <antti@apple.com>
Add a quirk to make youtube navigation bar scrollable without mouse hover on iOS
https://bugs.webkit.org/show_bug.cgi?id=197555
<rdar://problem/49582231>
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 <drousso@apple.com>
Web Inspector: Record actions performed on WebGL2RenderingContext
https://bugs.webkit.org/show_bug.cgi?id=176008
<rdar://problem/34213884>
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 <commit-queue@webkit.org>
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 <jh718.park@samsung.com>
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 <antti@apple.com>
Add a quirk to make gmail navigation bar scrollable without mouse hover on iOS
https://bugs.webkit.org/show_bug.cgi?id=197529
<rdar://problem/49403416>
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 <simon.fraser@apple.com>
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 <youenn@apple.com>
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 <rniwa@webkit.org>
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 <timothy@apple.com>
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 <cdumez@apple.com>
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 <git@gkatsev.com>
WebVTT: fix vertical cue alignment.
https://bugs.webkit.org/show_bug.cgi?id=136627.
<rdar://problem/49725538>
Reviewed by Eric Carlson.
Updated existing test results.
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
2019-05-02 Don Olmstead <don.olmstead@sony.com>
[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 <jiewen_tan@apple.com>
[WebAuthN] Add a quirk for google.com when processing AppID extension
https://bugs.webkit.org/show_bug.cgi?id=196046
<rdar://problem/49088479>
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 <ross.kirsling@sony.com>
Unreviewed fix for non-unified build after r244853.
* page/SecurityOrigin.cpp:
2019-05-02 Frederic Wang <fwang@igalia.com>
[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 <jiewen_tan@apple.com>
[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 <youenn@apple.com>
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 <justin_fan@apple.com>
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 <jiewen_tan@apple.com>
Move Document::domainIsRegisterable to SecurityOrigin::isMatchingRegistrableDomainSuffix
https://bugs.webkit.org/show_bug.cgi?id=181950
<rdar://problem/43357371>
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 <rniwa@webkit.org>
[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 <wenson_hsieh@apple.com>
[iOS] Add a version of viewport shrink-to-fit heuristics that preserves page layout
https://bugs.webkit.org/show_bug.cgi?id=197342
<rdar://problem/50063091>
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 <zalan@apple.com>
[iOS] Star rating is covered with a black circle when writing a review on Yelp
https://bugs.webkit.org/show_bug.cgi?id=197469
<rdar://problem/48094446>
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 <sabouhallawa@apple.com>
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 <darin@apple.com>
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 <sroberts@apple.com>
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 <sroberts@apple.com>
Unreviewed, rolling out r244822.
Causing
Reverted changeset:
https://trac.webkit.org/changeset/244822
2019-05-01 Youenn Fablet <youenn@apple.com>
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 <eric.carlson@apple.com>
XMLHttpRequest should propagate user gestures for media playback
https://bugs.webkit.org/show_bug.cgi?id=197428
<rdar://problem/46677392>
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 <darin@apple.com>
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 <wilander@apple.com>
Add logging of Ad Click Attribution errors and events to a dedicated channel
https://bugs.webkit.org/show_bug.cgi?id=197332
<rdar://problem/49918800>
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 <mmaxfield@apple.com>
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 <youenn@apple.com>
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 <youenn@apple.com>
[macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
https://bugs.webkit.org/show_bug.cgi?id=196864
<rdar://problem/49854497>
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 <commit-queue@webkit.org>
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 <commit-queue@webkit.org>
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 <achristensen@webkit.org>
Add WKContentRuleList ping resource-type
https://bugs.webkit.org/show_bug.cgi?id=197325
<rdar://problem/49841404>
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 <justin_fan@apple.com>
[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 <zalan@apple.com>
Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
https://bugs.webkit.org/show_bug.cgi?id=197347
<rdar://problem/49393423>
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 <youenn@apple.com>
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 <youenn@apple.com>
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 <antti@apple.com>
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 <youenn@apple.com>
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 <mcatanzaro@igalia.com>
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 <cgarcia@igalia.com>
[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 <tsavell@apple.com>
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 <achristensen@webkit.org>
<rdar://problem/50299396> Fix internal High Sierra build
https://bugs.webkit.org/show_bug.cgi?id=197388
* Configurations/Base.xcconfig:
2019-04-29 Zalan Bujtas <zalan@apple.com>
Double-tapping a post to like doesn't work on Instagram.com (needs 'dblclick' event)
https://bugs.webkit.org/show_bug.cgi?id=197347
<rdar://problem/49393423>
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 <simon.fraser@apple.com>
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 <youenn@apple.com>
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 <jfernandez@igalia.com>
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 <simon.fraser@apple.com>
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 <cdumez@apple.com>
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 <ross.kirsling@sony.com>
Unreviewed fix for non-unified build after r244687.
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2019-04-29 Youenn Fablet <youenn@apple.com>
RTCTrackEvent should be delayed until the whole remote description is set
https://bugs.webkit.org/show_bug.cgi?id=196808
<rdar://problem/49802649>
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 <cgarcia@igalia.com>
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 <aestes@apple.com>
[Apple Pay] Increment the API version from 6 to 7
https://bugs.webkit.org/show_bug.cgi?id=197041
<rdar://problem/49986625>
Reviewed by Geoffrey Garen.
* Modules/applepay/PaymentCoordinatorClient.cpp:
(WebCore::PaymentCoordinatorClient::supportsVersion):
2019-04-28 Andy Estes <aestes@apple.com>
Fix the watchOS engineering build.
* Modules/webgpu/WebGPUComputePassEncoder.cpp: Included Logging.h.
2019-04-28 Youenn Fablet <youenn@apple.com>
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 <simon.fraser@apple.com>
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 <megan_gardner@apple.com>
Lookup only looking up the first word in selection
https://bugs.webkit.org/show_bug.cgi?id=197341
<rdar://problem/48221414>
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 <jer.noble@apple.com>
Reduce the number of copies made during SourceBufferPrivateAVFObjC::append() using SharedBuffer
https://bugs.webkit.org/show_bug.cgi?id=197335
<rdar://problem/49175604>
Rubber-stamped by Alex Christensen.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::append):
2019-04-26 Jessie Berlin <jberlin@webkit.org>
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 <commit-queue@webkit.org>
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 <rmorisset@apple.com>
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 <eric.carlson@apple.com>
Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>
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 <commit-queue@webkit.org>
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 <youenn@apple.com>
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 <achristensen@webkit.org>
Fix Windows build after r244695
https://bugs.webkit.org/show_bug.cgi?id=197165
* loader/PingLoader.cpp:
2019-04-26 Alex Christensen <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <cfleizach@apple.com>
AX: Provide iOS method for setting focus
https://bugs.webkit.org/show_bug.cgi?id=197200
<rdar://problem/50131679>
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 <sabouhallawa@apple.com>
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 <youenn@apple.com>
[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
<rdar://problem/49627667>
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 <sihui_liu@apple.com>
Stop IDB transactions to release locked database files when network process is ready to suspend
https://bugs.webkit.org/show_bug.cgi?id=196372
<rdar://problem/48930116>
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 <Takashi.Komori@sony.com>
[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 <mmaxfield@apple.com>
[iOS] Add internal setting to force -webkit-text-size-adjust to "auto"
https://bugs.webkit.org/show_bug.cgi?id=197275
<rdar://problem/50211019>
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 <mmaxfield@apple.com>
[iOS] Implement idempotent mode for text autosizing
https://bugs.webkit.org/show_bug.cgi?id=197250
<rdar://problem/50211034>
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 <simon.fraser@apple.com>
REGRESSION (r234330): 3 legacy-animation-engine/compositing tests are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=188357
<rdar://problem/42986633>
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 <sihui_liu@apple.com>
[ 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
<rdar://problem/49386836>
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 <cdumez@apple.com>
ASSERT(scriptExecutionContext()) in Performance::resourceTimingBufferFullTimerFired()
https://bugs.webkit.org/show_bug.cgi?id=197300
<rdar://problem/49965990>
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 <timothy@apple.com>
Disable ContentChangeObserver on iOSMac.
https://bugs.webkit.org/show_bug.cgi?id=197292
rdar://problem/49039957
Reviewed by Zalan Bujtas.
We dont 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 <timothy@apple.com>
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 <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <pvollan@apple.com>
-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:] never returns _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=196991
<rdar://problem/45507423>
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 <achristensen@webkit.org>
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 <achristensen@webkit.org>
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 <commit-queue@webkit.org>
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 <antti@apple.com>
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 <antti@apple.com>
Visited link hash should be computed only once
https://bugs.webkit.org/show_bug.cgi?id=197229
<rdar://problem/48438924>
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 <a> 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 <pnormand@igalia.com>
[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 <pnormand@igalia.com>
[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 <cgarcia@igalia.com>
[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 <zalan@apple.com>
Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
https://bugs.webkit.org/show_bug.cgi?id=196948
<rdar://problem/49927131>
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 <youenn@apple.com>
Do not restart WebRTC stats timer if backend is stopped
https://bugs.webkit.org/show_bug.cgi?id=197257
<rdar://problem/50095879>
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 <andresg_22@apple.com>
Flaky crash under WebCore::AXObjectCache::stopCachingComputedObjectAttributes()
https://bugs.webkit.org/show_bug.cgi?id=187391
<rdar://problem/40681396
Check for null value returned by AccessibilityObject::axObjectCache.
Reviewed by Chris Fleizach.
No need for new test since existing tests caught this problem.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::firstChild const):
(WebCore::AccessibilityNodeObject::lastChild const):
(WebCore::AccessibilityNodeObject::previousSibling const):
(WebCore::AccessibilityNodeObject::nextSibling const):
(WebCore::AccessibilityNodeObject::addChildren):
(WebCore::AccessibilityNodeObject::anchorElement const):
(WebCore::AccessibilityNodeObject::changeValueByStep):
(WebCore::AccessibilityNodeObject::changeValueByPercent):
(WebCore::AccessibilityNodeObject::textForLabelElement const):
(WebCore::AccessibilityNodeObject::titleElementText const):
(WebCore::AccessibilityNodeObject::alternativeText const):
(WebCore::AccessibilityNodeObject::ariaLabeledByText const):
(WebCore::AccessibilityNodeObject::helpText const):
2019-04-24 Simon Fraser <simon.fraser@apple.com>
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 <eric.carlson@apple.com>
Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>
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 <beidson@apple.com>
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 <wilander@apple.com>
Age out unconverted Ad Click Attributions after one week.
https://bugs.webkit.org/show_bug.cgi?id=197238
<rdar://problem/50177349>
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 <simon.fraser@apple.com>
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 <simon.fraser@apple.com>
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<RenderAsTextFlag>.
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 <graouts@apple.com>
[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
<rdar://problem/48946154>
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 <fwang@igalia.com>
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 <greg@unrelenting.technology>
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 <cdumez@apple.com>
X-Frame-Options header should be ignored when frame-ancestors CSP directive is present
https://bugs.webkit.org/show_bug.cgi?id=197226
<rdar://problem/50155649>
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 <zalan@apple.com>
[ContentChangeObserver] Do not use the global _WKContentChange in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=196286
<rdar://problem/49364417>
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 <pnormand@igalia.com>
[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 <pnormand@igalia.com>
[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 <cfleizach@apple.com>
AX: Remove deprecated Accessibility Object Model events
https://bugs.webkit.org/show_bug.cgi?id=197073
<rdar://problem/50027819>
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 <aestes@apple.com>
[iOS] QuickLook documents loaded from file: URLs should be allowed to perform same-document navigations
https://bugs.webkit.org/show_bug.cgi?id=196749
<rdar://problem/35773454>
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 <drousso@apple.com>
Web Inspector: Debugger: remove ASSERT_NOT_REACHED where it's possible to reach
https://bugs.webkit.org/show_bug.cgi?id=197210
<rdar://problem/48462912>
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 <commit-queue@webkit.org>
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 <drousso@apple.com>
Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.ownerDocument.frameIdentifier')
https://bugs.webkit.org/show_bug.cgi?id=196420
<rdar://problem/49444205>
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 `<iframe>`).
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
2019-04-23 Devin Rousso <drousso@apple.com>
ContentSecurityPolicy::logToConsole should include line/column number and source location
https://bugs.webkit.org/show_bug.cgi?id=114317
<rdar://problem/13614617>
Reviewed by Timothy Hatcher.
No change in functionality.
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
(WebCore::ContentSecurityPolicy::logToConsole const):
2019-04-23 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: support recording TypedOMCSSImageValue
https://bugs.webkit.org/show_bug.cgi?id=192609
Reviewed by Timothy Hatcher.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildAction):
2019-04-23 Andres Gonzalez <andresg_22@apple.com>
Accessibility text search and selection API enhancements.
https://bugs.webkit.org/show_bug.cgi?id=197095
<rdar://problem/48181791>
Reviewed by Chris Fleizach.
- Split the existing SelectTextWithCriteria API into two: search text API (SearchTextWithCriteria) and a text operation API (TextOperation: select, replace, capitalize...).
- This allows for more flexibility and extensibility.
- Added the ability to retrieve text markers for multiple search hits.
- Various code clean up and consolidation.
- Added LayoutTest for search API.
- Previous API is marked with "To be deprecated", and is implemented with new implementation. May be removed in a future change.
Test: accessibility/mac/search-text/search-text.html
* accessibility/AccessibilityObject.cpp:
(WebCore::rangeClosestToRange):
(WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
(WebCore::AccessibilityObject::findTextRange const):
(WebCore::AccessibilityObject::findTextRanges const):
(WebCore::AccessibilityObject::performTextOperation):
(WebCore::AccessibilityObject::frame const):
(WebCore::AccessibilityObject::selectText): Deleted.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilitySearchTextCriteria::AccessibilitySearchTextCriteria):
(WebCore::AccessibilityTextOperation::AccessibilityTextOperation):
(WebCore::AccessibilitySelectTextCriteria::AccessibilitySelectTextCriteria): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilityTextCriteriaForParameterizedAttribute):
(accessibilitySearchTextCriteriaForParameterizedAttribute):
(accessibilityTextOperationForParameterizedAttribute):
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute): Deleted.
2019-04-23 Guy Lewin <guy@lewin.co.il>
Multiple File Input Icon Set Regardless of File List
https://bugs.webkit.org/show_bug.cgi?id=195537
Reviewed by Alexey Proskuryakov.
File input elements display icon with an empty file list after
resetting the file list in 'change' event handler - on iOS
Test: fast/forms/file/file-reset-in-change-using-open-panel-with-icon.html
* html/FileInputType.cpp:
(WebCore::FileInputType::filesChosen):
2019-04-23 Eric Carlson <eric.carlson@apple.com>
Create AVFoundationSoftLink.{h,mm} to reduce duplicate code
https://bugs.webkit.org/show_bug.cgi?id=197171
<rdar://problem/47454979>
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-23 Timothy Hatcher <timothy@apple.com>
Speed up RenderTheme::systemColor on Speedometer2.
https://bugs.webkit.org/show_bug.cgi?id=197203
rdar://problem/50056756
Reviewed by Tim Horton.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor const): Remove some unused code. And fetch the cache after an early return.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Avoid some allocations in LocalDefaultSystemAppearance
when a CSS color is in the system color cache.
2019-04-23 Ryosuke Niwa <rniwa@webkit.org>
[iOS] element.focus() sometimes fails to reveal the focused element when it becomes editable dynamically
https://bugs.webkit.org/show_bug.cgi?id=197188
Reviewed by Wenson Hsieh.
The bug was caused by the scroll-to-reveal code triggered by Element::updateFocusAppearance updating
the scroll position via scrolling tree update in a layer tree commit which happens after
_zoomToRevealFocusedElement in WKContentView had already scrolled the frame view.
To fix this problem, we need to defer the editor state update until the layer commit (see r244494),
and update the scrolling tree before invoking WebPageProxy::editorStateChanged which brings up
the keyboard and scroll-to-reveal the caret in the UI process side.
We also avoid revealing the focus for the second time via Document::scheduleScrollToFocusedElement
in Element::updateFocusAppearance as this timer based scrolling also happens after we had already
revealed the caret in _zoomToRevealFocusedElement. This is a bit hacky but works for most cases since
we wouldn't bring up a keyboard if the focused element was not editable anyway.
Test: editing/selection/ios/scrolling-to-focused-element-inside-iframe.html
* dom/Element.cpp:
(WebCore::Element::updateFocusAppearance): Avoid scheduling a timer based reavel of the focused element
when we're already revealing the element via selection change.
2019-04-23 Remy Demarest <rdemarest@apple.com>
Fix layout issues occuring when entering full screen mode.
https://bugs.webkit.org/show_bug.cgi?id=197086
<rdar://problem/47733671>.
Reviewed by Darin Adler.
This issue is the result of changing the style mask of the window after entering
full screen mode. Safari adds an invisible toolbar to display the URL of the page
which ends up breaking the layout. Having that window use a style that includes a
titlebar fixes the bug.
* platform/mac/WebCoreFullScreenWindow.mm:
(-[WebCoreFullScreenWindow constrainFrameRect:toScreen:]): Ensure that the window
can fill the entire screen including the underlapping the menu bar, so that the
window does not resize when the animation is done.
(-[WebCoreFullScreenWindow canBecomeMainWindow]): Borderless windows cannot become
main by default, adding the titlebar allows it to become main, prevent this from
happening at all to preserve the existing behavior.
2019-04-23 Chris Dumez <cdumez@apple.com>
[Process-Swap-On-Navigation] WebKit hangs when going back to a form submission's page due to Process-Swap-On-Navigation on iOS 12.2 and higher
https://bugs.webkit.org/show_bug.cgi?id=197097
<rdar://problem/50048318>
Reviewed by Alex Christensen.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
If we still have a provisional item (new load has been started or we did not clear it because we're about to retry),
then let the client know the load will continue by passing an extra flag with the didFailProvisionalLoad.
* loader/FrameLoaderClient.h:
* loader/FrameLoaderTypes.h:
2019-04-23 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Implement AtkComponentIface scroll_to methods
https://bugs.webkit.org/show_bug.cgi?id=196856
Reviewed by Michael Catanzaro.
Implement scroll_to and scroll_to_point when ATK >= 2.30.
Fixes: accessibility/scroll-to-global-point-iframe-nested.html
accessibility/scroll-to-global-point-iframe.html
accessibility/scroll-to-global-point-main-window.html
accessibility/scroll-to-global-point-nested.html
accessibility/scroll-to-make-visible-div-overflow.html
accessibility/scroll-to-make-visible-iframe.html
accessibility/scroll-to-make-visible-nested-2.html
accessibility/scroll-to-make-visible-nested.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::scrollToMakeVisible const): Add new method receiving the
ScrollRectToVisibleOptions since ATK interface has a parameter to decide how to scroll.
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(atkToContents):
(webkitAccessibleComponentRefAccessibleAtPoint):
(webkitAccessibleComponentGetExtents):
(webkitAccessibleComponentGrabFocus):
(webkitAccessibleComponentScrollTo):
(webkitAccessibleComponentScrollToPoint):
(webkitAccessibleComponentInterfaceInit):
(core): Deleted.
2019-04-22 Youenn Fablet <youenn@apple.com>
Update libwebrtc logging when WebCore WebRTC logging is updated
https://bugs.webkit.org/show_bug.cgi?id=197166
<rdar://problem/50107696>
Unreviewed.
Build fix after https://trac.webkit.org/changeset/244511.
* page/Page.cpp:
(WebCore::Page::configureLoggingChannel):
2019-04-22 Youenn Fablet <youenn@apple.com>
Cache API should return Abort error in case of putting an aborted fetch
https://bugs.webkit.org/show_bug.cgi?id=196757
Reviewed by Darin Adler.
In case of an aborted fetch, call consume callback with an AbortError.
Update the code that handles load cancelling as the loader callback is called.
Covered by rebased tests.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::addAbortSteps):
(WebCore::FetchResponse::BodyLoader::didFail):
(WebCore::FetchResponse::BodyLoader::BodyLoader):
(WebCore::FetchResponse::BodyLoader::~BodyLoader):
(WebCore::FetchResponse::stop):
* Modules/fetch/FetchResponse.h:
2019-04-22 Youenn Fablet <youenn@apple.com>
Update libwebrtc logging when WebCore WebRTC logging is updated
https://bugs.webkit.org/show_bug.cgi?id=197166
Reviewed by Eric Carlson.
When updating WebRTC logging from Web Inspector, update libwebrtc logging so that no page reload is required.
Manually tested.
* page/Page.cpp:
(WebCore::Page::configureLoggingChannel):
2019-04-22 Simon Fraser <simon.fraser@apple.com>
Introduce the concept of "opportunistic" stacking contexts
https://bugs.webkit.org/show_bug.cgi?id=197077
Reviewed by Zalan Bujtas.
Bring back a variant of some code removed in r236424, which allows a RenderLayer
to be stacking context for painting, without actually being on in terms of CSS.
Internally, RenderLayer will call setIsOpportunisticStackingContext() to make a layer
into a stacking context for painting. External callers deal with isStackingContext()
or isCSSStackingContext().
Sadly we can't make m_forcedStackingContext (set on media element layers) trigger a
non-CSS stacking context; media controls use mix-blend-mode, and rely on the fake-stacking
media layer to be the "isolateBlending" ancestor.
No code uses this yet.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::shouldBeCSSStackingContext const):
(WebCore::RenderLayer::isStackingContextChanged):
(WebCore::RenderLayer::setIsOpportunisticStackingContext):
(WebCore::RenderLayer::setIsCSSStackingContext):
(WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
(WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::RenderLayer::shouldBeStackingContext const): Deleted.
(WebCore::RenderLayer::setIsStackingContext): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::compositingOpacity const):
2019-04-22 Justin Fan <justin_fan@apple.com>
[WebGPU] Move swap chain methods from GPUDevice to GPUCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=197126
Reviewed by Dean Jackson.
GPUSwapChains are now configured via GPUCanvasContext instead of GPUDevice. Covers WebGPU API
pull request #262.
Existing WebGPU tests updated to match.
* Modules/webgpu/GPUCanvasContext.cpp:
(WebCore::GPUCanvasContext::configureSwapChain):
(WebCore::GPUCanvasContext::replaceSwapChain): Deleted.
* Modules/webgpu/GPUCanvasContext.h:
* Modules/webgpu/GPUCanvasContext.idl:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createSwapChain const): Deleted.
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::device):
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUSwapChainDescriptor.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUSwapChainDescriptor.h.
(WebCore::WebGPUSwapChainDescriptor::asGPUSwapChainDescriptor const):
* Modules/webgpu/WebGPUSwapChainDescriptor.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::setSwapChain):
(WebCore::GPUDevice::tryCreateSwapChain const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUSwapChain.h:
* platform/graphics/gpu/GPUSwapChainDescriptor.h:
(WebCore::GPUSwapChainDescriptor::GPUSwapChainDescriptor):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::tryCreate):
2019-04-22 Said Abou-Hallawa <said@apple.com>
Mark SVGStringList properties '[SameObject]' in the IDL files
Followup to https://bugs.webkit.org/show_bug.cgi?id=197137
Reviewed by Darin Adler.
The SVG elements do not create tear-off wrappers for SVGStrigList DOM
objects anymore. Instead they return Ref pointers to the same RefCounted
objects. So they should be marked '[SameObject]' in their IDL files.
* svg/SVGTests.idl:
* svg/SVGViewElement.idl:
2019-04-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244495.
https://bugs.webkit.org/show_bug.cgi?id=197159
Causing build failures on OpenSource and Internal bots
(Requested by ShawnRoberts on #webkit).
Reverted changeset:
"WHLSLPrepare.cpp always recompiles, even if nothing was
changed"
https://bugs.webkit.org/show_bug.cgi?id=197151
https://trac.webkit.org/changeset/244495
2019-04-22 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r241289): [GTK] accessibility/removed-continuation-element-causes-crash.html and accessibility/removed-anonymous-block-child-causes-crash.html crashes
https://bugs.webkit.org/show_bug.cgi?id=194630
Reviewed by Michael Catanzaro.
Do not assume core object always has a wrapper in webkitAccessibleRefChild().
Fixes: accessibility/removed-continuation-element-causes-crash.html
accessibility/removed-anonymous-block-child-causes-crash.html
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleRefChild): Return early if wrapper is nullptr.
2019-04-21 Darin Adler <darin@apple.com>
WHLSLPrepare.cpp always recompiles, even if nothing was changed
https://bugs.webkit.org/show_bug.cgi?id=197151
Reviewed by Dan Bernstein.
* 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-04-20 Said Abou-Hallawa <said@apple.com>
REGRESSION (r243137): SVGViewElement.viewTarget should not return a new object
https://bugs.webkit.org/show_bug.cgi?id=197137
Reviewed by Darin Adler.
All the DOM objects accessing the viewTarget of the same SVGViewElement
should hold a Ref pointer to the same SVGStringList property.
Test: svg/dom/SVGViewElement-viewTarget.html
* svg/SVGViewElement.idl:
2019-04-20 Jer Noble <jer.noble@apple.com>
REGRESSION(r243958): Unnecessary deactivation of AudioSession (PLT Regression)
https://bugs.webkit.org/show_bug.cgi?id=197123
<rdar://problem/49783264>
Reviewed by Per Arne Vollan.
Only set m_becameActive if we actually activated the AudioSession before starting playback. This
avoids unnecessarily deactivating the AudioSession in processWillSuspend().
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
2019-04-19 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: CPU: ensure that tracking stops when disconnecting Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=197115
<rdar://problem/49877875>
Reviewed by Joseph Pecoraro.
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
2019-04-19 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: Elements: "Inspect Element" context menu often doesn't select that element
https://bugs.webkit.org/show_bug.cgi?id=197091
<rdar://problem/49953728>
Reviewed by Joseph Pecoraro.
Delay the `inspect` event fron firing with the focued node until the frontend has had a
chance to request the document. Otherwise, requesting the document clears the mapping of
node-to-id, so the focused node's id would no longer be valid.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorDOMAgent::getDocument):
(WebCore::InspectorDOMAgent::focusNode):
(WebCore::InspectorDOMAgent::didCommitLoad):
2019-04-19 John Wilander <wilander@apple.com>
Disable Ad Click Attribution in ephemeral sessions and make sure conversion requests use an ephemeral, stateless session
https://bugs.webkit.org/show_bug.cgi?id=197108
<rdar://problem/49918702>
Reviewed by Alex Christensen.
Tests: http/tests/adClickAttribution/conversion-disabled-in-ephemeral-session.html
http/tests/adClickAttribution/store-disabled-in-ephemeral-session.html
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
Early return for ephemeral sessions.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::shouldUseCredentialStorage):
Now returns false for StoredCredentialsPolicy:EphemeralStatelessCookieless.
* platform/network/StoredCredentialsPolicy.h:
Added enum value EphemeralStatelessCookieless.
2019-04-19 Timothy Hatcher <timothy@apple.com>
Standardize the <meta name="color-scheme"> separator.
https://bugs.webkit.org/show_bug.cgi?id=193931
rdar://problem/49995929
Reviewed by Darin Adler.
Tests: css-dark-mode/color-scheme-meta.html
* dom/Document.cpp:
(WebCore::processColorSchemeString): Use isHTMLSpace insead of isColorSchemeSeparator and isASCIISpace.
(WebCore::isColorSchemeSeparator): Deleted.
2019-04-19 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Add quirks to disable autocorrection and autocapitalization in hidden editable areas on some websites
https://bugs.webkit.org/show_bug.cgi?id=197102
<rdar://problem/49864669>
Reviewed by Ryosuke Niwa.
Add a quirk to disable autocorrection and autocapitalization in hidden editable areas.
* page/Quirks.cpp:
(WebCore::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreasForHost):
(WebCore::Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas const):
* page/Quirks.h:
2019-04-18 Fujii Hironori <Hironori.Fujii@sony.com>
Implement KeyedDecoderGeneric and KeyedEncoderGeneric
https://bugs.webkit.org/show_bug.cgi?id=186410
Reviewed by Don Olmstead.
Implemented KeyedDecoderGeneric and KeyedEncoderGeneric by using
WTF::Persistence::Decoder and WTF::Persistence::Encoder.
No new tests. Covered by existing tests.
* PlatformWin.cmake: Added KeyedDecoderGeneric.cpp and
KeyedEncoderGeneric.cpp, and removed KeyedDecoderCF.cpp and
KeyedEncoderCF.cpp for WinCairo port.
* platform/generic/KeyedDecoderGeneric.cpp:
* platform/generic/KeyedDecoderGeneric.h:
* platform/generic/KeyedEncoderGeneric.cpp:
* platform/generic/KeyedEncoderGeneric.h:
2019-04-18 Ross Kirsling <ross.kirsling@sony.com>
[WinCairo] Non-unified build fails to link Tools
https://bugs.webkit.org/show_bug.cgi?id=196866
Reviewed by Fujii Hironori.
* CMakeLists.txt:
Drive-by fix -- don't disable string pooling when building WebCoreTestSupport.
(This should have been part of r235203.)
2019-04-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244434.
https://bugs.webkit.org/show_bug.cgi?id=197089
caused 1 API test failure (Requested by zalan on #webkit).
Reverted changeset:
"Regression (r244291): Broken API Test
AutoLayoutRenderingProgressRelativeOrdering"
https://bugs.webkit.org/show_bug.cgi?id=196948
https://trac.webkit.org/changeset/244434
2019-04-18 Don Olmstead <don.olmstead@sony.com>
[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512
<rdar://problem/37510435>
Unreviewed build fix.
Add new header from r244440.
* Headers.cmake:
2019-04-18 Don Olmstead <don.olmstead@sony.com>
[CMake] Make WebCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182512
<rdar://problem/37510435>
Reviewed by Alex Christensen.
The header copying is moved to a target WebCorePrivateFrameworkHeaders. This target was
originally Windows only but now this is enabled for all CMake based ports.
Enumerated all headers within WebCore that are used for WebKit(Legacy), tools and
tests. Shared headers are within Headers.cmake while port and platform specific headers
are in their respective CMake files. Listing out all headers is preferred because globbing
will break the build whenever a file is added.
All include directories within the WebCore source tree are now PRIVATE. They were
modified to use WebCore_PRIVATE_INCLUDE_DIRECTORIES. They will not propagate to other targets
which will prevent erroneous includes in targets dependent on WebCore.
* CMakeLists.txt:
* Headers.cmake: Added.
* PlatformAppleWin.cmake:
* PlatformGTK.cmake:
* PlatformMac.cmake:
* PlatformPlayStation.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
* platform/Cairo.cmake:
* platform/Curl.cmake:
* platform/FreeType.cmake:
* platform/GStreamer.cmake:
* platform/HolePunch.cmake:
* platform/ImageDecoders.cmake:
* platform/Soup.cmake: Added.
* platform/TextureMapper.cmake:
2019-04-18 Justin Fan <justin_fan@apple.com>
[Web GPU] Implement API default values
https://bugs.webkit.org/show_bug.cgi?id=197032
Reviewed by Myles C. Maxfield.
Add default values and 'required' qualifiers recently merged to the WebGPU API.
WebGPU tests specifying these default values have been updated to rely on them for functionality.
* Modules/webgpu/GPUBindGroupLayoutBinding.idl:
* Modules/webgpu/GPUBindGroupLayoutDescriptor.idl:
* Modules/webgpu/GPUBlendDescriptor.idl:
* Modules/webgpu/GPUBufferDescriptor.idl:
* Modules/webgpu/GPUColor.idl:
* Modules/webgpu/GPUColorStateDescriptor.idl:
* Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
* Modules/webgpu/GPUExtent3D.idl:
* Modules/webgpu/GPUInputStateDescriptor.idl:
* Modules/webgpu/GPUOrigin3D.h:
* Modules/webgpu/GPUOrigin3D.idl:
* Modules/webgpu/GPURequestAdapterOptions.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUVertexAttributeDescriptor.idl:
* Modules/webgpu/GPUVertexInputDescriptor.idl:
* Modules/webgpu/WebGPUBindGroupBinding.idl:
* Modules/webgpu/WebGPUBindGroupDescriptor.idl:
* Modules/webgpu/WebGPUBufferBinding.h:
* Modules/webgpu/WebGPUBufferBinding.idl:
* Modules/webgpu/WebGPUCommandEncoder.idl:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl:
* Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
* Modules/webgpu/WebGPURenderPassDescriptor.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
(WebCore::WebGPURenderPipelineDescriptor::tryCreateGPURenderPipelineDescriptor const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
* platform/graphics/gpu/GPUBlendDescriptor.h:
* platform/graphics/gpu/GPUColorStateDescriptor.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
* platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
* platform/graphics/gpu/GPURenderPassDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineDescriptor.h:
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
* platform/graphics/gpu/GPURequestAdapterOptions.h:
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::convertRenderPipelineDescriptor):
(WebCore::trySetFunctionsForPipelineDescriptor):
2019-04-18 Jer Noble <jer.noble@apple.com>
Refactoring: Pull all fullscreen code out of Document and into its own helper class
https://bugs.webkit.org/show_bug.cgi?id=197017
Reviewed by Eric Carlson.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/SelectorCheckerTestFunctions.h:
(WebCore::matchesFullScreenPseudoClass):
(WebCore::matchesFullScreenAnimatingFullScreenTransitionPseudoClass):
(WebCore::matchesFullScreenDocumentPseudoClass):
(WebCore::matchesFullScreenControlsHiddenPseudoClass):
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::isAttributeOnAllOwners): Deleted.
(WebCore::Document::fullScreenIsAllowedForElement const): Deleted.
(WebCore::Document::requestFullScreenForElement): Deleted.
(WebCore::Document::webkitCancelFullScreen): Deleted.
(WebCore::Document::webkitExitFullscreen): Deleted.
(WebCore::Document::webkitFullscreenEnabled const): Deleted.
(WebCore::unwrapFullScreenRenderer): Deleted.
(WebCore::Document::webkitWillEnterFullScreen): Deleted.
(WebCore::Document::webkitDidEnterFullScreen): Deleted.
(WebCore::Document::webkitWillExitFullScreen): Deleted.
(WebCore::Document::webkitDidExitFullScreen): Deleted.
(WebCore::Document::setFullScreenRenderer): Deleted.
(WebCore::Document::dispatchFullScreenChangeEvents): Deleted.
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent): Deleted.
(WebCore::Document::fullScreenElementRemoved): Deleted.
(WebCore::Document::adjustFullScreenElementOnNodeRemoval): Deleted.
(WebCore::Document::isAnimatingFullScreen const): Deleted.
(WebCore::Document::setAnimatingFullScreen): Deleted.
(WebCore::Document::areFullscreenControlsHidden const): Deleted.
(WebCore::Document::setFullscreenControlsHidden): Deleted.
(WebCore::Document::clearFullscreenElementStack): Deleted.
(WebCore::Document::popFullscreenElementStack): Deleted.
(WebCore::Document::pushFullscreenElementStack): Deleted.
(WebCore::Document::addDocumentToFullScreenChangeEventQueue): Deleted.
* dom/Document.h:
(WebCore::Document::fullscreenManager):
(WebCore::Document::webkitIsFullScreen const): Deleted.
(WebCore::Document::webkitFullScreenKeyboardInputAllowed const): Deleted.
(WebCore::Document::webkitCurrentFullScreenElement const): Deleted.
(WebCore::Document::webkitCurrentFullScreenElementForBindings const): Deleted.
(WebCore::Document::fullScreenRenderer const): Deleted.
(WebCore::Document::webkitFullscreenElement const): Deleted.
(WebCore::Document::webkitFullscreenElementForBindings const): Deleted.
* dom/Document.idl:
* dom/DocumentFullscreen.h:
(WebCore::DocumentFullscreen::webkitFullscreenEnabled):
(WebCore::DocumentFullscreen::webkitFullscreenElement):
(WebCore::DocumentFullscreen::webkitExitFullscreen):
(WebCore::DocumentFullscreen::webkitIsFullScreen):
(WebCore::DocumentFullscreen::webkitFullScreenKeyboardInputAllowed):
(WebCore::DocumentFullscreen::webkitCurrentFullScreenElement):
(WebCore::DocumentFullscreen::webkitCancelFullScreen):
* dom/DocumentFullscreen.idl:
* dom/Element.cpp:
(WebCore::Element::webkitRequestFullscreen):
* dom/EventPath.cpp:
(WebCore::shouldEventCrossShadowBoundary):
* dom/FullscreenManager.cpp: Added.
(WebCore::isAttributeOnAllOwners):
(WebCore::FullscreenManager::FullscreenManager):
(WebCore::FullscreenManager::fullscreenIsAllowedForElement const):
(WebCore::FullscreenManager::requestFullscreenForElement):
(WebCore::FullscreenManager::cancelFullscreen):
(WebCore::FullscreenManager::requestExitFullscreen):
(WebCore::FullscreenManager::exitFullscreen):
(WebCore::FullscreenManager::isFullscreenEnabled const):
(WebCore::unwrapFullscreenRenderer):
(WebCore::FullscreenManager::willEnterFullscreen):
(WebCore::FullscreenManager::didEnterFullscreen):
(WebCore::FullscreenManager::willExitFullscreen):
(WebCore::FullscreenManager::didExitFullscreen):
(WebCore::FullscreenManager::setFullscreenRenderer):
(WebCore::FullscreenManager::dispatchFullscreenChangeEvents):
(WebCore::FullscreenManager::dispatchFullscreenChangeOrErrorEvent):
(WebCore::FullscreenManager::fullscreenElementRemoved):
(WebCore::FullscreenManager::adjustFullscreenElementOnNodeRemoval):
(WebCore::FullscreenManager::isAnimatingFullscreen const):
(WebCore::FullscreenManager::setAnimatingFullscreen):
(WebCore::FullscreenManager::areFullscreenControlsHidden const):
(WebCore::FullscreenManager::setFullscreenControlsHidden):
(WebCore::FullscreenManager::clear):
(WebCore::FullscreenManager::emptyEventQueue):
(WebCore::FullscreenManager::clearFullscreenElementStack):
(WebCore::FullscreenManager::popFullscreenElementStack):
(WebCore::FullscreenManager::pushFullscreenElementStack):
(WebCore::FullscreenManager::addDocumentToFullscreenChangeEventQueue):
* dom/FullscreenManager.h: Added.
(WebCore::FullscreenManager::document):
(WebCore::FullscreenManager::document const):
(WebCore::FullscreenManager::topDocument const):
(WebCore::FullscreenManager::page const):
(WebCore::FullscreenManager::frame const):
(WebCore::FullscreenManager::documentElement const):
(WebCore::FullscreenManager::hasLivingRenderTree const):
(WebCore::FullscreenManager::pageCacheState const):
(WebCore::FullscreenManager::scheduleFullStyleRebuild):
(WebCore::FullscreenManager::fullscreenElement const):
(WebCore::FullscreenManager::isFullscreen const):
(WebCore::FullscreenManager::isFullscreenKeyboardInputAllowed const):
(WebCore::FullscreenManager::currentFullscreenElement const):
(WebCore::FullscreenManager::fullscreenRenderer const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isFullscreen const):
(WebCore::HTMLMediaElement::isStandardFullscreen const):
(WebCore::HTMLMediaElement::enterFullscreen):
(WebCore::HTMLMediaElement::exitFullscreen):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
* inspector/agents/InspectorDOMAgent.cpp:
* page/EventHandler.cpp:
(WebCore::EventHandler::isKeyEventAllowedInFullScreen const):
(WebCore::EventHandler::internalKeyEvent):
* page/Page.cpp:
(WebCore::Page::setFullscreenControlsHidden):
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapNewRenderer):
(WebCore::RenderFullScreen::wrapExistingRenderer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::isDescendantOfFullScreenLayer):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::splitInlines):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::createRenderer):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement const):
* testing/Internals.cpp:
(WebCore::Internals::webkitWillEnterFullScreenForElement):
(WebCore::Internals::webkitDidEnterFullScreenForElement):
(WebCore::Internals::webkitWillExitFullScreenForElement):
(WebCore::Internals::webkitDidExitFullScreenForElement):
(WebCore::Internals::isAnimatingFullScreen const):
2019-04-18 Jer Noble <jer.noble@apple.com>
Add support for parsing FairPlayStreaming PSSH boxes.
https://bugs.webkit.org/show_bug.cgi?id=197064
Reviewed by Eric Carlson.
API Tests: ISO.ISOFairPlayStreamingPsshBox
Add a new set of ISOBox classes for parsing the contents of a FairPlayStreaming PSSH box,
and add support for this new box to CDMFairPlayStreaming.
Drive-by fix: add an explicit include for MainThread.h to LibWebRTCProviderCocoa.cpp.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FourCC.h:
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::cencName):
(WebCore::fairPlaySystemID):
(WebCore::extractSchemeAndKeyIdFromCenc):
(WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsCenc):
(WebCore::CDMPrivateFairPlayStreaming::sanitizeCenc):
(WebCore::validInitDataTypes):
(WebCore::CDMFactory::platformRegisterFactories):
* platform/graphics/avfoundation/CDMFairPlayStreaming.h:
* platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.cpp: Added.
(WebCore::ISOFairPlayStreamingPsshBox::fairPlaySystemID):
(WebCore::ISOFairPlayStreamingInfoBox::parse):
(WebCore::ISOFairPlayStreamingKeyRequestInfoBox::parse):
(WebCore::ISOFairPlayStreamingKeyAssetIdBox::parse):
(WebCore::ISOFairPlayStreamingKeyContextBox::parse):
(WebCore::ISOFairPlayStreamingKeyVersionListBox::parse):
(WebCore::ISOFairPlayStreamingKeyRequestBox::parse):
(WebCore::ISOFairPlayStreamingInitDataBox::parse):
(WebCore::ISOFairPlayStreamingPsshBox::parse):
* platform/graphics/avfoundation/ISOFairPlayStreamingPsshBox.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2019-04-18 Sihui Liu <sihui_liu@apple.com>
Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
https://bugs.webkit.org/show_bug.cgi?id=196128
<rdar://problem/49562115>
Reviewed by Geoffrey Garen.
If a key is auto-generated, it should become a property of the value object. Network process would perform the
key injection by deserializing IDBValue into script value, setting the property, serializing the result and
storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to
deserialize types including Blob and File.
To solve this issue, we move the key injection to web process and let network process store the original value
it gets. In this case, when web process asks for some value, network process should return key, value and key
path so that web process can decide whether it should perform a key injection before returning the result. Note
that the auto-generated key would always be stored as the key in a ObjectStore record.
Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::primaryKeyPath):
* Modules/indexeddb/IDBGetAllResult.cpp:
(WebCore::IDBGetAllResult::isolatedCopy):
(WebCore::IDBGetAllResult::addKey):
(WebCore::IDBGetAllResult::addValue):
(WebCore::IDBGetAllResult::keys const):
(WebCore::IDBGetAllResult::values const):
(WebCore::IDBGetAllResult::allBlobFilePaths const):
(WebCore::isolatedCopyOfVariant): Deleted.
* Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
because we only needed to store either key or value before, and now the stored value could be incomplete.
(WebCore::IDBGetAllResult::IDBGetAllResult):
(WebCore::IDBGetAllResult::keyPath const):
(WebCore::IDBGetAllResult::encode const):
(WebCore::IDBGetAllResult::decode):
* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::setValue):
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::IDBGetResult):
(WebCore::IDBGetResult::keyPath const):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
(WebCore::IDBTransaction::didGetRecordOnServer):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
(WebCore::IDBServer::MemoryIndex::getAllRecords const):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::currentData):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
(WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process.
UniqueIDBDatabase stores any value it gets from IDBClient.
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::getResultRef):
* Modules/indexeddb/shared/IDBResultData.h:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
return null, but we expect it to return result as long as the property value is the same as target. Therefore,
we can add an early return here.
(WebCore::createKeyPathArray):
(WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
value gets stored does not include auto-generated key, as we remove the key injection from network process. In
this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in
database record, we could use value of that key when we find a match in key path.
(WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is
probably auto-generated, so we could inject the result key into the result value unconditionally.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBCursorWithValueCustom.cpp:
(WebCore::JSIDBCursorWithValue::value const):
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result const):
2019-04-18 Zalan Bujtas <zalan@apple.com>
Regression (r244291): Broken API Test AutoLayoutRenderingProgressRelativeOrdering
https://bugs.webkit.org/show_bug.cgi?id=196948
<rdar://problem/49927131>
Reviewed by Tim Horton.
* page/FrameView.cpp:
(WebCore::FrameView::setContentsSize):
(WebCore::FrameView::autoSizeIfEnabled):
* page/FrameView.h:
2019-04-18 Shawn Roberts <sroberts@apple.com>
Unreviewed manual rollout of r244248 and r244409
Causing assertion failures on Mac WK2 Debug builds
https://bugs.webkit.org/show_bug.cgi?id=195623
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):
* loader/ResourceLoadInfo.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
2019-04-18 Antti Koivisto <antti@apple.com>
Tile update problems in iframe after scrolling page too soon after load
https://bugs.webkit.org/show_bug.cgi?id=197057
<rdar://problem/49913663>
Reviewed by Simon Fraser.
We end up destroying FrameHosting scrolling node when we shouldn't.
No test, despite attempts I couldn't get this state to stick. The problem is that in
most cases the destroying scrolling node gets immediately recreated and connected again.
Getting into testably buggy state requires some very specific layer tree configuration update.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
Test the right thing.
2019-04-18 Antoine Quint <graouts@apple.com>
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html
https://bugs.webkit.org/show_bug.cgi?id=197004
Reviewed by Antti Koivisto.
We need to release pointer capture when an element that has pointer capture is disconnected from the DOM.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor): Notify the PointerCaptureController that an element was disconnected.
* dom/PointerEvent.cpp:
(WebCore::PointerEvent::create): Broaden createPointerCancelEvent() to take in an event type so that we may use it to create a
lostpointercapture event as well.
(WebCore::PointerEvent::createPointerCancelEvent): Deleted.
* dom/PointerEvent.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::elementWasRemoved): Check whether the provided element matches one of the target overrides recorded
in the map of captured pointer IDs.
(WebCore::PointerCaptureController::pointerEventWasDispatched): This block of code was actually useless in this location, the new code
added in elementWasRemoved() performs the actions that the spec text mandates.
(WebCore::PointerCaptureController::cancelPointer): Replace the call to createPointerCancelEvent() with one to create().
* page/PointerCaptureController.h:
2019-04-17 Antoine Quint <graouts@apple.com>
[Pointer Events WPT] Unskip imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
https://bugs.webkit.org/show_bug.cgi?id=197006
Reviewed by Antti Koivisto.
Add support for on* HTML attributes and JS properties for pointer events.
* dom/GlobalEventHandlers.idl:
* html/HTMLAttributeNames.in:
* html/HTMLElement.cpp:
(WebCore::HTMLElement::createEventHandlerNameMap):
2019-04-17 Timothy Hatcher <timothy@apple.com>
Standardize the `<meta name="color-scheme">` separator.
https://bugs.webkit.org/show_bug.cgi?id=193931
Reviewed by Simon Fraser.
Drop support for comma as a valid seperator in <meta name="color-scheme"> to
match the proposal being tracked by: https://github.com/whatwg/html/issues/4504
Tests: css-dark-mode/color-scheme-meta.html
css-dark-mode/older-syntax/supported-color-schemes-meta.html
* dom/Document.cpp:
(WebCore::isColorSchemeSeparator): Drop support for comma.
2019-04-17 Timothy Hatcher <timothy@apple.com>
Rename `supported-color-schemes` to `color-scheme`.
https://bugs.webkit.org/show_bug.cgi?id=197016
rdar://problem/49980259
Reviewed by Simon Fraser.
Changed `supported-color-schemes` to `color-scheme` to follow the spec changes
being tracked by: https://github.com/w3c/csswg-drafts/issues/3807
The old `supported-color-schemes` is now an alias of `color-scheme` for compatibility.
Tests: css-dark-mode/color-scheme-css-parse.html
css-dark-mode/color-scheme-css.html
css-dark-mode/color-scheme-meta.html
css-dark-mode/color-scheme-priority.html
css-dark-mode/color-scheme-scrollbar.html
css-dark-mode/older-syntax/supported-color-schemes-css.html
css-dark-mode/older-syntax/supported-color-schemes-meta.html
css-dark-mode/older-systems/color-scheme-css.html
css-dark-mode/older-systems/color-scheme-meta.html
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::updateColorScheme):
(WebCore::StyleBuilderConverter::convertColorScheme):
(WebCore::StyleBuilderConverter::updateSupportedColorSchemes): Deleted.
(WebCore::StyleBuilderConverter::convertSupportedColorSchemes): Deleted.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueColorScheme):
(WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyMatchedProperties):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeColorScheme):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSupportedColorSchemes): Deleted.
* dom/Document.cpp:
(WebCore::processColorSchemeString):
(WebCore::Document::processColorScheme):
(WebCore::Document::useDarkAppearance const):
(WebCore::processColorSchemes): Deleted.
(WebCore::Document::processSupportedColorSchemes): Deleted.
* dom/Document.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* page/FrameView.cpp:
(WebCore::FrameView::rendererForColorScheme const):
(WebCore::FrameView::useDarkAppearance const):
(WebCore::FrameView::styleColorOptions const):
(WebCore::FrameView::rendererForSupportedColorSchemes const): Deleted.
* page/FrameView.h:
* rendering/style/RenderStyle.cpp:
(WebCore::rareInheritedDataChangeRequiresRepaint):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::colorScheme const):
(WebCore::RenderStyle::setHasExplicitlySetColorScheme):
(WebCore::RenderStyle::hasExplicitlySetColorScheme const):
(WebCore::RenderStyle::setColorScheme):
(WebCore::RenderStyle::initialColorScheme):
(WebCore::RenderStyle::NonInheritedFlags::operator== const):
(WebCore::RenderStyle::supportedColorSchemes const): Deleted.
(WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Deleted.
(WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Deleted.
(WebCore::RenderStyle::setSupportedColorSchemes): Deleted.
(WebCore::RenderStyle::initialSupportedColorSchemes): Deleted.
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleColorScheme.h: Renamed from Source/WebCore/rendering/style/StyleSupportedColorSchemes.h.
(WebCore::StyleColorScheme::StyleColorScheme):
(WebCore::StyleColorScheme::operator== const):
(WebCore::StyleColorScheme::operator!= const):
(WebCore::StyleColorScheme::isAuto const):
(WebCore::StyleColorScheme::isOnly const):
(WebCore::StyleColorScheme::colorScheme const):
(WebCore::StyleColorScheme::add):
(WebCore::StyleColorScheme::contains const):
(WebCore::StyleColorScheme::setAllowsTransformations):
(WebCore::StyleColorScheme::allowsTransformations const):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
2019-04-17 Justin Fan <justin_fan@apple.com>
[Web GPU] GPUComputePassEncoder::dispatch number of thread groups, not grid size
https://bugs.webkit.org/show_bug.cgi?id=196984
Reviewed by Myles C. Maxfield.
Test: Updated compute-squares.html.
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
(WebCore::GPUComputePassEncoder::dispatch):
2019-04-17 Andy Estes <aestes@apple.com>
[iOS] Support multiple file selection in UIDocumentPickerViewController
https://bugs.webkit.org/show_bug.cgi?id=197014
<rdar://problem/49963514>
Reviewed by Tim Horton.
* platform/LocalizedStrings.h:
Exported multipleFileUploadText().
2019-04-17 John Wilander <wilander@apple.com>
Add prioritization of ad click conversions and cleaning of sent ad click conversions
https://bugs.webkit.org/show_bug.cgi?id=196934
<rdar://problem/49917773>
Reviewed by Chris Dumez.
Tests: http/tests/adClickAttribution/second-attribution-converted-with-higher-priority.html
http/tests/adClickAttribution/second-attribution-converted-with-lower-priority.html
http/tests/adClickAttribution/second-conversion-with-higher-priority.html
http/tests/adClickAttribution/second-conversion-with-lower-priority.html
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::hasHigherPriorityThan const):
Added to facilitate priority comparison between two attributions.
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Destination::Destination):
Added a WTF::HashTableDeletedValueType constructor and changed the copy constructor to
a move constructor.
(WebCore::AdClickAttribution::isEmpty const):
2019-04-17 Devin Rousso <drousso@apple.com>
AX: AccessibilityObject::parentObject() doesn't need to be pure virtual
https://bugs.webkit.org/show_bug.cgi?id=197026
<rdar://problem/49448209>
Reviewed by Timothy Hatcher.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::parentObject const):
2019-04-17 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Use aria role as a hint whether a tap should result in a synthetic click
https://bugs.webkit.org/show_bug.cgi?id=196988
<rdar://problem/49955328>
Reviewed by Simon Fraser.
Test: fast/events/touch/ios/content-observation/tap-on-input-looking-div-with-role.html
* accessibility/AccessibilityObject.h:
2019-04-17 Alex Christensen <achristensen@webkit.org>
WebSocketHandshake should not know about a Document
https://bugs.webkit.org/show_bug.cgi?id=196468
Reviewed by Tim Horton.
I'll need to move WebSocketHandshake to the NetworkProcess for rdar://problem/46287028
It currently uses the Document pointer for 3 things:
1. To get the user agent, which we can pass in as a creation parameter.
2. To get the origin, which we can also pass in as a creation parameter.
3. To get cookies for the web inspector. We can pass in a functor instead and have the inspector provide cookies itself.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
(WebCore::WebSocketChannel::disconnect):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::clientHandshakeRequest):
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::document):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::WebSocketHandshake):
(WebCore::WebSocketHandshake::clientHandshakeMessage const):
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientOrigin const): Deleted.
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const): Deleted.
(WebCore::WebSocketHandshake::clearDocument): Deleted.
* Modules/websockets/WebSocketHandshake.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::enable):
2019-04-17 Timothy Hatcher <timothy@apple.com>
Unreviewed build fix for iOSMac after r244223.
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::routeSharingPolicy const): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
around AVAudioSessionRouteSharingPolicyLongForm use.
2019-04-17 Chris Dumez <cdumez@apple.com>
Remember device orientation permission for the duration of the browsing session
https://bugs.webkit.org/show_bug.cgi?id=196992
<rdar://problem/49946067>
Reviewed by Alex Christensen.
Use DeviceOrientationOrMotionPermissionState type more consistently in the code base
instead of bool or Optional<bool>. Added "Prompt" value to this enumeration which is the
default state and which indicates we should ask the client.
* WebCore.xcodeproj/project.pbxproj:
* dom/DeviceOrientationAndMotionAccessController.cpp:
(WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
* dom/DeviceOrientationAndMotionAccessController.h:
(WebCore::DeviceOrientationAndMotionAccessController::accessState const):
* dom/DeviceOrientationOrMotionEvent.cpp:
(WebCore::DeviceOrientationOrMotionEvent::requestPermission):
* dom/DeviceOrientationOrMotionPermissionState.h:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
(WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
* page/ChromeClient.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
2019-04-17 Rob Buis <rbuis@igalia.com>
XMLHttpRequest has the wrong fallback encoding
https://bugs.webkit.org/show_bug.cgi?id=191741
Reviewed by Alex Christensen.
Allow overriding the response charset as specified here:
https://xhr.spec.whatwg.org/#final-charset
Behavior matches Firefox and Chrome.
Tests: imported/w3c/web-platform-tests/encoding/replacement-encodings.any.html
imported/w3c/web-platform-tests/encoding/replacement-encodings.any.worker.html
imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.html
imported/w3c/web-platform-tests/encoding/unsupported-encodings.any.worker.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::finalResponseCharset const):
(WebCore::XMLHttpRequest::createDecoder const):
* xml/XMLHttpRequest.h:
2019-04-16 Antoine Quint <graouts@apple.com>
Opt Google Maps into simulated mouse events dispatch quirk
https://bugs.webkit.org/show_bug.cgi?id=196965
<rdar://problem/49934766>
Reviewed by Dean Jackson.
Use the correct Google Maps path.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2019-04-16 Antoine Quint <graouts@apple.com>
Opt flipkart.com into simulated mouse events dispatch quirk
https://bugs.webkit.org/show_bug.cgi?id=196961
<rdar://problem/49648520>
Reviewed by Dean Jackson.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2019-04-16 Antoine Quint <graouts@apple.com>
Opt MSN.com into simulated mouse events dispatch quirk
https://bugs.webkit.org/show_bug.cgi?id=196960
<rdar://problem/49403260>
Reviewed by Dean Jackson.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
2019-04-16 Zan Dobersek <zdobersek@igalia.com>
ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
https://bugs.webkit.org/show_bug.cgi?id=191354
<rdar://problem/46123406>
Reviewed by Michael Catanzaro.
ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
index validity and, if the index is valid, check for completeness of the
corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
also only retrieve duration for already-complete frames, or expand the
default 0-second value according to the flashing-protection rule when
the target frame is not yet complete.
Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
as that method goes on and decodes image data to determine specific
information. The ImageSource class that's querying this information
doesn't anticipate this, and doesn't handle the increased memory
consumption of the decoded data, leaving MemoryCache in the blind about
the image resource's actual amount of consumed memory. ImageSource can
instead gracefully handle any incomplete frame by marking the decoding
status for this frame as only partial.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2019-04-16 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed non-unified build fix after r244307.
* page/DiagnosticLoggingClient.h:
2019-04-16 Chris Dumez <cdumez@apple.com>
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>
Reviewed by Geoff Garen.
Notify the FrameLoaderClient whenever an explicit open was done and provide it with
the latest document URL.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didExplicitOpen):
* loader/FrameLoaderClient.h:
2019-04-16 Timothy Hatcher <timothy@apple.com>
FrameView base background color always starts white.
https://bugs.webkit.org/show_bug.cgi?id=196976
Reviewed by Beth Dakin.
* page/FrameView.cpp:
(WebCore::FrameView::setBaseBackgroundColor): Bail early if the base background
color did not change.
2019-04-16 Devin Rousso <drousso@apple.com>
Unprefix -webkit-sticky
https://bugs.webkit.org/show_bug.cgi?id=196962
<rdar://problem/40903458>
Reviewed by Simon Fraser.
Updated existing tests.
This change doesn't modify functionality, only exposing a new unprefixed CSS value.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator PositionType const):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::convertPositionStyle):
2019-04-16 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r244321.
https://bugs.webkit.org/show_bug.cgi?id=196968
Causing all WK2 Debug builds to exit early after Assertion
failures. (Requested by ShawnRoberts on #webkit).
Reverted changeset:
"URL set by document.open() is not communicated to the
UIProcess"
https://bugs.webkit.org/show_bug.cgi?id=196941
https://trac.webkit.org/changeset/244321
2019-04-16 Caitlin Potter <caitp@igalia.com>
[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
https://bugs.webkit.org/show_bug.cgi?id=176810
Reviewed by Saam Barati.
Previously, there was a comment here indicating uncertainty of whether it
was necessary to filter DontEnum properties explicitly or not. It turns
out that it was necessary in the case of JSC ProxyObjects.
This patch adds DontEnum filtering for ProxyObjects, however we continue
to explicitly filter them in JSDOMConvertRecord, which needs to use the
property descriptor after filtering. This change prevents observably
fetching the property descriptor twice per property.
* bindings/js/JSDOMConvertRecord.h:
2019-04-15 Antoine Quint <graouts@apple.com>
[iOS] Redundant pointer events causes material design buttons to flush twice
https://bugs.webkit.org/show_bug.cgi?id=196914
<rdar://problem/49571860>
Reviewed by Dean Jackson.
Test: pointerevents/ios/pointer-event-order.html
Do not dispatch pointer events for mouse events on iOS since we're already dispatching them when processing touch events.
* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent):
2019-04-15 John Wilander <wilander@apple.com>
Add a query string nonce to LayoutTests/http/tests/adClickAttribution/send-attribution-conversion-request.html to address flakiness
https://bugs.webkit.org/show_bug.cgi?id=196955
Unreviewed test gardening. The WebCore change is only in a dedicated
test function.
No new tests. Existing test updated.
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::urlForTesting const):
Now preserves the query string in the test URL.
2019-04-15 Chris Dumez <cdumez@apple.com>
URL set by document.open() is not communicated to the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=196941
<rdar://problem/49237544>
Reviewed by Geoffrey Garen.
Notify the FrameLoaderClient whenever an explicit open was done and provide it with
the latest document URL.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didExplicitOpen):
* loader/FrameLoaderClient.h:
2019-04-15 Eike Rathke <erack@redhat.com>
Fix logic flow for error log
https://bugs.webkit.org/show_bug.cgi?id=196933
Reviewed by Alexey Proskuryakov.
Missing block braces logged an error always, not just
if (actionIfInvalid == Complain).
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isSafeToLoadURL):
2019-04-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] FontPlatformData objects aren't cached at all when using font-family:system-ui
https://bugs.webkit.org/show_bug.cgi?id=196846
<rdar://problem/49499971>
Reviewed by Simon Fraser and Darin Adler.
When adding the special codepath for system-ui to behave as an entire list of fonts rather than a single item,
I never added a cache for the FontPlatformData objects that codepath creates. The non-system-ui codepath already
has a cache in fontPlatformDataCache() in FontCache.cpp.
This patch causes a 16.8x performance improvement on the attached benchmark.
Test: PerformanceTests/Layout/system-ui-rebuild-emoji.html
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::invalidateFontCache):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
(WebCore::FontFamilySpecificationKey::FontFamilySpecificationKey):
(WebCore::FontFamilySpecificationKey::operator== const):
(WebCore::FontFamilySpecificationKey::operator!= const):
(WebCore::FontFamilySpecificationKey::isHashTableDeletedValue const):
(WebCore::FontFamilySpecificationKey::computeHash const):
(WebCore::FontFamilySpecificationKeyHash::hash):
(WebCore::FontFamilySpecificationKeyHash::equal):
(WebCore::fontMap):
(WebCore::clearFontFamilySpecificationCoreTextCache):
(WebCore::FontFamilySpecificationCoreText::fontRanges const):
* platform/graphics/cocoa/FontFamilySpecificationCoreText.h:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
(WebCore::safeCFEqual): Deleted.
2019-04-15 Devin Rousso <drousso@apple.com>
Web Inspector: fake value descriptors for promises add a catch handler, preventing "rejectionhandled" events from being fired
https://bugs.webkit.org/show_bug.cgi?id=196484
<rdar://problem/49114725>
Reviewed by Joseph Pecoraro.
Test: inspector/runtime/promise-native-getter.html
Mark errors created from getters as being `isNativeGetterTypeError`.
* bindings/js/JSDOMExceptionHandling.cpp:
(WebCore::throwGetterTypeError):
(WebCore::rejectPromiseWithGetterTypeError):
(WebCore::rejectPromiseWithThisTypeError):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::makeGetterTypeErrorForBuiltins):
* bindings/js/JSDOMPromiseDeferred.h:
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createRejectedPromiseWithTypeError):
* Modules/streams/WritableStream.js:
(getter.closed):
(getter.ready):
2019-04-15 Jer Noble <jer.noble@apple.com>
Add a DiagnosticLogging method taking an arbitrary dictionary of values.
https://bugs.webkit.org/show_bug.cgi?id=196773
Reviewed by Alex Christensen.
* page/DiagnosticLoggingClient.h:
2019-04-15 Justin Fan <justin_fan@apple.com>
Let WTF::convertSafely deduce types from arguments.
Reviewer's (Darin Adler) follow-up to https://bugs.webkit.org/show_bug.cgi?id=196793.
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::tryCreate):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetInputStateForPipelineDescriptor):
2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
Throw TypeError when custom element constructor returns a wrong element or tries to create itself
https://bugs.webkit.org/show_bug.cgi?id=196892
Reviewed by Dean Jackson.
Throw TypeError instead of InvalidStateError for consistency. This updates WebKit's custom elements
implementation for https://github.com/whatwg/html/pull/4525.
Tests: imported/w3c/web-platform-tests/custom-elements/upgrading/Node-cloneNode.html
imported/w3c/web-platform-tests/custom-elements/upgrading/upgrading-parser-created-element.html
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::upgradeElement):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
2019-04-15 Don Olmstead <don.olmstead@sony.com>
[CMake] WebCore derived sources should only be referenced inside WebCore
https://bugs.webkit.org/show_bug.cgi?id=196904
Reviewed by Konstantin Tokarev.
Use WebCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_WEBCORE_DIR.
* CMakeLists.txt:
* PlatformGTK.cmake:
* PlatformWin.cmake:
* WebCoreMacros.cmake:
2019-04-15 John Wilander <wilander@apple.com>
Send delayed Ad Click Attribution conversion requests to the click source
https://bugs.webkit.org/show_bug.cgi?id=196838
<rdar://problem/47650157>
Reviewed by Chris Dumez and Youenn Fablet.
WebCore::AdClickAttribution now:
- Sets m_earliestTimeToSend correctly based on WallTime::now().
- Allows for a test override of the base URL for conversions.
- Holds state for whether or not a conversion request has been sent.
- Outputs m_earliestTimeToSend and m_conversion->hasBeenSent in toString().
- Returns m_earliestTimeToSend as a result of a call to
convertAndGetEarliestTimeToSend() which used to be called setConversion().
Test: http/tests/adClickAttribution/send-attribution-conversion-request.html
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::convertAndGetEarliestTimeToSend):
(WebCore::AdClickAttribution::url const):
(WebCore::AdClickAttribution::urlForTesting const):
(WebCore::AdClickAttribution::markConversionAsSent):
(WebCore::AdClickAttribution::wasConversionSent const):
(WebCore::AdClickAttribution::toString const):
(WebCore::AdClickAttribution::setConversion): Deleted.
Renamed convertAndGetEarliestTimeToSend().
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Conversion::Conversion):
(WebCore::AdClickAttribution::Conversion::encode const):
(WebCore::AdClickAttribution::Conversion::decode):
* platform/Timer.h:
Now exports nextFireInterval.
2019-04-15 Chris Dumez <cdumez@apple.com>
Regression(r237903) Speedometer 2 is 1-2% regressed on iOS
https://bugs.webkit.org/show_bug.cgi?id=196841
<rdar://problem/45957016>
Reviewed by Myles C. Maxfield.
Speedometer 2 content does not use the text-underline-offset and text-decoration-thickness
features that were added in r237903 so I looked for behavior changes in the context of
Speedometer from r237903. I found that RenderStyle::changeAffectsVisualOverflow() started
returning true a lot more often after r237903. The reason is that r237903 dropped the
visualOverflowForDecorations() checks in this method and started returning true a lot
more as a result.
To restore previous behavior, this patch adds back the visualOverflowForDecorations() checks
that were dropped in r237903. I have verified that with this patch,
RenderStyle::changeAffectsVisualOverflow() returns true as many times as it used to before
r237903.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
2019-04-15 Said Abou-Hallawa <said@apple.com>
ASSERT fires when removing a disallowed clone from the shadow tree without reseting its corresponding element
https://bugs.webkit.org/show_bug.cgi?id=196895
Reviewed by Darin Adler.
When cloning elements to the shadow tree of an SVGUseElement, the
corresponding element links are set from the clones to the originals.
Later some of the elements may be disallowed to exist in the shadow tree.
For example the SVGPatternElement is disallowed and has to be removed
even after cloning. The problem is the corresponding elements are not
reset to null. Usually this is not a problem because the removed elements
will be deleted and the destructor of SVGElement will reset the corresponding
element links. However in some cases, the cloned element is referenced
from another SVGElement, for example the target of a SVGTRefElement. In
this case the clone won't be deleted but it will be linked to the original
and the event listeners won't be copied from the original. When the
original is deleted, its event listeners have to be removed. The event
listeners of the clones also ave to be removed. But because the event
listeners of the original were not copied when cloning, the assertion in
SVGElement::removeEventListener() fires.
Test: svg/custom/use-disallowed-element-clear-corresponding-element.html
* svg/SVGUseElement.cpp:
(WebCore::disassociateAndRemoveClones):
2019-04-15 Devin Rousso <drousso@apple.com>
Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute
https://bugs.webkit.org/show_bug.cgi?id=196556
<rdar://problem/49570681>
Reviewed by Timothy Hatcher.
Test: inspector/dom-debugger/attribute-modified-style.html
* css/PropertySetCSSStyleDeclaration.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope):
(WebCore::InlineCSSStyleDeclaration::willMutate): Added.
* dom/StyledElement.cpp:
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::inlineStyleChanged):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added.
(WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added.
(WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added.
(WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted.
2019-04-15 Devin Rousso <drousso@apple.com>
Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
https://bugs.webkit.org/show_bug.cgi?id=196887
<rdar://problem/49870627>
Reviewed by Timothy Hatcher.
Test: inspector/dom/event-listener-add-remove.html
inspector/dom/event-listener-inspected-node.html
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::setInspectedNode):
(WebCore::InspectorDOMAgent::didAddEventListener):
(WebCore::InspectorDOMAgent::willRemoveEventListener):
2019-04-15 Antoine Quint <graouts@apple.com>
Ensure iOS layout traits are used for media controls in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196812
<rdar://problem/47460637>
Unreviewed. Speculative fix for test regressions on open-source bots.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits):
2019-04-11 Antoine Quint <graouts@apple.com>
Ensure iOS layout traits are used for media controls in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196812
<rdar://problem/47460637>
Reviewed by Dean Jackson.
Test: media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html
Instead of looking at the UA string, check whether we support touches which is the correct indicator of whether we should
be using the iOS layout traits for media controls.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits):
2019-04-14 Rob Buis <rbuis@igalia.com>
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. Ignore prefetches for content extension checks.
Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
http/tests/cache/link-prefetch-main-resource.html
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):
* loader/ResourceLoadInfo.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
2019-04-14 Dean Jackson <dino@apple.com>
Extract UTI mapping and allow for additions
https://bugs.webkit.org/show_bug.cgi?id=196822
<rdar://problem/49822339>
Reviewed by Darin Adler
Post landing feedback on minimizing String constructors.
* platform/network/mac/UTIUtilities.mm:
(WebCore::MIMETypeFromUTITree):
(WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
2019-04-14 Don Olmstead <don.olmstead@sony.com>
[CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=196742
Reviewed by Konstantin Tokarev.
Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.
* CMakeLists.txt:
2019-04-12 Antoine Quint <graouts@apple.com>
Provide a quirk to disable Pointer Events
https://bugs.webkit.org/show_bug.cgi?id=196877
<rdar://problem/49863470>
Reviewed by Dean Jackson.
Add a quirk to disable Pointer Events. We also opt a website that has compatibility issues with Pointer Events into this new quirk.
* dom/PointerEvent.idl:
* page/Quirks.cpp:
(WebCore::Quirks::shouldDisablePointerEventsQuirk const):
* page/Quirks.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
2019-04-12 Wenson Hsieh <wenson_hsieh@apple.com>
Enable modern compatibility mode by default in WKWebView on some devices
https://bugs.webkit.org/show_bug.cgi?id=196883
<rdar://problem/49864527>
Reviewed by Tim Horton.
Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring
compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with
a bundle ID that begins with "com.apple.".
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::setApplicationBundleIdentifier):
(WebCore::applicationBundleStartsWith):
(WebCore::IOSApplication::isAppleApplication):
2019-04-12 Justin Fan <justin_fan@apple.com>
[Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
https://bugs.webkit.org/show_bug.cgi?id=196793
Reviewed by Darin Adler.
On 32-bit platforms, NSUInteger is 32-bit, which limits certain Web GPU parameters.
Ensure that valid parameters are properly converted to NSUInteger for Metal calls, regardless of platform.
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::byteLength const):
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::tryGetResourceAsBufferBinding):
(WebCore::setBufferOnEncoder):
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferUsage):
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::setSubData):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::drawIndexed):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetInputStateForPipelineDescriptor):
2019-04-12 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed fix for non-unified build.
* dom/ScriptedAnimationController.h:
Add missing include from r244182.
2019-04-11 Ryosuke Niwa <rniwa@webkit.org>
WebThread should run at a higher priority than user initiated
https://bugs.webkit.org/show_bug.cgi?id=196849
<rdar://problem/46851062>
Reviewed by Geoffrey Garen.
Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
won't wait for other threads with priority 30-37 but does not content with the main thread.
Also removed the call to pthread_attr_setschedparam which disables QoS.
This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
iBooks to an opened book.
* platform/ios/wak/WebCoreThread.mm:
(StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.
2019-04-12 Ryosuke Niwa <rniwa@webkit.org>
Add CSS Shadow Parts as a feature under consideration
https://bugs.webkit.org/show_bug.cgi?id=196835
Reviewed by Antti Koivisto.
This feature is under consideration.
* features.json:
2019-04-12 Ross Kirsling <ross.kirsling@sony.com>
WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
https://bugs.webkit.org/show_bug.cgi?id=196845
Reviewed by Ryosuke Niwa.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
(WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
(WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
(WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
(WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
(WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
(WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
Remove inline specifier to address linking errors (regardless of CMake platform).
Doing this in a .cpp file interferes with symbol creation.
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/webvr/VREyeParameters.cpp:
* Modules/webvr/VRFrameData.cpp:
* Modules/webvr/VRPose.cpp:
* accessibility/AccessibilityList.cpp:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
* bindings/js/JSDOMConvertWebGL.cpp:
* bindings/js/JSHistoryCustom.cpp:
* bindings/js/JSIDBCursorWithValueCustom.cpp:
* bindings/js/JSPerformanceObserverCustom.cpp:
* bindings/js/WindowProxy.cpp:
* platform/ColorData.gperf:
* platform/mediastream/RealtimeMediaSourceSettings.cpp:
* platform/network/DNSResolveQueue.cpp:
* workers/service/ServiceWorkerClientQueryOptions.h:
* workers/service/ServiceWorkerContainer.cpp:
Add missing includes to address compiler errors on GTK.
2019-04-12 Zalan Bujtas <zalan@apple.com>
REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
https://bugs.webkit.org/show_bug.cgi?id=196789
<rdar://problem/49855255>
Reviewed by Tim Horton.
Disable auto-sizing mode at the start of each test.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
2019-04-12 Eric Carlson <eric.carlson@apple.com>
Update AudioSession route sharing policy
https://bugs.webkit.org/show_bug.cgi?id=196776
<rdar://problem/46501611>
Reviewed by Jer Noble.
No new tests, updated an API test.
* platform/audio/AudioSession.cpp:
(WebCore::convertEnumerationToString):
* platform/audio/AudioSession.h:
(WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
(WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::updateSessionState):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routeSharingPolicy const):
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSession::setCategory):
2019-04-12 Antoine Quint <graouts@apple.com>
Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196830
<rdar://problem/49124313>
Reviewed by Wenson Hsieh.
We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
document to see if it matches some known websites that require this quirk.
We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
flag to ensure we correctly created touch regions for simulated mouse events.
* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
(WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
* page/Quirks.h:
2019-04-11 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=196146
Reviewed by Antti Koivisto.
computeCoordinatedPositioningForLayer() failed to handle nested positions elements
inside overflow scroll, because it only walked up to the first containing block of
a nested position:absolute. We need to walk all the way up the ancestor layer chain,
looking at containing block, scroller and composited ancestor relationships.
Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
more ancestor traversals, but we now only run this code if there's composited scrolling
in the ancestor chain.
Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::enclosingCompositedScrollingLayer):
(WebCore::isScrolledByOverflowScrollLayer):
(WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
(WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
(WebCore::collectStationaryLayerRelatedOverflowNodes):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::collectRelatedCoordinatedScrollingNodes):
(WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.
2019-04-12 Manuel Rego Casasnovas <rego@igalia.com>
[css-flex][css-grid] Fix synthesized baseline
https://bugs.webkit.org/show_bug.cgi?id=196312
Reviewed by Javier Fernandez.
When a flex or grid container has no baseline,
its baseline should be synthesized from the border edges.
The same happens for flex and grid items.
Right now we were using the content box in some cases
and even using the margin box in a particular scenario.
The patch fixes this.
At the same time this is also fixing the baseline for
inline flex/grid containers to make it interoperable with Firefox.
Inline blocks have a special behavior per legacy reasons,
which applies to inline flex/grid containers when they have no items;
otherwise the items should be used to compute its baseline.
See more at: https://github.com/w3c/csswg-drafts/issues/3416
Note that we need to keep current behavior for buttons,
as the flexbox spec doesn't apply to them.
Tests: css3/flexbox/flexbox-baseline-margins.html
fast/css-grid-layout/grid-baseline-margins-1.html
fast/css-grid-layout/grid-baseline-margins-2.html
imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html
* rendering/RenderButton.cpp:
(WebCore::synthesizedBaselineFromContentBox):
(WebCore::RenderButton::baselinePosition const):
* rendering/RenderButton.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderFlexibleBox::baselinePosition const):
(WebCore::RenderFlexibleBox::firstLineBaseline const):
(WebCore::RenderFlexibleBox::inlineBlockBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::inlineBlockBaseline const):
2019-04-11 Simon Fraser <simon.fraser@apple.com>
Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=196848
Reviewed by Zalan Bujtas.
Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
in the layer tree. We only need to do work related to making positioned scrolling tree nodes
for layers which are layer tree descendants of overflow:scroll.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2019-04-11 Zalan Bujtas <zalan@apple.com>
Try to fix Windows build.
* page/PrintContext.cpp:
(WebCore::PrintContext::computedPageMargin):
2019-04-11 Megan Gardner <megan_gardner@apple.com>
Update 'Save Image' to more clear instructions
https://bugs.webkit.org/show_bug.cgi?id=196833
<rdar://problem/47446845>
Reviewed by Wenson Hsieh.
Not testable, UI change only.
* en.lproj/Localizable.strings:
2019-04-11 Zalan Bujtas <zalan@apple.com>
Add @page margin support
https://bugs.webkit.org/show_bug.cgi?id=196680
<rdar://problem/45217707>
Reviewed by Tim Horton.
This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
in the WebProcess if needed (see PrintInfo for current printer margins).
Tests: printing/page-with-10mm-left-margin.html
printing/page-with-zero-margin.html
* page/PrintContext.cpp:
(WebCore::PrintContext::computedPageMargin):
(WebCore::PrintContext::computedPageSize):
* page/PrintContext.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
(WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):
2019-04-11 Dean Jackson <dino@apple.com>
Extract UTI mapping and allow for additions
https://bugs.webkit.org/show_bug.cgi?id=196822
<rdar://problem/49822339>
Reviewed by Tim Horton.
Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
of accepted MIME types. And add a new helper to map
MIME types to UTI types when the system was unable to
find an existing type.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
* platform/network/mac/UTIUtilities.mm:
(WebCore::UTIFromUnknownMIMEType):
(WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):
2019-04-09 Ryosuke Niwa <rniwa@webkit.org>
[iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
https://bugs.webkit.org/show_bug.cgi?id=196670
Reviewed by Wenson Hsieh.
The bug was ultimately caused by two reasons:
1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.
When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
and then previousWordPositionBoundary would identify it as a word boundary.
Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
to make SimplifiedBackwardsTextIterator directly testable in layout tests.
This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
with sentence granularity at the beginning of a line as indicated by the new tests.
Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
editing/text-iterator/backwards-text-iterator-basic.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
(WebCore::AXObjectCache::startCharacterOffsetOfSentence):
* accessibility/AXObjectCache.h:
(WebCore::CharacterOffset::isEqual const):
* editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
of a line fails on iOS.
(WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
* editing/TextIterator.h:
* editing/VisibleUnits.cpp:
(WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
the current position, and fixed a bug that an early return for the text node was not taking the suffix length
into account when deciding whether next position resides in the starting container node or not.
(WebCore::startSentenceBoundary):
(WebCore::startOfSentence):
* testing/Internals.cpp:
(WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Added.
* testing/Internals.h:
* testing/Internals.idl:
2019-04-11 Wenson Hsieh <wenson_hsieh@apple.com>
Allow the MediaSource API to be enabled via website policy
https://bugs.webkit.org/show_bug.cgi?id=196429
<rdar://problem/48774333>
Reviewed by Tim Horton.
Add support in DocumentLoader for adjusting page settings using its per-site policies. See WebKit ChangeLog for
more detail (in particular, the implementation of applyToDocumentLoader).
Test: fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::applyPoliciesToSettings const):
(WebCore::DocumentLoader::attachToFrame):
* loader/DocumentLoader.h:
Add an enum class for MediaSource policies; while we're at it, make all of these enum values 8 bits wide.
(WebCore::DocumentLoader::mediaSourcePolicy const):
(WebCore::DocumentLoader::setMediaSourcePolicy):
2019-04-11 Youenn Fablet <youenn@apple.com>
Support RTCDataChannel blob binaryType
https://bugs.webkit.org/show_bug.cgi?id=196821
Reviewed by Eric Carlson.
Add support for receiving blobs.
Default value is still left to 'arraybuffer' which is not spec compliant.
Covered by rebased test.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::setBinaryType):
(WebCore::RTCDataChannel::didReceiveRawData):
2019-04-11 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: can't reliably stop/start a recording
https://bugs.webkit.org/show_bug.cgi?id=196778
<rdar://problem/47606798>
Reviewed by Timothy Hatcher.
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::stopTracking):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::stopTracking):
Send an end timestamp to match other instruments.
2019-04-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r244158.
Casued 8 inspector/timeline/ test failures.
Reverted changeset:
"Web Inspector: Timelines: can't reliably stop/start a
recording"
https://bugs.webkit.org/show_bug.cgi?id=196778
https://trac.webkit.org/changeset/244158
2019-04-11 Pablo Saavedra <psaavedra@igalia.com>
[WPE] Build error with ENABLE_VIDEO=OFF after r244078
https://bugs.webkit.org/show_bug.cgi?id=196811
createGenericCue() is only defined when VIDEO_TRACK is enabled.
Reviewed by Eric Carlson.
* testing/Internals.cpp:
(WebCore::Internals::createGenericCue):
* testing/Internals.h:
2019-04-11 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
https://bugs.webkit.org/show_bug.cgi?id=146718
<rdar://problem/21722487>
Reviewed by Joanmarie Diggs.
Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
aria-hidden="false".
Fixes: accessibility/aria-hidden-false-works-in-subtrees.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):
* accessibility/atk/WebKitAccessible.cpp:
(roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
<div role="roup">test</div>.
2019-04-10 Said Abou-Hallawa <sabouhallawa@apple.com>
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484
Reviewed by Simon Fraser.
This change fixes these issues with animation timing:
1. Calling the requestAnimationFrame callbacks would have happened when
the DisplayLink fires. This may have happened even if the frame is
missed and no display is committed.
2. Style changes and layout triggered by script could trigger painting
at more than 60fps. CoreAnimation commits could happen at more than
60fps, although WindowServer will throttle those, and only some will
be shown on the screen.
This change introduces a new paint scheduling model where painting is
driven by a "RenderingUpdateScheduler", which only triggers paints once
per 16.7ms frame.
Code that previously scheduled a compositing layer flush now schedules a
"RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
callback. When the render happens, we service requestAnimationFrame callbacks,
Web Animations, intersection observations and resize observations per the
"Update the rendering" step of the HTML Event Loop specification:
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
In the future, more rendering steps will be added to this code.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
Fix layout tests by adding null check.
* animation/DocumentAnimationScheduler.cpp: Removed.
* animation/DocumentAnimationScheduler.h: Removed.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::cacheCurrentTime):
(WebCore::DocumentTimeline::animationTimingDidChange):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::unscheduleAnimationResolution):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::scheduleNextTick):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
Simplify this function by handling the case of no-animations separately.
(WebCore::DocumentTimeline::resolveAnimationsForElement):
Simplify the loop and delete hasPendingAcceleratedAnimations because it
is initialized to true and is not changed inside the loop.
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
(WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
There is no need to force update in resolveStyle(). notifyFlushRequired()
will be called eventually which will scheduleRenderingUpdate().
(WebCore::Document::prepareForDestruction):
(WebCore::Document::updateAnimationsAndSendEvents):
(WebCore::Document::serviceRequestAnimationFrameCallbacks):
(WebCore::Document::windowScreenDidChange):
(WebCore::Document::scheduleRenderingUpdate):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::addResizeObserver):
(WebCore::Document::updateResizeObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Document::scheduleResizeObservations): Deleted.
(WebCore::Document::animationScheduler): Deleted.
No need to schedule web-animations, intersection observations and resize
observations updates separately. All of them will be updated through the
"Update the rendering" step, i.e. Page::updateRendering().
* dom/Document.h:
(WebCore::Document::numberOfIntersectionObservers const):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
* dom/ScriptedAnimationController.h:
* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
(WebCore::FrameView::viewportContentsChanged):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layoutTimerFired):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::layoutIfNeeded):
(WebCore::Page::updateRendering):
(WebCore::Page::renderingUpdateScheduler):
(WebCore::Page::willDisplayPage): Deleted.
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
(WebCore::Page::updateIntersectionObservations): Deleted.
(WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Page::hasResizeObservers const): Deleted.
(WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
(WebCore::Page::checkResizeObservations): Deleted.
(WebCore::Page::scheduleResizeObservations): Deleted.
(WebCore::Page::notifyResizeObservers): Deleted.
* page/Page.h:
(WebCore::Page::setNeedsCheckResizeObservations): Deleted.
(WebCore::Page::needsCheckResizeObservations const): Deleted.
The IntersectionObserver and the ResizeObserver do not need to schedule
their own timers. The RenderingUpdateScheduler will schedule the "Update
the rendering" step in which these obverses will be served.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::notifyFlushRequired):
Force committing the layers to be 60 fps at maximum.
* page/RenderingUpdateScheduler.cpp: Added.
(WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
(WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
(WebCore::RenderingUpdateScheduler::isScheduled const):
(WebCore::RenderingUpdateScheduler::startTimer):
(WebCore::RenderingUpdateScheduler::clearScheduled):
(WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
(WebCore::RenderingUpdateScheduler::windowScreenDidChange):
(WebCore::RenderingUpdateScheduler::displayRefreshFired):
(WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
* page/RenderingUpdateScheduler.h: Added.
(WebCore::RenderingUpdateScheduler::create):
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::observe):
(WebCore::ResizeObserver::scheduleObservations): Deleted.
* page/ResizeObserver.h:
(WebCore::ResizeObserver::hasActiveObservations const):
* page/ios/ContentChangeObserver.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
* page/scrolling/ScrollingStateTree.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
(WebCore::RenderLayerCompositor::layerTreeAsText):
2019-04-10 Ryosuke Niwa <rniwa@webkit.org>
Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
https://bugs.webkit.org/show_bug.cgi?id=193027
Reviewed by Wenson Hsieh.
Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
like removing contenteditable content attribute during DOM mutations or when the destination becomes
disconnected (orphaned) from the document due to bugs elsewhere in the codebase.
Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.
2019-04-10 Devin Rousso <drousso@apple.com>
Web Inspector: save sheet should be anchored underneath the tab bar when detached
https://bugs.webkit.org/show_bug.cgi?id=196722
<rdar://problem/49613280>
Reviewed by Timothy Hatcher.
No web observable change.
* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::changeSheetRect): Added.
* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::setSheetRect): Added.
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::setSheetRect): Added.
2019-04-10 Devin Rousso <drousso@apple.com>
Web Inspector: Inspector: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195971
<rdar://problem/49039645>
Reviewed by Joseph Pecoraro.
No change in functionality.
* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::evaluateForTestInFrontend):
(WebCore::InspectorController::ensureInspectorAgent):
2019-04-10 Megan Gardner <megan_gardner@apple.com>
Remove unneeded extern C
https://bugs.webkit.org/show_bug.cgi?id=196786
Reviewed by Tim Horton.
No tests needed, just needs to compile.
Removing staging hack for Reveal framework.
* editing/cocoa/DictionaryLookup.mm:
2019-04-10 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
https://bugs.webkit.org/show_bug.cgi?id=196725
<rdar://problem/49669810>
Reviewed by Timothy Hatcher.
Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
functions so that callers into `InspectorController` can be guaranteed to have a valid
instance of the agent.
This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
There is no `DOM.enable` command, so there's no issue there either.
* inspector/InspectorController.h:
(WebCore::InspectorController::pageAgent): Deleted.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::inspect):
(WebCore::InspectorController::hideHighlight):
(WebCore::InspectorController::ensureDOMAgent): Added.
(WebCore::InspectorController::ensurePageAgent): Added.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
2019-04-10 Alex Christensen <achristensen@webkit.org>
Add SPI WKNavigationResponse._downloadAttribute
https://bugs.webkit.org/show_bug.cgi?id=196755
<rdar://49587365>
Reviewed by Brady Eidson.
Covered by an API test that validates the attribute is correctly sent through the FrameLoader to the API.
When a user clicks on a link with a download attribute, the download attribute should be used as the suggested filename sometimes.
The application needs this information after it has received the response in order to make fully informed decisions about downloads.
In order to get this attribute to the decidePolicyForNavigationResponse, we need to store the attribute on the DocumentLoader
from the FrameLoadRequest then send it from the DocumentLoader when the response is received.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setDownloadAttribute):
(WebCore::DocumentLoader::downloadAttribute const):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkContentPolicy):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/FrameLoaderClient.h:
2019-04-10 Youenn Fablet <youenn@apple.com>
SWClientConnection should not double hop to fire some events
https://bugs.webkit.org/show_bug.cgi?id=196735
Reviewed by Alex Christensen.
Some events, like postMessage in service workers is hopping from main thread to service worker thread to dispatch events.
Some other events, like service worker state update, are hopping from main thread to service worker thread, then posting a task to dispatch events.
This may create ordering problems.
To fix the issue, we now hop to the service worker thread and dispatch the events.
In addition, for documents, we post a task and do the whole service worker processing in it.
This ensures that some tests, like whether there is a service worker container,
or creation of a service worker are done consistently.
Covered by unflaked test.
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::updateWorkerState):
(WebCore::SWClientConnection::fireUpdateFoundEvent):
(WebCore::SWClientConnection::notifyClientsOfControllerChange):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::updateState):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::updateRegistrationState):
(WebCore::ServiceWorkerContainer::fireUpdateFoundEvent):
(WebCore::ServiceWorkerContainer::fireControllerChangeEvent):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
Notify of the script URL in the error message.
This will help diagnose flakiness issues.
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::fireUpdateFoundEvent):
* workers/service/ServiceWorkerRegistration.h:
2019-04-10 Devin Rousso <drousso@apple.com>
Web Inspector: Timelines: can't reliably stop/start a recording
https://bugs.webkit.org/show_bug.cgi?id=196778
<rdar://problem/47606798>
Reviewed by Timothy Hatcher.
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::stopTracking):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::stopTracking):
Send an end timestamp to match other instruments.
2019-04-10 Tim Horton <timothy_horton@apple.com>
Add modern API for overriding the page's specified viewport configuration
https://bugs.webkit.org/show_bug.cgi?id=167734
<rdar://problem/30331795>
Reviewed by Simon Fraser.
New API test: WebKit.OverrideViewportArguments
* dom/Document.cpp:
(WebCore::Document::updateViewportArguments):
* dom/Document.h:
(WebCore::Document::viewportArguments const):
Make the viewportArguments() getter respect the overridden arguments.
* dom/ViewportArguments.cpp:
(WebCore::numericPrefix):
(WebCore::findSizeValue):
(WebCore::findScaleValue):
(WebCore::findBooleanValue):
(WebCore::parseViewportFitValue):
(WebCore::viewportErrorMessage):
(WebCore::reportViewportWarning):
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
Make it possible to parse ViewportArguments without a Document, so
that it can be used in the UI process. We only used the Document for
two things: error reporting, and getting the state of one setting.
Refactor error handling to use a passed-arund function, and add a
variant of setViewportFeature() that doesn't take a Document.
2019-04-10 Justin Fan <justin_fan@apple.com>
[Web GPU] Indexed drawing and GPUCommandEncoder crash prevention
https://bugs.webkit.org/show_bug.cgi?id=196758
Reviewed by Dean Jackson.
Test: webgpu/draw-indexed-triangles.html
Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed to enable indexed drawing.
Disable GPUCommandEncoders with active pass encoders from being submitted or encoding blits.
Prevent active GPUCommandEncoders from being submitted or encoding blit commands:
* Modules/webgpu/WebGPUCommandEncoder.cpp:
(WebCore::WebGPUCommandEncoder::finish):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
(WebCore::GPUCommandBuffer::copyTextureToTexture):
Implement GPURenderPassEncoder::setIndexBuffer and GPURenderPassEncoder::drawIndexed:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setIndexBuffer):
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Remove unnecessary move operations.
(WebCore::WebGPURenderPassEncoder::drawIndexed): Added.
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::isIndex const):
* platform/graphics/gpu/GPUInputStateDescriptor.h:
* platform/graphics/gpu/GPURenderPassEncoder.h: Cache the index buffer, as Metal does not set the index buffer separate from the draw call.
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::indexFormat const):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setIndexBuffer):
(WebCore::GPURenderPassEncoder::setVertexBuffers):
(WebCore::mtlPrimitiveTypeForGPUPrimitiveTopology):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::mtlIndexTypeForGPUIndexFormat): Added.
(WebCore::GPURenderPassEncoder::drawIndexed): Added.
(WebCore::primitiveTypeForGPUPrimitiveTopology): Deleted.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):
2019-04-09 Ryosuke Niwa <rniwa@webkit.org>
OfflineAudioDestinationNode::startRendering leaks OfflineAudioDestinationNode if offlineRender exists early
https://bugs.webkit.org/show_bug.cgi?id=196759
Reviewed by Eric Carlson.
OfflineAudioDestinationNode::startRendering unconditionally ref's itself before invoking offlineRender() in a new thread.
But offlineRender can early exit without ever calling deref() in the main thread, leading to the leak of
OfflineAudioDestinationNode. Fixed the leak by always calling deref in the main thread after calling offlineRender().
Also removed the debug assertion in offlineRender which always hits when we run the relevant test.
Test: imported/w3c/web-platform-tests/webaudio/the-audio-api/the-offlineaudiocontext-interface/current-time-block-size.html
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
(WebCore::OfflineAudioDestinationNode::offlineRender):
(WebCore::OfflineAudioDestinationNode::notifyComplete): Merged into startRendering.
* Modules/webaudio/OfflineAudioDestinationNode.h:
2019-04-10 Megan Gardner <megan_gardner@apple.com>
Fix text autoscrolling when typing in modern webkit
https://bugs.webkit.org/show_bug.cgi?id=196718
<rdar://problem/49225507>
Reviewed by Tim Horton.
Tests: fast/events/autoscroll-when-input-is-offscreen.html
fast/events/autoscroll-with-software-keyboard.html
We have been relying on UIKit to scroll editable text, but
since we cannot give them enough information for them to always
do the right thing, we should just do all the work in WebKit.
This has the added benifit of fixing some tricky autoscrolling
bugs that have cropped up recently.
* editing/Editor.cpp:
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::revealSelectionAfterEditingOperation):
We should be scrolling the main frame in WebKit. We have been relying on UIKit,
but we cannot give them enough information to guarantee a correct scroll, so just
do all the work in WebKit.
* page/FrameView.cpp:
(WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
Update to use the rect that is actually visible, accounting for the software keyboard.
2019-04-10 Ross Kirsling <ross.kirsling@sony.com>
WebCore should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
https://bugs.webkit.org/show_bug.cgi?id=196762
Reviewed by Ryosuke Niwa.
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Modules/websockets/WebSocketFrame.cpp:
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentTable const):
* accessibility/AccessibilityObject.cpp:
* accessibility/AccessibilityRenderObject.cpp:
* animation/CSSAnimation.cpp:
* animation/DeclarativeAnimation.cpp:
* bindings/js/DOMGCOutputConstraint.h:
* bindings/js/JSCanvasRenderingContext2DCustom.cpp:
(WebCore::root):
(WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSCanvasRenderingContext2D::visitAdditionalChildren):
* bindings/js/JSDOMConvertNumbers.cpp:
* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSExtendableMessageEventCustom.cpp:
* bindings/js/SerializedScriptValue.cpp:
* css/CSSFontFaceSource.cpp:
* css/CSSFontFaceSource.h:
* css/MediaQueryMatcher.h:
* css/parser/CSSPropertyParserHelpers.cpp:
* dom/DocumentParser.cpp:
* dom/EventPath.cpp:
* dom/MouseEvent.h:
* dom/SpectreGadget.cpp:
* dom/SpectreGadget.h:
* editing/ChangeListTypeCommand.cpp:
* editing/EditAction.cpp:
* editing/ReplaceSelectionCommand.cpp:
* editing/TextGranularity.h:
* html/HTMLFormControlsCollection.cpp:
* html/HTMLImageElement.cpp:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* inspector/InspectorController.cpp:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
* inspector/agents/InspectorCanvasAgent.cpp:
* inspector/agents/WebHeapAgent.cpp:
* inspector/agents/page/PageAuditAgent.cpp:
* inspector/agents/page/PageConsoleAgent.cpp:
* inspector/agents/page/PageNetworkAgent.cpp:
* inspector/agents/worker/WorkerAuditAgent.cpp:
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightResultCache.h:
* loader/NavigationAction.cpp:
* loader/ResourceLoadObserver.cpp:
* page/FrameTree.cpp:
* page/IntersectionObserver.cpp:
* page/PageConfiguration.cpp:
* page/PerformanceResourceTiming.cpp:
* page/ResizeObservation.cpp:
* page/UndoManager.cpp:
* plugins/PluginData.cpp:
* rendering/Grid.h:
* rendering/GridBaselineAlignment.cpp:
* rendering/GridBaselineAlignment.h:
* rendering/GridLayoutFunctions.cpp:
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderFlexibleBox.cpp:
* rendering/RenderIFrame.cpp:
* rendering/RenderLayerFilters.cpp:
* rendering/TextDecorationPainter.cpp:
* rendering/TextDecorationPainter.h:
* rendering/TextPainter.cpp:
* rendering/TextPainter.h:
* rendering/style/StyleRareNonInheritedData.cpp:
* rendering/style/StyleRareNonInheritedData.h:
* rendering/svg/SVGRenderSupport.h:
* rendering/updating/RenderTreeBuilder.cpp:
* rendering/updating/RenderTreeBuilderSVG.cpp:
* style/InlineTextBoxStyle.cpp:
* style/InlineTextBoxStyle.h:
* style/StylePendingResources.cpp:
* svg/SVGMatrix.h:
* svg/SVGViewSpec.h:
* svg/SVGZoomAndPan.h:
* workers/WorkerScriptLoader.cpp:
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorker.cpp:
* workers/service/ServiceWorkerClientData.cpp:
* workers/service/ServiceWorkerClients.cpp:
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
* workers/service/ServiceWorkerJob.cpp:
* workers/service/ServiceWorkerProvider.cpp:
* workers/service/context/ServiceWorkerFetch.cpp:
* workers/service/context/ServiceWorkerInspectorProxy.h:
* workers/service/context/ServiceWorkerThread.cpp:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
* workers/service/server/SWServerJobQueue.cpp:
* workers/service/server/SWServerToContextConnection.cpp:
* workers/service/server/SWServerWorker.cpp:
* workers/service/server/SWServerWorker.h:
* worklets/Worklet.h:
2019-04-10 Antoine Quint <graouts@apple.com>
Enable Pointer Events on watchOS
https://bugs.webkit.org/show_bug.cgi?id=196771
<rdar://problem/49040909>
Reviewed by Dean Jackson.
* Configurations/FeatureDefines.xcconfig:
2019-04-10 Youenn Fablet <youenn@apple.com>
Delay initialization of quota users until the first quota request
https://bugs.webkit.org/show_bug.cgi?id=196467
Reviewed by Chris Dumez.
Instead of triggering initialization of each user when being added,
delay initialization until the first call to requestSpace with a non zero task size.
This will make sure we do not load Cache API information in memory or check for
IDB space until actually necessary.
To implement that, move from a HashSet of being initialized users to a HashMap where the key is user and
the value is the user initialization state.
When removing a user, delay the call to processPendingRequest so that a synchronous call to addUser
can be taken into consideration.
This unflakes some Cache API tests as these tests do clear the Cache API and check for the clearing result.
Clearing the caches triggers a removeUser/addUser dance which then triggers initialization of the Caches structure.
Covered by existing tests.
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::initializeUsersIfNeeded):
(WebCore::StorageQuotaManager::askUserToInitialize):
(WebCore::StorageQuotaManager::addUser):
(WebCore::StorageQuotaManager::requestSpace):
* storage/StorageQuotaManager.h:
2019-04-10 Philippe Normand <pnormand@igalia.com>
there is no vp8 support in youtube.com/html5 page with libwebkit2gtk 2.24 (MSE enabled)
https://bugs.webkit.org/show_bug.cgi?id=196615
Reviewed by Xabier Rodriguez-Calvar.
Add vp8.0 and vp9.0 in supported mime-types if the corresponding video decoders are found.
No new tests, existing web-platform-tests cover this change.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp:
(WebCore::GStreamerRegistryScanner::initialize):
2019-04-10 Philippe Normand <pnormand@igalia.com>
[GStreamer] Adaptive streaming playback broken with GStreamer < 1.12
https://bugs.webkit.org/show_bug.cgi?id=196765
Reviewed by Xabier Rodriguez-Calvar.
Without the following patch in gst-plugins-bad, the uridownloader
doesn't relay need-context messages to its parent, so in our case
the player can't share its context with secondary webkitwebsrc
elements and a RELEASE_ASSERT is hit in the WebProcess.
So the workaround is to use again webkit+ protocol prefixes for
GStreamer versions older than 1.12.
https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/8cf858fb27919e1d631223375f81b98055623733
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::convertToInternalProtocol):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStart):
(webKitWebSrcGetProtocols):
(convertPlaybinURI):
(webKitWebSrcSetUri):
(CachedResourceStreamingClient::responseReceived):
(webKitSrcWouldTaintOrigin):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2019-04-10 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Defer the emision of AtkObject::children-changed signal after layout is done
https://bugs.webkit.org/show_bug.cgi?id=187948
Reviewed by Michael Catanzaro.
The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
most of them update the backing store at the beginning.
Fixes: accessibility/children-changed-sends-notification.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
* accessibility/AXObjectCache.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
(WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
(WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/wpe/AXObjectCacheWPE.cpp:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
2019-04-10 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Test accessibility/insert-children-assert.html is crashing since added in r216980
https://bugs.webkit.org/show_bug.cgi?id=172281
<rdar://problem/37030990>
Reviewed by Joanmarie Diggs.
The crash happens because at some point the test tries to get the anonymous block text, getting the RenderText as
first child and RenderFullScreen as last child and the latter doesn't have a node. This is because in atk we do
things differently, we don't include the static text elements individually, but parent element uses
textUnderElement() to get all the pieces together. We can just turn the asserts into actual nullptr checks.
Fixes: accessibility/insert-children-assert.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const):
2019-04-09 Keith Rollin <krollin@apple.com>
Unreviewed build maintenance -- update .xcfilelists.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2019-04-09 Zalan Bujtas <zalan@apple.com>
[AutoSizing] Avoid making text paragraphs scroll horizontally when there is a wide table
https://bugs.webkit.org/show_bug.cgi?id=196743
<rdar://problem/43897551>
Reviewed by Tim Horton.
This patch changes the auto size behavior by using fixed constraint (instead of a min/max pair) to compute the content height.
Now with the initial containing block width is firmly set to auto-sizing width, the overflow content will not stretch the ICB. Instead it overflows the ICB
and triggers scrolling the same way the non-auto-sizing mode does.
* page/FrameView.cpp:
(WebCore::FrameView::autoSizeIfEnabled):
(WebCore::FrameView::enableAutoSizeMode):
* page/FrameView.h:
* testing/Internals.cpp:
(WebCore::Internals::enableAutoSizeMode):
* testing/Internals.h:
* testing/Internals.idl:
2019-04-09 Youenn Fablet <youenn@apple.com>
Close service worker database on network process suspension
https://bugs.webkit.org/show_bug.cgi?id=196623
<rdar://problem/48930869>
Reviewed by Alex Christensen.
Add suspend/resume support to SWServer.
On suspend, close the service worker database and stop pushing for changes.
On resume, push changes if needed.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::close):
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::isClosed const): Deleted.
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::closeDatabase):
* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::pushChangesToDatabase):
(WebCore::RegistrationStore::clearAll):
(WebCore::RegistrationStore::startSuspension):
(WebCore::RegistrationStore::endSuspension):
* workers/service/server/RegistrationStore.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startSuspension):
(WebCore::SWServer::endSuspension):
* workers/service/server/SWServer.h:
2019-04-09 Justin Fan <justin_fan@apple.com>
[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
https://bugs.webkit.org/show_bug.cgi?id=196719
Reviewed by Myles C. Maxfield.
Implement setBlendColor, setViewport, and setScissorRect for GPURenderPassEncoder.
Tests: webgpu/viewport-scissor-rect-triangle-strip.html, webgpu/blend-color-triangle-strip.html
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setBlendColor):
(WebCore::WebGPURenderPassEncoder::setViewport):
(WebCore::WebGPURenderPassEncoder::setScissorRect):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setBlendColor):
(WebCore::GPURenderPassEncoder::setViewport):
(WebCore::GPURenderPassEncoder::setScissorRect):
2019-04-09 Andy Estes <aestes@apple.com>
[Apple Pay] Add release logging to PaymentCoordinator
https://bugs.webkit.org/show_bug.cgi?id=196738
Reviewed by Alex Christensen.
When allowed, log interactions with PaymentCoordinator to os_log to help diagnose Apple Pay bugs.
The following information might be logged: names of functions called, merchant API versions,
boolean results of canMakePayments(), boolean results of beginPaymentSession(), whether
completePaymentSession() was called with a final state result, boolean results of
shouldAllowApplePay(), whether a document has evaluated user agent scripts or is running
user scripts, and whether a client supports unrestricted Apple Pay.
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::supportsVersion const):
(WebCore::PaymentCoordinator::canMakePayments):
(WebCore::PaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::PaymentCoordinator::openPaymentSetup):
(WebCore::PaymentCoordinator::beginPaymentSession):
(WebCore::PaymentCoordinator::completeMerchantValidation):
(WebCore::PaymentCoordinator::completeShippingMethodSelection):
(WebCore::PaymentCoordinator::completeShippingContactSelection):
(WebCore::PaymentCoordinator::completePaymentMethodSelection):
(WebCore::PaymentCoordinator::completePaymentSession):
(WebCore::PaymentCoordinator::abortPaymentSession):
(WebCore::PaymentCoordinator::cancelPaymentSession):
(WebCore::PaymentCoordinator::validateMerchant):
(WebCore::PaymentCoordinator::didAuthorizePayment):
(WebCore::PaymentCoordinator::didSelectPaymentMethod):
(WebCore::PaymentCoordinator::didSelectShippingMethod):
(WebCore::PaymentCoordinator::didSelectShippingContact):
(WebCore::PaymentCoordinator::didCancelPaymentSession):
(WebCore::PaymentCoordinator::shouldAllowApplePay const):
(WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::isAlwaysOnLoggingAllowed const):
* platform/Logging.h:
* testing/MockPaymentCoordinator.h:
2019-04-09 John Wilander <wilander@apple.com>
Pick up Ad Click Attribution conversions in NetworkResourceLoader::willSendRedirectedRequest()
https://bugs.webkit.org/show_bug.cgi?id=196558
<rdar://problem/47650245>
Reviewed by Youenn Fablet.
Tests: http/tests/adClickAttribution/attribution-conversion-through-cross-site-image-redirect.html
http/tests/adClickAttribution/attribution-conversion-through-image-redirect-with-priority.html
http/tests/adClickAttribution/attribution-conversion-through-image-redirect-without-priority.html
The existing API tests were expanded too.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
Enhanced the use of AdClickAttribution::MaxEntropy.
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::parseConversionRequest):
New function to parse and validate URLs with a path starting with
/.well-known/ad-click-attribution/.
(WebCore::AdClickAttribution::toString const):
Added output for the conversion priority for testing purposes.
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Campaign::isValid const):
(WebCore::AdClickAttribution::Conversion::isValid const):
Enhanced the use of AdClickAttribution::MaxEntropy.
2019-04-09 Don Olmstead <don.olmstead@sony.com>
[CMake] Apple builds should use ICU_INCLUDE_DIRS
https://bugs.webkit.org/show_bug.cgi?id=196720
Reviewed by Konstantin Tokarev.
* PlatformMac.cmake:
2019-04-09 Jer Noble <jer.noble@apple.com>
Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
https://bugs.webkit.org/show_bug.cgi?id=196097
Reviewed by Eric Carlson.
Test: media/track/track-in-band-metadata-display-order.html
Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
TextTrackCueGeneric for testing.
Drive-by fixes:
Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
a HTMLMediaElement*
TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
enable use of is<> and downcast<>.
* Source/WebCore/CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* Sources.txt:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
(WebCore::MediaControlTextTrackContainerElement::logger const):
(WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
(WebCore::MediaControlTextTrackContainerElement::logChannel const):
* html/shadow/MediaControlElements.h:
* html/track/DataCue.h:
(isType):
* html/track/TextTrackCueGeneric.h:
(isType):
* html/track/TextTrackCueGeneric.idl: Added.
* html/track/VTTCue.h:
(isType):
* testing/Internals.cpp:
(WebCore::Internals::createGenericCue):
* testing/Internals.h:
* testing/Internals.idl:
2019-04-09 Sihui Liu <sihui_liu@apple.com>
Remove unnecessary network process assertion for IDB close
https://bugs.webkit.org/show_bug.cgi?id=196693
Reviewed by Geoffrey Garen.
We already took assertion at WebCore::SQLiteDatabase::close.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::m_quotaManagerGetter): Deleted.
(WebCore::IDBServer::IDBServer::closeDatabase): Deleted.
(WebCore::IDBServer::IDBServer::didCloseDatabase): Deleted.
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::create): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose): Deleted.
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2019-04-09 Eike Rathke <erack@redhat.com>
Initialize trackTypeAsString for call to GST_INFO_OBJECT() in TrackType::Text
https://bugs.webkit.org/show_bug.cgi?id=196350
Reviewed by Xabier Rodriguez-Calvar.
trackTypeAsString was uninitialized in the
TrackPrivateBaseGStreamer::TrackType::Text case when calling
GST_INFO_OBJECT().
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
2019-04-09 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Cleanup WebKitAccessibleHyperlink
https://bugs.webkit.org/show_bug.cgi?id=196602
Reviewed by Michael Catanzaro.
Cleanups:
- Rename webkitAccessibleHyperlinkNew() as webkitAccessibleHyperlinkGetOrCreate() and move the code to get/set
the object data here.
- Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
struct are no longer leaked.
- Remove all confusing core() functions and simply use webkitAccessibleGetAccessibilityObject().
- Use nullptr instead of 0 and other coding style issues.
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(webkitAccessibleHyperlinkActionDoAction):
(webkitAccessibleHyperlinkActionGetNActions):
(webkitAccessibleHyperlinkActionGetDescription):
(webkitAccessibleHyperlinkActionGetKeybinding):
(webkitAccessibleHyperlinkActionGetName):
(atk_action_interface_init):
(webkitAccessibleHyperlinkGetURI):
(webkitAccessibleHyperlinkGetObject):
(rangeLengthForObject):
(webkitAccessibleHyperlinkGetStartIndex):
(webkitAccessibleHyperlinkGetEndIndex):
(webkitAccessibleHyperlinkIsValid):
(webkitAccessibleHyperlinkGetNAnchors):
(webkitAccessibleHyperlinkIsSelectedLink):
(webkitAccessibleHyperlinkGetProperty):
(webkitAccessibleHyperlinkSetProperty):
(webkit_accessible_hyperlink_class_init):
(webkitAccessibleHyperlinkGetOrCreate):
(core): Deleted.
(atkActionInterfaceInit): Deleted.
(getRangeLengthForObject): Deleted.
(webkitAccessibleHyperlinkFinalize): Deleted.
(webkitAccessibleHyperlinkClassInit): Deleted.
(webkitAccessibleHyperlinkInit): Deleted.
(webkitAccessibleHyperlinkGetType): Deleted.
(webkitAccessibleHyperlinkNew): Deleted.
(webkitAccessibleHyperlinkGetAccessibilityObject): Deleted.
* accessibility/atk/WebKitAccessibleHyperlink.h:
* accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
(webkitAccessibleHyperlinkImplGetHyperlink):
(webkitAccessibleHyperlinkImplInterfaceInit):
2019-04-08 Simon Fraser <simon.fraser@apple.com>
Remove some iOS #ifdefs around sticky-related code
https://bugs.webkit.org/show_bug.cgi?id=196726
Reviewed by Zalan Bujtas.
Now that async overflow scrolling can be enabled on macOS, RenderLayerCompositor::isAsyncScrollableStickyLayer()
should not have iOS-only code.
The answer to the FIXME in RenderLayerCompositor::computeStickyViewportConstraints is obvious: composited
overflow:scroll can be the container for sticky. The assertion can be removed.
* rendering/RenderLayer.cpp: Fix spacing in some logging.
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
2019-04-08 Don Olmstead <don.olmstead@sony.com>
[CMake][WinCairo] Separate copied headers into different directories
https://bugs.webkit.org/show_bug.cgi?id=196655
Reviewed by Michael Catanzaro.
* CMakeLists.txt:
* PlatformWin.cmake:
2019-04-08 Chris Fleizach <cfleizach@apple.com>
AX: Automatically compute accessibility labels for Apple Pay buttons
https://bugs.webkit.org/show_bug.cgi?id=196661
Reviewed by Joanmarie Diggs.
Detect Apple Pay buttons and return a standard role and label for them based on their type.
Test: accessibility/mac/apple-pay-labels.html
accessibility/mac/apple-pay-session-v4.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::isControl const):
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::applePayButtonDescription const):
(WebCore::AccessibilityRenderObject::titleElementText const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::isApplePayButton const):
(WebCore::AccessibilityRenderObject::applePayButtonType const):
* accessibility/AccessibilityRenderObject.h:
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXApplePayPlainLabel):
(WebCore::AXApplePayBuyLabel):
(WebCore::AXApplePaySetupLabel):
(WebCore::AXApplePayDonateLabel):
(WebCore::AXApplePayCheckOutLabel):
(WebCore::AXApplePayBookLabel):
(WebCore::AXApplePaySubscribeLabel):
* platform/LocalizedStrings.h:
2019-04-08 Chris Fleizach <cfleizach@apple.com>
AX: Support API: accessibilityReplaceRange:withText
https://bugs.webkit.org/show_bug.cgi?id=196636
Reviewed by Daniel Bates.
Support this platform API on mac to provide a way to replace a range of editable text.
Test: accessibility/mac/replace-text-with-range.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::replaceTextInRange):
* accessibility/AccessibilityObject.h:
* accessibility/mac/AccessibilityObjectBase.mm:
(WebCore::PlainTextRange::PlainTextRange):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
2019-04-08 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Do not allow starting selection drags when selection views are not visible
https://bugs.webkit.org/show_bug.cgi?id=196686
<rdar://problem/49399192>
Reviewed by Tim Horton.
See WebKit ChangeLog for more details.
Tests: DragAndDropTests.CanDragImageWhenNotFirstResponder
DragAndDropTests.DoNotPerformSelectionDragWhenNotFirstResponder
* page/DragController.cpp:
(WebCore::DragController::draggableElement const):
Make this respect the case where m_dragSourceAction does not include DragSourceActionSelection. All the other
drag source types are currently consulted in this method, with the exception of DragSourceActionSelection.
2019-04-08 Youenn Fablet <youenn@apple.com>
Add a test to check for the service worker process name
https://bugs.webkit.org/show_bug.cgi?id=196621
Reviewed by Chris Dumez.
Add a service worker internal API to get process name.
Covered by updated test.
* WebCore.xcodeproj/project.pbxproj:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::processName const):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
* testing/ServiceWorkerInternals.mm: Added.
2019-04-08 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, speculative fix for build failure in old macOS after r243887
https://bugs.webkit.org/show_bug.cgi?id=196475
* dom/NodeList.h:
2019-04-08 Justin Fan <justin_fan@apple.com>
[Web GPU] Fix Web GPU experimental feature on iOS
https://bugs.webkit.org/show_bug.cgi?id=196632
Reviewed by Myles C. Maxfield.
Add feature conditionals for iOS 11.
Properly make Web GPU available on iOS 11+.
* Configurations/FeatureDefines.xcconfig:
* Configurations/WebKitTargetConditionals.xcconfig:
2019-04-08 Timothy Hatcher <timothy@apple.com>
Unreviewed build fix for iOSMac after r243893.
https://bugs.webkit.org/show_bug.cgi?id=196707
* dom/Element.cpp:
(WebCore::parentCrossingFrameBoundaries): Remove ENABLE(POINTER_EVENTS) since computedTouchActions()
no longer uses parentCrossingFrameBoundaries().
2019-04-08 Youenn Fablet <youenn@apple.com>
Lazily construct Navigator serviceWorker
https://bugs.webkit.org/show_bug.cgi?id=196692
Reviewed by Chris Dumez.
Make NavigatorBase a ContextDestructionObserver.
This allows to get the navigator script execution context.
Use it when creating the navigator ServiceWorkerContainer object.
For GC, introduce serviceWorkerIfAny which returns the container if created.
No JS observable change of behavior.
Covered by existing tests.
* bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::visitAdditionalChildren):
* bindings/js/JSWorkerNavigatorCustom.cpp:
(WebCore::JSWorkerNavigator::visitAdditionalChildren):
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::NavigatorBase):
(WebCore::NavigatorBase::serviceWorkerIfAny):
(WebCore::NavigatorBase::serviceWorker):
* page/NavigatorBase.h:
2019-04-08 Antti Koivisto <antti@apple.com>
Update touch-action region on property changes
https://bugs.webkit.org/show_bug.cgi?id=196608
Reviewed by Simon Fraser.
Test: pointerevents/ios/touch-action-region-dynamic.html
* rendering/EventRegion.cpp:
(WebCore::EventRegion::touchActionsForPoint const):
Correctly return 'auto' when nothing is found from the regions (this code is not used yet).
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
React to 'touch-action' property changes, similarly to 'pointer-events'.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::invalidateEventRegion):
Test if need to invalidate.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
Call invalidateEventRegion explicitly instead of relying on compositing update. This ensures
that we update the top level event region correctly when we have touch-actions.
2019-04-08 Javier Fernandez <jfernandez@igalia.com>
Implement white-space:break-spaces value
https://bugs.webkit.org/show_bug.cgi?id=177327
Reviewed by Myles Maxfield and Zalan Bujtas.
Finally the CSS WG decided [1] to move back the 'break-spaces' value to
the 'white-space' property. This makes the parsing logic easier than
the previous approach of using the 'overflow-wrap' property.
This new value prevents the white-space sequence to collapse and gives
breaking opportunities after every preserved white-space.
https://drafts.csswg.org/css-text-3/#valdef-white-space-break-spaces
Additionally, unlike 'pre-wrap', non-collapsible spaces or tabs at the
end of a line cannot be hung or visually collapsed, since we want them
to be preserved and broken.
[1] https://github.com/w3c/csswg-drafts/pull/2841
Tests: imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-008.html
imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-003.html
imported/w3c/web-platform-tests/css/css-text/white-space/break-spaces-009.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue): New mapping for CSSVaueBreakSpaces.
(WebCore::CSSPrimitiveValue::operator WhiteSpace const): New value BreakSpaces for the Whitespace enum.
* css/CSSProperties.json: new 'break-spaces' value for the 'white-space' property.
* css/CSSValueKeywords.in: new break-spaces keyword
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/SimpleLineLayout.cpp: The SimpleLineLayut codepath must handle properly the new behavior of preserved whitespaces.
(WebCore::SimpleLineLayout::LineState::hasTrailingWhitespace const): Require that m_trailingWhitespaceWidth being greater than zero.
(WebCore::SimpleLineLayout::LineState::hasWhitespaceFragments const): New function to detect former whitespae fragments that could be breaking opportunities.
(WebCore::SimpleLineLayout::removeTrailingWhitespace): The 'break-spaces' feature forbids to remove any trailing whitespace.
(WebCore::SimpleLineLayout::firstFragment): We have now leading whitespace sequences comming from the previous line.
(WebCore::SimpleLineLayout::createLineRuns): We should revert some breaking opportunities if others were formerly found in the line.
* rendering/SimpleLineLayoutTextFragmentIterator.cpp:
(WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): New style fields to determine whether the break-space feature is being used. Also split out the break-all and breal-all values.
* rendering/SimpleLineLayoutTextFragmentIterator.h:
* rendering/line/BreakingContext.h: Different codepath but similar changes to properly handle the new behavior of preserved whitespace.
(WebCore::BreakingContext::BreakingContext): New class field to determine whether there are some whitespace that may prevent the word ot be broken.
(WebCore::BreakingContext::handleText): New line-breaking logic to implement the break-spaces behavior.
(WebCore::BreakingContext::trailingSpacesHang): Cases where the preserved breakspaces should hand or overflow.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::collapseWhiteSpace): With break-spaces collapsing whitespaces is not allowed.
(WebCore::RenderStyle::breakOnlyAfterWhiteSpace const): Add the WhiteSpace::BreakSpaces to this group.
* rendering/style/RenderStyleConstants.h: A new constan added.
2019-04-08 Youenn Fablet <youenn@apple.com>
LibWebRTCMediaEndpoint does not need to hop to the signaling thread to gather stats
https://bugs.webkit.org/show_bug.cgi?id=196697
<rdar://problem/47477113>
Reviewed by Eric Carlson.
It is not thread safe to use m_backend in another thread than the main thread.
It is not useful anymore to hop to the signaling thread to gather stats.
No change of behavior.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
(WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
2019-04-08 Antoine Quint <graouts@apple.com>
[ Mac WK2 iOS Debug ] REGRESSION(r233667) Layout Test imported/w3c/web-platform-tests/web-animations/interfaces/DocumentTimeline/constructor.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=195233
<rdar://problem/48527231>
Reviewed by Dean Jackson.
We need to create the "main" document timeline (document.timeline) if it doesn't already exist and use its current time as a basis for any other DocumentTimeline instance.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
2019-04-08 Antoine Quint <graouts@apple.com>
[Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
https://bugs.webkit.org/show_bug.cgi?id=196118
<rdar://problem/46614137>
Reviewed by Chris Dumez.
Test: webanimations/js-wrapper-kept-alive.html
We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
We also need to ensure that the new implementation of hasPendingActivity() does not interfere with the ability of pages to enter the page
cache when running animations.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::canSuspendForDocumentSuspension const):
(WebCore::WebAnimation::stop):
(WebCore::WebAnimation::hasPendingActivity const):
* animation/WebAnimation.h:
2019-04-08 Eric Liang <ericliang@apple.com>
AX: <svg> elements with labels and no accessible contents are exposed as empty AXGroups
https://bugs.webkit.org/show_bug.cgi?id=156774
Reviewed by Chris Fleizach.
Labelled SVGs without accessible descendants are exposed as AXImage rather than groups.
Unlabelled equivalents are not exposed. Otherwise, SVGs with accessible descendants are exposed as AXGroup.
Also added back functionalities from last patch of determining whether a SVG element should be ignored.
Test: accessibility/svg-shape-labelled.html
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
2019-04-08 Youenn Fablet <youenn@apple.com>
Make sure UniqueIDBDatabaseConnection unregisters itself even if its database is gone
https://bugs.webkit.org/show_bug.cgi?id=196651
Reviewed by Brady Eidson.
In UniqueIDBDatabase methods, many operations are refing the transaction
so that it stays alive until a quota check decision is made.
This extends the lifetime of the transaction which may be lasting
longer than its database that may be cleared without waiting for the quota check decisions.
We therefore need to make sure that the transaction is cleaning itself correctly at destruction time.
Make sure that the transaction is unregistering itself from its IDBServer.
To do so, the transaction keeps a weak ref to the IDBServer.
This is timing sensitive hence difficult to test.
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
Like done below for UniqueIDBDatabaseConnection::didCommitTransaction,
add a check to ensure that either the database is we are in an error case.
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
2019-04-08 Christopher Reid <chris.reid@sony.com>
Undefined Behavior: m_experimentalImageMenuEnabled isn't initialized in HTMLImageElement when SERVICE_CONTROLS is disabled
https://bugs.webkit.org/show_bug.cgi?id=196664
Reviewed by Ross Kirsling.
No observable change in behavior.
Initialize m_experimentalImageMenuEnabled regardless of ENABLE(SERVICE_CONTROLS)
* html/HTMLImageElement.cpp:
2019-04-08 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r243943.
Caused test262 failures.
Reverted changeset:
"[JSC] Filter DontEnum properties in
ProxyObject::getOwnPropertyNames()"
https://bugs.webkit.org/show_bug.cgi?id=176810
https://trac.webkit.org/changeset/243943
2019-04-05 Sergio Villar Senin <svillar@igalia.com>
[GTK][WPE] outlook.live.com displays old-fashioned UI
https://bugs.webkit.org/show_bug.cgi?id=196642
Reviewed by Carlos Garcia Campos.
The new good looking UI is shown as long as pretend we're a Mac in the UA.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
2019-04-08 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Cleanup accessible wrapper base class
https://bugs.webkit.org/show_bug.cgi?id=196601
Reviewed by Mario Sanchez Prada.
Cleanups:
- Rename WebKitAccessibleWrapperAtk cpp and header as WebKitAccessible for consistency with the class name.
- Use WEBKIT_DEFINE_TYPE instead of custom type registration. This ensures that all CStrings used in private
struct are no longer leaked.
- Move core object pointer to the private struct.
- Remove confusing core() function and simply get the core object from the private struct.
- Use nullptr instead of 0 and other coding style issues.
- Rename cacheAndReturnAtkProperty as webkitAccessibleCacheAndReturnAtkProperty and use WebKitAccessible as
instance parameter.
- Make webkitAccessibleGetAccessibilityObject() return a reference, since we use a fallback object on detach it
never returns nullptr.
- Move objectFocusedAndCaretOffsetUnignored() to WebKitAccessibleUtil.
* SourcesGTK.txt:
* accessibility/atk/AXObjectCacheAtk.cpp:
* accessibility/atk/WebKitAccessible.cpp: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp.
(webkitAccessibleGetName):
(webkitAccessibleGetDescription):
(setAtkRelationSetFromCoreObject):
(isRootObject):
(webkitAccessibleGetParent):
(webkitAccessibleGetNChildren):
(webkitAccessibleRefChild):
(webkitAccessibleGetIndexInParent):
(webkitAccessibleGetAttributes):
(atkRole):
(webkitAccessibleGetRole):
(webkitAccessibleRefStateSet):
(webkitAccessibleRefRelationSet):
(webkitAccessibleInit):
(webkitAccessibleGetObjectLocale):
(webkit_accessible_class_init):
(interfaceMaskFromObject):
(uniqueAccessibilityTypeName):
(accessibilityTypeFromObject):
(webkitAccessibleNew):
(webkitAccessibleGetAccessibilityObject):
(webkitAccessibleDetach):
(webkitAccessibleIsDetached):
(webkitAccessibleCacheAndReturnAtkProperty):
* accessibility/atk/WebKitAccessible.h: Renamed from Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.h.
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
(core):
(webkitAccessibleActionGetKeybinding):
(webkitAccessibleActionGetName):
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
(core):
(documentAttributeValue):
* accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
(core):
(webkitAccessibleImageGetImageDescription):
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(core):
* accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
(core):
* accessibility/atk/WebKitAccessibleUtil.cpp:
(objectFocusedAndCaretOffsetUnignored):
* accessibility/atk/WebKitAccessibleUtil.h:
* editing/atk/FrameSelectionAtk.cpp:
2019-04-06 Antti Koivisto <antti@apple.com>
Combine event and touch action regions into a single class
https://bugs.webkit.org/show_bug.cgi?id=196644
<rdar://problem/49643614>
Reviewed by Darin Adler.
This patch replaces the existing TouchActionRegion class with the more general EventRegion class.
It collects both the overall event region and the touch action regions. This avoids duplication
and simplifies the code.
The patch also adds serialization support for EventRegion, so touch-action regions gets passed
to the UI process too.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setEventRegion):
(WebCore::GraphicsLayer::dumpProperties const):
(WebCore::GraphicsLayer::setTouchActionRegion): Deleted.
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::eventRegion const):
(WebCore::GraphicsLayer::touchActionRegion const): Deleted.
* platform/graphics/Region.cpp:
(WebCore::operator<<):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setEventRegion):
(WebCore::GraphicsLayerCA::setTouchActionRegion): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* rendering/EventRegion.cpp: Copied from Source/WebCore/rendering/TouchActionRegion.cpp.
(WebCore::EventRegion::operator== const):
(WebCore::EventRegion::unite):
(WebCore::EventRegion::translate):
(WebCore::EventRegion::uniteTouchActions):
(WebCore::EventRegion::touchActionsForPoint const):
(WebCore::operator<<):
(WebCore::TouchActionRegion::unite): Deleted.
(WebCore::TouchActionRegion::actionsForPoint const): Deleted.
(WebCore::TouchActionRegion::translate): Deleted.
* rendering/EventRegion.h: Copied from Source/WebCore/rendering/TouchActionRegion.h.
(WebCore::EventRegion::isEmpty const):
(WebCore::EventRegion::contains const):
(WebCore::EventRegion::hasTouchActions const):
(WebCore::EventRegion::encode const):
(WebCore::EventRegion::decode):
(WebCore::TouchActionRegion::isEmpty const): Deleted.
(WebCore::TouchActionRegion::operator== const): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/PaintInfo.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::collectEventRegionForFragments):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
* rendering/RenderLayerModelObject.cpp:
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TouchActionRegion.cpp: Removed.
* rendering/TouchActionRegion.h: Removed.
2019-04-05 Yongjun Zhang <yongjun_zhang@apple.com>
We should pass minimumEffectiveDeviceWidth to web process on new page creation.
https://bugs.webkit.org/show_bug.cgi?id=196077
<rdar://problem/49108202>
Reviewed by Chris Dumez.
If the page doesn't specify it requires to use the device width in viewport tag, we should try to scale down
the page to fit the window width.
Test: fast/viewport/ios/shrink-to-fit-for-page-without-viewport-meta.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::updateDefaultConfiguration): Also update the minimum layout size
when the default configuration is changed.
(WebCore::ViewportConfiguration::nativeWebpageParametersWithShrinkToFit): Make sure we fit the content
to window width.
2019-04-05 Jer Noble <jer.noble@apple.com>
[Cocoa] Deactivate the audio session before the WebProcess suspends.
https://bugs.webkit.org/show_bug.cgi?id=196658
Reviewed by Eric Carlson.
Test: platform/mac/media/audio-session-deactivated-when-suspended.html
Deactivate the audio session when we are notified that the session will suspend.
Drive-by fix: don't try to begin playback when the process is suspended.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::processWillSuspend):
(WebCore::PlatformMediaSessionManager::processDidResume):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::processIsSuspended const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setShouldDeactivateAudioSession):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
* testing/Internals.cpp:
(WebCore::Internals::processWillSuspend):
(WebCore::Internals::processDidResume):
* testing/Internals.h:
* testing/Internals.idl:
2019-04-05 Sihui Liu <sihui_liu@apple.com>
[iOS] Web process gets suspended while holding locked database files
https://bugs.webkit.org/show_bug.cgi?id=196519
<rdar://problem/49531797>
Reviewed by Chris Dumez.
Don't use DatabaseTracker singleton before it is initialized.
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::isInitialized):
* Modules/webdatabase/DatabaseTracker.h:
2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
Make WeakPtr<Element> possible and deploy it in form associated elements code
https://bugs.webkit.org/show_bug.cgi?id=196626
Reviewed by Antti Koivisto.
Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
No new tests sine there should be no behavioral change.
* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem):
(WebCore::HTMLElement::asFormAssociatedElement):
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:
2019-04-05 Caitlin Potter <caitp@igalia.com>
[JSC] Filter DontEnum properties in ProxyObject::getOwnPropertyNames()
https://bugs.webkit.org/show_bug.cgi?id=176810
Reviewed by Saam Barati.
Previously, there was a comment here indicating uncertainty of whether it
was necessary to filter DontEnum properties explicitly or not. It turns
out that it was necessary in the case of JSC ProxyObjects.
This patch adds DontEnum filtering for ProxyObjects, however we continue
to explicitly filter them in JSDOMConvertRecord, which needs to use the
property descriptor after filtering. This change prevents observably
fetching the property descriptor twice per property.
* bindings/js/JSDOMConvertRecord.h:
2019-04-05 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed manual rollout of r243929
https://bugs.webkit.org/show_bug.cgi?id=196626
* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
(WebCore::HTMLElement::asFormAssociatedElement): Deleted.
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem):
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:
2019-04-05 Sihui Liu <sihui_liu@apple.com>
[iOS] Web process gets suspended while holding locked database files
https://bugs.webkit.org/show_bug.cgi?id=196519
<rdar://problem/49531797>
Reviewed by Chris Dumez.
We should close all databases and make sure not open new databases when web process is ready to suspend.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setIsDatabaseOpeningForbidden):
(WebCore::SQLiteDatabase::open):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteDatabaseTracker.cpp:
(WebCore::SQLiteDatabaseTracker::setClient):
(WebCore::SQLiteDatabaseTracker::incrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::decrementTransactionInProgressCount):
(WebCore::SQLiteDatabaseTracker::hasTransactionInProgress):
2019-04-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243833.
https://bugs.webkit.org/show_bug.cgi?id=196645
This change breaks build of WPE and GTK ports (Requested by
annulen on #webkit).
Reverted changeset:
"[CMake][WTF] Mirror XCode header directories"
https://bugs.webkit.org/show_bug.cgi?id=191662
https://trac.webkit.org/changeset/243833
2019-04-05 David Kilzer <ddkilzer@apple.com>
REGRESSION(r243887): Try to fix Windows builds by including <wtf/IsoMalloc.h>
Caused by:
[WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
https://bugs.webkit.org/show_bug.cgi?id=196475
* css/CSSComputedStyleDeclaration.h:
* dom/DOMRectReadOnly.h:
* dom/LiveNodeList.h:
* dom/NodeIterator.h:
* dom/TreeWalker.h:
* fileapi/Blob.h:
* fileapi/File.h:
* fileapi/FileList.h:
* html/CachedHTMLCollection.h:
* html/HTMLFormElement.h:
* html/HTMLNameCollection.h:
* html/canvas/GPUBasedCanvasRenderingContext.h:
* page/RemoteDOMWindow.h:
2019-04-05 Ryosuke Niwa <rniwa@webkit.org>
Make WeakPtr<Element> possible and deploy it in form associated elements code
https://bugs.webkit.org/show_bug.cgi?id=196626
Reviewed by Antti Koivisto.
Make Element inherit from CanMakeWeakPtr and deploy WeakPtr<*Element> in FormAssociatedElement and HTMLFormElement.
No new tests sine there should be no behavioral change.
* dom/Element.h:
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::FormAssociatedElement):
(WebCore::FormAssociatedElement::insertedIntoAncestor):
(WebCore::FormAssociatedElement::setForm):
(WebCore::FormAssociatedElement::resetFormOwner):
(WebCore::FormAssociatedElement::formAttributeChanged):
* html/FormAssociatedElement.h:
(WebCore::FormAssociatedElement::form const):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::asFormNamedItem):
(WebCore::HTMLElement::asFormAssociatedElement):
* html/HTMLElement.h:
(WebCore::HTMLElement::asFormNamedItem): Deleted.
* html/HTMLFormControlElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::formImageElements const): Inlined into updateNamedElementCache.
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::registerInvalidAssociatedFormControl):
(WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded):
(WebCore::HTMLFormElement::registerImgElement):
(WebCore::HTMLFormElement::defaultButton const):
(WebCore::HTMLFormElement::resetDefaultButton):
(WebCore::HTMLFormElement::matchesValidPseudoClass const):
(WebCore::HTMLFormElement::matchesInvalidPseudoClass const):
* html/HTMLFormElement.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::HTMLImageElement):
(WebCore::HTMLImageElement::insertedIntoAncestor):
* html/HTMLImageElement.h:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.h:
* html/HTMLObjectElement.h:
* html/HTMLPictureElement.h:
* html/HTMLSlotElement.h:
* svg/SVGElement.h:
2019-04-05 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Use a smart pointer for AccessibilityObject wrapper and remove GTK specific code
https://bugs.webkit.org/show_bug.cgi?id=196593
<rdar://problem/49599153>
Reviewed by Michael Catanzaro.
We have specific code for GTK to get/set the wrapper only because we don't use smart pointers. Also use
WebKitAccessible as AccessibilityObjectWrapper instead of generic AtkObject, to enforce wrappers to be
WebKitAccessible instances. This requires a few casts to AtkObject.
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::setWrapper):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::detachWrapper):
(WebCore::AXObjectCache::attachWrapper):
(WebCore::notifyChildrenSelectionChange):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
* accessibility/atk/AccessibilityObjectAtk.cpp:
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(webkitAccessibleComponentRefAccessibleAtPoint):
* accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
(webkitAccessibleHypertextGetLink):
(webkitAccessibleHypertextGetNLinks):
* accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
(webkitAccessibleSelectionRefSelection):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableRefAt):
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
(webkitAccessibleTableGetCaption):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
(convertToGPtrArray):
(webkitAccessibleTableCellGetTable):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(accessibilityObjectLength):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(setAtkRelationSetFromCoreObject):
(atkParentOfRootObject):
(webkitAccessibleGetParent):
(webkitAccessibleRefChild):
(isTextWithCaret):
* editing/atk/FrameSelectionAtk.cpp:
(WebCore::emitTextSelectionChange):
(WebCore::maybeEmitTextFocusChange):
2019-04-04 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] REGRESSION (r242687): Programmatic scroll of overflow scroll results in bad rendering
https://bugs.webkit.org/show_bug.cgi?id=195584
Reviewed by Zalan Bujtas.
Push data to the scrolling tree about whether an overflow:scroll scroll was programmatic, by having
RenderLayer::scrollToOffset() call into AsyncScrollingCoordinator::requestScrollPositionUpdate(),
just as we do for frames.
AsyncScrollingCoordinator::requestScrollPositionUpdate() is generalized to take any ScrollableArea.
Fix an assumption in the ScrollingTree that we only care about programmatic scrolls on the root node.
ScrollingTree::commitTreeState() no longer sets isHandlingProgrammaticScroll; instead,
callers of ScrollingTreeScrollingNode::scrollTo() pass a ScrollType. Commit functions pass
ScrollType::Programmatic when handling RequestedScrollPosition changes as necessary.
Programmatic scrolls need to get to the scrolling tree in the UI process so that we update
the tree's notion of scroll position, and trigger actual UIScrollView scrolls (layers may have
already been put in the right locations, but the UI process needs to know that a scroll happened).
However, we need to prevent notifications from programmatic scrolls getting back to the
web process, because this causes jumpiness. This is done via an early return in
RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll().
Tests: scrollingcoordinator/ios/programmatic-overflow-scroll.html
scrollingcoordinator/ios/programmatic-page-scroll.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::requestScrollPositionUpdate):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::isHandlingProgrammaticScroll): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::isHandlingProgrammaticScroll const):
(WebCore::ScrollingTree::setIsHandlingProgrammaticScroll):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollingNodeID const):
* rendering/RenderLayer.h:
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::timerFired):
2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, speculative fix for build failure
https://bugs.webkit.org/show_bug.cgi?id=196475
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
2019-04-04 Ryosuke Niwa <rniwa@webkit.org>
Element::isFocusable() debug asserts too frequently
https://bugs.webkit.org/show_bug.cgi?id=196634
Reviewed by Geoffrey Garen.
Remove the debug assertion for now.
* dom/Element.cpp:
(WebCore::Element::isFocusable const):
2019-04-04 Simon Fraser <simon.fraser@apple.com>
Have ScrollableArea store a ScrollType for the current scroll
https://bugs.webkit.org/show_bug.cgi?id=196627
Reviewed by Zalan Bujtas.
RenderLayer had isInUserScroll() which is the opposite of ScrollableArea::inProgrammaticScroll(),
so just have ScrollableArea store a ScrollType.
RenderLayer's scrolling bottleneck, scrollToOffset(), now takes a ScrollType, and pushes
it onto the base class.
AsyncScrollingCoordinator::requestScrollPositionUpdate() can use the incoming scrollType (currently
incorrect for iOS WK2 overflow) rather than deducing a user scroll from ScrollingLayerPositionAction.
No behavior change.
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameViewLayoutContext.cpp:
(WebCore::LayoutScope::LayoutScope):
(WebCore::LayoutScope::~LayoutScope):
* page/ios/FrameIOS.mm:
(WebCore::Frame::overflowScrollPositionChangedForNode):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* platform/ScrollView.cpp:
(WebCore::ScrollView::setScrollPosition):
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::currentScrollType const):
(WebCore::ScrollableArea::setCurrentScrollType):
(WebCore::ScrollableArea::setIsUserScroll): Deleted.
(WebCore::ScrollableArea::inProgrammaticScroll const): Deleted.
(WebCore::ScrollableArea::setInProgrammaticScroll): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
(WebCore::RenderLayer::scrollToOffset):
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollOffset):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::start):
2019-04-04 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r243868.
Causing timeouts failures on several queues
Reverted changeset:
"[Web Animations] JS wrapper may be deleted while animation is
yet to dispatch its finish event"
https://bugs.webkit.org/show_bug.cgi?id=196118
https://trac.webkit.org/changeset/243868
2019-04-04 Youenn Fablet <youenn@apple.com>
Pass storage quota parameters from UIProcess to NetworkProcess as part of WebsiteDataStore parameters
https://bugs.webkit.org/show_bug.cgi?id=196543
Reviewed by Alex Christensen.
Add a default routine to compute a third party quota from a per origin quota.
No change of behavior.
* storage/StorageQuotaManager.h:
(WebCore::StorageQuotaManager::defaultThirdPartyQuotaFromPerOriginQuota):
(WebCore::StorageQuotaManager::defaultThirdPartyQuota):
2019-04-04 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243807 and r243824.
https://bugs.webkit.org/show_bug.cgi?id=196611
Test added is a flaky timeout on iOS Simulator, 3 tests
unskipped are flaky failures (Requested by ShawnRoberts on
#webkit).
Reverted changesets:
"Blob type cannot be stored correctly in IDB when
IDBObjectStore has autoIncrement and keyPath options"
https://bugs.webkit.org/show_bug.cgi?id=196128
https://trac.webkit.org/changeset/243807
"Follow up fix for r243807: Use MarkedArgumentBuffer instead
of Vector for JSValue"
https://bugs.webkit.org/show_bug.cgi?id=196547
https://trac.webkit.org/changeset/243824
2019-04-04 Simon Fraser <simon.fraser@apple.com>
Fix rare crash under collectRelatedCoordinatedScrollingNodes()
https://bugs.webkit.org/show_bug.cgi?id=196610
rdar://problem/49595426
Reviewed by Zalan Bujtas.
hasCompositedScrollableOverflow() doesn't check whether a layer is composited (it has
to report the right status before layers have been created), so collectRelatedCoordinatedScrollingNodes()
needs to check whether there's backing.
* rendering/RenderLayerCompositor.cpp:
(WebCore::collectRelatedCoordinatedScrollingNodes):
2019-04-04 Simon Fraser <simon.fraser@apple.com>
Move "inProgrammaticScroll" down to ScrollableArea
https://bugs.webkit.org/show_bug.cgi?id=196614
Reviewed by Zalan Bujtas.
A future patch will need to update "inProgrammaticScroll" on RenderLayers, so push
inProgrammaticScroll() down to ScrollableArea.
ScrollableArea already has "isScrolledProgrammatically", which I rename to "scrollShouldClearLatchedState"
to reduce confusion. It might be possible to remove this in future with some refactoring.
Sadly we can no longer use SetForScope<> in FrameView after this change so add some manual save/restore code.
* dom/Element.cpp:
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
* page/EventHandler.cpp:
(WebCore::EventHandler::completeWidgetWheelEvent):
(WebCore::EventHandler::handleWheelEvent):
* page/FrameView.cpp:
(WebCore::FrameView::setFrameRect):
(WebCore::FrameView::topContentInsetDidChange):
(WebCore::FrameView::updateLayoutViewport):
(WebCore::FrameView::setScrollPosition):
(WebCore::FrameView::setWasScrolledByUser):
* page/FrameView.h:
* platform/ScrollView.h:
(WebCore::ScrollView::inProgrammaticScroll const): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::ScrollableArea):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::inProgrammaticScroll const):
(WebCore::ScrollableArea::setInProgrammaticScroll):
(WebCore::ScrollableArea::scrollShouldClearLatchedState const):
(WebCore::ScrollableArea::setScrollShouldClearLatchedState):
(WebCore::ScrollableArea::isScrolledProgrammatically const): Deleted.
(WebCore::ScrollableArea::setScrolledProgrammatically): Deleted.
2019-04-04 Sihui Liu <sihui_liu@apple.com>
Leak of UniqueIDBDatabase in network process running layout tests
https://bugs.webkit.org/show_bug.cgi?id=196565
<rdar://problem/49346139>
Reviewed by Geoffrey Garen.
UniqueIDBDatabase will null itself after it receives confirmation about connecton close from its clients, but it
is possible that the web process to network process connection closes before servers gets the
confirmDidCloseFromServer. Therefore, we should let UniqueIDBDatabase forget connection when it receives a
conenctionClosedFromClient.
No new test because this bug is caused by race between network receiving conenctionClosedFromClient and
receiving confirmDidCloseFromServer. This is testable by running some existing layout tests in a row with leak
option.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
(WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2019-04-04 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::GameControllerGamepad):
2019-04-04 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Host should be able to mute screen capture and camera/microphone independently
https://bugs.webkit.org/show_bug.cgi?id=196555
<rdar://problem/47303865>
Reviewed by Youenn Fablet.
Test: fast/mediastream/media-stream-page-muted.html
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream): Call setCaptureTracksMuted to pass page muted
state to tracks.
(WebCore::MediaStream::startProducingData): Ditto.
(WebCore::MediaStream::setCaptureTracksMuted): New.
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack): Call setMuted with page muted state.
(WebCore::MediaStreamTrack::setMuted): Set muted according to page state and source type.
(WebCore::MediaStreamTrack::pageMutedStateDidChange): Call setMuted.
(WebCore::MediaStreamTrack::mediaState const): Update for new page state.
* Modules/mediastream/MediaStreamTrack.h:
* page/MediaProducer.h: Split capture muted state into two: camera/microphone and screen.
* page/Page.h:
(WebCore::Page::isMediaCaptureMuted const): Update for state changes.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::setCaptureTracksMuted): Deleted.
(WebCore::MediaStreamPrivate::hasCaptureVideoSource const): Deleted.
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setMuted): Log state.
(WebCore::RealtimeMediaSource::notifyMutedChange): Call notifyMutedObservers on the
next runloop so events aren't dispatched synchronously.
* testing/Internals.cpp:
(WebCore::Internals::setPageMuted): Add new state.
2019-04-04 Chris Dumez <cdumez@apple.com>
Unreviewed, update r243884 to use macros in Compiler.h instead.
* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::dropDistantTiles):
2019-04-04 Chris Fleizach <cfleizach@apple.com>
AX: Crash under WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored()
https://bugs.webkit.org/show_bug.cgi?id=196600
<rdar://problem/49572996>
Reviewed by Joanmarie Diggs.
Audit AX code to not dereference renderer before checking if it's null.
Not clear how to reproduce at this time.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::webAreaIsPresentational):
(WebCore::AccessibilityRenderObject::layoutCount const):
(WebCore::AccessibilityRenderObject::widget const):
2019-04-04 Antti Koivisto <antti@apple.com>
Compute accurate regions for touch-action
https://bugs.webkit.org/show_bug.cgi?id=196536
<rdar://problem/49516022>
Reviewed by Simon Fraser.
Tests: pointerevents/ios/touch-action-region-basic.html
pointerevents/ios/touch-action-region-layers.html
pointerevents/ios/touch-action-region-pan-x-y.html
- Use style system to compute effective touch-action without additional tree walks.
- Compute touch-action region in a fake paint, at the same time with the event region.
This patch doesn't yet use the computed region for anything except test output.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/StyleResolver.cpp:
(WebCore::computeEffectiveTouchActions):
(WebCore::StyleResolver::adjustRenderStyle):
Update RenderStyle::effectiveTouchAction.
* dom/Element.cpp:
(WebCore::Element::computedTouchActions const):
Just get it from the style.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setEventRegion):
(WebCore::GraphicsLayer::setTouchActionRegion):
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::touchActionRegion const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setTouchActionRegion):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/PaintInfo.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::collectEventRegionForFragments):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Need to do this for the top compositing layer too.
(WebCore::RenderLayerBacking::updateEventRegion):
Compute touch-action region too.
As a basic optimization avoid doing any extra work if there are no elements with non-default touch-action property.
* rendering/TouchActionRegion.cpp: Added.
(WebCore::toIndex):
(WebCore::toTouchAction):
(WebCore::toString):
(WebCore::TouchActionRegion::unite):
(WebCore::TouchActionRegion::actionsForPoint const):
(WebCore::TouchActionRegion::translate):
(WebCore::operator<<):
* rendering/TouchActionRegion.h: Added.
Class for collecting and maintaining touch-action region.
(WebCore::TouchActionRegion::isEmpty const):
(WebCore::TouchActionRegion::operator== const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::effectiveTouchActions const):
(WebCore::RenderStyle::setEffectiveTouchActions):
Implement as inherited property for efficiency (touch-action itself is non-inherited).
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, fix linking error because the build of RTCIceTransport.cpp is handled in Xcode project side accidentally
https://bugs.webkit.org/show_bug.cgi?id=196475
We did not have RTCIceTransport.cpp in Sources.txt.
* WebCore.xcodeproj/project.pbxproj:
2019-04-04 Yusuke Suzuki <ysuzuki@apple.com>
[WebCore] Put most of derived classes of ScriptWrappable into IsoHeap
https://bugs.webkit.org/show_bug.cgi?id=196475
Reviewed by Saam Barati.
This patch puts most of derived classes of ScriptWrappable into IsoHeap. We do not include derived classes of Event simply
because Internal repository code also inherits it. After watching the result of this patch, we will try Event and its derived
classes into IsoHeap too.
This patch makes the following things IsoHeap-allocated. These classes are listed by using lldb python script.
1. DOM collections (HTMLCollection etc.)
2. WebAudio nodes
3. IDB classes
4. FileSystem API classes
5. Canvas contexts
6. WebRTC classses
7. XMLHttpRequest related classes
8. WebSocket related classes
9. Worker and Worklet related classes
10. Other misc classes
* Modules/applepay/ApplePaySession.cpp:
* Modules/applepay/ApplePaySession.h:
* Modules/encryptedmedia/MediaKeySession.cpp:
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/DOMFileSystem.h:
(WebCore::DOMFileSystem::createEntryForFile): Deleted.
(WebCore::DOMFileSystem::name const): Deleted.
* Modules/entriesapi/FileSystemDirectoryEntry.h:
* Modules/entriesapi/FileSystemDirectoryReader.cpp:
* Modules/entriesapi/FileSystemDirectoryReader.h:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/entriesapi/FileSystemEntry.h:
* Modules/entriesapi/FileSystemFileEntry.h:
* Modules/geolocation/Geolocation.cpp:
* Modules/geolocation/Geolocation.h:
(WebCore::Geolocation::document const): Deleted.
(WebCore::Geolocation::frame const): Deleted.
(WebCore::Geolocation::resetIsAllowed): Deleted.
(WebCore::Geolocation::isAllowed const): Deleted.
(WebCore::Geolocation::isDenied const): Deleted.
(WebCore::Geolocation::hasListeners const): Deleted.
* Modules/indexeddb/IDBCursor.cpp:
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBCursorWithValue.cpp:
* Modules/indexeddb/IDBCursorWithValue.h:
* Modules/indexeddb/IDBDatabase.cpp:
* Modules/indexeddb/IDBDatabase.h:
(WebCore::IDBDatabase::info const): Deleted.
(WebCore::IDBDatabase::databaseConnectionIdentifier const): Deleted.
(WebCore::IDBDatabase::connectionProxy): Deleted.
(WebCore::IDBDatabase::isClosingOrClosed const): Deleted.
* Modules/indexeddb/IDBKeyRange.cpp:
* Modules/indexeddb/IDBKeyRange.h:
(WebCore::IDBKeyRange::lower const): Deleted.
(WebCore::IDBKeyRange::upper const): Deleted.
(WebCore::IDBKeyRange::lowerOpen const): Deleted.
(WebCore::IDBKeyRange::upperOpen const): Deleted.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
* Modules/indexeddb/IDBOpenDBRequest.h:
* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
* Modules/indexeddb/IDBTransaction.h:
(WebCore::IDBTransaction::mode const): Deleted.
(WebCore::IDBTransaction::info const): Deleted.
(WebCore::IDBTransaction::database): Deleted.
(WebCore::IDBTransaction::database const): Deleted.
(WebCore::IDBTransaction::originalDatabaseInfo const): Deleted.
(WebCore::IDBTransaction::isVersionChange const): Deleted.
(WebCore::IDBTransaction::isReadOnly const): Deleted.
(WebCore::IDBTransaction::isFinished const): Deleted.
* Modules/mediarecorder/MediaRecorder.cpp:
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediasession/MediaRemoteControls.cpp:
* Modules/mediasession/MediaRemoteControls.h:
(WebCore::MediaRemoteControls::create): Deleted.
(WebCore::MediaRemoteControls::previousTrackEnabled const): Deleted.
(WebCore::MediaRemoteControls::nextTrackEnabled const): Deleted.
* Modules/mediasource/MediaSource.cpp:
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediasource/SourceBuffer.h:
* Modules/mediasource/SourceBufferList.cpp:
* Modules/mediasource/SourceBufferList.h:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaDeviceInfo.cpp:
* Modules/mediastream/MediaDeviceInfo.h:
(WebCore::MediaDeviceInfo::label const): Deleted.
(WebCore::MediaDeviceInfo::deviceId const): Deleted.
(WebCore::MediaDeviceInfo::groupId const): Deleted.
(WebCore::MediaDeviceInfo::kind const): Deleted.
* Modules/mediastream/MediaDevices.cpp:
* Modules/mediastream/MediaDevices.h:
* Modules/mediastream/MediaStream.cpp:
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/RTCDTMFSender.cpp:
* Modules/mediastream/RTCDTMFSender.h:
* Modules/mediastream/RTCDataChannel.cpp:
* Modules/mediastream/RTCDataChannel.h:
* Modules/mediastream/RTCIceCandidate.cpp:
* Modules/mediastream/RTCIceCandidate.h:
(WebCore::RTCIceCandidate::candidate const): Deleted.
(WebCore::RTCIceCandidate::sdpMid const): Deleted.
(WebCore::RTCIceCandidate::sdpMLineIndex const): Deleted.
(WebCore::RTCIceCandidate::setCandidate): Deleted.
* Modules/mediastream/RTCIceTransport.cpp:
* Modules/mediastream/RTCIceTransport.h:
(WebCore::RTCIceTransport::create): Deleted.
(WebCore::RTCIceTransport::state const): Deleted.
(WebCore::RTCIceTransport::setState): Deleted.
(WebCore::RTCIceTransport::gatheringState const): Deleted.
(WebCore::RTCIceTransport::setGatheringState): Deleted.
(WebCore::RTCIceTransport::RTCIceTransport): Deleted.
* Modules/mediastream/RTCPeerConnection.cpp:
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::create): Deleted.
(WebCore::RTCRtpReceiver::setBackend): Deleted.
(WebCore::RTCRtpReceiver::getParameters): Deleted.
(WebCore::RTCRtpReceiver::getContributingSources const): Deleted.
(WebCore::RTCRtpReceiver::getSynchronizationSources const): Deleted.
(WebCore::RTCRtpReceiver::track): Deleted.
(WebCore::RTCRtpReceiver::backend): Deleted.
* Modules/mediastream/RTCRtpSender.cpp:
* Modules/mediastream/RTCRtpSender.h:
(WebCore::RTCRtpSender::track): Deleted.
(WebCore::RTCRtpSender::trackId const): Deleted.
(WebCore::RTCRtpSender::trackKind const): Deleted.
(WebCore::RTCRtpSender::mediaStreamIds const): Deleted.
(WebCore::RTCRtpSender::setMediaStreamIds): Deleted.
(WebCore::RTCRtpSender::isStopped const): Deleted.
(WebCore::RTCRtpSender::backend): Deleted.
* Modules/mediastream/RTCRtpTransceiver.cpp:
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::create): Deleted.
(WebCore::RTCRtpTransceiver::sender): Deleted.
(WebCore::RTCRtpTransceiver::receiver): Deleted.
(WebCore::RTCRtpTransceiver::iceTransport): Deleted.
(WebCore::RTCRtpTransceiver::backend): Deleted.
* Modules/mediastream/RTCSessionDescription.cpp:
* Modules/mediastream/RTCSessionDescription.h:
(WebCore::RTCSessionDescription::type const): Deleted.
(WebCore::RTCSessionDescription::sdp const): Deleted.
(WebCore::RTCSessionDescription::setSdp): Deleted.
* Modules/notifications/Notification.cpp:
* Modules/notifications/Notification.h:
* Modules/paymentrequest/PaymentRequest.cpp:
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentResponse.cpp:
* Modules/paymentrequest/PaymentResponse.h:
* Modules/speech/SpeechSynthesisUtterance.cpp:
* Modules/speech/SpeechSynthesisUtterance.h:
* Modules/webaudio/AnalyserNode.cpp:
* Modules/webaudio/AnalyserNode.h:
* Modules/webaudio/AudioBasicInspectorNode.cpp:
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioBasicProcessorNode.cpp:
* Modules/webaudio/AudioBasicProcessorNode.h:
* Modules/webaudio/AudioBufferSourceNode.cpp:
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioContext.h:
* Modules/webaudio/AudioDestinationNode.cpp:
* Modules/webaudio/AudioDestinationNode.h:
* Modules/webaudio/AudioNode.cpp:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
* Modules/webaudio/AudioScheduledSourceNode.h:
* Modules/webaudio/BiquadFilterNode.cpp:
* Modules/webaudio/BiquadFilterNode.h:
* Modules/webaudio/ChannelMergerNode.cpp:
* Modules/webaudio/ChannelMergerNode.h:
* Modules/webaudio/ChannelSplitterNode.cpp:
* Modules/webaudio/ChannelSplitterNode.h:
* Modules/webaudio/ConvolverNode.cpp:
* Modules/webaudio/ConvolverNode.h:
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
* Modules/webaudio/DefaultAudioDestinationNode.h:
* Modules/webaudio/DelayNode.cpp:
* Modules/webaudio/DelayNode.h:
* Modules/webaudio/DynamicsCompressorNode.cpp:
* Modules/webaudio/DynamicsCompressorNode.h:
* Modules/webaudio/GainNode.cpp:
* Modules/webaudio/GainNode.h:
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
* Modules/webaudio/MediaElementAudioSourceNode.h:
* Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
* Modules/webaudio/MediaStreamAudioDestinationNode.h:
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
* Modules/webaudio/MediaStreamAudioSourceNode.h:
* Modules/webaudio/OfflineAudioContext.cpp:
* Modules/webaudio/OfflineAudioContext.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
* Modules/webaudio/OfflineAudioDestinationNode.h:
* Modules/webaudio/OscillatorNode.cpp:
* Modules/webaudio/OscillatorNode.h:
* Modules/webaudio/PannerNode.cpp:
* Modules/webaudio/PannerNode.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
* Modules/webaudio/ScriptProcessorNode.h:
* Modules/webaudio/WaveShaperNode.cpp:
* Modules/webaudio/WaveShaperNode.h:
* Modules/webgpu/GPUCanvasContext.cpp:
* Modules/webgpu/GPUCanvasContext.h:
* Modules/websockets/WebSocket.cpp:
* Modules/websockets/WebSocket.h:
* Modules/webvr/VRDisplay.cpp:
* Modules/webvr/VRDisplay.h:
(WebCore::VRDisplay::isPresenting const): Deleted.
(WebCore::VRDisplay::displayName const): Deleted.
(WebCore::VRDisplay::displayId const): Deleted.
(WebCore::VRDisplay::depthNear const): Deleted.
(WebCore::VRDisplay::setDepthNear): Deleted.
(WebCore::VRDisplay::depthFar const): Deleted.
(WebCore::VRDisplay::setDepthFar): Deleted.
(WebCore::VRDisplay::document): Deleted.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CSSAnimation.cpp:
* animation/CSSAnimation.h:
* animation/CSSTransition.cpp:
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
* animation/DeclarativeAnimation.h:
* animation/WebAnimation.cpp:
* animation/WebAnimation.h:
* bindings/js/ScriptWrappable.h:
* css/CSSComputedStyleDeclaration.cpp:
* css/CSSComputedStyleDeclaration.h:
* css/CSSStyleDeclaration.cpp:
(): Deleted.
* css/CSSStyleDeclaration.h:
* css/DOMMatrix.h:
* css/DOMMatrixReadOnly.cpp:
* css/DOMMatrixReadOnly.h:
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:
* css/PropertySetCSSStyleDeclaration.cpp:
* css/PropertySetCSSStyleDeclaration.h:
* css/WebKitCSSMatrix.cpp:
* css/WebKitCSSMatrix.h:
* css/typedom/TypedOMCSSImageValue.cpp: Added.
* css/typedom/TypedOMCSSImageValue.h:
* css/typedom/TypedOMCSSNumericValue.cpp: Added.
* css/typedom/TypedOMCSSNumericValue.h:
* css/typedom/TypedOMCSSStyleValue.cpp: Added.
* css/typedom/TypedOMCSSStyleValue.h:
* css/typedom/TypedOMCSSUnitValue.cpp: Added.
* css/typedom/TypedOMCSSUnitValue.h:
* css/typedom/TypedOMCSSUnparsedValue.cpp: Added.
* css/typedom/TypedOMCSSUnparsedValue.h:
* dom/AbortController.cpp:
* dom/AbortController.h:
* dom/AbortSignal.cpp:
* dom/AbortSignal.h:
* dom/AllDescendantsCollection.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
* dom/AllDescendantsCollection.h:
* dom/ChildNodeList.cpp:
* dom/ChildNodeList.h:
* dom/ClassCollection.cpp:
* dom/ClassCollection.h:
* dom/DOMImplementation.cpp:
* dom/DOMImplementation.h:
(WebCore::DOMImplementation::ref): Deleted.
(WebCore::DOMImplementation::deref): Deleted.
(WebCore::DOMImplementation::document): Deleted.
(WebCore::DOMImplementation::hasFeature): Deleted.
* dom/DOMPoint.h:
* dom/DOMPointReadOnly.cpp:
* dom/DOMPointReadOnly.h:
* dom/DOMQuad.cpp:
* dom/DOMQuad.h:
* dom/DOMRect.h:
* dom/DOMRectReadOnly.cpp: Copied from Source/WebCore/dom/DOMPointReadOnly.cpp.
* dom/DOMRectReadOnly.h:
* dom/DataTransferItemList.cpp:
* dom/DataTransferItemList.h:
(WebCore::DataTransferItemList::ref): Deleted.
(WebCore::DataTransferItemList::deref): Deleted.
(WebCore::DataTransferItemList::dataTransfer): Deleted.
(WebCore::DataTransferItemList::hasItems const): Deleted.
(WebCore::DataTransferItemList::items const): Deleted.
* dom/DatasetDOMStringMap.cpp:
* dom/DatasetDOMStringMap.h:
* dom/DocumentParser.h:
* dom/EventTarget.cpp:
* dom/EventTarget.h:
* dom/LiveNodeList.cpp:
* dom/LiveNodeList.h:
* dom/MessageChannel.cpp:
* dom/MessagePort.cpp:
* dom/MessagePort.h:
* dom/NameNodeList.cpp:
* dom/NameNodeList.h:
* dom/NamedNodeMap.cpp:
* dom/NamedNodeMap.h:
(WebCore::NamedNodeMap::NamedNodeMap): Deleted.
(WebCore::NamedNodeMap::element): Deleted.
* dom/NodeIterator.cpp:
* dom/NodeIterator.h:
(WebCore::NodeIterator::detach): Deleted.
(WebCore::NodeIterator::referenceNode const): Deleted.
(WebCore::NodeIterator::pointerBeforeReferenceNode const): Deleted.
* dom/NodeList.cpp: Copied from Source/WebCore/xml/XMLHttpRequestEventTarget.h.
* dom/NodeList.h:
* dom/NodeRareData.cpp:
* dom/ScriptExecutionContext.cpp:
* dom/SimulatedClick.cpp:
* dom/StaticNodeList.cpp:
* dom/StaticNodeList.h:
* dom/TagCollection.cpp:
* dom/TagCollection.h:
* dom/TreeWalker.cpp:
* dom/TreeWalker.h:
(WebCore::TreeWalker::create): Deleted.
(WebCore::TreeWalker::currentNode): Deleted.
(WebCore::TreeWalker::currentNode const): Deleted.
* fileapi/Blob.cpp:
* fileapi/Blob.h:
* fileapi/File.cpp:
* fileapi/File.h:
* fileapi/FileList.cpp:
* fileapi/FileList.h:
(WebCore::FileList::create): Deleted.
(WebCore::FileList::length const): Deleted.
(WebCore::FileList::isEmpty const): Deleted.
(WebCore::FileList::files const): Deleted.
(WebCore::FileList::file const): Deleted.
(WebCore::FileList::FileList): Deleted.
(WebCore::FileList::append): Deleted.
(WebCore::FileList::clear): Deleted.
* fileapi/FileReader.cpp:
* fileapi/FileReader.h:
* html/CachedHTMLCollection.h:
* html/GenericCachedHTMLCollection.cpp:
* html/GenericCachedHTMLCollection.h:
* html/HTMLAllCollection.cpp:
* html/HTMLAllCollection.h:
* html/HTMLCollection.cpp:
* html/HTMLCollection.h:
* html/HTMLFormControlsCollection.cpp:
* html/HTMLFormControlsCollection.h:
* html/HTMLNameCollection.cpp:
* html/HTMLNameCollection.h:
* html/HTMLOptionsCollection.cpp:
* html/HTMLOptionsCollection.h:
* html/HTMLTableRowsCollection.cpp:
* html/HTMLTableRowsCollection.h:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
(WebCore::ImageBitmap::isDetached const): Deleted.
(WebCore::ImageBitmap::buffer): Deleted.
(WebCore::ImageBitmap::originClean const): Deleted.
* html/LabelsNodeList.cpp:
* html/LabelsNodeList.h:
* html/MediaController.cpp:
* html/MediaController.h:
* html/OffscreenCanvas.cpp:
* html/OffscreenCanvas.h:
* html/RadioNodeList.cpp:
* html/RadioNodeList.h:
* html/canvas/CanvasRenderingContext.cpp:
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/GPUBasedCanvasRenderingContext.h:
* html/canvas/ImageBitmapRenderingContext.cpp:
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/OffscreenCanvasRenderingContext2D.cpp:
* html/canvas/OffscreenCanvasRenderingContext2D.h:
* html/canvas/PaintRenderingContext2D.cpp:
* html/canvas/PaintRenderingContext2D.h:
* html/canvas/PlaceholderRenderingContext.cpp:
* html/canvas/PlaceholderRenderingContext.h:
* html/canvas/WebGL2RenderingContext.cpp:
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContextBase.cpp:
* html/canvas/WebGLRenderingContextBase.h:
* html/track/AudioTrackList.h:
* html/track/DataCue.cpp:
* html/track/DataCue.h:
* html/track/InbandDataTextTrack.cpp:
* html/track/InbandDataTextTrack.h:
* html/track/InbandGenericTextTrack.cpp:
* html/track/InbandGenericTextTrack.h:
* html/track/InbandTextTrack.cpp:
* html/track/InbandTextTrack.h:
* html/track/InbandWebVTTTextTrack.cpp:
* html/track/InbandWebVTTTextTrack.h:
* html/track/LoadableTextTrack.cpp:
* html/track/LoadableTextTrack.h:
* html/track/TextTrack.cpp:
* html/track/TextTrack.h:
* html/track/TextTrackCue.cpp:
* html/track/TextTrackCue.h:
* html/track/TextTrackCueGeneric.cpp:
* html/track/TextTrackCueGeneric.h:
* html/track/TextTrackList.cpp:
* html/track/TextTrackList.h:
* html/track/TrackListBase.cpp:
* html/track/TrackListBase.h:
* html/track/VTTCue.cpp:
* html/track/VTTCue.h:
* html/track/VideoTrackList.h:
* loader/appcache/DOMApplicationCache.cpp:
* loader/appcache/DOMApplicationCache.h:
* page/AbstractDOMWindow.cpp:
* page/AbstractDOMWindow.h:
* page/BarProp.cpp:
* page/BarProp.h:
(WebCore::BarProp::create): Deleted.
* page/DOMWindow.cpp:
* page/DOMWindow.h:
* page/EventSource.cpp:
* page/EventSource.h:
* page/History.cpp:
* page/History.h:
* page/Location.cpp:
* page/Location.h:
(WebCore::Location::create): Deleted.
(WebCore::Location::toString const): Deleted.
* page/Navigator.cpp:
* page/Navigator.h:
* page/Performance.cpp:
* page/Performance.h:
* page/RemoteDOMWindow.cpp:
* page/RemoteDOMWindow.h:
* page/Screen.cpp:
* page/Screen.h:
* page/VisualViewport.cpp:
* page/VisualViewport.h:
* plugins/DOMMimeTypeArray.cpp:
* plugins/DOMMimeTypeArray.h:
(WebCore::DOMMimeTypeArray::create): Deleted.
* plugins/DOMPlugin.cpp:
* plugins/DOMPlugin.h:
(WebCore::DOMPlugin::create): Deleted.
* plugins/DOMPluginArray.cpp:
* plugins/DOMPluginArray.h:
(WebCore::DOMPluginArray::create): Deleted.
* storage/Storage.cpp:
* storage/Storage.h:
(WebCore::Storage::area const): Deleted.
* workers/AbstractWorker.cpp:
* workers/AbstractWorker.h:
* workers/DedicatedWorkerGlobalScope.cpp:
* workers/DedicatedWorkerGlobalScope.h:
* workers/Worker.cpp:
* workers/Worker.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* workers/service/ServiceWorker.cpp:
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerGlobalScope.cpp:
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerRegistration.cpp:
* workers/service/ServiceWorkerRegistration.h:
* worklets/PaintWorkletGlobalScope.cpp:
* worklets/PaintWorkletGlobalScope.h:
* worklets/Worklet.cpp:
* worklets/Worklet.h:
* worklets/WorkletGlobalScope.cpp:
* worklets/WorkletGlobalScope.h:
* xml/XMLHttpRequest.cpp:
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequestEventTarget.h:
* xml/XMLHttpRequestUpload.cpp:
* xml/XMLHttpRequestUpload.h:
* xml/XPathParser.cpp:
2019-04-04 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
std::ptr_fun() is deprecated.
* platform/ios/LegacyTileGrid.mm:
(WebCore::LegacyTileGrid::dropDistantTiles):
2019-04-04 Antoine Quint <graouts@apple.com>
[Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
https://bugs.webkit.org/show_bug.cgi?id=196118
<rdar://problem/46614137>
Reviewed by Ryosuke Niwa.
Test: webanimations/js-wrapper-kept-alive.html
We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
(WebCore::WebAnimation::hasPendingActivity const):
* animation/WebAnimation.h:
2019-04-04 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Use a timer to request the creation of pending tiles
https://bugs.webkit.org/show_bug.cgi?id=196594
Reviewed by Žan Doberšek.
Use a timer to request pending tile creation, as calls to notifyFlushRequired() are discarded
while inside a layer flush.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::requestPendingTileCreationTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2019-04-03 Carlos Garcia Campos <cgarcia@igalia.com>
[ATK] Wrong index passed to AtkObject::children-changed::add signal in AXObjectCache::attachWrapper()
https://bugs.webkit.org/show_bug.cgi?id=196538
Reviewed by Michael Catanzaro.
In most of the cases the parent is not found, probably because the child is not a direct descendant of the
parent returned by parentObjectUnignored(). We need to handle the case of find() returning notFound.
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::attachWrapper): Use -1 as the index when find() returns notFound.
2019-04-03 Timothy Hatcher <timothy@apple.com>
Update AutoFill field icons to be SVG instead of PNG images.
https://bugs.webkit.org/show_bug.cgi?id=196557
rdar://problem/48292514
Reviewed by Tim Horton.
* css/html.css:
(input::-webkit-credentials-auto-fill-button):
(input::-webkit-contacts-auto-fill-button):
(input::-webkit-credit-card-auto-fill-button):
2019-04-03 Simon Fraser <simon.fraser@apple.com>
Simplify some "programmaticScroll" code paths
https://bugs.webkit.org/show_bug.cgi?id=196589
Reviewed by Zalan Bujtas.
AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() just returned early if programmaticScroll
was true, so instead, just never call it. This means we can remove the "programmaticScroll" argument from
scheduleUpdateScrollPositionAfterAsyncScroll(). Also change some callers to use the ScrollType enum
instead of a bool.
Now, ThreadedScrollingTree::scrollingTreeNodeDidScroll() just returns early. Programmatic scrolls
update state on the main thread before updating the scrolling tree, so this makes sense.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScrollTimerFired):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* page/scrolling/AsyncScrollingCoordinator.h:
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::ScheduledScrollUpdate):
(WebCore::AsyncScrollingCoordinator::ScheduledScrollUpdate::matchesUpdateType const):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileScrollingState):
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2019-04-03 Youenn Fablet <youenn@apple.com>
Add logging and ASSERTs to investigate issue with VPModuleInitialize
https://bugs.webkit.org/show_bug.cgi?id=196573
Reviewed by Eric Carlson.
Add some ASSERTs.
No change of behavior.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2019-04-03 Simon Fraser <simon.fraser@apple.com>
Remove some redundant memebers from ScrollingStateFrameScrollingNode
https://bugs.webkit.org/show_bug.cgi?id=196571
Reviewed by Zalan Bujtas.
m_requestedScrollPosition and m_requestedScrollPositionRepresentsProgrammaticScroll were
duplicated on ScrollingStateFrameScrollingNode and ScrollingStateScrollingNode, so
remove them from the derived class.
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
2019-04-03 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION (r220717): Assertion fires when animating an SVG rounded corner rect till it collapses
https://bugs.webkit.org/show_bug.cgi?id=196518
Reviewed by Simon Fraser.
r220717 made RenderSVGRect clear its m_path in updateShapeFromElement().
RenderSVGRect tries to optimize its layout and drawing if the rectangle
is not rounded. So it uses the flag m_usePathFallback to know whether to
use m_path or m_innerStrokeRect and m_outerStrokeRect. If the rectangle
is rounded but its boundingSize is empty, m_path will be cleared,
m_innerStrokeRect and m_outerStrokeRect will be recalculated but
m_usePathFallback will not be reset to false. Therefore when calling
RenderSVGRect::isEmpty(), it will call RenderSVGShape::isEmpty() which
will assert since m_path is null.
Test: svg/animations/animate-rounded-corner-rect-zero-height.svg
* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
Reset m_usePathFallback to false once clearPath() is called.
2019-04-03 Ryosuke Niwa <rniwa@webkit.org>
Nullptr crash in InlineTextBox::selectionState via TextIndicator::createWithRange
https://bugs.webkit.org/show_bug.cgi?id=196579
Reviewed by Simon Fraser.
Avoid crashing accessing the unengated optional's value in relese builds for now.
Unfortunately, fixing the underlying cause of the selection states of RenderView & RenderObject
getting out out of sync would require a significant re-architecturing of the whole selection
repainting / state managing mechanism.
* rendering/SelectionRangeData.h:
(WebCore::SelectionRangeData::startPosition const):
(WebCore::SelectionRangeData::endPosition const):
2019-04-03 Myles C. Maxfield <mmaxfield@apple.com>
-apple-trailing-word is needed for browser detection
https://bugs.webkit.org/show_bug.cgi?id=196575
Unreviewed.
This is an unreviewed partial revert of r243819. Turns out there are some websites
which use this property to do browser detection. So, we need to continue to parse
the property, but we don't need the property to do anything.
Test: fast/text/trailing-word-detection.html
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TrailingWord const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::trailingWord const):
(WebCore::RenderStyle::setTrailingWord):
(WebCore::RenderStyle::initialTrailingWord):
* rendering/style/RenderStyleConstants.h:
2019-04-03 Don Olmstead <don.olmstead@sony.com>
[CMake][WTF] Mirror XCode header directories
https://bugs.webkit.org/show_bug.cgi?id=191662
Reviewed by Konstantin Tokarev.
Use WTFFramework as a dependency and include frameworks/WTF.cmake for AppleWin internal
builds.
* CMakeLists.txt:
* PlatformWin.cmake:
2019-04-03 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove SVG properties tear-off objects
https://bugs.webkit.org/show_bug.cgi?id=191237
Reviewed by Simon Fraser.
This patch cleans the code from unused SVG sources and get rid off the
remaining SVG properties tear-off objects. Here are more details:
-- Remove the SVGAttributeAnimationController and move its code to the
SVGAnimateElementBase. SVGAttributeAnimationController was introduced
to allow animating the SVG properties whether they are backed by tear
off objects or not. Since there will be no tear off objects anymore,
one animation controller will be needed. But in this case, it will be
better if we make SVGAnimateElementBase is the animation controller
and make it manage the animator directly.
-- Remove SVGAttributeRegistry, SVGAttributeOwnerProxy and the virtual
function SVGElement::attributeOwnerProxy(). Remove also all the
overriding functions attributeOwnerProxy() from all the SVGElements.
-- Remove isKnownAttribute() from all the SVG header files except from
four classes: SVGURIReference, SVGFitToViewBox, SVGLangSpace
and SVGExternalResourcesRequired.
-- Remove all the SVG animated properties classifying functions from
SVGElement. This is now handled by SVGPropertyRegistry.
-- There is no need for the enum AnimatedPropertyType anymore. The SVG
property accessor knows its type, knows how to access it and know what
animator it should be created for it.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::synchronizeAllAttributes const):
(WebCore::Element::synchronizeAttribute const):
(WebCore::Element::fastAttributeLookupAllowed const):
These functions are surprisingly marked 'const'. They were calling 'const'
functions in SVGElement and SVGElement was casting 'this' as non 'const'
before calling the non 'const' functions through the non 'const' 'this'
pointer. Change this by moving the casting to the Element functions.
* rendering/svg/RenderSVGResourceGradient.cpp:
(WebCore::RenderSVGResourceGradient::applyResource):
* rendering/svg/RenderSVGResourcePattern.cpp:
(WebCore::RenderSVGResourcePattern::applyResource):
* svg/SVGAElement.h:
* svg/SVGAltGlyphElement.h:
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
(WebCore::SVGAnimateElementBase::animator const):
(WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
(WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
(WebCore::SVGAnimateElementBase::setTargetElement):
(WebCore::SVGAnimateElementBase::setAttributeName):
(WebCore::SVGAnimateElementBase::resetAnimation):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
(WebCore::SVGAnimateElementBase::applyResultsToTarget):
(WebCore::SVGAnimateElementBase::clearAnimatedType):
(WebCore::SVGAnimateElementBase::calculateDistance):
(WebCore::SVGAnimateElementBase::attributeAnimationController): Deleted.
(WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const): Deleted.
(WebCore::SVGAnimateElementBase::isAdditive const): Deleted.
* svg/SVGAnimateElementBase.h:
(WebCore::SVGAnimateElementBase::animatorIfExists const):
(WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists const): Deleted.
The order of the functions was changed to resemble the order of running
the animation:
-- Setting the animation range
-- Starting the animation
-- Progressing the animation
-- Applying the the progressed animaVal() to the target element
-- Stopping the animation
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::calculateDistance):
* svg/SVGAnimateMotionElement.h:
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
(WebCore::SVGAnimationElement::shouldApplyAnimation): Deleted.
* svg/SVGAnimationElement.h:
(WebCore::SVGAnimationElement::attributeRegistry): Deleted.
(WebCore::SVGAnimationElement::calculateDistance): Deleted.
* svg/SVGAttributeAnimationController.cpp: Removed.
* svg/SVGAttributeAnimationController.h: Removed.
* svg/SVGAttributeAnimationControllerBase.cpp: Removed.
* svg/SVGAttributeAnimationControllerBase.h: Removed.
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.h:
* svg/SVGComponentTransferFunctionElement.h:
* svg/SVGCursorElement.h:
* svg/SVGDefsElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeAttribute):
(WebCore::SVGElement::synchronizeAllAttributes):
(WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
(WebCore::createAttributeNameToAnimatedPropertyTypeMap): Deleted.
(WebCore::attributeNameToAnimatedPropertyTypeMap): Deleted.
(WebCore::createCSSPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
(WebCore::cssPropertyWithSVGDOMNameToAnimatedPropertyTypeMap): Deleted.
(WebCore::SVGElement::animatedPropertyTypesForAttribute): Deleted.
(WebCore::SVGElement::synchronizeAnimatedSVGAttribute const): Deleted.
(WebCore::SVGElement::isAnimatableCSSProperty): Deleted.
(WebCore::SVGElement::isPresentationAttributeWithSVGDOM): Deleted.
* svg/SVGElement.h:
(WebCore::SVGElement::attributeOwnerProxy const): Deleted.
(WebCore::SVGElement::attributeRegistry): Deleted.
(WebCore::SVGElement::synchronizeAttribute): Deleted.
(WebCore::SVGElement::synchronizeAttributes): Deleted.
(WebCore::SVGElement::animatedTypes const): Deleted.
(WebCore::SVGElement::lookupAnimatedProperty const): Deleted.
(WebCore::SVGElement::lookupOrCreateAnimatedProperty): Deleted.
(WebCore::SVGElement::lookupOrCreateAnimatedProperties): Deleted.
(WebCore::SVGElement::isKnownAttribute): Deleted.
* svg/SVGEllipseElement.h:
* svg/SVGExternalResourcesRequired.h:
(WebCore::SVGExternalResourcesRequired::attributeRegistry): Deleted.
(WebCore::SVGExternalResourcesRequired::attributeOwnerProxy): Deleted.
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.h:
* svg/SVGFELightElement.h:
* svg/SVGFEMergeNodeElement.h:
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry): Deleted.
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::attributeRegistry): Deleted.
* svg/SVGFontElement.h:
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.h:
* svg/SVGGeometryElement.h:
* svg/SVGGlyphRefElement.h:
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged):
* svg/SVGGradientElement.h:
(WebCore::SVGGradientElement::attributeRegistry): Deleted.
(WebCore::SVGGradientElement::isKnownAttribute): Deleted.
* svg/SVGGraphicsElement.h:
(WebCore::SVGGraphicsElement::attributeRegistry): Deleted.
* svg/SVGImageElement.h:
* svg/SVGLineElement.h:
* svg/SVGLinearGradientElement.h:
* svg/SVGMPathElement.h:
* svg/SVGMarkerElement.cpp:
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.h:
* svg/SVGPathElement.h:
* svg/SVGPatternElement.h:
* svg/SVGPolyElement.h:
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.h:
* svg/SVGStopElement.h:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.h:
* svg/SVGTRefElement.h:
* svg/SVGTests.cpp:
(WebCore::SVGTests::svgAttributeChanged):
(WebCore::SVGTests::attributeRegistry): Deleted.
(WebCore::SVGTests::isKnownAttribute): Deleted.
* svg/SVGTests.h:
* svg/SVGTextContentElement.cpp:
* svg/SVGTextContentElement.h:
(WebCore::SVGTextContentElement::attributeRegistry): Deleted.
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.h:
(WebCore::SVGTextPositioningElement::attributeRegistry): Deleted.
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::SVGURIReference):
(WebCore::SVGURIReference::attributeRegistry): Deleted.
* svg/SVGURIReference.h:
* svg/SVGUseElement.h:
* svg/SVGViewElement.h:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec):
* svg/SVGViewSpec.h:
* svg/SVGZoomAndPanType.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h: Removed.
* svg/properties/SVGAnimatedPropertyAnimator.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAnimator.h:
* svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyTearOff.h: Removed.
* svg/properties/SVGAnimatedPropertyType.h: Removed.
* svg/properties/SVGAnimationAdditiveFunction.h:
(WebCore::SVGAnimationAdditiveFunction::animate):
(WebCore::SVGAnimationAdditiveFunction::progress): Deleted.
* svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
(WebCore::SVGAnimationLengthListFunction::animate):
(WebCore::SVGAnimationNumberListFunction::animate):
(WebCore::SVGAnimationPointListFunction::animate):
(WebCore::SVGAnimationTransformListFunction::animate):
(WebCore::SVGAnimationLengthListFunction::progress): Deleted.
(WebCore::SVGAnimationNumberListFunction::progress): Deleted.
(WebCore::SVGAnimationPointListFunction::progress): Deleted.
(WebCore::SVGAnimationTransformListFunction::progress): Deleted.
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationAngleFunction::animate):
(WebCore::SVGAnimationColorFunction::animate):
(WebCore::SVGAnimationIntegerFunction::animate):
(WebCore::SVGAnimationLengthFunction::animate):
(WebCore::SVGAnimationNumberFunction::animate):
(WebCore::SVGAnimationPathSegListFunction::animate):
(WebCore::SVGAnimationRectFunction::animate):
(WebCore::SVGAnimationAngleFunction::progress): Deleted.
(WebCore::SVGAnimationColorFunction::progress): Deleted.
(WebCore::SVGAnimationIntegerFunction::progress): Deleted.
(WebCore::SVGAnimationLengthFunction::progress): Deleted.
(WebCore::SVGAnimationNumberFunction::progress): Deleted.
(WebCore::SVGAnimationPathSegListFunction::progress): Deleted.
(WebCore::SVGAnimationRectFunction::progress): Deleted.
* svg/properties/SVGAnimationDiscreteFunction.h:
(WebCore::SVGAnimationDiscreteFunction::animate):
(WebCore::SVGAnimationDiscreteFunction::progress): Deleted.
* svg/properties/SVGAnimationFunction.h:
(WebCore::SVGAnimationFunction::calculateDistance const):
-- Rename the 'progress()' functions of SVGAttributeAnimator and SVGAnimationFunction
to 'animate()'.
-- Rename the argument 'percentage' of these function to 'progress'
-- Make calculateDistance return Optional<float> so it does not have to
return -1 in case of error.
* svg/properties/SVGAttribute.h: Removed.
* svg/properties/SVGAttributeAccessor.h: Removed.
* svg/properties/SVGAttributeAnimator.h:
(WebCore::SVGAttributeAnimator::calculateDistance const):
* svg/properties/SVGAttributeOwnerProxy.cpp: Removed.
* svg/properties/SVGAttributeOwnerProxy.h: Removed.
* svg/properties/SVGAttributeOwnerProxyImpl.h: Removed.
* svg/properties/SVGAttributeRegistry.h: Removed.
* svg/properties/SVGLegacyAnimatedProperty.cpp: Removed.
* svg/properties/SVGLegacyAnimatedProperty.h: Removed.
* svg/properties/SVGLegacyProperty.h: Removed.
* svg/properties/SVGListProperty.h: Removed.
* svg/properties/SVGListPropertyTearOff.h: Removed.
* svg/properties/SVGPrimitivePropertyAnimator.h:
* svg/properties/SVGProperty.h:
* svg/properties/SVGPropertyAnimator.h:
* svg/properties/SVGPropertyTearOff.h: Removed.
* svg/properties/SVGValuePropertyAnimator.h:
* svg/properties/SVGValuePropertyListAnimator.h:
2019-04-03 Myles C. Maxfield <mmaxfield@apple.com>
Documents can be destroyed before their CSSFontFaceSet is destroyed
https://bugs.webkit.org/show_bug.cgi?id=195830
Reviewed by Darin Adler.
CSSFontFaceSet has a raw pointer to its owning document. JS can keep the CSSFontFaceSet alive (by using FontFaceSet)
and can destroy the document at any time. When the document is destroyed, the link between the two objects needs to
be severed.
Test: fast/text/font-face-set-destroy-document.html
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::CSSFontFace):
* css/CSSFontFace.h:
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::CSSFontFaceSet):
(WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
* css/CSSFontFaceSet.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSFontSelector.h:
* css/FontFace.cpp:
(WebCore::FontFace::FontFace):
2019-04-03 Sihui Liu <sihui_liu@apple.com>
Follow up fix for r243807: Use MarkedArgumentBuffer instead of Vector for JSValue
https://bugs.webkit.org/show_bug.cgi?id=196547
Reviewed by Geoffrey Garen.
JSValue in Vector could be garbage collected because GC doesn't know Vector memory on C++ heap.
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result const):
2019-04-03 Chris Dumez <cdumez@apple.com>
HTML fragment serialization should not strip whitespace from URL attribute values
https://bugs.webkit.org/show_bug.cgi?id=196551
Reviewed by Ryosuke Niwa.
HTML fragment serialization should not strip whitespace from URL attribute values as per:
- https://html.spec.whatwg.org/multipage/parsing.html#html-fragment-serialisation-algorithm
WebKit was stripping such whitespace, Gecko and Blink are not. Align WebKit with other
browser engines and the specification.
No new tests, rebaselined existing test.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
2019-04-02 Ryosuke Niwa <rniwa@webkit.org>
Crash in HTMLCanvasElement::createContext2d after the element got adopted to a new document
https://bugs.webkit.org/show_bug.cgi?id=196527
Reviewed by Antti Koivisto.
We need to update CanvasBase::m_scriptExecutionContext when HTMLCanvasElement moves from
one document to another. Fixed the bug by making CanvasBase::scriptExecutionContext make
a virtual function call instead of directly storing a raw pointer. In HTMLCanvasElement,
we use Node::scriptExecutionContext(). Use ContextDestructionObserver in CustomPaintCanvas
and OffscreenCanvas instead of a raw pointer.
Unfortunately, no new tests since there is no reproducible test case.
* html/CanvasBase.cpp:
(WebCore::CanvasBase::CanvasBase):
* html/CanvasBase.h:
(WebCore::CanvasBase::scriptExecutionContext const):
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::CustomPaintCanvas):
* html/CustomPaintCanvas.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
* html/HTMLCanvasElement.h:
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::OffscreenCanvas):
* html/OffscreenCanvas.h:
2019-04-03 Myles C. Maxfield <mmaxfield@apple.com>
Remove support for -apple-trailing-word
https://bugs.webkit.org/show_bug.cgi?id=196525
Reviewed by Zalan Bujtas.
This CSS property is nonstandard and not used.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::operator TrailingWord const): Deleted.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h:
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::BreakingContext):
(WebCore::BreakingContext::lineBreak):
(WebCore::BreakingContext::clearLineBreakIfFitsOnLine):
(WebCore::BreakingContext::commitLineBreakClear):
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::handleBR):
(WebCore::BreakingContext::handleFloat):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::handleEndOfLine):
(WebCore::BreakingContext::InlineIteratorHistory::InlineIteratorHistory): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::push): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::update): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::renderer const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::offset const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::atTextParagraphSeparator const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::previousInSameNode const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::get const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::current const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::historyLength const): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::moveTo): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::increment): Deleted.
(WebCore::BreakingContext::InlineIteratorHistory::clear): Deleted.
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::trailingWord const): Deleted.
(WebCore::RenderStyle::setTrailingWord): Deleted.
(WebCore::RenderStyle::initialTrailingWord): Deleted.
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
2019-04-03 Youenn Fablet <youenn@apple.com>
Use makePendingActivity in DOMCache
https://bugs.webkit.org/show_bug.cgi?id=196515
Reviewed by Geoffrey Garen.
No change of behavior, just modernizing the code.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords):
(WebCore::DOMCache::batchDeleteOperation):
(WebCore::DOMCache::batchPutOperation):
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::match):
2019-04-03 Chris Dumez <cdumez@apple.com>
[XML Parser] Insert the error message block when stopping parsing and an error occurred
https://bugs.webkit.org/show_bug.cgi?id=196546
Reviewed by Alexey Proskuryakov.
Insert the error message block when stopping parsing and an error occurred. This is based
on the following Blink commit:
- https://chromium.googlesource.com/chromium/src.git/+/565958bc22e2d49fed7af144482c2bf4d416fec5
No new tests, rebaselined existing test.
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
Avoid showing the error message block twice in some cases. No need to ever call
insertErrorMessageBlock() if we're already stopped since stopParsing() already
takes care of doing this.
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::stopParsing):
When XMLDocumentParser::stopParsing() is called to stop parsing, call
insertErrorMessageBlock() to insert the <parsererror> element if an error
occurred.
2019-04-03 Youenn Fablet <youenn@apple.com>
Clear WorkerCacheStorageConnection callbacks on WorkerGlobalScope termination
https://bugs.webkit.org/show_bug.cgi?id=196521
Reviewed by Alex Christensen.
When the worker global scope is preparing for termination,
all ActiveDOMObjects are stopped.
At that time, the completion handlers related to
WorkerCacheStorageConnection should be cleared to be able to free
memory, and as they are now no-op anyway.
We clear the completion handlers once the active DOM objects are stopped
to limit the processing triggered by clearing them.
Introducing a new Stopped error code to handle this case.
Add an assertion so that this error does not surface to JS.
Covered by existing tests.
* Modules/cache/CacheStorageConnection.cpp:
(WebCore::CacheStorageConnection::clearPendingRequests):
* Modules/cache/CacheStorageConnection.h:
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::errorToException):
* Modules/cache/DOMCacheEngine.h:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::prepareForTermination):
(WebCore::WorkerGlobalScope::stopIndexedDatabase):
2019-04-03 Youenn Fablet <youenn@apple.com>
Adopt new VCP SPI
https://bugs.webkit.org/show_bug.cgi?id=193357
<rdar://problem/43656651>
Reviewed by Eric Carlson.
Covered by existing tests.
* testing/Internals.cpp:
(WebCore::Internals::supportsVCPEncoder):
2019-04-03 Chris Dumez <cdumez@apple.com>
Remove legacy webkitRequestAnimationFrame time quirk
https://bugs.webkit.org/show_bug.cgi?id=196458
<rdar://problem/49490207>
Reviewed by Simon Fraser.
Remove legacy webkitRequestAnimationFrame time quirk and log a deprecation
warning whenever webkitRequestAnimationFrame is called.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::requestAnimationFrame):
(WebCore::DOMWindow::webkitRequestAnimationFrame):
2019-04-03 Sihui Liu <sihui_liu@apple.com>
Blob type cannot be stored correctly in IDB when IDBObjectStore has autoIncrement and keyPath options
https://bugs.webkit.org/show_bug.cgi?id=196128
Reviewed by Geoffrey Garen.
If a key is auto-generated, it should become a property of the value object. Network process would perform the
key injection by deserializing IDBValue into script value, setting the property, serializing the result and
storing it in a database record. But network process does not have a JSDOMGlobalObject, so it would fail to
deserialize types including Blob and File.
To solve this issue, we move the key injection to web process and let network process store the original value
it gets. In this case, when web process asks for some value, network process should return key, value and key
path so that web process can decide whether it should perform a key injection before returning the result. Note
that the auto-generated key would always be stored as the key in a ObjectStore record.
Test: storage/indexeddb/modern/objectstore-autoincrement-types.html
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::primaryKeyPath):
* Modules/indexeddb/IDBGetAllResult.cpp:
(WebCore::IDBGetAllResult::isolatedCopy):
(WebCore::IDBGetAllResult::addKey):
(WebCore::IDBGetAllResult::addValue):
(WebCore::IDBGetAllResult::keys const):
(WebCore::IDBGetAllResult::values const):
(WebCore::IDBGetAllResult::allBlobFilePaths const):
(WebCore::isolatedCopyOfVariant): Deleted.
* Modules/indexeddb/IDBGetAllResult.h: Introduce an IDBKeyPath parameter. Also replace Variant with two Vectors,
because we only needed to store either key or value before, and now the stored value could be incomplete.
(WebCore::IDBGetAllResult::IDBGetAllResult):
(WebCore::IDBGetAllResult::keyPath const):
(WebCore::IDBGetAllResult::encode const):
(WebCore::IDBGetAllResult::decode):
* Modules/indexeddb/IDBGetResult.cpp:
(WebCore::IDBGetResult::setValue):
* Modules/indexeddb/IDBGetResult.h:
(WebCore::IDBGetResult::IDBGetResult):
(WebCore::IDBGetResult::keyPath const):
* Modules/indexeddb/IDBObjectStore.cpp:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::didGetAllRecordsOnServer):
(WebCore::IDBTransaction::didGetRecordOnServer):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
* Modules/indexeddb/server/MemoryIndex.cpp:
(WebCore::IDBServer::MemoryIndex::getResultForKeyRange const):
(WebCore::IDBServer::MemoryIndex::getAllRecords const):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::currentData):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
(WebCore::IDBServer::MemoryObjectStore::getAllRecords const):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::cachedStatementForGetAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Remove the key injection from network process.
UniqueIDBDatabase stores any value it gets from IDBClient.
* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::getResultRef):
* Modules/indexeddb/shared/IDBResultData.h:
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::injectIDBKeyIntoScriptValue): If property is read-only, set would fail and injectKeyIntoResult would
return null, but we expect it to return result as long as the property value is the same as target. Therefore,
we can add an early return here.
(WebCore::createKeyPathArray):
(WebCore::generateIndexKeyForValue): We used to generate IndexKey from value stored in database but now the
value gets stored does not include auto-generated key, as we remove the key injection from network process. In
this case if the IDBIndex has the same key path as the auto-generated key, IndexKey would be failed to create
for it cannot extract auto-generated key from value. Since the auto-generated key would always be the key in
database record, we could use value of that key when we find a match in key path.
(WebCore::deserializeIDBValueWithKeyInjection): If the key path in the result is single entry, the key is
probably auto-generated, so we could inject the result key into the result value unconditionally.
* bindings/js/IDBBindingUtilities.h:
* bindings/js/JSIDBCursorWithValueCustom.cpp:
(WebCore::JSIDBCursorWithValue::value const):
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::result const):
2019-04-03 Michael Catanzaro <mcatanzaro@igalia.com>
Get rid of HTMLInputElement::setEditingValue
https://bugs.webkit.org/show_bug.cgi?id=196402
Reviewed by Darin Adler.
HTMLInputElement::setEditingValue is only used for Epiphany password autofill. We did it
this way because that's what Chrome uses for autofill, but Apple uses
HTMLInputElement::setValueForUser. Let's switch to that instead, then we can get rid of
setEditingValue.
This fixes logging into ting.com after username and password are autofilled by Epiphany.
Before this change, the login would fail unless you first manually edit either the username
or the password field.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue): Deleted.
* html/HTMLInputElement.h:
* testing/Internals.cpp:
(WebCore::Internals::setEditingValue): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2019-04-03 Pablo Saavedra <psaavedra@igalia.com>
Missing includes that were previously provided via UnifiedSources
https://bugs.webkit.org/show_bug.cgi?id=196434
Unreviewed build fix.
* html/InputType.h:
2019-04-03 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce and add plumbing for a website policy for meta viewport tag handling
https://bugs.webkit.org/show_bug.cgi?id=196285
Reviewed by Tim Horton.
Add MetaViewportPolicy to DocumentLoader. See WebKit ChangeLog for more detail.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::metaViewportPolicy const):
(WebCore::DocumentLoader::setMetaViewportPolicy):
2019-04-03 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remote Inspector indicate callback should always happen on the main thread
https://bugs.webkit.org/show_bug.cgi?id=196513
<rdar://problem/49498284>
Reviewed by Devin Rousso.
* platform/ios/wak/WebCoreThreadSystemInterface.cpp:
(InitWebCoreThreadSystemInterface):
2019-04-02 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238266): Exchange 2013 Outlook Web Access displays partially blank page when creating new e-mail
https://bugs.webkit.org/show_bug.cgi?id=196522
rdar://problem/49472941
Reviewed by Zalan Bujtas.
In this content a layer is composited to clip descendants, and has negative z-order children,
so we compute that it "paints into ancestor", and has a foreground layer. This combination doesn't
make sense, and when the layer becomes scrollable, we end up with bad paint phases on layers, and
fail to paint the contents.
Fix by ensuring that a layer has its own backing store if it requires a foreground layer
by virtue of having negative z-order children.
Test: compositing/backing/foreground-layer-no-paints-into-ancestor.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
2019-04-02 Timothy Hatcher <timothy@apple.com>
Cursor count badge reverts to Zero during Drag & Drop of multiple items.
https://bugs.webkit.org/show_bug.cgi?id=196511
Reviewed by Daniel Bates.
* page/DragController.cpp:
(WebCore::DragController::tryDocumentDrag): Don't set m_numberOfItemsToBeAccepted to
zero when dragging to a non-file input element.
2019-04-02 Chris Dumez <cdumez@apple.com>
HTML Parser: Remove conditional parsing of <noembed> content
https://bugs.webkit.org/show_bug.cgi?id=196514
Reviewed by Geoffrey Garen.
Our HTML Parser has raw text handling for <noembed> content only if plugins are runnable.
However, the HTML specification doesn't ask such behavior [1], and it doesn't match to
our HTML serializer. We should always handle it as raw text.
Blink already made this change in https://chromium-review.googlesource.com/c/1477556.
[1] https://html.spec.whatwg.org/multipage/parsing.html#parsing-html-fragments:noembed
No new tests, updated existing test.
* html/parser/HTMLParserOptions.cpp:
(WebCore::HTMLParserOptions::HTMLParserOptions):
* html/parser/HTMLParserOptions.h:
* html/parser/HTMLTokenizer.cpp:
(WebCore::HTMLTokenizer::updateStateFor):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processStartTagForInBody):
2019-04-02 Chris Dumez <cdumez@apple.com>
XMLHttpRequestUpload's loadstart event not correct initialized
https://bugs.webkit.org/show_bug.cgi?id=196174
<rdar://problem/49191412>
Reviewed by Alex Christensen.
Align progress event firing with the XHR specification.
No new tests, rebaselined existing tests.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
As per [1], the loadstart event fired on the XMLHttpRequestUpload object should use
loaded=0 and total=`reqs bodys total bytes`.
[1] https://xhr.spec.whatwg.org/#the-send()-method (step 11.2.)
(WebCore::XMLHttpRequest::didSendData):
As per [2], the progress / load / loadend should use loaded=transmitted and total=length.
[2] https://xhr.spec.whatwg.org/#ref-for-process-request-end-of-body (steps 5, 6 and 7)
(WebCore::XMLHttpRequest::didReceiveData):
As per [3], we should fire the readystatechange event *before* the progress event.
This is covered by web-platform-tests/xhr/send-response-event-order.htm which was failing
differently after the other changes in this patch.
[3] https://xhr.spec.whatwg.org/#ref-for-process-response (steps 9.4 and 9.5)
(WebCore::XMLHttpRequest::dispatchErrorEvents):
As per [4], in case of an error, we should fire the provided 'event' and 'loadend' with
loaded=0 and total=0.
[4] https://xhr.spec.whatwg.org/#request-error-steps (steps 7 and 8)
* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
* xml/XMLHttpRequestUpload.h:
Simplify XMLHttpRequestUpload. It no longer needs to store loaded / total as data
members now that they are always passed by the call site. lengthComputable is set
to !!total as [5] says to set it to true if length/total is not 0.
[5] https://xhr.spec.whatwg.org/#concept-event-fire-progress
2019-04-02 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: add support for showing WebGPU contexts
https://bugs.webkit.org/show_bug.cgi?id=196413
<rdar://problem/49438898>
Reviewed by Timothy Hatcher.
Tests: inspector/canvas/create-context-webgpu.html
inspector/canvas/resolveCanvasContext-webgpu.html
* Modules/webgpu/GPUCanvasContext.idl:
* Modules/webgpu/GPUCanvasContext.h:
(WebCore::GPUCanvasContext::canvas const): Added.
* Modules/webgpu/GPUCanvasContext.cpp:
(WebCore::GPUCanvasContext::create):
* testing/InternalSettings.idl:
* testing/InternalSettings.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setWebGPUEnabled): Added.
2019-04-02 Chris Dumez <cdumez@apple.com>
[WK2] Add support for Window's beforeprint / afterprint events
https://bugs.webkit.org/show_bug.cgi?id=196478
Reviewed by Alex Christensen.
Add support for Window's beforeprint / afterprint events as per:
- https://html.spec.whatwg.org/#dom-print
Blink and Gecko already support this.
Test: printing/printing-events.html
* dom/EventNames.h:
* html/HTMLAttributeNames.in:
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::createWindowEventHandlerNameMap):
* page/Page.cpp:
(WebCore::dispatchPrintEvent):
(WebCore::Page::dispatchBeforePrintEvent):
(WebCore::Page::dispatchAfterPrintEvent):
* page/Page.h:
* page/WindowEventHandlers.idl:
2019-04-02 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Hover menus do not function on fidelity.com
https://bugs.webkit.org/show_bug.cgi?id=196507
<rdar://problem/49496520>
Reviewed by Simon Fraser.
fidelity.com has 400ms hover intent timer to bring up the main menus.
Test: fast/events/touch/ios/content-observation/400ms-hover-intent.html
* page/ios/ContentChangeObserver.cpp:
2019-04-02 Timothy Hatcher <timothy@apple.com>
NSAttributedString crashes when encoding text attachment cell for missing image.
https://bugs.webkit.org/show_bug.cgi?id=196504
rdar://problem/49161281
Reviewed by Tim Horton.
Clean up and fix a couple of errors and crashes in the missing image path of our
attributed string converter.
Fixes include:
* Removed manual call to release on a RetainPtr, leading to autorelease pool crash.
* No longer try to load an image that is missing on disk and has long been renamed.
* No longer use a NSTextAttachmentCell in the Mac code path which can't be encoded
for sending to the UIProcess, so it was pretty useless in the web content process.
* Stopped using NSFileWrapper for the missing image so the attachment can contain the
retina versions of the missing image.
* Simplified bundle finding code, since WebCore is assumed to be loaded.
* Fix leak of attachment by adding missing adoptNS().
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::_addAttachmentForElement): Unify and simplify missing image path.
(_NSFirstPathForDirectoriesInDomains): Deleted.
(_NSSystemLibraryPath): Deleted.
(_webKitBundle): Deleted.
2019-04-02 Chris Dumez <cdumez@apple.com>
[Fetch API] Allow used body replacement in Request constructor
https://bugs.webkit.org/show_bug.cgi?id=183703
<rdar://problem/49425609>
Reviewed by Youenn Fablet.
Allow used body replacement in Request constructor as per:
- https://github.com/whatwg/fetch/pull/675
No new tests, rebaseline existing test.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
2019-04-02 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r243551.
Seems to have broken file uploads to SoundCloud
Reverted changeset:
"XMLHttpRequestUpload's loadstart event not correct
initialized"
https://bugs.webkit.org/show_bug.cgi?id=196174
https://trac.webkit.org/changeset/243551
2019-04-02 Justin Fan <justin_fan@apple.com>
[Web GPU] Implement blend states and color write mask for GPUColorStateDescriptor
https://bugs.webkit.org/show_bug.cgi?id=196474
Reviewed by Myles C. Maxfield.
Blend states and color write masks must now be specified on GPUColorStateDescriptor instead of
relying on underlying MTLRenderPipelineColorAttachmentDescriptor defaults.
Test: webgpu/blend-triangle-strip.html, webgpu/color-write-mask-triangle-strip.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webgpu/GPUBlendDescriptor.idl:
* Modules/webgpu/GPUColorStateDescriptor.idl:
* Modules/webgpu/GPUColorWriteBits.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUBlendDescriptor.h:
* platform/graphics/gpu/GPUColorStateDescriptor.h:
* platform/graphics/gpu/GPUColorWriteBits.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::mtlColorWriteMaskForGPUColorWriteFlags):
(WebCore::mtlBlendOperationForGPUBlendOperation):
(WebCore::mtlBlendFactorForGPUBlendFactor):
(WebCore::setColorStatesForColorAttachmentArray):
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::trySetColorStatesForColorAttachmentArray): Deleted.
2019-04-02 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Ignore reconstructed renderers when checking for visibility change
https://bugs.webkit.org/show_bug.cgi?id=196483
<rdar://problem/49288174>
Reviewed by Simon Fraser.
This patch fixes the cases when the content gets reconstructed in a way that existing and visible elements gain
new renderers within one style recalc. We failed to recognize such cases and ended up detecting the newly constructed renderers
as "visible change" thereby triggering hover.
Test: fast/events/touch/ios/content-observation/visible-content-gains-new-renderer.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::renderTreeUpdateDidStart):
(WebCore::ContentChangeObserver::renderTreeUpdateDidFinish):
(WebCore::ContentChangeObserver::reset):
(WebCore::ContentChangeObserver::willDestroyRenderer):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::RenderTreeUpdateScope::RenderTreeUpdateScope):
(WebCore::ContentChangeObserver::RenderTreeUpdateScope::~RenderTreeUpdateScope):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::visibleRendererWasDestroyed const):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):
(WebCore::RenderTreeUpdater::tearDownRenderers):
2019-04-02 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] WEBKIT_MAKE_FORWARDING_HEADERS shouldn't use POST_BUILD to copy generated headers
https://bugs.webkit.org/show_bug.cgi?id=182757
Reviewed by Don Olmstead.
No new tests because no behavior changes.
* PlatformWin.cmake: Do not use DERIVED_SOURCE_DIRECTORIES of
WEBKIT_MAKE_FORWARDING_HEADERS. Added
WebCore_PRIVATE_FRAMEWORK_HEADERS.
* WebCoreMacros.cmake (GENERATE_DOM_NAMES): Added
${_namespace}ElementTypeHelpers.h to _outputfiles.
2019-04-02 Cathie Chen <cathiechen@igalia.com>
Update the status of ResizeObserver in features.json.
https://bugs.webkit.org/show_bug.cgi?id=196443
Reviewed by Rob Buis.
* features.json:
2019-04-01 Ryosuke Niwa <rniwa@webkit.org>
Nullptr crash in Document::open after calling policyChecker().stopCheck()
https://bugs.webkit.org/show_bug.cgi?id=196479
Reviewed by Antti Koivisto.
Added a missing nullptr check in Document::open after calling m_frame->loader().policyChecker().stopCheck()
since it invokes m_willSubmitFormCompletionHandlers in WebKit2, and that could clear m_frame.
Unfortunately, we don't have any reproducible test case.
* dom/Document.cpp:
(WebCore::Document::open):
2019-04-01 Timothy Hatcher <timothy@apple.com>
Unreviewed build fix.
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END
around SecTrustedApplicationCreateFromPath call.
2019-04-01 Simon Fraser <simon.fraser@apple.com>
Remove some unused iOS scrolling-related code in Frame
https://bugs.webkit.org/show_bug.cgi?id=196473
Reviewed by Zalan Bujtas.
This code has no callers.
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::scrollOverflowLayer): Deleted.
(WebCore::Frame::overflowAutoScrollTimerFired): Deleted.
(WebCore::Frame::startOverflowAutoScroll): Deleted.
(WebCore::Frame::checkOverflowScroll): Deleted.
* page/Frame.h:
2019-04-01 Chris Dumez <cdumez@apple.com>
Attr nodes are not cloned properly
https://bugs.webkit.org/show_bug.cgi?id=196466
Reviewed by Ryosuke Niwa.
Attr nodes are not cloned properly according to:
- https://dom.spec.whatwg.org/#concept-node-clone
A cloned Attr node should retain its prefix and namespace.
Both Gecko and Blink agree with the DOM specification here.
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::importNode):
2019-04-01 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG tear off objects for SVGMatrix, SVGTransfrom, SVGTransformList and SVGAnimatedTransformList
https://bugs.webkit.org/show_bug.cgi?id=196086
Reviewed by Simon Fraser.
The IDL changes:
SVGTransform.idl:
Remove the NewObject qualifier from matrix attribute. This matches
the specs: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGTransform.
SVGTransform will internally hold an SVGMatrix. A change in this
SVGMatrix will affect the container SVGTransform.
SVGTransformList.idl:
Remove the NewObject qualifier from consolidate() method. This matches
the specs:
https://www.w3.org/TR/SVG11/coords.html#__svg__SVGTransformList__consolidate
The method consolidate() should return a reference to the first item
in the list after consolidating it.
Code changes:
-- SVGMatrix is now a superclass of SVGValueProperty<AffineTransform>.
No need for SVGMatrixValue since it was wrapper of AffineTransform.
-- SVGTransformValue now holds a Ref<SVGMatrix> member in addition to the
angle and the rotationCenter. Ref<SVGMatrix> is what SVGTransform.matrix
will return. So a change in this matrix will change the owner SVGTransform.
-- SVGTransform is now the owner of SVGMatrix via its SVGTransformValue.
-- SVGTransformList is now a superclass of SVGValuePropertyList<SVGTransform>.
It is responsible for parsing a String to items of SVGTransform.
-- SVGAnimatedTransformList is now defined as SVGAnimatedPropertyList<
SVGTransformList>.
Note the ownership chain of these objects is the following:
-- SVGAnimatedTransformList owns the SVGTransformList via its baseVal
and animVal members.
-- SVGTransformList owns SVGTransform via its list of items
-- SVGTransform owns SVGMatrix via its SVGTransformValue.
So a change in SVGMatrix will propagate to the owner SVGElement through
the following ownership chain:
SVGMatrix
|_ SVGTransfrom
|_ SVGTransformList
|_ SVGAmimatedTransformList
|_ SVGElement
To get the mechanics of this change right, a new accessor, a new animator
and animation functions are added for the SVGAnimatedTransformList.
-- SVGViewSpec used to hold an SVGAnimatedTransformListAttribute for the
member m_transform although this member should not be animated. See the
comment in the old SVGViewSpec::transform(). This has been changed in this
patch. SVGViewSpec now holds Ref<SVGTransformList> which matches the specs:
https://www.w3.org/TR/SVG11/types.html#InterfaceSVGViewSpec.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::attributeAnimationController):
(WebCore::SVGAnimateElementBase::hasValidAttributeType const):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
* svg/SVGAnimateElementBase.h:
(WebCore::SVGAnimateElementBase::animateRangeString const):
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::animateRangeString const):
* svg/SVGAnimateTransformElement.h:
This change is needed because animating the transform attribute can be
written as
<animate ... from="translate(100)" to="translate(200)"/>
or
<animateTransform type="translate" from="100" to="200"/>"
So we need to surround the animation range string with the type qualifier
for animateTransform.
* svg/SVGAnimatedTransformList.cpp: Removed.
* svg/SVGAnimatedTransformList.h: Removed.
* svg/SVGAnimatedType.h: Removed.
* svg/SVGAnimatedTypeAnimator.cpp: Removed.
* svg/SVGAnimatedTypeAnimator.h: Removed.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
* svg/SVGAnimationElement.h:
(WebCore::SVGAnimationElement::adjustForInheritance): Deleted.
(WebCore::SVGAnimationElement::adjustFromToListValues): Deleted.
(WebCore::SVGAnimationElement::animateDiscreteType): Deleted.
These functions were used by SVGLegacyAttributeAnimationController.
* svg/SVGAnimatorFactory.h: Removed.
* svg/SVGExternalResourcesRequired.h:
(WebCore::SVGExternalResourcesRequired::isKnownAttribute):
* svg/SVGFEImageElement.h:
* svg/SVGFEMorphologyElement.h:
* svg/SVGFETileElement.h:
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::isKnownAttribute):
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::SVGGradientElement):
(WebCore::SVGGradientElement::parseAttribute):
(WebCore::SVGGradientElement::registerAttributes): Deleted.
* svg/SVGGradientElement.h:
(WebCore::SVGGradientElement::gradientTransform const):
(WebCore::SVGGradientElement::gradientTransformAnimated):
(WebCore::SVGGradientElement::isKnownAttribute):
* svg/SVGGraphicsElement.cpp:
(WebCore::SVGGraphicsElement::SVGGraphicsElement):
(WebCore::SVGGraphicsElement::animatedLocalTransform const):
(WebCore::SVGGraphicsElement::parseAttribute):
(WebCore::SVGGraphicsElement::svgAttributeChanged):
There is one attribute for this element which is "SVGNames::transformAttr"
So there is no need to check for it twice.
(WebCore::SVGGraphicsElement::registerAttributes): Deleted.
* svg/SVGGraphicsElement.h:
(WebCore::SVGGraphicsElement::transform const):
(WebCore::SVGGraphicsElement::transformAnimated):
(WebCore::SVGGraphicsElement::isKnownAttribute): Deleted.
* svg/SVGLangSpace.cpp:
(WebCore::SVGLangSpace::SVGLangSpace):
(WebCore::SVGLangSpace::xmlspace const):
(WebCore::SVGLangSpace::isKnownAttribute):
(WebCore::SVGLangSpace::svgAttributeChanged):
(WebCore::SVGLangSpace::registerAttributes): Deleted.
* svg/SVGLangSpace.h:
(WebCore::SVGLangSpace::xmllang const):
(WebCore::SVGLangSpace::setXmllang):
(WebCore::SVGLangSpace::setXmlspace):
(WebCore::SVGLangSpace::attributeRegistry): Deleted.
(WebCore::SVGLangSpace::isKnownAttribute): Deleted.
* svg/SVGLegacyAttributeAnimationController.cpp: Removed.
* svg/SVGLegacyAttributeAnimationController.h: Removed.
* svg/SVGLinearGradientElement.cpp:
(WebCore::setGradientAttributes):
* svg/SVGMaskElement.h:
* svg/SVGMatrix.h:
(WebCore::SVGMatrix::create):
(WebCore::SVGMatrix::a const):
(WebCore::SVGMatrix::setA):
(WebCore::SVGMatrix::b const):
(WebCore::SVGMatrix::setB):
(WebCore::SVGMatrix::c const):
(WebCore::SVGMatrix::setC):
(WebCore::SVGMatrix::d const):
(WebCore::SVGMatrix::setD):
(WebCore::SVGMatrix::e const):
(WebCore::SVGMatrix::setE):
(WebCore::SVGMatrix::f const):
(WebCore::SVGMatrix::setF):
(WebCore::SVGMatrix::multiply const):
(WebCore::SVGMatrix::inverse const):
(WebCore::SVGMatrix::translate const):
(WebCore::SVGMatrix::scale const):
(WebCore::SVGMatrix::scaleNonUniform const):
(WebCore::SVGMatrix::rotate const):
(WebCore::SVGMatrix::rotateFromVector const):
(WebCore::SVGMatrix::flipX const):
(WebCore::SVGMatrix::flipY const):
(WebCore::SVGMatrix::skewX const):
(WebCore::SVGMatrix::skewY const):
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::SVGPatternElement):
(WebCore::SVGPatternElement::parseAttribute):
(WebCore::SVGPatternElement::svgAttributeChanged):
(WebCore::SVGPatternElement::collectPatternAttributes const):
(WebCore::SVGPatternElement::localCoordinateSpaceTransform const):
(WebCore::SVGPatternElement::registerAttributes): Deleted.
* svg/SVGPatternElement.h:
* svg/SVGPoint.h:
(WebCore::SVGPoint::matrixTransform const):
* svg/SVGPolyElement.h:
(WebCore::SVGPolyElement::isKnownAttribute): Deleted.
* svg/SVGRadialGradientElement.cpp:
(WebCore::setGradientAttributes):
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::createSVGTransform):
(WebCore::SVGSVGElement::createSVGTransformFromMatrix):
(WebCore::SVGSVGElement::viewBoxToViewTransform const):
* svg/SVGTextElement.cpp:
(WebCore::SVGTextElement::animatedLocalTransform const):
* svg/SVGTransform.cpp: Removed.
* svg/SVGTransform.h:
(WebCore::SVGTransform::create):
(WebCore::SVGTransform::~SVGTransform):
(WebCore::SVGTransform::clone const):
(WebCore::SVGTransform::type):
(WebCore::SVGTransform::angle):
(WebCore::SVGTransform::matrix):
(WebCore::SVGTransform::setMatrix):
(WebCore::SVGTransform::setTranslate):
(WebCore::SVGTransform::setScale):
(WebCore::SVGTransform::setRotate):
(WebCore::SVGTransform::setSkewX):
(WebCore::SVGTransform::setSkewY):
(WebCore::SVGTransform::SVGTransform):
* svg/SVGTransform.idl:
* svg/SVGTransformList.h:
* svg/SVGTransformList.idl:
* svg/SVGTransformListValues.cpp: Removed.
* svg/SVGTransformListValues.h: Removed.
* svg/SVGTransformValue.cpp: Removed.
* svg/SVGTransformValue.h:
(WebCore::SVGTransformValue::SVGTransformValue):
(WebCore::SVGTransformValue::operator=):
(WebCore::SVGTransformValue::matrix const):
(WebCore::SVGTransformValue::rotationCenter const):
(WebCore::SVGTransformValue::isValid const):
(WebCore::SVGTransformValue::setMatrix):
(WebCore::SVGTransformValue::matrixDidChange):
(WebCore::SVGTransformValue::translate const):
(WebCore::SVGTransformValue::setTranslate):
(WebCore::SVGTransformValue::scale const):
(WebCore::SVGTransformValue::setScale):
(WebCore::SVGTransformValue::setRotate):
(WebCore::SVGTransformValue::setSkewX):
(WebCore::SVGTransformValue::setSkewY):
(WebCore::SVGTransformValue::valueAsString const):
(WebCore::SVGTransformValue::prefixForTransfromType):
(WebCore::SVGTransformValue::appendNumbers const):
(WebCore::SVGTransformValue::appendMatrix const):
(WebCore::SVGTransformValue::appendTranslate const):
(WebCore::SVGTransformValue::appendScale const):
(WebCore::SVGTransformValue::appendRotate const):
(WebCore::SVGTransformValue::appendSkewX const):
(WebCore::SVGTransformValue::appendSkewY const):
(WebCore::SVGTransformValue::matrix): Deleted.
* svg/SVGTransformable.cpp:
(WebCore::SVGTransformable::parseAndSkipType):
(WebCore::parseAndSkipType): Deleted.
(WebCore::SVGTransformable::parseTransformAttribute): Deleted.
The code of this function was moved to SVGTransformList::parse().
* svg/SVGTransformable.h:
There is no need for enum TransformParsingMode. It was used by
SVGViewSpec::parseViewSpec() to tell SVGTransformable::parseTransformAttribute()
not to clear the list. SVGTransfromList now has two parse() functions:
one public and the second is private. The public one clear the list
before parsing the input String. The private one just does the parsing.
SVGViewSpec::parseViewSpec() calls the private once since it is a friend
of SVGTransfromList.
* svg/SVGValue.h: Removed.
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec):
(WebCore::SVGViewSpec::reset):
(WebCore::SVGViewSpec::parseViewSpec):
(WebCore::SVGViewSpec::registerAttributes): Deleted.
(WebCore::SVGViewSpec::transform): Deleted.
* svg/SVGViewSpec.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h: Removed.
* svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
(WebCore::SVGAnimationTransformListFunction::progress):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGMatrixTearOff.h: Removed.
* svg/properties/SVGPropertyAccessorImpl.h:
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-04-01 Devin Rousso <drousso@apple.com>
Web Inspector: DOMDebugger: breakpoints for attribute modifications still fire when breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=196456
<rdar://problem/49489747>
Reviewed by Joseph Pecoraro.
Test: inspector/dom-debugger/dom-breakpoints.html
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr):
(WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
2019-04-01 Wenson Hsieh <wenson_hsieh@apple.com>
Unable to copy and paste a PDF from Notes into Mail compose body
https://bugs.webkit.org/show_bug.cgi?id=196442
<rdar://problem/48573098>
Reviewed by Tim Horton.
Refactor some logic for inserting attachment elements upon paste or drop. Currently, we only prefer inserting
content as attachment elements if the items are annotated with UIPreferredPresentationStyleAttachment. However,
many data sources around the system (both first and third party) have not adopted this API, which makes it
difficult to determine whether a given item provider should be treated as a file or not. In this bug in
particular, no preferred presentation style is set, so we fail to handle the paste command by inserting an
attachment element.
However, most apps around the system that write file or attachment-like data to the pasteboard will at least
offer a suggested name for the file, in the form of -[NSItemProvider suggestedName]. To address this, instead of
relying solely on the preferredPresentationStyle, additionally take a suggested name as an indicator that the
item is probably a file.
In fact, Pasteboard::fileContentState already has similar logic to check for either a suggested file name or
explicitly specified presentation style. We pull this out into a separate helper method on PasteboardItemInfo,
and use it for both Pasteboard::fileContentState and prefersAttachmentRepresentation.
Tests: WKAttachmentTestsIOS.InsertPastedContactAsAttachment
WKAttachmentTestsIOS.InsertPastedMapItemAsAttachment
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::mimeTypeFromContentType):
Work around <rdar://problem/49478229> by using the "text/vcard" MIME type to handle "public.vcard". CoreServices
currently maps "public.vcard" to "text/directory" when using UTTypeCopyPreferredTagWithClass, despite the SPI
-[NSURLFileTypeMappings MIMETypeForExtension:] returning "text/vcard" for a ".vcf" file.
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::canBeTreatedAsAttachmentOrFile const):
Add a helper method to determine whether the PasteboardItemInfo prefers to be represented as inline data, or an
attachment, or neither. This differs slightly from the existing value of preferredPresentationStyle in that we
consider having a suggested file name as a strong indicator that the item should be treated as an attachment,
even if the presentation style is unspecified.
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
* platform/ios/PasteboardIOS.mm:
(WebCore::prefersAttachmentRepresentation):
Use PasteboardItemInfo::canBeTreatedAsAttachmentOrFile().
2019-04-01 Tim Horton <timothy_horton@apple.com>
Make UIWKDocumentContext rects per-character instead of per-word
https://bugs.webkit.org/show_bug.cgi?id=196459
Reviewed by Wenson Hsieh.
No new tests; adjusted expected results of WebKit.DocumentEditingContext.
* editing/TextIterator.cpp:
(WebCore::CharacterIterator::CharacterIterator):
* editing/TextIterator.h:
(WebCore::CharacterIterator::atEnd const):
(WebCore::CharacterIterator::text const):
Add WEBCORE_EXPORT to some things.
Introduce a CharacterIterator constructor that takes Positions, like one that TextIterator has.
Move initializers to the header.
2019-04-01 Antti Koivisto <antti@apple.com>
Update event region when toggling pointer-events:none
https://bugs.webkit.org/show_bug.cgi?id=195902
<rdar://problem/48988384>
Reviewed by Simon Fraser.
Test: fast/scrolling/ios/event-region-pointer-events.html
Normally paint invalidation requests compositing configuration update whenever anything that would
affect event region changes. However mutating 'pointer-events' property does not cause paint invalidation.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
Request compositing update explicitly from the containing layer.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::invalidateEventRegion):
* rendering/RenderLayer.h:
2019-04-01 Chris Dumez <cdumez@apple.com>
Support "noreferrer" for window.open()
https://bugs.webkit.org/show_bug.cgi?id=194533
Reviewed by Geoffrey Garen.
Support "noreferrer" for window.open() as per:
- https://github.com/whatwg/html/pull/4331
Tests: imported/w3c/web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noreferrer.html
http/wpt/html/browsers/the-window-object/window-open-noopener-webkit.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/WindowFeatures.cpp:
(WebCore::setWindowFeature):
* page/WindowFeatures.h:
2019-04-01 Said Abou-Hallawa <sabouhallawa@apple.com>
SVGMatrix.IDL methods do not conform to the specs
https://bugs.webkit.org/show_bug.cgi?id=196263
Reviewed by Simon Fraser.
I think there was a misconception about these functions. The specs link
is: https://www.w3.org/TR/SVG11/coords.html#InterfaceSVGMatrix.
Notice that the specs does not state that the SVGMethod methods should
raise the exception NO_MODIFICATION_ALLOWED_ERR if the object is read
only. Notice setting the attribute 'a' for example may raise this
exception. Therefore, I think the specs wanted to make these operations
read-only. None of the methods should raise the exception
NO_MODIFICATION_ALLOWED_ERR.
In fact the SVG code was doing the right thing. For example SVGMatrix::scale()
was calling SVGMatrixValue::scale() which was making a copy of itself,
applying the scale on the copy and then returning the copy. When
SVGMatrix::scale() receives the copy of the SVGMatrixValue it creates and
returns a new SVGMatrix object.
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGMatrix.h:
(WebCore::SVGMatrix::create):
(WebCore::SVGMatrix::a const):
(WebCore::SVGMatrix::b const):
(WebCore::SVGMatrix::c const):
(WebCore::SVGMatrix::d const):
(WebCore::SVGMatrix::e const):
(WebCore::SVGMatrix::f const):
(WebCore::SVGMatrix::multiply const):
(WebCore::SVGMatrix::inverse const):
(WebCore::SVGMatrix::translate const):
(WebCore::SVGMatrix::scale const):
(WebCore::SVGMatrix::scaleNonUniform const):
(WebCore::SVGMatrix::rotate const):
(WebCore::SVGMatrix::rotateFromVector const):
(WebCore::SVGMatrix::flipX const):
(WebCore::SVGMatrix::flipY const):
(WebCore::SVGMatrix::skewX const):
(WebCore::SVGMatrix::skewY const):
(WebCore::SVGMatrix::a): Deleted.
(WebCore::SVGMatrix::b): Deleted.
(WebCore::SVGMatrix::c): Deleted.
(WebCore::SVGMatrix::d): Deleted.
(WebCore::SVGMatrix::e): Deleted.
(WebCore::SVGMatrix::f): Deleted.
(WebCore::SVGMatrix::multiply): Deleted.
(WebCore::SVGMatrix::inverse): Deleted.
(WebCore::SVGMatrix::translate): Deleted.
(WebCore::SVGMatrix::scale): Deleted.
(WebCore::SVGMatrix::scaleNonUniform): Deleted.
(WebCore::SVGMatrix::rotate): Deleted.
(WebCore::SVGMatrix::rotateFromVector): Deleted.
(WebCore::SVGMatrix::flipX): Deleted.
(WebCore::SVGMatrix::flipY): Deleted.
(WebCore::SVGMatrix::skewX): Deleted.
(WebCore::SVGMatrix::skewY): Deleted.
(WebCore::SVGMatrix::SVGMatrix): Deleted.
* svg/SVGMatrix.idl:
* svg/SVGMatrixValue.h: Removed.
* svg/SVGTransform.cpp:
(WebCore::SVGTransform::matrix):
* svg/SVGTransformDistance.cpp:
(WebCore::SVGTransformDistance::addToSVGTransform const):
* svg/SVGTransformValue.h:
(WebCore::SVGTransformValue::matrix const):
(WebCore::SVGTransformValue::matrix):
(WebCore::SVGTransformValue::svgMatrix): Deleted.
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.
* svg/properties/SVGMatrixTearOff.h:
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::propertyReference const):
2019-04-01 Simon Fraser <simon.fraser@apple.com>
Plumb through a ScrollType value that indicates whether a scroll was a user or programmatic scroll
https://bugs.webkit.org/show_bug.cgi?id=196424
Reviewed by Zalan Bujtas.
In preparation for fixing webkit.org/b/195584, we need to know if an overflow scroll
is programmatic, so plumb through an enum value. The functions touched by this patch are
only ever called for programmatic scrolls.
* dom/Element.cpp:
(WebCore::Element::scrollTo):
(WebCore::Element::setScrollLeft):
(WebCore::Element::setScrollTop):
* platform/ScrollTypes.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::setScrollLeft):
(WebCore::RenderBox::setScrollTop):
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollToXPosition):
(WebCore::RenderLayer::scrollToYPosition):
* rendering/RenderLayer.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::setScrollLeft):
(WebCore::RenderListBox::setScrollTop):
* rendering/RenderListBox.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::setScrollLeft):
(WebCore::RenderTextControlSingleLine::setScrollTop):
* rendering/RenderTextControlSingleLine.h:
2019-04-01 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Refactor some logic for inserting pasted or dropped virtual card files as attachment elements
https://bugs.webkit.org/show_bug.cgi?id=196435
Work towards <rdar://problem/48573098>
Reviewed by Darin Adler.
Refactor some existing codepaths on iOS for inserting VCard files as attachment elements. Instead of using a
separate readVirtualContactFile method for converting a vcard file or data into an attachment element (possibly
accompanied by a link), use the existing readFilePaths WebContentReader method.
To handle links which may accompany the attachment element, add a helper method in PasteboardIOS that reads a
titled URL prior to inserting an attachment element, in the case of pasting or dropping a VCF.
This means we no longer need to handle attachment reading in readPasteboardWebContentDataForType, so we can
simply bail before reading "public.vcard" here and defer to reading other data types.
Covered by existing API tests in WKAttachmentTests and DragAndDropTestsIOS.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readVirtualContactFile): Deleted.
* platform/Pasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::readURLAlongsideAttachmentIfNecessary):
(WebCore::prefersAttachmentRepresentation):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
2019-04-01 Antti Koivisto <antti@apple.com>
Trying to scroll the compose pane on gmail.com scrolls the message list behind
https://bugs.webkit.org/show_bug.cgi?id=196426
<rdar://problem/49402667>
Reviewed by Darin Adler.
Test: fast/scrolling/ios/event-region-visibility-hidden.html
We fail to gather event region from desdendants of non-overflowing elements with 'visibility:hidden'.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
Skip the subtree walk only if the current region covers the box already.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):
Remove the (wrong) optimization, we bail out quickly on first renderer if possible so this is not high value.
2019-04-01 Emilio Cobos Álvarez <emilio@crisal.io>
Be less strict about closing blocks in attribute and functional pseudo-element selectors.
https://bugs.webkit.org/show_bug.cgi?id=142167
Reviewed by Antti Koivisto.
This was also an issue for, e.g., "::slotted(foo", turns out.
This matches Chromium, Firefox, and the spec:
https://drafts.csswg.org/css-syntax/#parse-error:
> Certain points in the parsing algorithm are said to be parse errors. The error
> handling for parse errors is well-defined: user agents must either act as
> described below when encountering such problems, or must abort processing at
> the first error that they encounter for which they do not wish to apply the
> rules described below.
https://drafts.csswg.org/css-syntax/#consume-simple-block:
> <EOF-token>
> This is a parse error. Return the block.
Tests: web-platform-tests/dom/nodes/selectors.js (and probably others)
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeAttribute):
(WebCore::CSSSelectorParser::consumePseudo):
2019-04-01 Pablo Saavedra <psaavedra@igalia.com>
Build failure after r243644 in GTK Linux 64-bit stable builds
https://bugs.webkit.org/show_bug.cgi?id=196440
Reviewed by Philippe Normand.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
2019-03-31 Manuel Rego Casasnovas <rego@igalia.com>
Scroll position gets reset when overflow:scroll is inside grid
https://bugs.webkit.org/show_bug.cgi?id=196337
<rdar://problem/49385784>
Reviewed by Simon Fraser.
Fix scroll position when there are changes inside a grid item with "overflow: scroll".
Test: fast/css-grid-layout/grid-item-content-scroll-position.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock): Use beginUpdateScrollInfoAfterLayoutTransaction()
and endAndCommitUpdateScrollInfoAfterLayoutTransaction().
2019-03-31 Ryosuke Niwa <rniwa@webkit.org>
Reduce the size of Node::deref by eliminating an explicit parentNode check
https://bugs.webkit.org/show_bug.cgi?id=195776
Reviewed by Darin Adler.
Address post-commit review comments.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::removedLastRef):
* dom/Node.h:
(WebCore::Node::deref):
(WebCore::Node::setParentNode):
2019-03-31 Sam Weinig <weinig@apple.com>
Remove more i386 specific configurations
https://bugs.webkit.org/show_bug.cgi?id=196430
Reviewed by Alexey Proskuryakov.
* Configurations/FeatureDefines.xcconfig:
ENABLE_WEB_AUTHN_macosx can now be enabled unconditionally on macOS.
2019-03-31 Andy Estes <aestes@apple.com>
[iOS] WebKit should consult the navigation response policy delegate before previewing a QuickLook document
https://bugs.webkit.org/show_bug.cgi?id=196433
<rdar://problem/49293305>
Reviewed by Tim Horton.
When ResourceLoader would encounter a response with a MIME type that QuickLook supports, the
response would be implicitly allowed and a QuickLook preview would be generated. After
generating, the client's navigation response policy delegate would be notified of the
preview response, but not the underlying response. Notably, the preview response has a URL
scheme of "x-apple-ql-id", does not include any underlying HTTP headers, and usually has a
MIME type of "text/html" or "application/pdf" rather than the underlying response MIME type.
To allow clients to make better navigation response policy decisions, this patch changes the
above behavior for WKWebView clients that have linked against a version of WebKit that
includes this change. Rather than notifying the client's navigation response policy delegate
of the preview response, we notify the client of the underlying response. Only if the client
responds with a policy of "allow" will the QuickLook preview response be loaded (without
another call to the navigation response policy delegate).
Non-WKWebView clients and clients that have linked against a version of WebKit that does not
include this change will retain the original behavior.
Covered by existing layout tests and new and existing API tests.
* WebCore.xcodeproj/project.pbxproj:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse const):
(WebCore::SubresourceLoader::didReceiveResponse):
* loader/ios/PreviewLoader.h:
* loader/ios/PreviewLoader.mm:
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
(-[WebPreviewLoader _loadPreviewIfNeeded]):
(-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
(-[WebPreviewLoader connectionDidFinishLoading:]):
(-[WebPreviewLoader connection:didFailWithError:]):
(WebCore::PreviewLoader::create):
(WebCore::PreviewLoader::didReceiveResponse):
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]): Deleted.
(WebCore::PreviewLoader::shouldCreateForMIMEType): Deleted.
* page/Settings.yaml:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::canShowMIMEType):
* platform/network/ios/PreviewConverter.h:
* platform/network/ios/PreviewConverter.mm:
(WebCore::PreviewConverter::supportsMIMEType):
2019-03-29 Dean Jackson <dino@apple.com>
gl.readPixels with type gl.FLOAT does not work
https://bugs.webkit.org/show_bug.cgi?id=171432
<rdar://problem/31905150>
Reviewed by Antoine Quint.
Our validation code was identifying readPixels of
type FLOAT as invalid, for three reasons:
- we didn't support the FLOAT type at all.
- we only allowed the combination of RGBA and
UNSIGNED_BYTE in WebGL 1 [*].
- if we had a framebuffer of format RGBA, we assumed
we could only read into a Uint8 ArrayBuffer.
[*] This bug isn't completely fixed, so I opened
https://bugs.webkit.org/show_bug.cgi?id=196418
Test: fast/canvas/webgl/readPixels-float.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::readPixels):
- flip the logic in a conditional that was clearly wrong yet
thankfully had no impact.
- support type FLOAT when the relevant extension is enabled.
- allow FLOAT as a valid type (see new bug above)
- create a new macro for CHECK_COMPONENT_COUNT
- update the existing macros to not be case statements,
so that we can put logic in the switch.
2019-03-30 Antti Koivisto <antti@apple.com>
Try to fix Windows build.
* platform/graphics/RoundedRect.cpp:
(WebCore::approximateAsRegion):
2019-03-30 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: JSC Sampling Profiler thread not getting subtracted in CPU Usage Timeline
https://bugs.webkit.org/show_bug.cgi?id=196419
<rdar://problem/49444023>
Reviewed by Devin Rousso.
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::addObserver):
We forgot to call the function that would setup platform state
allowing us to subtract out the sampling profiler thread.
2019-03-30 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Add iFrame elements to the list of "considered clickable" elements.
https://bugs.webkit.org/show_bug.cgi?id=196410
<rdar://problem/49436828>
Reviewed by Simon Fraser.
163.com constructs an iFrame to display the login pane on hover. This patch ensures that we take iFrames into account while observing for visible content change by considering iFrame elements "clickable".
(While iFrames don't necessarily have clickable content, we can't just sit and wait until they are fully loaded.)
Test: fast/events/touch/ios/content-observation/iframe-is-shown-on-hover.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2019-03-30 Antti Koivisto <antti@apple.com>
Try to fix Windows build.
* platform/graphics/Region.cpp:
* platform/graphics/RoundedRect.cpp:
2019-03-30 Antti Koivisto <antti@apple.com>
Hit-testing of boxes over scrollers should account for border-radius
https://bugs.webkit.org/show_bug.cgi?id=195374
<rdar://problem/48649993>
Reviewed by Simon Fraser.
Test: fast/scrolling/ios/border-radious-event-region.html
* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
Testing support.
* platform/graphics/GraphicsLayerClient.h:
* platform/graphics/RoundedRect.cpp:
(WebCore::approximateAsRegion):
Add a function to approximate RoundedRects as Regions.
It cuts away rectangles from the corners following the corner shapes.
More rectangles are cut for larger radii.
* platform/graphics/RoundedRect.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
Use the new interface to get rounded corners right.
In rectangle case this takes optimized paths.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:
2019-03-29 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Expand DOM timer observation to 350ms
https://bugs.webkit.org/show_bug.cgi?id=196411
<rdar://problem/49391144>
Reviewed by Simon Fraser.
imdb.com main page has 350ms hover intent timer to bring up the hover menus around the search bar.
Test: fast/events/touch/ios/content-observation/350ms-hover-intent.html
* page/ios/ContentChangeObserver.cpp:
2019-03-29 John Wilander <wilander@apple.com>
Move WebResourceLoadStatisticsStore IPC calls from the UI process to the network process
https://bugs.webkit.org/show_bug.cgi?id=196407
<rdar://problem/47859936>
Reviewed by Brent Fulgham.
Test: http/tests/storageAccess/grant-storage-access-under-opener-at-popup-user-gesture.html
This patch removes old code for the batching into "statistics updated" calls.
Since the move of Resource Load Statistics to the network process, all such
collection is done directly through dedicated calls to the network process.
The remaining functionality was renamed to make it more clear, i.e.
ResourceLoadObserver::notifyObserver() renamed to
ResourceLoadObserver::updateCentralStatisticsStore().
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setStatisticsUpdatedCallback):
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
(WebCore::ResourceLoadObserver::updateCentralStatisticsStore):
(WebCore::ResourceLoadObserver::clearState):
(WebCore::ResourceLoadObserver::setNotificationCallback): Deleted.
(WebCore::ResourceLoadObserver::ResourceLoadObserver): Deleted.
(WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded): Deleted.
(WebCore::ResourceLoadObserver::notifyObserver): Deleted.
* loader/ResourceLoadObserver.h:
* testing/Internals.cpp:
(WebCore::Internals::notifyResourceLoadObserver):
2019-03-29 Chris Dumez <cdumez@apple.com>
Make someWindow.frames, .self, .window always return someWindow
https://bugs.webkit.org/show_bug.cgi?id=195406
Reviewed by Alex Christensen.
Make someWindow.frames, .self, .window always return someWindow. Previously, they
would return null when the window would lose its browsing context.
This aligns our behavior with Firefox and the HTML specification:
- https://github.com/whatwg/html/pull/4410
Chrome has also recently aligned with Firefox and the HTML specification here so
it makes sense for WebKit to follow.
No new tests, rebaselined existing tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::self const):
(WebCore::JSDOMWindow::window const):
(WebCore::JSDOMWindow::frames const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::focus):
* page/DOMWindow.h:
* page/DOMWindow.idl:
2019-03-29 Myles C. Maxfield <mmaxfield@apple.com>
Delete WebMetal implementation in favor of WebGPU
https://bugs.webkit.org/show_bug.cgi?id=195418
Reviewed by Dean Jackson.
WebMetal was only ever intended to be a proof-of-concept, and was never intended to be shipped.
Now that our WebGPU implementation is achieving good functionality, we're hitting conflicts
because we have both implementations. We should delete the non-standard implementation in favor
of the standards-based implementation.
Deletes relevant tests.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Removed.
* bindings/js/JSWebMetalRenderingContextCustom.cpp: Removed.
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebMetalType): Deleted.
(WebCore::HTMLCanvasElement::createContextWebMetal): Deleted.
(WebCore::HTMLCanvasElement::getContextWebMetal): Deleted.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGPU const):
(WebCore::CanvasRenderingContext::isWebMetal const): Deleted.
* html/canvas/WebMetalBuffer.cpp: Removed.
* html/canvas/WebMetalBuffer.h: Removed.
* html/canvas/WebMetalBuffer.idl: Removed.
* html/canvas/WebMetalCommandBuffer.cpp: Removed.
* html/canvas/WebMetalCommandBuffer.h: Removed.
* html/canvas/WebMetalCommandBuffer.idl: Removed.
* html/canvas/WebMetalCommandQueue.cpp: Removed.
* html/canvas/WebMetalCommandQueue.h: Removed.
* html/canvas/WebMetalCommandQueue.idl: Removed.
* html/canvas/WebMetalComputeCommandEncoder.cpp: Removed.
* html/canvas/WebMetalComputeCommandEncoder.h: Removed.
* html/canvas/WebMetalComputeCommandEncoder.idl: Removed.
* html/canvas/WebMetalComputePipelineState.cpp: Removed.
* html/canvas/WebMetalComputePipelineState.h: Removed.
* html/canvas/WebMetalComputePipelineState.idl: Removed.
* html/canvas/WebMetalDepthStencilDescriptor.cpp: Removed.
* html/canvas/WebMetalDepthStencilDescriptor.h: Removed.
* html/canvas/WebMetalDepthStencilDescriptor.idl: Removed.
* html/canvas/WebMetalDepthStencilState.cpp: Removed.
* html/canvas/WebMetalDepthStencilState.h: Removed.
* html/canvas/WebMetalDepthStencilState.idl: Removed.
* html/canvas/WebMetalDrawable.cpp: Removed.
* html/canvas/WebMetalDrawable.h: Removed.
* html/canvas/WebMetalDrawable.idl: Removed.
* html/canvas/WebMetalEnums.cpp: Removed.
* html/canvas/WebMetalEnums.h: Removed.
* html/canvas/WebMetalEnums.idl: Removed.
* html/canvas/WebMetalFunction.cpp: Removed.
* html/canvas/WebMetalFunction.h: Removed.
* html/canvas/WebMetalFunction.idl: Removed.
* html/canvas/WebMetalLibrary.cpp: Removed.
* html/canvas/WebMetalLibrary.h: Removed.
* html/canvas/WebMetalLibrary.idl: Removed.
* html/canvas/WebMetalRenderCommandEncoder.cpp: Removed.
* html/canvas/WebMetalRenderCommandEncoder.h: Removed.
* html/canvas/WebMetalRenderCommandEncoder.idl: Removed.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Removed.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Removed.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Removed.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Removed.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Removed.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Removed.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Removed.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Removed.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Removed.
* html/canvas/WebMetalRenderPassDescriptor.cpp: Removed.
* html/canvas/WebMetalRenderPassDescriptor.h: Removed.
* html/canvas/WebMetalRenderPassDescriptor.idl: Removed.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Removed.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Removed.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Removed.
* html/canvas/WebMetalRenderPipelineDescriptor.cpp: Removed.
* html/canvas/WebMetalRenderPipelineDescriptor.h: Removed.
* html/canvas/WebMetalRenderPipelineDescriptor.idl: Removed.
* html/canvas/WebMetalRenderPipelineState.cpp: Removed.
* html/canvas/WebMetalRenderPipelineState.h: Removed.
* html/canvas/WebMetalRenderPipelineState.idl: Removed.
* html/canvas/WebMetalRenderingContext.cpp: Removed.
* html/canvas/WebMetalRenderingContext.h: Removed.
* html/canvas/WebMetalRenderingContext.idl: Removed.
* html/canvas/WebMetalSize.h: Removed.
* html/canvas/WebMetalSize.idl: Removed.
* html/canvas/WebMetalTexture.cpp: Removed.
* html/canvas/WebMetalTexture.h: Removed.
* html/canvas/WebMetalTexture.idl: Removed.
* html/canvas/WebMetalTextureDescriptor.cpp: Removed.
* html/canvas/WebMetalTextureDescriptor.h: Removed.
* html/canvas/WebMetalTextureDescriptor.idl: Removed.
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::contextAsScriptValue):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebMetalEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webMetalEnabled const): Deleted.
* platform/Logging.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
* platform/graphics/cocoa/WebMetalLayer.h: Removed.
* platform/graphics/cocoa/WebMetalLayer.mm: Removed.
* platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyBuffer.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyDevice.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyDrawable.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyEnums.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyFunction.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyLibrary.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Removed.
* platform/graphics/gpu/legacy/GPULegacySize.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyTexture.h: Removed.
* platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Removed.
* platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Removed.
* platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Removed.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebMetalEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2019-03-29 Devin Rousso <drousso@apple.com>
Web Inspector: add fast returns for instrumentation hooks that have no affect before a frontend is connected
https://bugs.webkit.org/show_bug.cgi?id=196382
<rdar://problem/49403417>
Reviewed by Joseph Pecoraro.
Ensure that all instrumentation hooks use `FAST_RETURN_IF_NO_FRONTENDS` or check that
`developerExtrasEnabled`. There should be no activity to/from any inspector objects until
developer extras are enabled.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorld):
(WebCore::InspectorInstrumentation::scriptExecutionBlockedByCSP):
(WebCore::InspectorInstrumentation::domContentLoadedEventFired):
(WebCore::InspectorInstrumentation::loadEventFired):
(WebCore::InspectorInstrumentation::frameDetachedFromParent):
(WebCore::InspectorInstrumentation::loaderDetachedFromFrame):
(WebCore::InspectorInstrumentation::frameStartedLoading):
(WebCore::InspectorInstrumentation::frameStoppedLoading):
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::frameWindowDiscardedImpl):
(WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
(WebCore::InspectorInstrumentation::didFailLoadingImpl):
(WebCore::InspectorInstrumentation::addMessageToConsoleImpl):
(WebCore::InspectorInstrumentation::consoleCountImpl):
(WebCore::InspectorInstrumentation::startConsoleTimingImpl):
(WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::frameWindowDiscarded):
2019-03-29 Chris Dumez <cdumez@apple.com>
Set window.closed immediately when close() is invoked
https://bugs.webkit.org/show_bug.cgi?id=195409
Reviewed by Alex Christensen.
Window.closed should return true if it is closing:
- https://html.spec.whatwg.org/#dom-window-closed
Window.close() sets the 'is closing' flag to true synchronously, as per:
- https://html.spec.whatwg.org/#dom-window-close (step 3.1)
No new tests, rebaselined existing tests.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::closed const):
2019-03-29 Zalan Bujtas <zalan@apple.com>
[Simple line layout] Turn off inline boxtree generation for multiline content
https://bugs.webkit.org/show_bug.cgi?id=196404
<rdar://problem/49234033>
Reviewed by Simon Fraser.
Currently simple line layout can't provide the correct line breaking context to the inline tree when the boxtree is
generated using the simple line runs. This patch limits the generation of such trees to single lines. Multiline content will
go through the "let's layout this content again" codepath.
This patch fixes disappearing content on Questar.
Test: fast/text/simple-line-layout-and-multiline-inlineboxtree.html
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::canUseForLineBoxTree):
2019-03-29 Justin Fan <justin_fan@apple.com>
[Web GPU] Replace unsigned longs in WebGPU with uint64_t
https://bugs.webkit.org/show_bug.cgi?id=196401
Reviewed by Myles C. Maxfield.
Unsigned long is not guaranteed to be 64 bits on all platforms. In addition, rowPitch is updated
to u32 in the API and the implementation to match.
No new tests. No new behavior.
* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::setSubData):
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUBufferBinding.h:
* Modules/webgpu/WebGPUCommandEncoder.cpp:
(WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
* Modules/webgpu/WebGPUCommandEncoder.h:
* Modules/webgpu/WebGPUCommandEncoder.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* platform/graphics/gpu/GPUBindGroupLayout.h:
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::byteLength const):
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUBufferDescriptor.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::setSubData):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):
2019-03-29 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION (r243250): Text interactions are no longer suppressed when editing in some websites
https://bugs.webkit.org/show_bug.cgi?id=196378
<rdar://problem/49231299>
Reviewed by Simon Fraser.
Enabling async overflow scrolling by default in r243250 exposed an issue with hidden editable area detection
heuristics. Currently, an empty value for RenderLayer::selfClipRect is used to determine whether the layer
enclosing the editable element or form control is completely clipped by a parent (in other words, the clip rect
is empty). With async overflow scrolling, the enclosing layer of the editable element (as seen in the websites
affected by this bug) will now be a clipping root for painting, since it is composited. This means selfClipRect
returns a non-empty rect despite the layer being entirely clipped, which negates the heuristic.
To address this, we adjust the clipping heuristic to instead walk up the layer tree (crossing frame boundaries)
and look for enclosing ancestors with overflow clip. For each layer we find with an overflow clip, compute the
clip rect of the previous layer relative to the ancestor with overflow clip. If the clipping rect is empty, we
know that the layer is hidden.
This isn't a perfect strategy, since it may still report false negatives (reporting a layer as visible when it
is not) in some cases. One such edge case is a series of overflow hidden containers, nested in such a way that
each container is only partially clipped relative to its ancestor, but the deepest layer is completely clipped
relative to the topmost layer. However, this heuristic is relatively cheap (entailing a layer tree walk at
worst) and works for common use cases on the web without risking scenarios in which text selection that
shouldn't be suppressed ends up becoming suppressed.
Test: editing/selection/ios/hide-selection-in-textarea-with-transform.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::isTransparentOrFullyClippedRespectingParentFrames const):
2019-03-29 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Add Server Trust Evaluation Support.
https://bugs.webkit.org/show_bug.cgi?id=191646
Reviewed by Fujii Hironori.
Tests: http/tests/ssl/iframe-upgrade.https.html
http/tests/ssl/mixedContent/insecure-websocket.html
http/tests/ssl/upgrade-origin-usage.html
* platform/network/curl/AuthenticationChallenge.h:
* platform/network/curl/AuthenticationChallengeCurl.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::protectionSpaceForPasswordBased):
(WebCore::AuthenticationChallenge::protectionSpaceForServerTrust):
(WebCore::AuthenticationChallenge::protectionSpaceFromHandle): Deleted.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::disableServerTrustEvaluation):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::disableServerTrustEvaluation):
2019-03-29 Ryosuke Niwa <rniwa@webkit.org>
Pasting a table from Confluence strip of table cell content
https://bugs.webkit.org/show_bug.cgi?id=196390
Reviewed by Antti Koivisto.
The bug was ultimately caused by FrameView of the document we use to sanitize the pasteboard content
having 0px by 0px dimension. This caused div with `overflow-x: auto` surrounding a table to have
the height of 0px. Because StyledMarkupAccumulator::renderedTextRespectingRange uses TextIterator
to serialize a text node and this div was an ancestor of the text node, TextIterator::handleTextNode
ended up exiting early.
Fixed the bug by giving FrameView, which is used to sanitize the content, a dimension of 800px by 600px.
Using TextIteratorIgnoresStyleVisibility is not a great alternative since removing invisible content
during paste is an important privacy feature.
Test: editing/pasteboard/paste-content-with-overflow-auto-parent-across-origin.html
* editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent):
2019-03-29 Antoine Quint <graouts@apple.com>
WebKitTestRunner crashes when running pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
https://bugs.webkit.org/show_bug.cgi?id=196345
Reviewed by Dean Jackson.
An enum used within a WTF::OptionSet needs to have only power-of-two values that are larger than 0.
* platform/TouchAction.h:
* rendering/style/StyleRareNonInheritedData.h:
2019-03-29 Michael Catanzaro <mcatanzaro@igalia.com>
HTMLInputElement::setEditingValue should not fail if renderer doesn't exist
https://bugs.webkit.org/show_bug.cgi?id=195708
Reviewed by Wenson Hsieh.
HTMLInputElement::setEditingValue currently returns early if the element's renderer() is
null. This is causing the Epiphany password manager to fail to remember passwords on
https://www.geico.com/ except for navigations through page cache.
This check was originally added to avoid some assertion, but I don't know which one, and
there's definitely not any assertion hit nowadays in this case. Probably there are more
guards checking if renderer() is null elsewhere in the code nowadays, closer to where it's
really needed.
Test: fast/forms/editing-value-null-renderer.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setEditingValue):
2019-03-29 Chris Dumez <cdumez@apple.com>
Unreviewed, rebaseline WPT test after r243638.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2019-03-28 Antoine Quint <graouts@apple.com>
All PointerEvent.isTrusted is always false.
https://bugs.webkit.org/show_bug.cgi?id=196075
<rdar://problem/49158778>
Reviewed by Chris Dumez.
Test: pointerevents/ios/pointer-events-is-trusted.html
The constructors we were using for some PointerEvent::create() methods were using initializers which are expected to be used with JS APIs
and thus generate untrusted events. We switch to using constructors using dedicated parameters which will set isTrusted to true.
* dom/PointerEvent.cpp:
(WebCore::PointerEvent::create):
(WebCore::PointerEvent::createPointerCancelEvent):
(WebCore::PointerEvent::PointerEvent):
(WebCore::m_isPrimary):
(WebCore::m_pointerType):
* dom/PointerEvent.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::cancelPointer):
2019-03-29 Philippe Normand <pnormand@igalia.com>
[GStreamer] imxvpudecoder detection and handling
https://bugs.webkit.org/show_bug.cgi?id=196346
Reviewed by Xabier Rodriguez-Calvar.
When the imxvpudecoder is used, the texture sampling of the
directviv-uploaded texture returns an RGB value, so there's no need
to convert it. This patch also includes a refactoring of the
ImageRotation flag handling. The flag is now computed once only
and stored in an instance variable.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
(WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
(WebCore::MediaPlayerPrivateGStreamerBase::setVideoSourceOrientation):
(WebCore::MediaPlayerPrivateGStreamerBase::updateTextureMapperFlags):
(WebCore::texMapFlagFromOrientation): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2019-03-29 Cathie Chen <cathiechen@igalia.com>
Implement ResizeObserver.
https://bugs.webkit.org/show_bug.cgi?id=157743
Reviewed by Simon Fraser.
Tests: resize-observer/modify-frametree-in-callback.html
resize-observer/multi-frames.html
resize-observer/observe-element-from-other-frame.html
Imported from WPT by https://bugs.webkit.org/show_bug.cgi?id=193821
The data structure: Document has a ResizeObserver slot. ResizeObserver has a ResizeObservation slot.
ResizeObservation is related to one Element and the last reported size.
On the other hand, Element has a ResizeObservation slot.
At the beginning of willDisplayPage, it will check resize observations for current page if:
1. There is FrameView be layout and there are ResizeObservers in this page.
2. m_resizeObserverTimer has been started by observe() or hasSkippedResizeObservers().
During checkResizeObservations(), we'll gatherDocumentsNeedingResizeObservationCheck() first,
then notifyResizeObservers() for each document. During notifyResizeObservers(), it will gather
the m_activeObservations whose size changed and target element deeper than require depth.
The size changed shallower observations are skipped observations which will be delivered
in the next time. And an ErrorEvent will be reported.
After gathering, deliverResizeObservations create entries and invoke the callbacks with them.
The Element from other document could be observed.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getParserLocation const):
(WebCore::Document::addResizeObserver):
(WebCore::Document::removeResizeObserver):
(WebCore::Document::hasResizeObservers):
(WebCore::Document::gatherResizeObservations): Gather m_activeObservations at depth and return the shallowest depth.
(WebCore::Document::deliverResizeObservations): Deliver m_activeObservations, generate ResizeObserverEntries, and invoke the m_callbacks.
(WebCore::Document::hasSkippedResizeObservations const): To determine if Document has the size changed but not delivered observations.
(WebCore::Document::setHasSkippedResizeObservations):
(WebCore::Document::scheduleResizeObservations):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::~Element):
(WebCore::Element::disconnectFromResizeObservers):
(WebCore::Element::ensureResizeObserverData):
(WebCore::Element::resizeObserverData):
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::resizeObserverData):
(WebCore::ElementRareData::setResizeObserverData):
(WebCore::ElementRareData::useTypes const):
* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layoutTimerFired): We need to start a ResizeObserver timer here, because for WK1 this might not trigger flushCompositingChanges.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::willDisplayPage):
(WebCore::Page::hasResizeObservers const):
(WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Gather the documents with resize observers.
(WebCore::Page::checkResizeObservations): Gather documents then notifyResizeObservers for each document.
(WebCore::Page::scheduleResizeObservations):
(WebCore::Page::notifyResizeObservers): Gather m_activeObservations and deliver them. Report ErrorEvent if it has skipped observations.
* page/Page.h:
(WebCore::Page::setNeedsCheckResizeObservations): Page needs to check ResizeObservations if FrameView layout or m_resizeObserverTimer has been started.
(WebCore::Page::needsCheckResizeObservations const):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):
(WebCore::getParserLocationForConsoleMessage): Deleted.
* page/ResizeObservation.cpp: Added.
(WebCore::ResizeObservation::create):
(WebCore::ResizeObservation::ResizeObservation):
(WebCore::ResizeObservation::~ResizeObservation):
(WebCore::ResizeObservation::updateObservationSize):
(WebCore::ResizeObservation::computeObservedSize const):
(WebCore::ResizeObservation::computeTargetLocation const):
(WebCore::ResizeObservation::computeContentRect const):
(WebCore::ResizeObservation::elementSizeChanged const):
(WebCore::ResizeObservation::targetElementDepth const):
* page/ResizeObservation.h: Copied from Tools/DumpRenderTree/TestOptions.h.
(WebCore::ResizeObservation::target const):
* page/ResizeObserver.cpp: Added.
(WebCore::ResizeObserver::create):
(WebCore::ResizeObserver::ResizeObserver):
(WebCore::ResizeObserver::~ResizeObserver):
(WebCore::ResizeObserver::scheduleObservations):
(WebCore::ResizeObserver::observe):
(WebCore::ResizeObserver::unobserve):
(WebCore::ResizeObserver::disconnect):
(WebCore::ResizeObserver::targetDestroyed):
(WebCore::ResizeObserver::gatherObservations):
(WebCore::ResizeObserver::deliverObservations):
(WebCore::ResizeObserver::removeTarget):
(WebCore::ResizeObserver::removeAllTargets):
(WebCore::ResizeObserver::removeObservation):
(WebCore::ResizeObserver::hasPendingActivity const):
(WebCore::ResizeObserver::activeDOMObjectName const):
(WebCore::ResizeObserver::canSuspendForDocumentSuspension const):
(WebCore::ResizeObserver::stop):
* page/ResizeObserver.h: Added.
(WebCore::ResizeObserver::hasObservations const):
(WebCore::ResizeObserver::hasActiveObservations const):
(WebCore::ResizeObserver::maxElementDepth):
(WebCore::ResizeObserver::hasSkippedObservations const):
(WebCore::ResizeObserver::setHasSkippedObservations):
* page/ResizeObserver.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
* page/ResizeObserverCallback.h: Copied from Tools/DumpRenderTree/TestOptions.h.
* page/ResizeObserverCallback.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
* page/ResizeObserverEntry.h: Copied from Tools/DumpRenderTree/TestOptions.h.
(WebCore::ResizeObserverEntry::create):
(WebCore::ResizeObserverEntry::target const):
(WebCore::ResizeObserverEntry::contentRect const):
(WebCore::ResizeObserverEntry::ResizeObserverEntry):
* page/ResizeObserverEntry.idl: Copied from Tools/DumpRenderTree/TestOptions.h.
* page/Settings.yaml:
2019-03-28 Chris Dumez <cdumez@apple.com>
Support <object>.contentWindow
https://bugs.webkit.org/show_bug.cgi?id=195562
Reviewed by Sam Weinig.
Support <object>.contentWindow as per:
- https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-object-contentwindow
No new tests, updated / rebaselined existing tests.
* html/HTMLObjectElement.idl:
2019-03-28 Myles C. Maxfield <mmaxfield@apple.com>
FontFace constructor throws an exception when there is a name which starts with a number
https://bugs.webkit.org/show_bug.cgi?id=196232
<rdar://problem/49293978>
Reviewed by Ryosuke Niwa.
We were technically following the spec, but Chrome and Firefox are both consistent and it was making a website break.
This is just a short-term fix until the underlying https://bugs.webkit.org/show_bug.cgi?id=196381 is fixed.
Test: fast/text/font-face-family.html
* css/FontFace.cpp:
(WebCore::FontFace::setFamily):
2019-03-28 Justin Fan <justin_fan@apple.com>
[Web GPU] Replace 'unsigned long' with 'unsigned' when implementing u32 variables
https://bugs.webkit.org/show_bug.cgi?id=194618
<rdar://problem/48055796>
Reviewed by Myles C. Maxfield.
WebIDL for "unsigned" on 64-bit is "unsigned long". Update Web GPU to match.
No new tests; no change in behavior.
* Modules/webgpu/GPUBindGroupLayoutBinding.h:
* Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp:
(WebCore::WHLSL::Metal::calculateVertexBufferIndex):
* Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h:
* Modules/webgpu/WebGPUBindGroupBinding.h:
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::validateBufferBindingType):
(WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::setSubData):
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUBufferBinding.h:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
(WebCore::WebGPURenderPassEncoder::draw):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* platform/graphics/gpu/GPUBindGroupBinding.h:
* platform/graphics/gpu/GPUBindGroupLayout.h:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUExtent3D.h:
* platform/graphics/gpu/GPULimits.h:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::GPUBindGroupLayout::tryCreate):
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::GPUBindGroup::tryCreate):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):
(WebCore::GPURenderPassEncoder::draw):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetInputStateForPipelineDescriptor):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::storageModeForPixelFormatAndSampleCount):
2019-03-28 Ryosuke Niwa <rniwa@webkit.org>
getBoundingClientRect always returns empty rect on a collapsed range
https://bugs.webkit.org/show_bug.cgi?id=196380
Reviewed by Wenson Hsieh.
The bug was caused by Range::boundingRect merging rects via FloatRect::unite which ignores empty rects.
Use uniteIfNonZero instead to fix the bug. Note that we can't use uniteEvenIfEmpty because that would
set x, y to always 0, 0 as we would end up merging any rect with the initial empty rect.
Test: fast/dom/Range/getBoundingClientRect-on-collapsed-selection-range.html
* dom/Range.cpp:
(WebCore::Range::boundingRect const):
2019-03-28 Justin Fan <justin_fan@apple.com>
[Web GPU] Prototype compute pipeline with MSL
https://bugs.webkit.org/show_bug.cgi?id=196107
<rdar://problem/46289650>
Reviewed by Myles Maxfield.
Add GPUComputePassEncoder, GPUComputePipeline, and GPUComputePipelineDescriptor.
Implement everything needed to prototype a compute pipeline in Web GPU using Metal shaders and bound resources.
Test: webgpu/compute-squares.html
Add files and symbols:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Misc fixes:
* Modules/webgpu/WHLSL/WHLSLNameResolver.h: Missing include.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Missing include.
* Modules/webgpu/WebGPUPipelineStageDescriptor.cpp: Added. Move pipeline stage validation logic here.
(WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const):
* Modules/webgpu/WebGPURenderPipeline.cpp: Remove unnecessary include.
* Modules/webgpu/WebGPURenderPipeline.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Add missing inlcude.
(WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const): Moved to WebGPUPipelineStageDescriptor.cpp.
* platform/graphics/gpu/GPUPipelineDescriptorBase.h: Add missing include.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Add missing include.
(WebCore::GPURenderPipeline::GPURenderPipeline): Remove unecessary ref of GPUPipelineLayout.
* platform/text/mac/TextEncodingRegistryMac.mm: Carbon.h was causing ambiguous reference build errors in this file.
Enable creating a GPUComputePassEncoder from a GPUCommandEncoder:
* Modules/webgpu/WebGPUCommandEncoder.cpp:
(WebCore::WebGPUCommandEncoder::beginRenderPass): No longer passing this WebGPUCommandEncoder to pass encoders.
(WebCore::WebGPUCommandEncoder::beginComputePass): Added.
* Modules/webgpu/WebGPUCommandEncoder.h:
* Modules/webgpu/WebGPUCommandEncoder.idl:
Add GPUComputePassEncoder:
* Modules/webgpu/WebGPUComputePassEncoder.cpp: Added.
(WebCore::WebGPUComputePassEncoder::create):
(WebCore::WebGPUComputePassEncoder::WebGPUComputePassEncoder):
(WebCore::WebGPUComputePassEncoder::setPipeline):
(WebCore::WebGPUComputePassEncoder::dispatch):
(WebCore::WebGPUComputePassEncoder::passEncoder):
(WebCore::WebGPUComputePassEncoder::passEncoder const):
* Modules/webgpu/WebGPUComputePassEncoder.h: Added.
* Modules/webgpu/WebGPUComputePassEncoder.idl: Added.
* platform/graphics/gpu/GPUComputePassEncoder.h: Added.
(WebCore::GPUComputePassEncoder::~GPUComputePassEncoder):
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Added.
(WebCore::GPUComputePassEncoder::tryCreate):
(WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
(WebCore::GPUComputePassEncoder::setPipeline):
(WebCore::GPUComputePassEncoder::dispatch): Use a default calculation for threadsPerThreadgroup while MSL is still an accepted shader format.
(WebCore::GPUComputePassEncoder::platformPassEncoder const):
(WebCore::GPUComputePassEncoder::useResource):
(WebCore::GPUComputePassEncoder::setComputeBuffer):
Add GPUComputePipeline:
* Modules/webgpu/WebGPUComputePipeline.cpp: Added.
(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
* Modules/webgpu/WebGPUComputePipeline.h: Added.
(WebCore::WebGPUComputePipeline::computePipeline const):
* Modules/webgpu/WebGPUComputePipeline.idl: Added.
* Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Added.
(WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
* Modules/webgpu/WebGPUComputePipelineDescriptor.h: Added.
* Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Added.
* platform/graphics/gpu/GPUComputePipeline.h: Added.
(WebCore::GPUComputePipeline::platformComputePipeline const):
* platform/graphics/gpu/GPUComputePipelineDescriptor.h: Added.
(WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Added.
(WebCore::tryCreateMtlComputeFunction):
(WebCore::tryCreateMTLComputePipelineState):
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
Enable creating a GPUComputePipeline from a GPUDevice:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createComputePipeline const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateComputePipeline const):
* platform/graphics/gpu/GPUDevice.h:
No longer unnecessarily ref the WebGPUCommandEncoder when creating pass encoder:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup):
(WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): Deleted.
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Deleted.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::setPipeline):
(WebCore::WebGPURenderPassEncoder::passEncoder):
(WebCore::WebGPURenderPassEncoder::passEncoder const):
* Modules/webgpu/WebGPURenderPassEncoder.h:
Updates to GPUBindGroup and *setBindGroup for compute function arguments:
* platform/graphics/gpu/GPUBindGroup.h:
(WebCore::GPUBindGroup::vertexArgsBuffer const):
(WebCore::GPUBindGroup::fragmentArgsBuffer const):
(WebCore::GPUBindGroup::computeArgsBuffer const):
(WebCore::GPUBindGroup::vertexArgsBuffer): Deleted. Const-qualified.
(WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::tryGetResourceAsMTLSamplerState): Now just returns the MTLSamplerState to reduce reference churning.
(WebCore::GPUBindGroup::tryCreate):
(WebCore::GPUBindGroup::GPUBindGroup):
(WebCore::tryGetResourceAsSampler): Renamed to tryGetResourceAsMTLSamplerState.
Updates to GPUProgrammablePassEncoder and GPURenderPassEncoder:
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
(WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
(WebCore::GPUProgrammablePassEncoder::setComputeBuffer): Added.
* platform/graphics/gpu/GPURenderPassEncoder.h:
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder):
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Remove unecessary include.
(WebCore::GPUProgrammablePassEncoder::endPass): No longer virtual. Delegates shared behavior for derived classes.
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::setPipeline):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::GPURenderPassEncoder::useResource): These private overrides are called only by base after checking for encoder existence.
(WebCore::GPURenderPassEncoder::setVertexBuffer): Ditto.
(WebCore::GPURenderPassEncoder::setFragmentBuffer): Ditto.
(WebCore::GPURenderPassEncoder::endPass): Deleted. Now handled by base class.
2019-03-27 Jiewen Tan <jiewen_tan@apple.com>
IDBRequest::dispatchEvent should check nullability of m_transaction before operations that rely on it to be non null
https://bugs.webkit.org/show_bug.cgi?id=196319
<rdar://problem/49355279>
Reviewed by Alex Christensen.
The test that triggers this crash is on Bug 196276.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::dispatchEvent):
2019-03-28 Ryosuke Niwa <rniwa@webkit.org>
Debug assert in DOMSelection::containsNode when node belongs to a different tree
https://bugs.webkit.org/show_bug.cgi?id=196342
Reviewed by Antti Koivisto.
The assertion was wrong. It's possible for Range::compareBoundaryPoints to return WRONG_DOCUMENT_ERR
when the node and the start container belong to two different trees.
Return false in such a case for now since it's unclear (unspecified) what these methods on Selection
should do with respect to shadow trees, preserving the current behavior of release builds.
Test: editing/selection/containsNode-with-no-common-ancestor.html
* page/DOMSelection.cpp:
(WebCore::DOMSelection::containsNode const):
2019-03-28 Tim Horton <timothy_horton@apple.com>
Fix the !ENABLE(APPLE_PAY) build
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::shouldAllowUserAgentScripts const):
2019-03-28 Sihui Liu <sihui_liu@apple.com>
Crash at IDBDatabaseInfo::infoForExistingObjectStore and IDBDatabaseInfo::infoForExistingObjectStore
https://bugs.webkit.org/show_bug.cgi?id=196120
<rdar://problem/39869767>
Reviewed by Ryosuke Niwa.
No new tests because it is unclear how the crash happens. Added release logging to help debug.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCreateIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2019-03-28 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: unbinding a canvas should always remove the agent as an observer
https://bugs.webkit.org/show_bug.cgi?id=196324
<rdar://problem/49357109>
Reviewed by Matt Baker.
No change in functionality.
* html/CanvasBase.cpp:
(WebCore::CanvasBase::notifyObserversCanvasChanged):
(WebCore::CanvasBase::notifyObserversCanvasResized):
(WebCore::CanvasBase::notifyObserversCanvasDestroyed):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::bindCanvas):
(WebCore::InspectorCanvasAgent::unbindCanvas):
2019-03-28 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Remove dead code in MediaPlayerPrivateGStreamer::doSeek()
https://bugs.webkit.org/show_bug.cgi?id=196352
Reviewed by Xabier Rodriguez-Calvar.
MediaPlayerPrivateGStreamerMSE overrides doSeek() and seek(), so this
branch is never reached.
This patch does not introduce behavior changes.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::doSeek):
2019-03-28 Simon Fraser <simon.fraser@apple.com>
[macOS WK2] Overlays on instagram.com are shifted if you click on a photo after scrolling
https://bugs.webkit.org/show_bug.cgi?id=196330
rdar://problem/49100304
Reviewed by Antti Koivisto.
When we call ScrollingTree::applyLayerPositions() on the main thread after a flush,
we need to ensure that the most recent version of the scrolling tree has been committed,
because it has to have state (like requested scroll position and layout viewport rect)
that match the layer flush.
To fix this we have to have the main thread wait for the commit to complete, so
ThreadedScrollingTree keeps track of a pending commit count, and uses a condition
variable to allow the main thread to safely wait for it to reach zero.
Tracing shows that this works as expected, and the main thread is never blocked for
more than a few tens of microseconds.
Also lock the tree mutex in ScrollingTree::handleWheelEvent(), since we enter the
scrolling tree here and we don't want that racing with applyLayerPositions() on the
main thread.
Test: scrollingcoordinator/mac/fixed-scrolled-body.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::applyLayerPositions):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::commitTreeState):
(WebCore::ThreadedScrollingTree::incrementPendingCommitCount):
(WebCore::ThreadedScrollingTree::decrementPendingCommitCount):
(WebCore::ThreadedScrollingTree::waitForPendingCommits):
(WebCore::ThreadedScrollingTree::applyLayerPositions):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeState):
2019-03-28 Zalan Bujtas <zalan@apple.com>
[SimpleLineLayout] Disable SLL when text-underline-position is not auto.
https://bugs.webkit.org/show_bug.cgi?id=196338
<rdar://problem/47975167>
Reviewed by Daniel Bates.
Disable simple line layout unconditionally on non-auto text-underline-position content. We don't support it yet.
Test: fast/text/simple-line-layout-with-text-underline-position.html
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
2019-03-28 Víctor Manuel Jáquez Leal <vjaquez@igalia.com>
Silence lot of warnings when compiling with clang
https://bugs.webkit.org/show_bug.cgi?id=196310
Reviewed by Michael Catanzaro.
No change in behavior.
* accessibility/AccessibilityObject.h: add missing override
clause.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcChangeState): add missing format string to log.
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h: add
missing virtual destructor.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
add missing override clause and remove unused private member.
2019-03-28 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Incorrect application of glyph positioning in the Y direction
https://bugs.webkit.org/show_bug.cgi?id=161493
Reviewed by Michael Catanzaro.
Use the first glyph origin as the initial advance of every complex text run.
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs): Update the yOffset using the height advance.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawGlyphs): Ditto.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Set the initial advance.
2019-03-27 Ryosuke Niwa <rniwa@webkit.org>
[macOS] Select element doesn't show popup if select element had lost focus while popup was previosuly shown
https://bugs.webkit.org/show_bug.cgi?id=196336
Reviewed by Tim Horton.
* rendering/RenderMenuList.cpp:
(RenderMenuList::popupDidHide): Added a comment.
2019-03-27 Justin Fan <justin_fan@apple.com>
[Web GPU] Standardize Web GPU object reference counting and creation logic
https://bugs.webkit.org/show_bug.cgi?id=196183
Reviewed by Dean Jackson.
Make getters return raw refs/pointers and provide const versions if necessary.
All Web GPU objects are non-nullable, but become no-op if invalid, and descriptors are not moved unless needed.
No new tests; no change in behavior.
Getter updates and const qualifications:
* Modules/webgpu/WebGPUAdapter.h:
(WebCore::WebGPUAdapter::options const):
* Modules/webgpu/WebGPUBindGroup.h:
(WebCore::WebGPUBindGroup::bindGroup):
(WebCore::WebGPUBindGroup::bindGroup const): Deleted.
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::WebGPUBindGroupDescriptor::tryCreateGPUBindGroupDescriptor const):
* Modules/webgpu/WebGPUBindGroupDescriptor.h:
* Modules/webgpu/WebGPUBindGroupLayout.h:
(WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer):
(WebCore::WebGPUBuffer::buffer const):
* Modules/webgpu/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::tryCreateGPURenderPassDescriptor const):
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
* Modules/webgpu/WebGPUSampler.h:
(WebCore::WebGPUSampler::sampler const):
* Modules/webgpu/WebGPUSwapChain.h:
(WebCore::WebGPUSwapChain::swapChain):
(WebCore::WebGPUSwapChain::swapChain const): Deleted.
* Modules/webgpu/WebGPUTexture.h:
(WebCore::WebGPUTexture::texture):
(WebCore::WebGPUTexture::texture const): Deleted.
* Modules/webgpu/WebGPUTextureView.h:
(WebCore::WebGPUTextureView::texture):
(WebCore::WebGPUTextureView::texture const): Deleted.
* platform/graphics/gpu/GPUBindGroupBinding.h:
* platform/graphics/gpu/GPUBindGroupDescriptor.h:
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::tryGetResourceAsMTLSamplerState):
Web GPU object creation logic:
* Modules/webgpu/WebGPUCommandEncoder.cpp:
(WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
(WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
(WebCore::WebGPUCommandEncoder::beginRenderPass):
(WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
* Modules/webgpu/WebGPUCommandEncoder.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const):
(WebCore::WebGPUDevice::createTexture const):
(WebCore::WebGPUDevice::createPipelineLayout const):
(WebCore::WebGPUDevice::createBindGroup const):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::getQueue const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUPipelineLayout.cpp:
(WebCore::WebGPUPipelineLayout::create):
(WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
* Modules/webgpu/WebGPUPipelineLayout.h:
(WebCore::WebGPUPipelineLayout::pipelineLayout):
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.cpp:
(WebCore::WebGPUPipelineLayoutDescriptor::tryCreateGPUPipelineLayoutDescriptor const):
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.h:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
(WebCore::WebGPUQueue::WebGPUQueue):
(WebCore::WebGPUQueue::submit):
* Modules/webgpu/WebGPUQueue.h:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
(WebCore::WebGPUShaderModule::WebGPUShaderModule):
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer):
(WebCore::GPUDevice::tryCreateTexture const):
(WebCore::GPUDevice::tryCreateShaderModule const):
(WebCore::GPUDevice::tryCreateRenderPipeline const):
(WebCore::GPUDevice::tryGetQueue const):
(WebCore::GPUDevice::createShaderModule const): Deleted.
(WebCore::GPUDevice::createRenderPipeline const): Deleted.
(WebCore::GPUDevice::getQueue const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUPipelineLayout.cpp:
(WebCore::GPUPipelineLayout::create):
(WebCore::GPUPipelineLayout::GPUPipelineLayout):
* platform/graphics/gpu/GPUPipelineLayout.h:
(WebCore::GPUPipelineLayout::bindGroupLayouts const):
* platform/graphics/gpu/GPUPipelineLayoutDescriptor.h:
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/GPUShaderModule.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::setSubData):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::tryCreate):
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::tryCreate):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::tryCreate):
(WebCore::GPURenderPipeline::GPURenderPipeline):
(WebCore::GPURenderPipeline::create): Deleted.
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::tryCreate):
(WebCore::GPUShaderModule::create): Deleted.
Add WebGPUPipelineLayoutDescriptor.cpp to project:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-03-27 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r243346.
Causing timeouts in animation tests across 10 builds
Reverted changeset:
"[Web Animations] JS wrapper may be deleted while animation is
yet to dispatch its finish event"
https://bugs.webkit.org/show_bug.cgi?id=196118
https://trac.webkit.org/changeset/243346
2019-03-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Stop using the global _WKContentChange
https://bugs.webkit.org/show_bug.cgi?id=196288
<rdar://problem/49228081>
Reviewed by Simon Fraser.
This patch ensures that activities on frames don't overwrite the observed state on other frames.
(Unfortunately the global variable is still used in WebKitLegacy (see webkit.org/b/196286)).
Tests: fast/events/touch/ios/content-observation/remove-subframe-while-observing.html
fast/events/touch/ios/content-observation/subframe.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::observedContentChange const): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::observedContentChange const):
(WebCore::ContentChangeObserver::setHasNoChangeState):
(WebCore::ContentChangeObserver::setHasIndeterminateState):
(WebCore::ContentChangeObserver::setHasVisibleChangeState):
(WebCore::ContentChangeObserver::setObservedContentState):
2019-03-27 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG tear off objects for SVGPathSeg, SVGPathSegList and SVGAnimatedPathSegList
https://bugs.webkit.org/show_bug.cgi?id=196085
Reviewed by Simon Fraser.
The SVGPathSegList is similar to the other SVGLists, e.g. SVGNUmberList
and SVGPointList except in two things:
1. Its items can be different but they are derived from the same base
class SVGPathSeg.
2. The SVGPathSeg items are only used for DOM. When drawing or animating
we have to have an SVGPathByteStream and convert it to a Path. Converting
an SVGPathByteStream to SVGPathSeg items and vice versa is expensive.
Building a Path from an SVGPathByteStream is also expensive. So an extra
care needs to be taken for when these conversions happen.
In addition to handling the SVGPathSeg items, SVGPathSegList will manage
the associated SVGPathByteStream and Path objects. SVGPathSegList will be
lazy in getting updated objects when a change happens. For example, when
the byte stream changes, SVGPathSegList will clear its items and nullify
the Path object. But it will not build any of them until they are explicitly
requested.
Like what was done for other SVG properties when removing their tear off
objects, a new accessor, a new animator and a new animation function will
be added for the SVGAnimatedPathSegList.
All the header files of the concrete classes of SVGPathSeg will be removed
because they are small structures which hold some data items and they provide
setters and getters for these items. Here is the new file structures and
their contents:
-- SVGPathSeg.h still has the class SVGPathSeg which is now a superclass
of SVGProperty.
-- SVGPathSegValue.h will have the template class SVGPathSegValue which
holds an std::tuple of packed arguments. It provides setters and getters
for these arguments. SVGPathSegValue.h will also have specialized
classed derived from SVGPathSegValue and hold different arguments.
-- SVGPathSegImpl.h will have the final concrete SVGPathSeg classes.
Note SVGPathSeg concrete classes do not need to have a reference to the
the context SVGPathElement. SVGPathSeg will be owned by its SVGPathSegList
which will be owned by the SVGAnimatedPathSegList which will be owned by
the SVGPathElement.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSSVGPathSegCustom.cpp:
* bindings/scripts/CodeGenerator.pm:
(IsSVGPathSegTypeName):
(IsSVGPathSegType):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromPathElement):
* svg/SVGAnimatedPath.cpp: Removed.
* svg/SVGAnimatedPath.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGPathByteStream.h:
(WebCore::SVGPathByteStream::SVGPathByteStream):
This constructor is used by SVGAnimationPathSegListFunction to convert
the 'form', 'to' and 'toAtEndOfDuration' strings to SVGPathByteStreams.
(WebCore::SVGPathByteStream::resize): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::initialValue): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::fromString): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::parse): Deleted.
(WebCore::SVGPropertyTraits<SVGPathByteStream>::toString): Deleted.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::SVGPathElement):
(WebCore::SVGPathElement::parseAttribute):
(WebCore::SVGPathElement::svgAttributeChanged):
(WebCore::SVGPathElement::getTotalLength const):
(WebCore::SVGPathElement::getPointAtLength const):
(WebCore::SVGPathElement::getPathSegAtLength const):
(WebCore::SVGPathElement::createSVGPathSegClosePath): Deleted.
(WebCore::SVGPathElement::createSVGPathSegMovetoAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegMovetoRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegArcAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegArcRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoHorizontalRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegLinetoVerticalRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoCubicSmoothRel): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothAbs): Deleted.
(WebCore::SVGPathElement::createSVGPathSegCurvetoQuadraticSmoothRel): Deleted.
The SVGPathSeg creation functions are moved to the header file.
(WebCore::SVGPathElement::registerAttributes): Deleted.
(WebCore::SVGPathElement::pathByteStream const): Deleted.
(WebCore::SVGPathElement::pathForByteStream const): Deleted.
(WebCore::SVGPathElement::lookupOrCreateDWrapper): Deleted.
(WebCore::SVGPathElement::animatedPropertyWillBeDeleted): Deleted.
(WebCore::SVGPathElement::pathSegList): Deleted.
(WebCore::SVGPathElement::normalizedPathSegList): Deleted.
(WebCore::SVGPathElement::animatedPathSegList): Deleted.
(WebCore::SVGPathElement::animatedNormalizedPathSegList): Deleted.
(WebCore::SVGPathElement::approximateMemoryCost const): Deleted.
(WebCore::SVGPathElement::pathSegListChanged): Deleted.
Managing the SVGPathByteStream and the drawing Path objects will be the
responsibility of SVGPathSegList.
* svg/SVGPathElement.h:
* svg/SVGPathSeg.h:
* svg/SVGPathSegArc.h: Removed.
* svg/SVGPathSegArcAbs.h: Removed.
* svg/SVGPathSegArcRel.h: Removed.
* svg/SVGPathSegClosePath.h: Removed.
* svg/SVGPathSegCurvetoCubic.h: Removed.
* svg/SVGPathSegCurvetoCubicAbs.h: Removed.
* svg/SVGPathSegCurvetoCubicRel.h: Removed.
* svg/SVGPathSegCurvetoCubicSmooth.h: Removed.
* svg/SVGPathSegCurvetoCubicSmoothAbs.h: Removed.
* svg/SVGPathSegCurvetoCubicSmoothRel.h: Removed.
* svg/SVGPathSegCurvetoQuadratic.h: Removed.
* svg/SVGPathSegCurvetoQuadraticAbs.h: Removed.
* svg/SVGPathSegCurvetoQuadraticRel.h: Removed.
* svg/SVGPathSegCurvetoQuadraticSmoothAbs.h: Removed.
* svg/SVGPathSegCurvetoQuadraticSmoothRel.h: Removed.
* svg/SVGPathSegImpl.h: Added.
* svg/SVGPathSegLinetoAbs.h: Removed.
* svg/SVGPathSegLinetoHorizontal.h: Removed.
* svg/SVGPathSegLinetoHorizontalAbs.h: Removed.
* svg/SVGPathSegLinetoHorizontalRel.h: Removed.
* svg/SVGPathSegLinetoRel.h: Removed.
* svg/SVGPathSegLinetoVertical.h: Removed.
* svg/SVGPathSegLinetoVerticalAbs.h: Removed.
* svg/SVGPathSegLinetoVerticalRel.h: Removed.
The definition of these classes are now in SVGPathSegImpl.h.
* svg/SVGPathSegList.cpp: Removed.
* svg/SVGPathSegList.h:
* svg/SVGPathSegListBuilder.cpp:
(WebCore::SVGPathSegListBuilder::SVGPathSegListBuilder):
(WebCore::SVGPathSegListBuilder::moveTo):
(WebCore::SVGPathSegListBuilder::lineTo):
(WebCore::SVGPathSegListBuilder::lineToHorizontal):
(WebCore::SVGPathSegListBuilder::lineToVertical):
(WebCore::SVGPathSegListBuilder::curveToCubic):
(WebCore::SVGPathSegListBuilder::curveToCubicSmooth):
(WebCore::SVGPathSegListBuilder::curveToQuadratic):
(WebCore::SVGPathSegListBuilder::curveToQuadraticSmooth):
(WebCore::SVGPathSegListBuilder::arcTo):
(WebCore::SVGPathSegListBuilder::closePath):
* svg/SVGPathSegListBuilder.h:
The concrete SVGPathSeg classes can now create instances of their classes
without having to go through the SVGPathElement.
* svg/SVGPathSegListSource.cpp:
(WebCore::SVGPathSegListSource::SVGPathSegListSource):
* svg/SVGPathSegListSource.h:
* svg/SVGPathSegListValues.cpp: Removed.
* svg/SVGPathSegListValues.h: Removed.
* svg/SVGPathSegMovetoAbs.h: Removed.
* svg/SVGPathSegMovetoRel.h: Removed.
* svg/SVGPathSegValue.h: Added.
(WebCore::SVGPathSegValue::create):
(WebCore::SVGPathSegValue::clone const):
(WebCore::SVGPathSegValue::SVGPathSegValue):
(WebCore::SVGPathSegValue::argument const):
(WebCore::SVGPathSegValue::setArgument):
(WebCore::SVGPathSegLinetoHorizontal::x const):
(WebCore::SVGPathSegLinetoHorizontal::setX):
(WebCore::SVGPathSegLinetoVertical::y const):
(WebCore::SVGPathSegLinetoVertical::setY):
(WebCore::SVGPathSegSingleCoordinate::x const):
(WebCore::SVGPathSegSingleCoordinate::setX):
(WebCore::SVGPathSegSingleCoordinate::y const):
(WebCore::SVGPathSegSingleCoordinate::setY):
(WebCore::SVGPathSegCurvetoQuadratic::x const):
(WebCore::SVGPathSegCurvetoQuadratic::setX):
(WebCore::SVGPathSegCurvetoQuadratic::y const):
(WebCore::SVGPathSegCurvetoQuadratic::setY):
(WebCore::SVGPathSegCurvetoQuadratic::x1 const):
(WebCore::SVGPathSegCurvetoQuadratic::setX1):
(WebCore::SVGPathSegCurvetoQuadratic::y1 const):
(WebCore::SVGPathSegCurvetoQuadratic::setY1):
(WebCore::SVGPathSegCurvetoCubicSmooth::x const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setX):
(WebCore::SVGPathSegCurvetoCubicSmooth::y const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setY):
(WebCore::SVGPathSegCurvetoCubicSmooth::x2 const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setX2):
(WebCore::SVGPathSegCurvetoCubicSmooth::y2 const):
(WebCore::SVGPathSegCurvetoCubicSmooth::setY2):
(WebCore::SVGPathSegCurvetoCubic::x const):
(WebCore::SVGPathSegCurvetoCubic::setX):
(WebCore::SVGPathSegCurvetoCubic::y const):
(WebCore::SVGPathSegCurvetoCubic::setY):
(WebCore::SVGPathSegCurvetoCubic::x1 const):
(WebCore::SVGPathSegCurvetoCubic::setX1):
(WebCore::SVGPathSegCurvetoCubic::y1 const):
(WebCore::SVGPathSegCurvetoCubic::setY1):
(WebCore::SVGPathSegCurvetoCubic::x2 const):
(WebCore::SVGPathSegCurvetoCubic::setX2):
(WebCore::SVGPathSegCurvetoCubic::y2 const):
(WebCore::SVGPathSegCurvetoCubic::setY2):
(WebCore::SVGPathSegArc::x const):
(WebCore::SVGPathSegArc::setX):
(WebCore::SVGPathSegArc::y const):
(WebCore::SVGPathSegArc::setY):
(WebCore::SVGPathSegArc::r1 const):
(WebCore::SVGPathSegArc::setR1):
(WebCore::SVGPathSegArc::r2 const):
(WebCore::SVGPathSegArc::setR2):
(WebCore::SVGPathSegArc::angle const):
(WebCore::SVGPathSegArc::setAngle):
(WebCore::SVGPathSegArc::largeArcFlag const):
(WebCore::SVGPathSegArc::setLargeArcFlag):
(WebCore::SVGPathSegArc::sweepFlag const):
(WebCore::SVGPathSegArc::setSweepFlag):
* svg/SVGPathSegWithContext.h: Removed.
* svg/SVGPathUtilities.cpp:
(WebCore::buildSVGPathByteStreamFromSVGPathSegList):
(WebCore::buildSVGPathSegListFromByteStream):
(WebCore::buildStringFromByteStream):
(WebCore::buildSVGPathByteStreamFromSVGPathSegListValues): Deleted.
(WebCore::appendSVGPathByteStreamFromSVGPathSeg): Deleted.
(WebCore::buildSVGPathSegListValuesFromByteStream): Deleted.
(WebCore::buildStringFromSVGPathSegListValues): Deleted.
* svg/SVGPathUtilities.h:
Since the class SVGPathSegListValues is removed, all the parsing functions
have now to deal with SVGPathSegList directly.
* svg/SVGPoint.h:
* svg/SVGValue.h:
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Removed.
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h: Removed.
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
(WebCore::SVGAnimatedPathSegList::create):
(WebCore::SVGAnimatedPathSegList::currentPathByteStream):
(WebCore::SVGAnimatedPathSegList::currentPath):
(WebCore::SVGAnimatedPathSegList::approximateMemoryCost const):
Provides an easy way to access the current SVGPathByteStream and Path
objects from the SVGAnimatedPathSegList.
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationPathSegListFunction::progress):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-03-27 Ryan Haddad <ryanhaddad@apple.com>
AVAudioSessionRouteSharingPolicyLongForm has been deprecated
https://bugs.webkit.org/show_bug.cgi?id=196301
Unrereivewed build fix.
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routeSharingPolicy const):
2019-03-27 Chris Dumez <cdumez@apple.com>
XMLHttpRequestUpload's loadstart event not correct initialized
https://bugs.webkit.org/show_bug.cgi?id=196174
<rdar://problem/49191412>
Reviewed by Alex Christensen.
Align progress event firing with the XHR specification.
No new tests, rebaselined existing tests.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
As per [1], the loadstart event fired on the XMLHttpRequestUpload object should use
loaded=0 and total=`reqs bodys total bytes`.
[1] https://xhr.spec.whatwg.org/#the-send()-method (step 11.2.)
(WebCore::XMLHttpRequest::didSendData):
As per [2], the progress / load / loadend should use loaded=transmitted and total=length.
[2] https://xhr.spec.whatwg.org/#ref-for-process-request-end-of-body (steps 5, 6 and 7)
(WebCore::XMLHttpRequest::didReceiveData):
As per [3], we should fire the readystatechange event *before* the progress event.
This is covered by web-platform-tests/xhr/send-response-event-order.htm which was failing
differently after the other changes in this patch.
[3] https://xhr.spec.whatwg.org/#ref-for-process-response (steps 9.4 and 9.5)
(WebCore::XMLHttpRequest::dispatchErrorEvents):
As per [4], in case of an error, we should fire the provided 'event' and 'loadend' with
loaded=0 and total=0.
[4] https://xhr.spec.whatwg.org/#request-error-steps (steps 7 and 8)
* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
* xml/XMLHttpRequestUpload.h:
Simplify XMLHttpRequestUpload. It no longer needs to store loaded / total as data
members now that they are always passed by the call site. lengthComputable is set
to !!total as [5] says to set it to true if length/total is not 0.
[5] https://xhr.spec.whatwg.org/#concept-event-fire-progress
2019-03-27 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r242687): Fullscreen YouTube videos show blank white space at top
https://bugs.webkit.org/show_bug.cgi?id=196304
rdar://problem/49175760
Reviewed by Zalan Bujtas.
repositionRelatedLayers() should not short-circuit when topContentInset is zero,
because topContentInset might be changing from non-zero to zero, and then we need
to move layers around.
Test: scrollingcoordinator/mac/top-content-inset-to-zero.html
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
2019-03-26 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] Fixed elements in frames can be misplaced sometimes
https://bugs.webkit.org/show_bug.cgi?id=196290
Reviewed by Frédéric Wang.
In a page containing position:fixed inside an async-scrolling iframe, if the
main page is scrolled down, and you reload, then the fixed element in the iframe can
get misplaced or disappear.
The bug was that the reconcileViewportConstrainedLayerPositions() recursive state node
walk would cross frame boundaries, hitting subframe ScrollingStateFixedNodes with a viewport rect
for the main page.
Fix by giving ScrollingStateTree the responsibility for the recursive tree walk, and
have it bail at at frame boundaries.
Test: scrollingcoordinator/ios/fixed-in-frame-layer-reconcile-layer-position.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): Deleted.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::reconcileLayerPositionsRecursive):
(WebCore::ScrollingStateTree::reconcileViewportConstrainedLayerPositions):
* page/scrolling/ScrollingStateTree.h:
2019-03-27 Philippe Normand <pnormand@igalia.com>
Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is enabled
https://bugs.webkit.org/show_bug.cgi?id=196178
Reviewed by Xabier Rodriguez-Calvar.
The gst/gl/gl.h header needs to be included before
GraphicsContext3D.h to avoid declaration conflicts with
OpenGLShims.
Based on a patch from Mike Gorse <mgorse@suse.com>
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
2019-03-27 Philippe Normand <pnormand@igalia.com>
[GStreamer] Remove the HLS queue buffering query hack
https://bugs.webkit.org/show_bug.cgi?id=196244
Reviewed by Xabier Rodriguez-Calvar.
Because the http src element now provides network statistics to
the player we can now compute an estimation of the data loading in
case the buffering query isn't handled by any element of the
pipeline.
No new tests, existing HLS tests cover this change.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::findHLSQueue): Deleted.
(WebCore::isHLSProgressing): Deleted.
2019-03-26 Said Abou-Hallawa <sabouhallawa@apple.com>
Unreviewed Windows build fix
https://bugs.webkit.org/show_bug.cgi?id=196083
<rdar://problem/49121836>
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::isSupportedAttributeType):
2019-03-26 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Refactor some helper functions for building UserAgent strings
https://bugs.webkit.org/show_bug.cgi?id=195990
Reviewed by Brent Fulgham.
Add an optional argument to standardUserAgentWithApplicationName to request the desktop version of the user
agent in Cocoa platforms. Work towards refactoring some codepaths to make the implementation of the "Request
Desktop Site" feature in Safari a bit more straightforward.
No change in behavior.
* platform/UserAgent.h:
* platform/ios/UserAgentIOS.mm:
(WebCore::standardUserAgentWithApplicationName):
The corresponding macOS version is currently hard-coded — the followup bug webkit.org/b/196275 tracks making
this dynamically fetch the paired macOS version when building for iOS.
* platform/mac/UserAgentMac.mm:
(WebCore::standardUserAgentWithApplicationName):
2019-03-26 Said Abou-Hallawa <said@apple.com>
Remove the SVG tear off objects for SVGLength, SVGLengthList and SVGAnimatedLengthList
https://bugs.webkit.org/show_bug.cgi?id=196083
Reviewed by Simon Fraser.
-- SVGLength will be a superclass of SVGValueProperty<SVGLengthValue>. It
is a wrapper of SVGLengthValue. It will be provide the DOM methods. It
can setValueAsString() and return valueAsString().
-- SVGLengthList will be a superclass of SVGValuePropertyList<SVGLength>.
The base class will provide all the DOM methods. SVGLengthList will be
responsible for parsing a String to a SVGLength items. It can also
build a string representing the stored items.
-- SVGAnimatedLengthList will be defined as SVGAnimatedPropertyList<SVGLengthList>.
Like SVGAnimatedPointList, all the required methods and attributes
will be handled by SVGAnimatedPropertyList.
-- SVGAnimatedLengthAccessor and SVGAnimatedLengthListAccessor will be
added to access the members of types SVGAnimatedLength and
SVGAnimatedLengthList.
-- SVGAnimatedLengthAnimator and SVGAnimatedLengthListAnimator will be
created by the the new accessors to animate attributes of types
SVGAnimatedLength and SVGAnimatedLengthList.
-- SVGAnimationLengthFunction and SVGAnimationLengthListFunction will be
responsible for progressing the animVal() of attributes of types
SVGAnimatedLength and SVGAnimatedLengthList.
-- SVGValuePropertyAnimator is a new template class which can animate a
none reflecting attribute which should be backed by a value property,
e.g. SVGLength.
-- SVGValuePropertyListAnimator is a new template class which can animate a
none reflecting attribute which should be backed by a value property
list, e.g. SVGLengthList.
Notes:
-- SVGElement::isAnimatedStyleAttribute() will return true if the
attribute is known by SVGPropertyAnimatorFactory. Or it's has
a reflecting SVGAnimatedPropertyLength property and its name is
one of the names listed in isAnimatedStylePropertyAttribute() of
the propertyRegistry() of the SVGElement.
-- SVGElement::commitPropertyChange() has to handle the attributes
for which isAnimatedStylePropertyAttribute() returns true different
from the other ones. styleReclac() needs updated attributes since
it does not access the reflecting properties in the SVGELement.
-- SVGTextContentElement does not need a customized SVGAnimatedLength.
All SVGTextContentElement::textLengthAnimated() needs to know is
whether m_textLength->baseVal() holds an empty SVGLength. If it
does, it sets its value to getComputedTextLength().
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::updateCharacterData):
(WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::hasValidAttributeType const):
* svg/SVGAnimatedLength.cpp: Removed.
* svg/SVGAnimatedLength.h: Removed.
* svg/SVGAnimatedLengthList.cpp: Removed.
* svg/SVGAnimatedLengthList.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::isTargetAttributeCSSProperty):
(WebCore::inheritsFromProperty):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::isSupportedAttribute):
(WebCore::SVGAnimatorFactory::create):
These changes were required because some of the tests were trying to
animated unsupported attributes. To differentiate between between the
these two cases:
1) the attribute is animate-able by the legacy controller.
2) animating the attribute or the attribute itself is not supported
by the element.
We want SVGAnimatorFactory tell us whether it can create an animator for
a given attribute or not.
* svg/SVGCircleElement.cpp:
(WebCore::SVGCircleElement::SVGCircleElement):
(WebCore::SVGCircleElement::parseAttribute):
(WebCore::SVGCircleElement::svgAttributeChanged):
(WebCore::SVGCircleElement::registerAttributes): Deleted.
* svg/SVGCircleElement.h:
* svg/SVGCursorElement.cpp:
(WebCore::SVGCursorElement::SVGCursorElement):
(WebCore::SVGCursorElement::parseAttribute):
(WebCore::SVGCursorElement::svgAttributeChanged):
(WebCore::SVGCursorElement::registerAttributes): Deleted.
* svg/SVGCursorElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::commitPropertyChange):
(WebCore::SVGElement::isAnimatedStyleAttribute const):
* svg/SVGElement.h:
* svg/SVGEllipseElement.cpp:
(WebCore::SVGEllipseElement::SVGEllipseElement):
(WebCore::SVGEllipseElement::parseAttribute):
(WebCore::SVGEllipseElement::svgAttributeChanged):
(WebCore::SVGEllipseElement::registerAttributes): Deleted.
* svg/SVGEllipseElement.h:
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::SVGFilterElement):
(WebCore::SVGFilterElement::registerAttributes):
(WebCore::SVGFilterElement::parseAttribute):
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
(WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
(WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes): Deleted.
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::x const):
(WebCore::SVGFilterPrimitiveStandardAttributes::y const):
(WebCore::SVGFilterPrimitiveStandardAttributes::width const):
(WebCore::SVGFilterPrimitiveStandardAttributes::height const):
(WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
(WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
(WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
(WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
(WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute): Deleted.
* svg/SVGForeignObjectElement.cpp:
(WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
(WebCore::SVGForeignObjectElement::parseAttribute):
(WebCore::SVGForeignObjectElement::registerAttributes): Deleted.
* svg/SVGForeignObjectElement.h:
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::SVGImageElement):
(WebCore::SVGImageElement::parseAttribute):
(WebCore::SVGImageElement::registerAttributes): Deleted.
* svg/SVGImageElement.h:
* svg/SVGLength.h:
(WebCore::SVGLength::create):
(WebCore::SVGLength::clone const):
(WebCore::SVGLength::unitType):
(WebCore::SVGLength::valueForBindings):
(WebCore::SVGLength::setValueForBindings):
(WebCore::SVGLength::valueInSpecifiedUnits):
(WebCore::SVGLength::setValueInSpecifiedUnits):
(WebCore::SVGLength::setValueAsString):
(WebCore::SVGLength::newValueSpecifiedUnits):
(WebCore::SVGLength::convertToSpecifiedUnits):
(WebCore::SVGLength::valueAsString): Deleted.
(WebCore::SVGLength::SVGLength): Deleted.
* svg/SVGLengthList.h:
(WebCore::SVGLengthList::create):
(WebCore::SVGLengthList::lengthMode const):
(WebCore::SVGLengthList::parse):
(WebCore::SVGLengthList::SVGLengthList):
* svg/SVGLengthListValues.cpp: Removed.
* svg/SVGLengthListValues.h: Removed.
* svg/SVGLineElement.cpp:
(WebCore::SVGLineElement::SVGLineElement):
(WebCore::SVGLineElement::parseAttribute):
(WebCore::SVGLineElement::svgAttributeChanged):
(WebCore::SVGLineElement::registerAttributes): Deleted.
* svg/SVGLineElement.h:
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
(WebCore::SVGLinearGradientElement::parseAttribute):
(WebCore::SVGLinearGradientElement::svgAttributeChanged):
(WebCore::SVGLinearGradientElement::registerAttributes): Deleted.
* svg/SVGLinearGradientElement.h:
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::SVGMarkerElement):
(WebCore::SVGMarkerElement::registerAttributes):
(WebCore::SVGMarkerElement::parseAttribute):
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::SVGMaskElement):
(WebCore::SVGMaskElement::registerAttributes):
(WebCore::SVGMaskElement::parseAttribute):
(WebCore::SVGMaskElement::svgAttributeChanged):
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::SVGPatternElement):
(WebCore::SVGPatternElement::registerAttributes):
(WebCore::SVGPatternElement::parseAttribute):
* svg/SVGPatternElement.h:
* svg/SVGPoint.h:
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
(WebCore::SVGRadialGradientElement::parseAttribute):
(WebCore::SVGRadialGradientElement::svgAttributeChanged):
(WebCore::SVGRadialGradientElement::registerAttributes): Deleted.
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.cpp:
(WebCore::SVGRectElement::SVGRectElement):
(WebCore::SVGRectElement::parseAttribute):
(WebCore::SVGRectElement::svgAttributeChanged):
(WebCore::SVGRectElement::registerAttributes): Deleted.
* svg/SVGRectElement.h:
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement):
(WebCore::SVGSVGElement::parseAttribute):
(WebCore::SVGSVGElement::svgAttributeChanged):
(WebCore::SVGSVGElement::registerAttributes): Deleted.
* svg/SVGSVGElement.h:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::SVGTextContentElement):
(WebCore::SVGTextContentElement::registerAttributes):
(WebCore::SVGTextContentElement::parseAttribute):
(WebCore::SVGTextContentElement::svgAttributeChanged):
(WebCore::SVGTextContentElement::textLengthAnimated):
* svg/SVGTextContentElement.h:
(WebCore::SVGTextContentElement::specifiedTextLength const):
(WebCore::SVGTextContentElement::textLength const):
(WebCore::SVGTextContentElement::specifiedTextLength): Deleted.
(WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
(WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute): Deleted.
(WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize): Deleted.
(WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty): Deleted.
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::SVGTextPathElement):
(WebCore::SVGTextPathElement::registerAttributes):
(WebCore::SVGTextPathElement::parseAttribute):
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
(WebCore::SVGTextPositioningElement::parseAttribute):
(WebCore::SVGTextPositioningElement::svgAttributeChanged):
(WebCore::SVGTextPositioningElement::registerAttributes): Deleted.
* svg/SVGTextPositioningElement.h:
(WebCore::SVGTextPositioningElement::x const):
(WebCore::SVGTextPositioningElement::y const):
(WebCore::SVGTextPositioningElement::dx const):
(WebCore::SVGTextPositioningElement::dy const):
(WebCore::SVGTextPositioningElement::xAnimated):
(WebCore::SVGTextPositioningElement::yAnimated):
(WebCore::SVGTextPositioningElement::dxAnimated):
(WebCore::SVGTextPositioningElement::dyAnimated):
(WebCore::SVGTextPositioningElement::isKnownAttribute): Deleted.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::SVGUseElement):
(WebCore::SVGUseElement::parseAttribute):
(WebCore::SVGUseElement::svgAttributeChanged):
(WebCore::SVGUseElement::registerAttributes): Deleted.
* svg/SVGUseElement.h:
* svg/SVGValue.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimator.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
(WebCore::SVGAnimationLengthListFunction::SVGAnimationLengthListFunction):
(WebCore::SVGAnimationLengthListFunction::progress):
(WebCore::SVGAnimationNumberListFunction::progress):
(WebCore::SVGAnimationPointListFunction::progress):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationLengthFunction::SVGAnimationLengthFunction):
(WebCore::SVGAnimationLengthFunction::progress):
* svg/properties/SVGAttributeAnimator.cpp:
(WebCore::SVGAttributeAnimator::isAnimatedStylePropertyAniamtor const):
* svg/properties/SVGAttributeAnimator.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPropertyAnimatorFactory.h:
(WebCore::SVGPropertyAnimatorFactory::createLengthAnimator):
(WebCore::SVGPropertyAnimatorFactory::createLengthListAnimator):
(WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
(WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute):
* svg/properties/SVGPropertyRegistry.h:
* svg/properties/SVGValuePropertyAnimator.h: Added.
(WebCore::SVGValuePropertyAnimator::SVGValuePropertyAnimator):
* svg/properties/SVGValuePropertyAnimatorImpl.h: Added.
* svg/properties/SVGValuePropertyListAnimator.h: Added.
(WebCore::SVGValuePropertyListAnimator::SVGValuePropertyListAnimator):
* svg/properties/SVGValuePropertyListAnimatorImpl.h: Added.
2019-03-26 Simon Fraser <simon.fraser@apple.com>
[iOS WK2] position:fixed inside oveflow:scroll is jumpy
https://bugs.webkit.org/show_bug.cgi?id=196238
Reviewed by Antti Koivisto.
We were inadvertently making Positioned nodes for position:fixed, which is unnecessary because
Fixed nodes handle them, and harmful because they introduced unwanted layer movement.
Tests: scrollingcoordinator/ios/fixed-in-overflow-scroll-scrolling-tree.html
scrollingcoordinator/ios/fixed-in-overflow-scroll.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2019-03-26 Dean Jackson <dino@apple.com>
vertexAttribPointer must restrict offset parameter
https://bugs.webkit.org/show_bug.cgi?id=196261
<rdar://problem/48458086>
Reviewed by Antoine Quint.
This WebGL function should fail if the offset parameter is
not within [0, max 32-bit int].
Test: fast/canvas/webgl/vertexAttribPointer-with-bad-offset.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::vertexAttribPointer):
2019-03-26 Antoine Quint <graouts@apple.com>
Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
https://bugs.webkit.org/show_bug.cgi?id=196254
<rdar://problem/49124334>
Unreviewed. Fix build broken by previous commit.
* dom/Event.cpp:
* dom/Event.h:
(WebCore::Event::hasEncounteredListener const): Deleted.
(WebCore::Event::setHasEncounteredListener): Deleted.
* dom/EventTarget.cpp:
(WebCore::EventTarget::innerInvokeEventListeners):
2019-03-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Skip anonymous renderers when checking for "willRespondToMouseClickEvents"
https://bugs.webkit.org/show_bug.cgi?id=196259
<rdar://problem/49240029>
Reviewed by Dean Jackson.
Anonymous renderers don't have associated DOM nodes so they can't have event listeners either. Let's skip them.
Test: fast/events/touch/ios/content-observation/crash-on-anonymous-renderer.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2019-03-26 Antoine Quint <graouts@apple.com>
Remove mousemoveEventHandlingPreventsDefault internal setting and quirk
https://bugs.webkit.org/show_bug.cgi?id=196254
<rdar://problem/49124334>
Reviewed by Dean Jackson.
* page/Quirks.cpp:
(WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const): Deleted.
* page/Quirks.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
(WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled): Deleted.
2019-03-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243493.
https://bugs.webkit.org/show_bug.cgi?id=196257
broke the non-gst-gl build (Requested by philn on #webkit).
Reverted changeset:
"Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is
enabled"
https://bugs.webkit.org/show_bug.cgi?id=196178
https://trac.webkit.org/changeset/243493
2019-03-26 Mike Gorse <mgorse@alum.wpi.edu>
Build failure with gstreamer 1.12.5 if USE_GSTREAMER_GL is enabled
https://bugs.webkit.org/show_bug.cgi?id=196178
Reviewed by Philippe Normand.
No new tests (build fix).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
Include gst/gl/gl.h before including GraphicsContext3D.h.
2019-03-26 Philippe Normand <pnormand@igalia.com>
[GStreamer] Sound loop with Google Hangouts and WhatsApp notifications
https://bugs.webkit.org/show_bug.cgi?id=189471
Reviewed by Xabier Rodriguez-Calvar.
The media duration is now cached (again). The loop issue was
triggered by the previous version of the code returning positive
infinite duration in didEnd(), followed by the timeupdate event
propagation that would trick the HTMLMediaElement into a new call
to play(). Now the cached duration is updated to current position
at EOS (for forward playback direction only), so the media element
no longer triggers a new play call for those cases.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
(WebCore::MediaPlayerPrivateGStreamer::platformDuration const):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::durationChanged):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
2019-03-26 Antti Koivisto <antti@apple.com>
Hit-testing on layers overlapping scrollers should hit-test on text boxes
https://bugs.webkit.org/show_bug.cgi?id=195373
<rdar://problem/48649865>
Reviewed by Simon Fraser.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
Collect event region for overflowing line boxes.
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
Collect event region for overflowing simple lines.
2019-03-25 Alex Christensen <achristensen@webkit.org>
Expected shouldn't assume its contained types are copyable
https://bugs.webkit.org/show_bug.cgi?id=195986
Reviewed by JF Bastien.
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadAction):
2019-03-20 Ryosuke Niwa <rniwa@webkit.org>
Leak of SVGFontFaceElement when RenderStyle holds onto a FontRances which uses it
https://bugs.webkit.org/show_bug.cgi?id=196059
Reviewed by Zalan Bujtas.
SVGFontFaceElement keeps its RenderStyle alive via ElementRareData but RenderStyle can hold onto FontRanges
and therefore CSSFontSource, which in turn keeps SVGFontFaceElement alive, making a reference cycle.
More precisely, there are two reference cycles:
SVGFontFaceElement (1) -> ElementRareData -> StyleInheritedData -> FontCascade -> FontCascadeFonts (2)
FontCascadeFonts (2) -> FontRanges (3)
FontCascadeFonts (2) -> CSSFontSelector -> CSSFontFaceSet -> CSSSegmentedFontFace -> FontRanges (3)
FontRanges (3) -> CSSFontAccessor > CSSFontFace > CSSFontSource -> SVGFontFaceElement (1)
No new tests. Unfortunately, writing a test proved to be intractable. The leak can be reproduced by running
svg/text/text-text-05-t.svg then svg/zoom/page/zoom-img-preserveAspectRatio-support-1.html consecutively.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::CSSFontFaceSource):
(WebCore::CSSFontFaceSource::load):
(WebCore::CSSFontFaceSource::font):
(WebCore::CSSFontFaceSource::isSVGFontFaceSource const):
* css/CSSFontFaceSource.h:
2019-03-25 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed, rolling out r243450.
AppleWin and WinCairo port builds get broken.
Reverted changeset:
"Add test for fix of #196095"
https://bugs.webkit.org/show_bug.cgi?id=196097
https://trac.webkit.org/changeset/243450
2019-03-25 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG tear off objects for SVGAngle, SVGAnimatedAngle and SVGAnimatedEnumeration
https://bugs.webkit.org/show_bug.cgi?id=196087
Reviewed by Simon Fraser.
In this patch, the tear off objects for SVGAnimatedEnumeration will be
removed. Because the angle is paired with the orient type so its tear
off objects have to be removed as well. Here is what this patch does:
-- SVGAngle is now a superclass of SVGValueProperty<SVGAngleValue>. Its
relationship with its owner will be managed by the owner of its base
class SVGProperty.
-- SVGAnimatedAngle is now defined to be SVGAnimatedValueProperty<
SVGAngle>. All the DOM interfaces will be handled by the base class
given its baseVal and animVal are of type SVGAngle.
-- SVGAnimatedEnumeration is now defined to be
SVGAnimatedDecoratedProperty<SVGDecoratedEnumeration, unsigned>.
This can be read: SVGAnimatedEnumeration is an SVGAnimatedProperty which
decorates the "SVGDecoratedEnumeration" type to "unsigned". The reason
for this complication is the IDL of SVGAnimatedEnumeration defines the
baseVal and animVal are of type unsigned. However SVGAnimatedEnumeration
should be able to convert a string to its enum value and vice versa.
-- SVGAnimatedDecoratedProperty is a template class which maps from
DecoratedProperty to DecorationType. The DecoratedProperty is actually
a template class which exposes a property of type DecorationType.
-- SVGDecoratedProperty is an abstract class which manages setting and
getting a property in DecorationType regardless of how it is actually
stored.
-- SVGDecoratedPrimitive is a superclass of SVGDecoratedProperty which
stores a primitive property whose type is PropertyType but can decorate
it to the callers as DecorationType.
-- SVGDecoratedEnumeration is a superclass of SVGDecoratedPrimitive
which stores a primitive type DecorationType like "BlendMode" but
decorates it as "unsigned"
To get the mechanics of this change correct, new accessors, animators
and animation functions need to be added for SVGAnimatedAngle,
SVGAnimatedEnumeration and SVGAnimatedOrientType. But since angle and
the orient type are paired under a single attribute, a pair accessor and
animator are also needed for the pair { angle, orientType }.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAngle.h:
(WebCore::SVGAngle::create):
(WebCore::SVGAngle::unitType):
(WebCore::SVGAngle::setValueForBindings):
(WebCore::SVGAngle::valueForBindings):
(WebCore::SVGAngle::setValueInSpecifiedUnits):
(WebCore::SVGAngle::valueInSpecifiedUnits):
(WebCore::SVGAngle::setValueAsString):
(WebCore::SVGAngle::newValueSpecifiedUnits):
(WebCore::SVGAngle::convertToSpecifiedUnits):
(WebCore::SVGAngle::valueAsString): Deleted.
(WebCore::SVGAngle::SVGAngle): Deleted.
* svg/SVGAnimatedAngle.cpp: Removed.
* svg/SVGAnimatedAngle.h: Removed.
* svg/SVGAnimatedEnumeration.cpp: Removed.
* svg/SVGAnimatedEnumeration.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGClipPathElement.cpp:
(WebCore::SVGClipPathElement::SVGClipPathElement):
(WebCore::SVGClipPathElement::parseAttribute):
(WebCore::SVGClipPathElement::svgAttributeChanged):
(WebCore::SVGClipPathElement::registerAttributes): Deleted.
* svg/SVGClipPathElement.h:
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
(WebCore::SVGComponentTransferFunctionElement::registerAttributes): Deleted.
* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGComponentTransferFunctionElement::type const):
(WebCore::SVGComponentTransferFunctionElement::typeAnimated):
(WebCore::SVGComponentTransferFunctionElement::attributeRegistry): Deleted.
(WebCore::SVGComponentTransferFunctionElement::isKnownAttribute): Deleted.
* svg/SVGElement.cpp:
(WebCore::SVGElement::commitPropertyChange):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::SVGFEBlendElement):
(WebCore::SVGFEBlendElement::parseAttribute):
(WebCore::SVGFEBlendElement::registerAttributes): Deleted.
* svg/SVGFEBlendElement.h:
(WebCore::SVGPropertyTraits<BlendMode>::fromString):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
(WebCore::SVGFEColorMatrixElement::parseAttribute):
(WebCore::SVGFEColorMatrixElement::registerAttributes): Deleted.
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::SVGFECompositeElement):
(WebCore::SVGFECompositeElement::parseAttribute):
(WebCore::SVGFECompositeElement::registerAttributes): Deleted.
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes): Deleted.
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
(WebCore::SVGFEDisplacementMapElement::parseAttribute):
(WebCore::SVGFEDisplacementMapElement::registerAttributes): Deleted.
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
(WebCore::SVGFEGaussianBlurElement::parseAttribute):
(WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
(WebCore::SVGFEGaussianBlurElement::registerAttributes): Deleted.
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
(WebCore::SVGFEMorphologyElement::parseAttribute):
(WebCore::SVGFEMorphologyElement::registerAttributes): Deleted.
* svg/SVGFEMorphologyElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
(WebCore::SVGFETurbulenceElement::parseAttribute):
(WebCore::SVGFETurbulenceElement::svgAttributeChanged):
(WebCore::SVGFETurbulenceElement::registerAttributes): Deleted.
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::SVGFilterElement):
(WebCore::SVGFilterElement::registerAttributes):
(WebCore::SVGFilterElement::parseAttribute):
* svg/SVGFilterElement.h:
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::SVGGradientElement):
(WebCore::SVGGradientElement::registerAttributes):
(WebCore::SVGGradientElement::parseAttribute):
* svg/SVGGradientElement.h:
(WebCore::SVGGradientElement::spreadMethod const):
(WebCore::SVGGradientElement::gradientUnits const):
(WebCore::SVGGradientElement::spreadMethodAnimated):
(WebCore::SVGGradientElement::gradientUnitsAnimated):
* svg/SVGMarkerElement.cpp:
(WebCore::SVGMarkerElement::SVGMarkerElement):
(WebCore::SVGMarkerElement::registerAttributes):
(WebCore::SVGMarkerElement::parseAttribute):
(WebCore::SVGMarkerElement::setOrient):
(WebCore::SVGMarkerElement::setOrientToAngle):
(WebCore::SVGMarkerElement::orientTypeIdentifier): Deleted.
(WebCore::SVGMarkerElement::orientAngleIdentifier): Deleted.
* svg/SVGMarkerElement.h:
* svg/SVGMarkerTypes.h:
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::autoStartReverseString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::fromString):
(WebCore::SVGPropertyTraits<SVGMarkerOrientType>::toString):
* svg/SVGMaskElement.cpp:
(WebCore::SVGMaskElement::SVGMaskElement):
(WebCore::SVGMaskElement::registerAttributes):
(WebCore::SVGMaskElement::parseAttribute):
* svg/SVGMaskElement.h:
* svg/SVGPatternElement.cpp:
(WebCore::SVGPatternElement::SVGPatternElement):
(WebCore::SVGPatternElement::registerAttributes):
(WebCore::SVGPatternElement::parseAttribute):
* svg/SVGPatternElement.h:
* svg/SVGSVGElement.cpp:
* svg/SVGScriptElement.cpp:
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::SVGTextContentElement):
(WebCore::SVGTextContentElement::registerAttributes):
(WebCore::SVGTextContentElement::parseAttribute):
* svg/SVGTextContentElement.h:
(WebCore::SVGTextContentElement::lengthAdjust const):
(WebCore::SVGTextContentElement::lengthAdjustAnimated):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::SVGTextPathElement):
(WebCore::SVGTextPathElement::registerAttributes):
(WebCore::SVGTextPathElement::parseAttribute):
* svg/SVGTextPathElement.h:
* svg/SVGValue.h:
* svg/properties/SVGAnimatedDecoratedProperty.h: Added.
(WebCore::SVGAnimatedDecoratedProperty::create):
(WebCore::SVGAnimatedDecoratedProperty::SVGAnimatedDecoratedProperty):
(WebCore::SVGAnimatedDecoratedProperty::setBaseVal):
(WebCore::SVGAnimatedDecoratedProperty::setBaseValInternal):
(WebCore::SVGAnimatedDecoratedProperty::baseVal const):
(WebCore::SVGAnimatedDecoratedProperty::setAnimVal):
(WebCore::SVGAnimatedDecoratedProperty::animVal const):
(WebCore::SVGAnimatedDecoratedProperty::currentValue const):
* svg/properties/SVGAnimatedEnumerationPropertyTearOff.h: Removed.
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
(WebCore::SVGAnimatedOrientType::create):
* svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAnimator.h:
(WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
* svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
* svg/properties/SVGAnimatedStaticPropertyTearOff.h: Removed.
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationAngleFunction::progress):
* svg/properties/SVGAnimationDiscreteFunctionImpl.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGDecoratedEnumeration.h: Added.
(WebCore::SVGDecoratedEnumeration::create):
* svg/properties/SVGDecoratedPrimitive.h: Added.
(WebCore::SVGDecoratedPrimitive::SVGDecoratedPrimitive):
* svg/properties/SVGDecoratedProperty.h: Added.
(WebCore::SVGDecoratedProperty::setValue):
(WebCore::SVGDecoratedProperty::value const):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
(WebCore::SVGPropertyOwnerRegistry::isAnimatedLengthAttribute):
* svg/properties/SVGPropertyRegistry.h:
* svg/properties/SVGStaticPropertyTearOff.h: Removed.
2019-03-25 Fujii Hironori <Hironori.Fujii@sony.com>
[iOS] Break a reference cycle between PreviewLoader and ResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194964
Unreviewed build fix for WinCairo port.
error C2504: 'CanMakeWeakPtr': base class undefined
* loader/ResourceLoader.h: Added #include <wtf/WeakPtr.h>.
2019-03-25 Andy Estes <aestes@apple.com>
[iOS] Break a reference cycle between PreviewLoader and ResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194964
<rdar://problem/48279441>
Reviewed by Alex Christensen.
When a document's QuickLook preview is loaded, a reference cycle is created between
WebPreviewLoader and ResourceLoader. Break the cycle by changing WebPreviewLoader to hold a
WeakPtr to its ResourceLoader ResourceLoader::releaseResources().
Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`. Also covered by
existing API tests.
* loader/ResourceLoader.h:
* loader/ios/PreviewLoader.mm:
(-[WebPreviewLoader initWithResourceLoader:resourceResponse:]):
(-[WebPreviewLoader _sendDidReceiveResponseIfNecessary]):
(-[WebPreviewLoader connection:didReceiveData:lengthReceived:]):
(-[WebPreviewLoader connectionDidFinishLoading:]):
(-[WebPreviewLoader connection:didFailWithError:]):
2019-03-25 Alex Christensen <achristensen@webkit.org>
Enable IPC sending and receiving non-default-constructible types
https://bugs.webkit.org/show_bug.cgi?id=196132
Reviewed by Geoff Garen.
This basically just requires the decoding of std::tuple to return an Optional<std::tuple> instead of
constructing a std::tuple then decoding into it. I now decode synchronous replies into an Optional<std::tuple>
then move it into the tuple of references where the successfully decoded reply should go. This required
the synchronous reply types be move constructible and move assignable.
* Modules/indexeddb/shared/IDBRequestData.h:
* Modules/indexeddb/shared/IDBTransactionInfo.h:
* platform/DragImage.h:
* platform/PasteboardWriterData.h:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/graphics/RemoteVideoSample.h:
2019-03-25 Alex Christensen <achristensen@webkit.org>
Stop storing raw pointers to Documents
https://bugs.webkit.org/show_bug.cgi?id=196042
Reviewed by Geoff Garen.
Use WeakPtr instead! This could change some UAF bugs into null dereference crashes.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::CSSFontSelector):
(WebCore::CSSFontSelector::addFontFaceRule):
(WebCore::CSSFontSelector::fontRangesForFamily):
* css/CSSFontSelector.h:
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::MediaQueryMatcher):
(WebCore::MediaQueryMatcher::matchMedia):
* css/MediaQueryMatcher.h:
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::StyleSheetList):
(WebCore::StyleSheetList::ownerNode const):
* css/StyleSheetList.h:
* css/ViewportStyleResolver.cpp:
(WebCore::ViewportStyleResolver::ViewportStyleResolver):
* css/ViewportStyleResolver.h:
* dom/Document.h:
(WebCore::Document::setTemplateDocumentHost):
(WebCore::Document::templateDocumentHost):
* dom/DocumentParser.cpp:
(WebCore::DocumentParser::DocumentParser):
* dom/DocumentParser.h:
(WebCore::DocumentParser::document const):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::ScriptedAnimationController):
* dom/ScriptedAnimationController.h:
* html/parser/HTMLScriptRunner.cpp:
(WebCore::HTMLScriptRunner::HTMLScriptRunner):
(WebCore::HTMLScriptRunner::runScript):
* html/parser/HTMLScriptRunner.h:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::MediaResourceLoader):
* loader/MediaResourceLoader.h:
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox const):
(WebCore::CachedResourceLoader::loadDone):
* loader/cache/CachedResourceLoader.h:
(WebCore::CachedResourceLoader::document const):
(WebCore::CachedResourceLoader::setDocument):
2019-03-25 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r243419.
Caused Mac WK2 testers to crash and become unresponsive.
Reverted changeset:
"[Web GPU] Prototype compute pipeline with MSL"
https://bugs.webkit.org/show_bug.cgi?id=196107
https://trac.webkit.org/changeset/243419
2019-03-25 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r243438.
243319 Caused Mac WK2 testers to crash and become
unresponsive.
Reverted changeset:
"Update WebGPU class names based on sketch.idl"
https://bugs.webkit.org/show_bug.cgi?id=194260
https://trac.webkit.org/changeset/243438
2019-03-25 Eric Carlson <eric.carlson@apple.com>
Delete MetadataPreloadingNotPermitted, it is unused
https://bugs.webkit.org/show_bug.cgi?id=196202
<rdar://problem/49213611>
Reviewed by Jer Noble.
No new tests, the flat was unused except in an existing test that was removed.
* html/MediaElementSession.cpp:
(WebCore::restrictionNames):
(WebCore::MediaElementSession::effectivePreloadForElement const):
* html/MediaElementSession.h:
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):
2019-03-25 Jer Noble <jer.noble@apple.com>
Test for: 196095 Inband Text Track cues interspersed with Data cues can display out of order.
https://bugs.webkit.org/show_bug.cgi?id=196097
Reviewed by Eric Carlson.
Test: media/track/track-in-band-metadata-display-order.html
Add a method in Internals to create a TextTrackCueGeneric (which can normally only be created
by parsing an in-band media track). This requires adding IDL for TextTrackCueGeneric, and exporting
TextTrackCueGeneric for testing.
Drive-by fixes:
Add runtime logging to MediaControlTextTrackContainerElement. This necessitates modifying the
parentMediaElement() method to take a const Node*, and const_cast that constness away in order to return
a HTMLMediaElement*
TextTrackCue, VTTCue, TextTrackCueGeneric, and DataCue should all use the WTF TypeCasts macros to
enable use of is<> and downcast<>.
* Source/WebCore/CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::parentMediaElement):
* html/shadow/MediaControlElementTypes.h:
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
(WebCore::MediaControlTextTrackContainerElement::logger const):
(WebCore::MediaControlTextTrackContainerElement::logIdentifier const):
(WebCore::MediaControlTextTrackContainerElement::logChannel const):
* html/shadow/MediaControlElements.h:
* html/track/DataCue.h:
(isType):
* html/track/TextTrackCueGeneric.h:
(isType):
* html/track/TextTrackCueGeneric.idl: Added.
* html/track/VTTCue.h:
(isType):
* testing/Internals.cpp:
(WebCore::Internals::createGenericCue):
* testing/Internals.h:
* testing/Internals.idl:
2019-03-25 Antti Koivisto <antti@apple.com>
Toggling "display: contents" to "display: none" fails to hide the element
https://bugs.webkit.org/show_bug.cgi?id=188259
<rdar://problem/42886896>
Reviewed by Simon Fraser.
Test: fast/css/display-contents-to-none.html
* style/StyleTreeResolver.cpp:
(WebCore::Style::affectsRenderedSubtree):
An element with 'display:contents' has a rendered subtree.
2019-03-25 Justin Fan <justin_fan@apple.com>
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-03-25 Javier Fernandez <jfernandez@igalia.com>
A single leading space is not considered as a word break even when word-break: break-all is set
https://bugs.webkit.org/show_bug.cgi?id=195361
Reviewed by Ryosuke Niwa.
We must consider leading white-spaces as potential soft-breaking
opportunities that may avoid breaking in the middle of the word.
However, 'break-word: break-all' [1] implies that we should ignore
previous opportunities and break at any character (among the ones
valid for 'break-all') that prevents the line to overflow. Note,
that these breakable characters are different from the ones
provided by 'line-break: anywhere' [2].
This change is covered by the already existent tests of the CSS
Text 3 suite of the Web Platform Tests.
The word-break-break-all-010.html was precisely designed to cover
the basic issue fixed with this change, verifying that the word is
indeed broken even if a single leading space constitutes a
previous soft-breaking opportunity.
There are other Web Platform Tests. which already pass before this
change, to verify that such leading white-space must be used
instead of breaking the word in any other case, including
overflow-wrap: break-word and even the deprecated word-break:
break-word.
- white-space/pre-wrap-008.html
- white-space/pre-wrap-015.html
- white-space/pre-wrap-016.html
- overflow-wrap/overflow-wrap-break-word-004.html
- overflow-wrap/overflow-wrap-break-word-005.html
- overflow-wrap/overflow-wrap-break-word-007.html
- word-break/word-break-break-all-011.html
- word-break/word-break-break-all-014.html
The reason why the word-break-break-all-010.html passes in Mac
platform is that for that case the SimpleLineLayout codepath is
executed instead, which doesn't have this bug, present in the old
line-breaking logic implemented in the BreakingContext class.
In order to verify the validity of this change, I've added several
tests under fast/text with the SimpleLineLayout disabled.
Tests: fast/text/overflow-wrap-break-word-004.html
fast/text/overflow-wrap-break-word-005.html
fast/text/overflow-wrap-break-word-007.html
fast/text/whitespace/pre-wrap-008.html
fast/text/whitespace/pre-wrap-015.html
fast/text/whitespace/pre-wrap-016.html
fast/text/word-break-break-all-010.html
fast/text/word-break-break-all-011.html
fast/text/word-break-break-all-015.html
imported/w3c/web-platform-tests/css/css-text/overflow-wrap/overflow-wrap-break-word-007.html
imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-008.html
imported/w3c/web-platform-tests/css/css-text/word-break/word-break-break-all-015.html
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::handleText):
2019-03-25 Rob Buis <rbuis@igalia.com>
Reflect HTMLLinkElement.as according to the spec
https://bugs.webkit.org/show_bug.cgi?id=196189
Reviewed by Youenn Fablet.
The 'as' attribute is an enumerated attribute [1] and should
reflect using a finite set of keywords, so lowercase the as getter
to match the defined set of destinations [2].
Test: imported/w3c/web-platform-tests/preload/reflected-as-value.html
[1] https://html.spec.whatwg.org/#enumerated-attribute
[2] https://fetch.spec.whatwg.org/#concept-request-destination
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::as const):
2019-03-25 Gyuyoung Kim <gyuyoung.kim@webkit.org>
Remove NavigatorContentUtils in WebCore/Modules
https://bugs.webkit.org/show_bug.cgi?id=196070
Reviewed by Alex Christensen.
NavigatorContentUtils was to support the custom scheme spec [1].
However, in WebKit side, no port has supported the feature in
WebKit layer after EFL port was removed. So there has been the
only IDL implementation of the NavigatorContentUtils in WebCore.
So we don't need to keep the implementation in WebCore anymore.
[1] https://html.spec.whatwg.org/multipage/system-state.html#custom-handlers
No new tests because this patch is just to remove the feature.
* CMakeLists.txt:
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp: Removed.
* Modules/navigatorcontentutils/NavigatorContentUtils.h: Removed.
* Modules/navigatorcontentutils/NavigatorContentUtils.idl: Removed.
* Modules/navigatorcontentutils/NavigatorContentUtilsClient.h: Removed.
* Sources.txt:
2019-03-25 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Fix grid container baseline alignment for orthogonal items
https://bugs.webkit.org/show_bug.cgi?id=196141
Reviewed by Javier Fernandez.
Grid container baseline was wrongly computed when done in reference to an orthogonal item.
Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-container-baseline-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::firstLineBaseline const): Simple change to use logicalTopForChild()
so it takes into account grid container and item writing modes.
2019-03-24 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix -Wpessimizing-move warning
https://bugs.webkit.org/show_bug.cgi?id=195905
<rdar://problem/49121824>
* svg/properties/SVGPropertyList.h:
2019-03-23 Justin Fan <justin_fan@apple.com>
[Web GPU] Prototype compute pipeline with MSL
https://bugs.webkit.org/show_bug.cgi?id=196107
<rdar://problem/46289650>
Reviewed by Myles Maxfield.
Add GPUComputePassEncoder, GPUComputePipeline, and GPUComputePipelineDescriptor.
Implement everything needed to prototype a compute pipeline in Web GPU using Metal shaders and bound resources.
Test: webgpu/compute-squares.html
Add files and symbols:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Misc fixes:
* Modules/webgpu/WHLSL/WHLSLNameResolver.h: Missing include.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Missing include.
* Modules/webgpu/WebGPUPipelineStageDescriptor.cpp: Added. Move pipeline stage validation logic here.
(WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const):
* Modules/webgpu/WebGPURenderPipeline.cpp: Remove unnecessary include.
* Modules/webgpu/WebGPURenderPipeline.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp: Add missing inlcude.
(WebCore::WebGPUPipelineStageDescriptor::tryCreateGPUPipelineStageDescriptor const): Moved to WebGPUPipelineStageDescriptor.cpp.
* platform/graphics/gpu/GPUPipelineDescriptorBase.h: Add missing include.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Add missing include.
(WebCore::GPURenderPipeline::GPURenderPipeline): Remove unecessary ref of GPUPipelineLayout.
* platform/text/mac/TextEncodingRegistryMac.mm: Carbon.h was causing ambiguous reference build errors in this file.
Enable creating a GPUComputePassEncoder from a GPUCommandEncoder:
* Modules/webgpu/WebGPUCommandEncoder.cpp:
(WebCore::WebGPUCommandEncoder::beginRenderPass): No longer passing this WebGPUCommandEncoder to pass encoders.
(WebCore::WebGPUCommandEncoder::beginComputePass): Added.
* Modules/webgpu/WebGPUCommandEncoder.h:
* Modules/webgpu/WebGPUCommandEncoder.idl:
Add GPUComputePassEncoder:
* Modules/webgpu/WebGPUComputePassEncoder.cpp: Added.
(WebCore::WebGPUComputePassEncoder::create):
(WebCore::WebGPUComputePassEncoder::WebGPUComputePassEncoder):
(WebCore::WebGPUComputePassEncoder::setPipeline):
(WebCore::WebGPUComputePassEncoder::dispatch):
(WebCore::WebGPUComputePassEncoder::passEncoder):
(WebCore::WebGPUComputePassEncoder::passEncoder const):
* Modules/webgpu/WebGPUComputePassEncoder.h: Added.
* Modules/webgpu/WebGPUComputePassEncoder.idl: Added.
* platform/graphics/gpu/GPUComputePassEncoder.h: Added.
(WebCore::GPUComputePassEncoder::~GPUComputePassEncoder):
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm: Added.
(WebCore::GPUComputePassEncoder::tryCreate):
(WebCore::GPUComputePassEncoder::GPUComputePassEncoder):
(WebCore::GPUComputePassEncoder::setPipeline):
(WebCore::GPUComputePassEncoder::dispatch): Use a default calculation for threadsPerThreadgroup while MSL is still an accepted shader format.
(WebCore::GPUComputePassEncoder::platformPassEncoder const):
(WebCore::GPUComputePassEncoder::useResource):
(WebCore::GPUComputePassEncoder::setComputeBuffer):
Add GPUComputePipeline:
* Modules/webgpu/WebGPUComputePipeline.cpp: Added.
(WebCore::WebGPUComputePipeline::create):
(WebCore::WebGPUComputePipeline::WebGPUComputePipeline):
* Modules/webgpu/WebGPUComputePipeline.h: Added.
(WebCore::WebGPUComputePipeline::computePipeline const):
* Modules/webgpu/WebGPUComputePipeline.idl: Added.
* Modules/webgpu/WebGPUComputePipelineDescriptor.cpp: Added.
(WebCore::WebGPUComputePipelineDescriptor::tryCreateGPUComputePipelineDescriptor const):
* Modules/webgpu/WebGPUComputePipelineDescriptor.h: Added.
* Modules/webgpu/WebGPUComputePipelineDescriptor.idl: Added.
* platform/graphics/gpu/GPUComputePipeline.h: Added.
(WebCore::GPUComputePipeline::platformComputePipeline const):
* platform/graphics/gpu/GPUComputePipelineDescriptor.h: Added.
(WebCore::GPUComputePipelineDescriptor::GPUComputePipelineDescriptor):
* platform/graphics/gpu/cocoa/GPUComputePipelineMetal.mm: Added.
(WebCore::tryCreateMtlComputeFunction):
(WebCore::tryCreateMTLComputePipelineState):
(WebCore::GPUComputePipeline::tryCreate):
(WebCore::GPUComputePipeline::GPUComputePipeline):
Enable creating a GPUComputePipeline from a GPUDevice:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createComputePipeline const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateComputePipeline const):
* platform/graphics/gpu/GPUDevice.h:
No longer unnecessarily ref the WebGPUCommandEncoder when creating pass encoder:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup):
(WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): Deleted.
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Deleted.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::setPipeline):
(WebCore::WebGPURenderPassEncoder::passEncoder):
(WebCore::WebGPURenderPassEncoder::passEncoder const):
* Modules/webgpu/WebGPURenderPassEncoder.h:
Updates to GPUBindGroup and *setBindGroup for compute function arguments:
* platform/graphics/gpu/GPUBindGroup.h:
(WebCore::GPUBindGroup::vertexArgsBuffer const):
(WebCore::GPUBindGroup::fragmentArgsBuffer const):
(WebCore::GPUBindGroup::computeArgsBuffer const):
(WebCore::GPUBindGroup::vertexArgsBuffer): Deleted. Const-qualified.
(WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::tryGetResourceAsMTLSamplerState): Now just returns the MTLSamplerState to reduce reference churning.
(WebCore::GPUBindGroup::tryCreate):
(WebCore::GPUBindGroup::GPUBindGroup):
(WebCore::tryGetResourceAsSampler): Renamed to tryGetResourceAsMTLSamplerState.
Updates to GPUProgrammablePassEncoder and GPURenderPassEncoder:
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
(WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
(WebCore::GPUProgrammablePassEncoder::setComputeBuffer): Added.
* platform/graphics/gpu/GPURenderPassEncoder.h:
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder):
* platform/graphics/gpu/GPURenderPipeline.h:
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Remove unecessary include.
(WebCore::GPUProgrammablePassEncoder::endPass): No longer virtual. Delegates shared behavior for derived classes.
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::setPipeline):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::GPURenderPassEncoder::useResource): These private overrides are called only by base after checking for encoder existence.
(WebCore::GPURenderPassEncoder::setVertexBuffer): Ditto.
(WebCore::GPURenderPassEncoder::setFragmentBuffer): Ditto.
(WebCore::GPURenderPassEncoder::endPass): Deleted. Now handled by base class.
2019-03-23 Simon Fraser <simon.fraser@apple.com>
REGRESSION (iOS 8): Scrollbar can't be hidden when webkit-overflow-scrolling is set to touch
https://bugs.webkit.org/show_bug.cgi?id=137043
rdar://problem/16595330
Reviewed by Zalan Bujtas.
Plumb horizontalScrollbarHiddenByStyle/verticalScrollbarHiddenByStyle through ScrollableAreaParameters
to the UI process, and use it to set UIScrollView indicators visible or not.
Tests: fast/scrolling/ios/scrollbar-hiding.html:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinatorTypes.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
(WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeScrollingNode.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalScrollbarHiddenByStyle const):
(WebCore::ScrollableArea::verticalScrollbarHiddenByStyle const):
* rendering/RenderLayer.cpp:
(WebCore::scrollbarHiddenByStyle):
(WebCore::RenderLayer::horizontalScrollbarHiddenByStyle const):
(WebCore::RenderLayer::verticalScrollbarHiddenByStyle const):
* rendering/RenderLayer.h:
2019-03-23 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Add support for observing opacity.
https://bugs.webkit.org/show_bug.cgi?id=196172
Reviewed by Simon Fraser.
This patch adds support for observing opacity changes. At this point we only track one transition at a time.
if the page registers transition on both left and opacity, the first is getting observed only.
Tests: fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-opacity-and-left.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove-with-transition.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-mousemove.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart-with-transition.html
fast/events/touch/ios/content-observation/opacity-change-happens-on-touchstart.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::isConsideredHidden):
(WebCore::ContentChangeObserver::didAddTransition):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
2019-03-23 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Check if the transitioned content is visible at onAnimationEnd
https://bugs.webkit.org/show_bug.cgi?id=196171
Reviewed by Simon Fraser.
At onAnimationEnd we don't yet have the final computed style for the transitioned content.
However the current state (before computing the final style) might already be qualified to be visible.
Introduce "CompletedTransition" to indicate that the transition is all set as far observing is concerned
(as opposed to "EndedTransition" where we still need to observe the content for the final style change).
Test: fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start-with-non-0px-end.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didFinishTransition):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
2019-03-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove build time dependency on Geoclue2
https://bugs.webkit.org/show_bug.cgi?id=195994
Reviewed by Michael Catanzaro.
Remove old Geoclue implementation.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/geoclue/GeolocationProviderGeoclue.cpp: Removed.
* platform/geoclue/GeolocationProviderGeoclue.h: Removed.
* platform/geoclue/GeolocationProviderGeoclueClient.h: Removed.
2019-03-22 Eric Carlson <eric.carlson@apple.com>
Flaky AVEncoderBitRateKey symbol not found crash on imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
https://bugs.webkit.org/show_bug.cgi?id=193724
<rdar://problem/47483831>
Reviewed by Jer Noble.
The soft link macros occasionally fail to load constants from AVFoundation.framework
which are actually in one of its sub-frameworks. While we investigate the cause
cause of the failure, ise the SOFT_LINK_CONSTANT_MAY_FAIL so we can detect the failure
and return a local copy of the string instead of crashing.
No new tests, this should prevent existing tests from crashing.
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::myAVFormatIDKey):
(WebCore::myAVNumberOfChannelsKey):
(WebCore::myAVSampleRateKey):
(WebCore::myAVEncoderBitRateKey):
2019-03-22 Youenn Fablet <youenn@apple.com>
REGRESSION: Flaky ASSERTION FAILED: !m_killed seen with http/tests/security/cross-origin-worker-indexeddb.html
https://bugs.webkit.org/show_bug.cgi?id=196024
<rdar://problem/49117272>
Reviewed by Alexey Proskuryakov.
Do not proceed with opening the database if it is being closed.
Speculative fix, this should stop making test crashing on bots.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
2019-03-22 Youenn Fablet <youenn@apple.com>
storage/indexeddb/closed-cursor-private.html is crashing on debug
https://bugs.webkit.org/show_bug.cgi?id=196101
Reviewed by Alex Christensen.
In case of immediate close for user delete, the transaction might be deleted.
If the request for space is pending, it will be executed with an error as parameter.
In that case, the call to didCommitTransaction will not find any existing transaction.
Speculative fix, test should no longer crash.
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
2019-03-22 Devin Rousso <drousso@apple.com>
Web Inspector: Safari Canvas Inspector seems to show the canvas being rendered twice per frame.
https://bugs.webkit.org/show_bug.cgi?id=196082
<rdar://problem/49113496>
Reviewed by Dean Jackson.
Tests: inspector/canvas/recording-2d.html
inspector/canvas/recording-bitmaprenderer.html
inspector/canvas/recording-html-2d.html
inspector/canvas/recording-webgl.html
inspector/canvas/setRecordingAutoCaptureFrameCount.html
WebGL `<canvas>` follow a different "rendering" path such that `HTMLCanvasElement::paint`
isn't called. Previously, there was a 0s timer that was started after the first action of a
frame was recorded (for the case that the `<canvas>` isn't attached to the DOM) that would
automatically stop the recording. It was possible that actions in two different "frame"s
were recorded as part of the same frame, because the WebGL `<canvas>` would instead fall
back to the timer to know when the "frame" had ended.
Now, there is additional instrumentation for the WebGL specific rendering path.
Additionally, replace the 0s timer with a microtask for more "immediate" calling.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
Ensure that the `InspectorInstrumentation` call is last. This matches what we expect, as
before we were instrumenting right before is it about to paint.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::Client::~Client): Added.
(WebCore::GraphicsContext3D::addClient): Added.
(WebCore::GraphicsContext3D::removeClient): Added.
(WebCore::GraphicsContext3D::setWebGLContext): Deleted.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::markLayerComposited):
(WebCore::GraphicsContext3D::forceContextLost):
(WebCore::GraphicsContext3D::recycleContext):
(WebCore::GraphicsContext3D::dispatchContextChangedNotification):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
(WebCore::WebGLRenderingContextBase::didComposite): Added.
(WebCore::WebGLRenderingContextBase::forceContextLost):
(WebCore::WebGLRenderingContextBase::recycleContext):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification): Added.
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Deleted.
Introduce a `GraphicsContext3DClient` abstract class, rather than passing the
`WebGLRenderingContextBase` directly to the `GraphicsContext3D` (layering violation).
Notify the client whenever the `GraphicsContext3D` composites, which will in turn notify the
`InspectorCanvasAgent` so that it knows that the "frame" is over.
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::requestNode):
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
(WebCore::InspectorCanvasAgent::resolveCanvasContext):
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
(WebCore::InspectorCanvasAgent::recordCanvasAction):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
(WebCore::InspectorCanvasAgent::didEnableExtension):
(WebCore::InspectorCanvasAgent::didCreateProgram):
(WebCore::InspectorCanvasAgent::willDeleteProgram):
(WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::clearCanvasData):
(WebCore::InspectorCanvasAgent::assertInspectorCanvas):
(WebCore::InspectorCanvasAgent::findInspectorCanvas):
(WebCore::InspectorCanvasAgent::assertInspectorProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram):
(WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): Deleted.
Replace raw pointers with `RefPtr`s. This is primarily used so that the microtask (instead
of a timer) that is enqueued after the first action of each frame is recorded can access a
ref-counted instance of an `InspectorCanvas`, ensuring that it isn't destructed.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::canvasElement):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::finalizeFrame):
(WebCore::InspectorCanvas::releaseObjectForRecording): Added.
(WebCore::InspectorCanvas::getCanvasContentAsDataURL):
(WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::releaseInitialState): Deleted.
(WebCore::InspectorCanvas::releaseFrames): Deleted.
(WebCore::InspectorCanvas::releaseData): Deleted.
Move the recording payload construction logic to `InspectorCanvas` so the actual data
doesn't need to leave that class.
Drive-by: unify the logic for getting the contents of a canvas from `InspectorCanvasAgent`.
2019-03-22 Keith Rollin <krollin@apple.com>
Enable ThinLTO support in Production builds
https://bugs.webkit.org/show_bug.cgi?id=190758
<rdar://problem/45413233>
Reviewed by Daniel Bates.
Enable building with Thin LTO in Production when using Xcode 10.2 or
later. This change results in a 1.45% progression in PLT5. Full
Production build times increase about 2-3%. Incremental build times
are more severely affected, and so LTO is not enabled for local
engineering builds.
LTO is enabled only on macOS for now, until rdar://problem/49013399,
which affects ARM builds, is fixed.
Removed the conditionals that disabled LTO on 32-bit systems since we
no longer build for those.
To change the LTO setting when building locally:
- If building with `make`, specify WK_LTO_MODE={none,thin,full} on the
command line.
- If building with `build-webkit`, specify --lto-mode={none,thin,full}
on the command line.
- If building with `build-root`, specify --lto={none,thin,full} on the
command line.
- If building with Xcode, create a LocalOverrides.xcconfig file at the
top level of your repository directory (if needed) and define
WK_LTO_MODE to full, thin, or none.
No new tests since there should be no observable behavior difference.
* Configurations/Base.xcconfig:
2019-03-22 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r243356.
Causes assertion failures with WebGL layout tests on macOS and
iOS.
Reverted changeset:
"Web Inspector: Safari Canvas Inspector seems to show the
canvas being rendered twice per frame."
https://bugs.webkit.org/show_bug.cgi?id=196082
https://trac.webkit.org/changeset/243356
2019-03-22 Antti Koivisto <antti@apple.com>
Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes
https://bugs.webkit.org/show_bug.cgi?id=196100
<rdar://problem/49117933>
Reviewed by Simon Fraser.
Test: fast/scrolling/ios/overflow-scroll-overlap-6.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::positionedNodesWithRelatedOverflow):
Add a separate map of positioned node ids for easy access.
* page/scrolling/cocoa/ScrollingTreePositionedNode.h:
(WebCore::ScrollingTreePositionedNode::scrollPositioningBehavior const):
(WebCore::ScrollingTreePositionedNode::relatedOverflowScrollingNodes const):
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
2019-03-22 Antoine Quint <graouts@apple.com>
[Web Animations] com.apple.WebKit.WebContent.Development at com.apple.WebCore: WebCore::WebAnimation::timeToNextTick const + 757
https://bugs.webkit.org/show_bug.cgi?id=196125
<rdar://problem/46520059>
Reviewed by Dean Jackson.
Because of floating point math in playState() that wouldn't account for timeEpsilon, we would get into a state where the animation phase
was "after" but the play state was "running" when the current time was about a microsecond away from the active time boundary. This meant
that the early return statement in WebAnimation::timeToNextTick() would not be hit while we would not handle the possibility of being in
the "after" phase in the rest of the function, therefore eventually hitting the ASSERT_NOT_REACHED() at the end of the function.
We now account for timeEpsilon in playState() and correctly report we're in the "finished" play state when in the "after" phase also.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):
2019-03-22 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Don't construct segments on PlaybackPipeline::flush
https://bugs.webkit.org/show_bug.cgi?id=195867
Reviewed by Xabier Rodriguez-Calvar.
The previous approach did not really work for flushes on only one
branch, as setting reset-time in FLUSH_STOP affects the running time
of the entire pipeline, causing timing issues in the other branch.
Since it's preferable not to interfere with the other branch if
possible, setting reset-time to FALSE fixes that problem.
Also, it's not necessary to fabricate a segment. Since we are not
seeking, only the base needs to be adjusted, and gstbasesrc already
handles this correctly by default.
This fixes an audio/video synchronization bug in YT when some
automatic quality changes occur.
Tests: imported/w3c/web-platform-tests/media-source/mediasource-correct-frames-after-reappend.html
imported/w3c/web-platform-tests/media-source/mediasource-correct-frames.html
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::flush):
2019-03-22 Frederic Wang <fwang@igalia.com>
Move implementation of mathsize to a single place
https://bugs.webkit.org/show_bug.cgi?id=196129
Reviewed by Ryosuke Niwa.
Currently, mathsize is partially implemented in the MathML UA stylesheet and partially
implemented in the MathML DOM classes using addPropertyToPresentationAttributeStyle. This
patch moves the whole implementation to the latter place, so that it's easier to understand.
It will also allow to conditionally disable the mathsize values removed from MathML Core.
No new tests, already covered by existing tests.
* css/mathml.css: Remove mathsize rules.
* mathml/MathMLElement.cpp:
(WebCore::convertMathSizeIfNeeded): Convert "small", "normal" and "big" to the values that
used to be in the UA stylesheet. Also add a comment that we don't support all MathML lengths.
(WebCore::MathMLElement::collectStyleForPresentationAttribute): Don't skip "small", "normal"
or "big".
(WebCore::convertToPercentageIfNeeded): Renamed to convertMathSizeIfNeeded.
2019-03-21 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG tear off objects for SVGNumber, SVGNumberList and SVGAnimatedNumberList
https://bugs.webkit.org/show_bug.cgi?id=196084
Reviewed by Simon Fraser.
To remove the tear off objects for these interfaces, we need to do the
following:
-- SVGNumber will be a superclass of SVGValueProperty<float>. It provides
the DOM interface functions.
-- SVGNumberList will be a superclass of SVGValuePropertyList<SVGNumber>.
It provides creation, parsing and converting to string functions.
-- SVGAnimatedNumberList will be defined as SVGAnimatedPropertyList<SVGNumberList>.
To make things work as expected:
-- Properties of type SVGAnimatedNumberList have to be registered with
SVGPropertyOwnerRegistry.
-- An accessor, an animator and an animation function should be defined
for SVGAnimatedNumberList.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/svg/SVGTextLayoutAttributesBuilder.cpp:
(WebCore::updateCharacterData):
(WebCore::SVGTextLayoutAttributesBuilder::fillCharacterDataMap):
* svg/SVGAnimatedNumberList.cpp: Removed.
* svg/SVGAnimatedNumberList.h: Removed.
* svg/SVGAnimatedPointList.cpp: Removed.
* svg/SVGAnimatedPointList.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
(WebCore::SVGComponentTransferFunctionElement::registerAttributes):
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGComponentTransferFunctionElement::tableValues const):
(WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
(WebCore::SVGFEColorMatrixElement::registerAttributes):
(WebCore::SVGFEColorMatrixElement::parseAttribute):
(WebCore::SVGFEColorMatrixElement::build const):
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::build const):
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGNumber.h:
(WebCore::SVGNumber::create):
(WebCore::SVGNumber::clone const):
(WebCore::SVGNumber::valueForBindings):
(WebCore::SVGNumber::setValueForBindings):
(WebCore::SVGNumber::SVGNumber): Deleted.
* svg/SVGNumberList.h:
(WebCore::SVGNumberList::create):
(WebCore::SVGNumberList::parse):
(WebCore::SVGNumberList::SVGNumberList): Deleted.
* svg/SVGNumberListValues.cpp: Removed.
* svg/SVGNumberListValues.h: Removed.
* svg/SVGTextPositioningElement.cpp:
(WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
(WebCore::SVGTextPositioningElement::registerAttributes):
(WebCore::SVGTextPositioningElement::parseAttribute):
* svg/SVGTextPositioningElement.h:
(WebCore::SVGTextPositioningElement::rotate const):
(WebCore::SVGTextPositioningElement::rotateAnimated):
* svg/SVGValue.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimationAdditiveListFunctionImpl.h:
(WebCore::SVGAnimationNumberListFunction::progress):
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-03-21 Devin Rousso <drousso@apple.com>
Web Inspector: Safari Canvas Inspector seems to show the canvas being rendered twice per frame.
https://bugs.webkit.org/show_bug.cgi?id=196082
<rdar://problem/49113496>
Reviewed by Dean Jackson.
Tests: inspector/canvas/recording-2d.html
inspector/canvas/recording-bitmaprenderer.html
inspector/canvas/recording-html-2d.html
inspector/canvas/recording-webgl.html
inspector/canvas/setRecordingAutoCaptureFrameCount.html
WebGL `<canvas>` follow a different "rendering" path such that `HTMLCanvasElement::paint`
isn't called. Previously, there was a 0s timer that was started after the first action of a
frame was recorded (for the case that the `<canvas>` isn't attached to the DOM) that would
automatically stop the recording. It was possible that actions in two different "frame"s
were recorded as part of the same frame, because the WebGL `<canvas>` would instead fall
back to the timer to know when the "frame" had ended.
Now, there is additional instrumentation for the WebGL specific rendering path.
Additionally, replace the 0s timer with a microtask for more "immediate" calling.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::paint):
Ensure that the `InspectorInstrumentation` call is last. This matches what we expect, as
before we were instrumenting right before is it about to paint.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::Client::~Client): Added.
(WebCore::GraphicsContext3D::addClient): Added.
(WebCore::GraphicsContext3D::removeClient): Added.
(WebCore::GraphicsContext3D::setWebGLContext): Deleted.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::markLayerComposited):
(WebCore::GraphicsContext3D::forceContextLost):
(WebCore::GraphicsContext3D::recycleContext):
(WebCore::GraphicsContext3D::dispatchContextChangedNotification):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
(WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D):
(WebCore::WebGLRenderingContextBase::didComposite): Added.
(WebCore::WebGLRenderingContextBase::forceContextLost):
(WebCore::WebGLRenderingContextBase::recycleContext):
(WebCore::WebGLRenderingContextBase::dispatchContextChangedNotification): Added.
(WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Deleted.
Introduce a `GraphicsContext3DClient` abstract class, rather than passing the
`WebGLRenderingContextBase` directly to the `GraphicsContext3D` (layering violation).
Notify the client whenever the `GraphicsContext3D` composites, which will in turn notify the
`InspectorCanvasAgent` so that it knows that the "frame" is over.
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::requestNode):
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
(WebCore::InspectorCanvasAgent::resolveCanvasContext):
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::requestShaderSource):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
(WebCore::InspectorCanvasAgent::recordCanvasAction):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
(WebCore::InspectorCanvasAgent::didEnableExtension):
(WebCore::InspectorCanvasAgent::didCreateProgram):
(WebCore::InspectorCanvasAgent::willDeleteProgram):
(WebCore::InspectorCanvasAgent::isShaderProgramDisabled):
(WebCore::InspectorCanvasAgent::isShaderProgramHighlighted):
(WebCore::InspectorCanvasAgent::clearCanvasData):
(WebCore::InspectorCanvasAgent::assertInspectorCanvas):
(WebCore::InspectorCanvasAgent::findInspectorCanvas):
(WebCore::InspectorCanvasAgent::assertInspectorProgram):
(WebCore::InspectorCanvasAgent::findInspectorProgram):
(WebCore::InspectorCanvasAgent::canvasRecordingTimerFired): Deleted.
Replace raw pointers with `RefPtr`s. This is primarily used so that the microtask (instead
of a timer) that is enqueued after the first action of each frame is recorded can access a
ref-counted instance of an `InspectorCanvas`, ensuring that it isn't destructed.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::canvasElement):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::finalizeFrame):
(WebCore::InspectorCanvas::releaseObjectForRecording): Added.
(WebCore::InspectorCanvas::getCanvasContentAsDataURL):
(WebCore::InspectorCanvas::appendActionSnapshotIfNeeded):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::releaseInitialState): Deleted.
(WebCore::InspectorCanvas::releaseFrames): Deleted.
(WebCore::InspectorCanvas::releaseData): Deleted.
Move the recording payload construction logic to `InspectorCanvas` so the actual data
doesn't need to leave that class.
Drive-by: unify the logic for getting the contents of a canvas from `InspectorCanvasAgent`.
2019-03-21 Tim Horton <timothy_horton@apple.com>
Adopt UIWKDocumentContext
https://bugs.webkit.org/show_bug.cgi?id=196040
<rdar://problem/48642440>
Reviewed by Ryosuke Niwa.
New API test: WebKit.DocumentEditingContext
* dom/Range.h:
* editing/TextGranularity.h:
Make TextGranularity encodable by providing EnumTraits.
* editing/TextIterator.cpp:
(WebCore::plainTextReplacingNoBreakSpace):
* editing/TextIterator.h:
Expose an nbsp-replacing variant of plainText that takes Positions instead of Ranges.
2019-03-21 Sihui Liu <sihui_liu@apple.com>
Fix key path extraction code in IndexedDB to check own property
https://bugs.webkit.org/show_bug.cgi?id=196099
Reviewed by Ryosuke Niwa.
Covered by existing tests.
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::cmp):
We don't need to check the second parameters if the first is already invalid.
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::bound):
Ditto.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
we should not clear the exception during serialization because the execeptions may be explicitly thrown by parameters.
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::get):
Fix implementation according to https://www.w3.org/TR/IndexedDB-2/#extract-key-from-value.
(WebCore::canInjectNthValueOnKeyPath):
Check the last identifier.
2019-03-21 Antoine Quint <graouts@apple.com>
[Web Animations] JS wrapper may be deleted while animation is yet to dispatch its finish event
https://bugs.webkit.org/show_bug.cgi?id=196118
<rdar://problem/46614137>
Reviewed by Ryosuke Niwa.
Test: webanimations/js-wrapper-kept-alive.html
We need to teach WebAnimation to keep its JS wrapper alive if it's relevant or could become relevant again by virtue of having a timeline.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::stop): Drive-by fix for the missing superclass method call.
(WebCore::WebAnimation::hasPendingActivity const):
* animation/WebAnimation.h:
2019-03-21 Jer Noble <jer.noble@apple.com>
Inband Text Track cues interspersed with Data cues can display out of order.
https://bugs.webkit.org/show_bug.cgi?id=196095
Reviewed by Eric Carlson.
The compareCueIntervalForDisplay() comparator depends on a virtual function, isPositionedAbove(TextTrackCue* other),
but this comparison returns inconsistent results for cueA->isPositionedAbove(cueB) and cueB->isPositionedAbove(cueA)
if the two cues are different subclasses of TextTrackCue.
The underlying algorithm should be fixed in a future patch, but for now, remove all non-displaying cues from the array
of activeCues before sorting, rather than after when iterating over the sorted list of activeCues.
* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay):
2019-03-21 Youenn Fablet <youenn@apple.com>
Cache API and IDB space usages should be initialized on first quota check
https://bugs.webkit.org/show_bug.cgi?id=195707
Reviewed by Chris Dumez.
Add a way to require IDBServer to create a quota user for a given origin.
Make sure that removing a user might kick-in processing of pending requests.
In the case of processing pending requests, we should not decide on the first task
except if it is triggered by a request space response.
Update processPendingRequests accordingly.
Tests: http/tests/IndexedDB/storage-limit-1.https.html
http/tests/IndexedDB/storage-limit-2.https.html
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::initializeQuotaUser):
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::removeUser):
(WebCore::StorageQuotaManager::askForMoreSpace):
(WebCore::StorageQuotaManager::processPendingRequests):
* storage/StorageQuotaManager.h:
2019-03-21 Alex Christensen <achristensen@webkit.org>
Fix iOS build after r243337
https://bugs.webkit.org/show_bug.cgi?id=195935
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
(WebCore::playbackSessionModel const): Deleted.
2019-03-21 Brent Fulgham <bfulgham@apple.com>
Hardening: Use WeakPtrs in PlaybackSessionInterface{Mac,AVKit}
https://bugs.webkit.org/show_bug.cgi?id=195935
<rdar://problem/49007015>
Reviewed by Eric Carlson.
The PlaybackSessionInterface{Mac,AVKit} implementations store their playback session model
and playback controls manager members as bare pointers, something we've been working
to eliminate.
This patch corrects this oversight.
No new tests since no changes in behavior.
* platform/cocoa/PlaybackSessionModel.h:
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::playbackSessionModel const): Moved to implementation since WEBCORE_EXPORT is not
supposed to be used with inline methods.
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
(WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
(WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::PlaybackSessionInterfaceMac::endScrubbing):
(WebCore::PlaybackSessionInterfaceMac::playBackControlsManager):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
2019-03-21 Said Abou-Hallawa <said@apple.com>
Remove the SVG tear off objects for SVGPoint, SVGPointList and SVGAnimatedPointList
https://bugs.webkit.org/show_bug.cgi?id=195905
Reviewed by Simon Fraser.
To remove the SVG tear off objects for SVGPoint, SVGPointList and
SVGAnimatedPointList, these changes are needed:
-- Define SVGPoint to be a superclass of SVGValueProperty<FloatPoint>.
-- Define SVGAnimatedPointList to be a superclass of SVGAnimatedPropertyList<SVGPointList>
-- Add SVGPropertyList which is a superclass of SVGList. Its items are
defined to RefCounted. It is the base class of SVGValuePropertyList
and it will be the base class of SVGPathSegList in a later patch.
-- Add SVGValuePropertyList which is the base class of all the lists whose
items are backed by a value objects like SVGPoint. The difference between
SVGPropertyList and SVGValuePropertyList is the former class can store
a Ref pointer of the base class like SVGPathSeg while the later type
has to store the same type for all the items.
-- Add SVGAnimatedPropertyList which is the base class for all the animated
lists. Note that:
1) SVGElement owns SVGAnimatedPropertyList
2) SVGAnimatedPropertyList owns m_baseVal whose type is SVGList
3) m_baseVal owns the items whose type is a superclass of SVGProperty.
When changing an item, it calls its owner which is an SVGList.
SVGList calls its owner which is SVGAnimatedPropertyList.
SVGAnimatedPropertyList calls its owner which SVGElement to commit
the change. Later SVGAnimatedPropertyList::synchronize() is called
which returns the property valueAsString() to update the reflecting
attribute.
-- New accessor, animator and animation function are added to access
and animate a member of type SVGAnimatedPropertyList.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/svg/SVGPathData.cpp:
(WebCore::pathFromCircleElement):
(WebCore::pathFromEllipseElement):
(WebCore::pathFromLineElement):
(WebCore::pathFromPathElement):
(WebCore::pathFromPolygonElement):
(WebCore::pathFromPolylineElement):
(WebCore::pathFromRectElement):
(WebCore::pathFromGraphicsElement):
* rendering/svg/SVGPathData.h:
The IDL of SVGPolyElement interface requires the following attribute:
readonly attribute SVGPointList points;
For which we return:
SVGPointList& points() { return m_points->baseVal(); }
But for all the other properties we return the currentValue(). So to have
the two functions with the same name, the following function is added:
const SVGPointList& points() const { return m_points->currentValue(); }
This definition requires changing all callers to be const.
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::operator<<):
* svg/SVGAnimatedPointList.cpp: Removed.
* svg/SVGAnimatedPointList.h: Removed.
* svg/SVGAnimatedType.h:
(WebCore::SVGAnimatedType::type const):
This function had a bad design. It was designed to use the index of the
variant as the AnimatedPropertyType. But when some of the types are removed
from SVGValueVariant, this broke things. This fix is temporary till the
class SVGValueVariant is removed.
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGExternalResourcesRequired.cpp:
* svg/SVGParserUtilities.cpp:
(WebCore::pointsListFromSVGData): Deleted.
* svg/SVGParserUtilities.h:
* svg/SVGPoint.h:
(WebCore::SVGPoint::create):
(WebCore::SVGPoint::clone const):
(WebCore::SVGPoint::x):
(WebCore::SVGPoint::setX):
(WebCore::SVGPoint::y):
(WebCore::SVGPoint::setY):
(WebCore::SVGPoint::matrixTransform const):
(WebCore::SVGPoint::matrixTransform): Deleted.
(WebCore::SVGPoint::SVGPoint): Deleted.
* svg/SVGPoint.idl:
matrixTransform() should not throw an exception.
* svg/SVGPointList.h:
(WebCore::SVGPointList::create):
(WebCore::SVGPointList::parse):
(WebCore::SVGPointList::SVGPointList): Deleted.
Move the parse() and valueAsString() methods to SVGPointList. It is now
a superclass of SVGValuePropertyList. Its items are of type Ref<SVGPoint>.
* svg/SVGPointListValues.cpp: Removed.
* svg/SVGPointListValues.h: Removed.
* svg/SVGPolyElement.cpp:
(WebCore::SVGPolyElement::SVGPolyElement):
(WebCore::SVGPolyElement::parseAttribute):
(WebCore::SVGPolyElement::approximateMemoryCost const):
(WebCore::SVGPolyElement::registerAttributes): Deleted.
(WebCore::SVGPolyElement::points): Deleted.
(WebCore::SVGPolyElement::animatedPoints): Deleted.
* svg/SVGPolyElement.h:
(WebCore::SVGPolyElement::points const):
(WebCore::SVGPolyElement::points):
(WebCore::SVGPolyElement::animatedPoints):
(WebCore::SVGPolyElement::pointList const): Deleted.
(WebCore::SVGPolyElement::attributeRegistry): Deleted.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::setCurrentTranslate):
(WebCore::SVGSVGElement::currentTranslate): Deleted.
* svg/SVGSVGElement.h:
* svg/SVGSVGElement.idl:
Define currentTranslate property to be of type Ref<SVGPoint>. When requesting
it just return a reference to it.
* svg/SVGValue.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimatedPropertyList.h: Added.
Define the accessor, the animator and the animated type of SVGPointList.
(WebCore::SVGAnimatedPropertyList::create):
(WebCore::SVGAnimatedPropertyList::~SVGAnimatedPropertyList):
(WebCore::SVGAnimatedPropertyList::baseVal const):
(WebCore::SVGAnimatedPropertyList::baseVal):
(WebCore::SVGAnimatedPropertyList::animVal const):
(WebCore::SVGAnimatedPropertyList::animVal):
(WebCore::SVGAnimatedPropertyList::currentValue const):
(WebCore::SVGAnimatedPropertyList::SVGAnimatedPropertyList):
(WebCore::SVGAnimatedPropertyList::ensureAnimVal):
* svg/properties/SVGAnimationAdditiveListFunction.h: Added.
(WebCore::SVGAnimationAdditiveListFunction::SVGAnimationAdditiveListFunction):
(WebCore::SVGAnimationAdditiveListFunction::toAtEndOfDuration const):
(WebCore::SVGAnimationAdditiveListFunction::adjustAnimatedList):
* svg/properties/SVGAnimationAdditiveListFunctionImpl.h: Added.
(WebCore::SVGAnimationPointListFunction::progress):
Define the animation function for animating SVGPointList.
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPropertyList.h: Added.
(WebCore::SVGPropertyList::SVGPropertyList):
(WebCore::SVGPropertyList::~SVGPropertyList):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
* svg/properties/SVGValuePropertyList.h: Added.
(WebCore::SVGValuePropertyList::operator=):
(WebCore::SVGValuePropertyList::operator Vector<typename PropertyType::ValueType> const):
(WebCore::SVGValuePropertyList::resize):
(WebCore::SVGValuePropertyList::SVGValuePropertyList):
2019-03-21 Said Abou-Hallawa <said@apple.com>
Remove the SVG property tear off objects for SVGAnimatedString
https://bugs.webkit.org/show_bug.cgi?id=196065
Reviewed by Simon Fraser.
-- Define SVGAnimatedString to be SVGAnimatedPrimitiveProperty<String>.
-- Add SVGAnimatedStringAccessor to associate an attribute name with a
pointer to an SVGAnimatedString member of an SVGElement. Given a
pointer to an SVGElement, this accessor will and create an animator
for the animated property.
-- Add SVGAnimatedStringAnimator to animated an SVGAnimatedString.
-- Add SVGAnimationStringFunction which is a discrete function and is
responsible for progressing an animated String over a period of time.
-- Define SVGStringAnimator to be SVGPrimitivePropertyAnimator<String,
SVGAnimationStringFunction>. SVGStringAnimator is responsible for
animating attributes with no reflecting animated properties, e.g.
"font-family".
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::SVGAElement):
(WebCore::SVGAElement::parseAttribute):
(WebCore::SVGAElement::registerAttributes): Deleted.
* svg/SVGAElement.h:
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::hasValidAttributeType const):
(WebCore::SVGAnimateElementBase::isDiscreteAnimator const):
* svg/SVGAnimateElementBase.h:
* svg/SVGAnimatedString.cpp: Removed.
* svg/SVGAnimatedString.h: Removed.
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::currentValuesForValuesAnimation):
The animation controller has to tell whether the animator is discrete or
not. The properties are now registered either in SVGAttributeRegistry which
relies on the tear off objects to know the AnimatedPropertyType of the
property. Or it is registered in SVGPropertyOwnerRegistry which creates
the animators through the accessors. Each animator knows whether it is
discrete or not.
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGAttributeAnimationController.cpp:
(WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
* svg/SVGAttributeAnimationController.h:
* svg/SVGAttributeAnimationControllerBase.h:
* svg/SVGCursorElement.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::SVGElement):
(WebCore::SVGElement::parseAttribute):
(WebCore::SVGElement::registerAttributes): Deleted.
* svg/SVGElement.h:
(WebCore::SVGElement::isKnownAttribute):
(WebCore::SVGElement::className const):
(WebCore::SVGElement::classNameAnimated):
(WebCore::SVGElement::attributeRegistry): Deleted.
* svg/SVGExternalResourcesRequired.cpp:
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::SVGFEBlendElement):
(WebCore::SVGFEBlendElement::registerAttributes):
(WebCore::SVGFEBlendElement::parseAttribute):
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
(WebCore::SVGFEColorMatrixElement::registerAttributes):
(WebCore::SVGFEColorMatrixElement::parseAttribute):
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
(WebCore::SVGFEComponentTransferElement::parseAttribute):
(WebCore::SVGFEComponentTransferElement::registerAttributes): Deleted.
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::SVGFECompositeElement):
(WebCore::SVGFECompositeElement::registerAttributes):
(WebCore::SVGFECompositeElement::parseAttribute):
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
(WebCore::SVGFEDiffuseLightingElement::parseAttribute):
(WebCore::SVGFEDiffuseLightingElement::registerAttributes): Deleted.
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
(WebCore::SVGFEDisplacementMapElement::registerAttributes):
(WebCore::SVGFEDisplacementMapElement::parseAttribute):
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
(WebCore::SVGFEDropShadowElement::parseAttribute):
(WebCore::SVGFEDropShadowElement::svgAttributeChanged):
(WebCore::SVGFEDropShadowElement::registerAttributes): Deleted.
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
(WebCore::SVGFEGaussianBlurElement::registerAttributes):
(WebCore::SVGFEGaussianBlurElement::parseAttribute):
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEMergeNodeElement.cpp:
(WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
(WebCore::SVGFEMergeNodeElement::parseAttribute):
(WebCore::SVGFEMergeNodeElement::registerAttributes): Deleted.
* svg/SVGFEMergeNodeElement.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
(WebCore::SVGFEMorphologyElement::registerAttributes):
(WebCore::SVGFEMorphologyElement::parseAttribute):
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
(WebCore::SVGFEOffsetElement::parseAttribute):
(WebCore::SVGFEOffsetElement::svgAttributeChanged):
(WebCore::SVGFEOffsetElement::registerAttributes): Deleted.
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
(WebCore::SVGFESpecularLightingElement::parseAttribute):
(WebCore::SVGFESpecularLightingElement::registerAttributes): Deleted.
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::SVGFETileElement):
(WebCore::SVGFETileElement::parseAttribute):
(WebCore::SVGFETileElement::registerAttributes): Deleted.
* svg/SVGFETileElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.cpp:
(WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
(WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
(WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::result const):
(WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
* svg/SVGLegacyAttributeAnimationController.cpp:
(WebCore::SVGLegacyAttributeAnimationController::isDiscreteAnimator const):
* svg/SVGLegacyAttributeAnimationController.h:
* svg/SVGMPathElement.h:
* svg/SVGScriptElement.h:
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::SVGURIReference):
(WebCore::SVGURIReference::isKnownAttribute):
(WebCore::SVGURIReference::parseAttribute):
(WebCore::SVGURIReference::registerAttributes): Deleted.
(WebCore::SVGURIReference::href const): Deleted.
(WebCore::SVGURIReference::hrefAnimated): Deleted.
* svg/SVGURIReference.h:
(WebCore::SVGURIReference::href const):
(WebCore::SVGURIReference::hrefAnimated):
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
* svg/properties/SVGPropertyAnimatorFactory.h:
(WebCore::SVGPropertyAnimatorFactory::createStringAnimator):
(WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-03-21 Zalan Bujtas <zalan@apple.com>
Do not insert the first-letter anonymous container until after we've constructed the first-letter renderer.
https://bugs.webkit.org/show_bug.cgi?id=195919
<rdar://problem/48573434>
Reviewed by Brent Fulgham.
When the container is injected too early, we might end up removing it as part of the collapsing logic
while the text renderer is being removed (replaced with the first letter + remaining text).
Test: fast/css/first-letter-and-float-crash.html
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2019-03-21 Eric Carlson <eric.carlson@apple.com>
Add UI process WebRTC runtime logging.
https://bugs.webkit.org/show_bug.cgi?id=196020
<rdar://problem/49071443>
Reviewed by Youenn Fablet.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels): Deleted.
(WebCore::channelConfigurationForString): Deleted.
(WebCore::WebConsoleAgent::setLoggingChannelLevel): Deleted.
* inspector/agents/WebConsoleAgent.h:
* inspector/agents/page/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::PageConsoleAgent): Change 'context' parameter from
WebAgentContext to PageAgentContext. Store the inspected page for later use.
(WebCore::PageConsoleAgent::getLoggingChannels): Moved from WebConsoleAgent.
(WebCore::channelConfigurationForString): Ditto.
(WebCore::PageConsoleAgent::setLoggingChannelLevel): Moved from WebConsoleAgent.
Call the inspected page to actually change the log channel configuration.
* inspector/agents/page/PageConsoleAgent.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::configureLoggingChannel): New.
* page/Page.h:
2019-03-21 Andy Estes <aestes@apple.com>
[iOS] Apple Pay should be available in documents with no user agent scripts
https://bugs.webkit.org/show_bug.cgi?id=196061
<rdar://problem/48649391>
Reviewed by Brady Eidson.
On platforms that support APPLE_PAY_REMOTE_UI, we can enable Apple Pay JS and Payment Request
by default in all WebKit clients.
In order to protect the privacy of Apple Pay transactions, this patch implements the
following restrictions on API usage:
1. If user agent scripts have been evaluated in a document, Apple Pay APIs will no longer be
available for the duration of the document's lifetime.
2. If an Apple Pay transaction has started in a document, user agent scripts will no longer
be evaluated for the duration of the document's lifetime.
These restrictions are disabled for clients with the
com.apple.private.WebKit.UnrestrictedApplePay entitlement and platforms that do support
Apple Pay but don't support APPLE_PAY_REMOTE_UI.
Added new API tests.
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::supportsVersion):
(WebCore::ApplePaySession::canMakePayments):
(WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
(WebCore::ApplePaySession::openPaymentSetup):
(WebCore::ApplePaySession::begin):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePaySession.idl:
* 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::shouldAllowApplePay const):
(WebCore::PaymentCoordinator::shouldAllowUserAgentScripts const):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::supportsUnrestrictedApplePay const):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::show):
(WebCore::ApplePayPaymentHandler::canMakePayment):
(WebCore::ApplePayPaymentHandler::version const):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):
(WebCore::PaymentRequest::canMakePayment):
Plumbed a Document& through to the various places that call into PaymentCoordinator for use
by shouldAllowApplePay and shouldAllowUserAgentScripts.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeUserAgentScriptInWorld):
(WebCore::ScriptController::shouldAllowUserAgentScripts const):
* bindings/js/ScriptController.h:
Added executeUserAgentScriptInWorld, which calls executeScriptInWorld if allowed.
* dom/Document.cpp:
(WebCore::Document::ensurePlugInsInjectedScript):
Changed to only evaluate the chrome client's plug-in extra script if allowed, and to mark
the document as having evaluated user agent scripts.
(WebCore::Document::hasEvaluatedUserAgentScripts const):
(WebCore::Document::isRunningUserScripts const):
(WebCore::Document::setAsRunningUserScripts):
(WebCore::Document::setHasEvaluatedUserAgentScripts):
(WebCore::Document::hasStartedApplePaySession const):
(WebCore::Document::setHasStartedApplePaySession):
* dom/Document.h:
Added helper functions to set state on the top document.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
Removed call to topDocument() now that isRunningUserScripts() always checks the top document.
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
Changed to only inject the user script if allowed.
* page/Settings.yaml:
* page/SettingsDefaultValues.h:
Enabled Apple Pay by default on platforms that enable APPLE_PAY_REMOTE_UI.
* testing/Internals.cpp:
(WebCore::Internals::setAsRunningUserScripts):
(WebCore::Internals::setHasStartedApplePaySession):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
Added some internal interfaces for use by TestWebKitAPI.
2019-03-21 Alex Christensen <achristensen@webkit.org>
Add SPI to inform applications of WKContentRuleList actions
https://bugs.webkit.org/show_bug.cgi?id=195965
<rdar://problem/42664365>
Reviewed by Geoff Garen.
We already had SPI to inform the application of notifications.
In order to inform it about other actions, I needed to put them in a different structure.
Basically, instead of a Vector<Action> I use a Vector<Vector<Action>> that contains the same actions.
That way we can give one callback per WKContentRuleList.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionActions.h:
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::loadEncodedRules):
* contentextensions/ContentExtensionRule.cpp:
(WebCore::ContentExtensions::Action::isolatedCopy const):
* contentextensions/ContentExtensionRule.h:
(WebCore::ContentExtensions::Action::operator== const):
(WebCore::ContentExtensions::Action::setExtensionIdentifier): Deleted.
(WebCore::ContentExtensions::Action::extensionIdentifier const): Deleted.
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForPingLoad):
(WebCore::ContentExtensions::applyResultsToRequest):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): Deleted.
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): Deleted.
(WebCore::ContentExtensions::applyBlockedStatusToRequest): Deleted.
* contentextensions/ContentExtensionsBackend.h:
* contentextensions/ContentRuleListResults.h: Added.
(WebCore::ContentRuleListResults::Result::shouldNotifyApplication const):
(WebCore::ContentRuleListResults::shouldNotifyApplication const):
(WebCore::ContentRuleListResults::encode const):
(WebCore::ContentRuleListResults::decode):
(WebCore::ContentRuleListResults::Result::encode const):
(WebCore::ContentRuleListResults::Result::decode):
(WebCore::ContentRuleListResults::Summary::encode const):
(WebCore::ContentRuleListResults::Summary::decode):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::subresourcesAllowReuse const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/PingLoader.cpp:
(WebCore::processContentRuleListsForLoad):
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):
(WebCore::processContentExtensionRulesForLoad): Deleted.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::applyResults):
(WebCore::CachedResourceRequest::applyBlockedStatus): Deleted.
* loader/cache/CachedResourceRequest.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::contentRuleListNotification):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::open):
* page/UserContentProvider.cpp:
(WebCore::UserContentProvider::processContentRuleListsForLoad):
(WebCore::UserContentProvider::actionsForResourceLoad):
(WebCore::UserContentProvider::processContentExtensionRulesForLoad): Deleted.
* page/UserContentProvider.h:
2019-03-21 Simon Fraser <simon.fraser@apple.com>
Add an internal feature flag to disable the -webkit-overflow-scrolling CSS property
https://bugs.webkit.org/show_bug.cgi?id=196058
rdar://problem/49078202
Reviewed by Antti Koivisto.
Add an internal setting called "legacyOverflowScrollingTouchEnabled", initially
on by default.
When disabled, it makes the -webkit-overflow-scrolling property be unsupported.
Tests: fast/scrolling/ios/overflow-scrolling-touch-disabled-stacking.html
fast/scrolling/ios/overflow-scrolling-touch-enabled-stacking.html
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* css/parser/CSSParserFastPaths.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/Settings.yaml:
2019-03-21 Antti Koivisto <antti@apple.com>
UI-process hit-testing needs to know about containing block relationships
https://bugs.webkit.org/show_bug.cgi?id=195845
<rdar://problem/48949633>
Reviewed by Simon Fraser.
Test: fast/scrolling/ios/overflow-scroll-overlap-5.html
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/cocoa/ScrollingTreePositionedNode.h:
(WebCore::ScrollingTreePositionedNode::layer const):
2019-03-21 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Cleanup reset state.
https://bugs.webkit.org/show_bug.cgi?id=196076
<rdar://problem/49107931>
Reviewed by Simon Fraser.
stopObservingPendingActivities() is a subset of reset() and call it when we've observed a visible change.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::willNotProceedWithClick):
(WebCore::ContentChangeObserver::stopObservingPendingActivities):
(WebCore::ContentChangeObserver::reset):
(WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
(WebCore::ContentChangeObserver::willDetachPage):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::cancelPendingActivities): Deleted.
* page/ios/ContentChangeObserver.h:
2019-03-21 Zalan Bujtas <zalan@apple.com>
Unreviewed build fix.
* page/ios/ContentChangeObserver.h:
2019-03-21 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Start tracking implicit transitions at mousemove
https://bugs.webkit.org/show_bug.cgi?id=196054
<rdar://problem/49093840>
Reviewed by Simon Fraser.
This patch fixes the hover menu issue on seriouseats.com. After tapping on the menu items, the submenus show up now.
1. Start observing at mousemove
2. Check if the style change is synchronous or not and start observing it accordingly.
Tests: fast/events/touch/ios/content-observation/0ms-delay-0ms-transition-on-mousemove.html
fast/events/touch/ios/content-observation/100ms-delay-10ms-transition-on-mousemove.html
fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-mousemove.html
fast/events/touch/ios/content-observation/10ms-delay-0ms-transition-on-touch-start.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::adjustObservedState):
2019-03-21 Simon Fraser <simon.fraser@apple.com>
Absolute in stacking-context scroller jiggles when scrolled
https://bugs.webkit.org/show_bug.cgi?id=196010
Reviewed by Zalan Bujtas.
Updating compositing layers after a scroll (in a compositing update on the main thread)
failed to traverse to an absolute layer inside a stacking-context overflow:scroll,
because the overflow's layer didn't have the "hasCompositingAncestor" bit set on it.
This happened because childState.subtreeIsCompositing wasn't being set when indirect
reasons trigger compositing. So clean up RenderLayerCompositor::computeCompositingRequirements()
to set childState.subtreeIsCompositing for "late" compositing decisions, and move the
"Subsequent layers in the parent stacking context also need to composite" chunk
down to after the last compositing decision has been made.
Test: compositing/overflow/absolute-in-overflow.html
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollTo):
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::applyLayerPositions):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
2019-03-21 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Start tracking implicit transitions at touchStart
https://bugs.webkit.org/show_bug.cgi?id=196051
<rdar://problem/49092952>
Reviewed by Simon Fraser.
This patch enables transition tracking on touchStart.
1. Start observing for new transitions at touchStart
2. Stop observing at touchEnd
3. Check the next style recalc when the transition is finished (at onAnimationEnd we don't yet have the final computed style).
4. Remove the tracked transition when it is canceled.
Tests: fast/events/touch/ios/content-observation/0ms-transition-on-touch-start.html
fast/events/touch/ios/content-observation/100ms-transition-on-touch-start.html
fast/events/touch/ios/content-observation/10ms-delay-transition-on-touch-start.html
fast/events/touch/ios/content-observation/transition-on-touch-start-and-remove.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didAddTransition):
(WebCore::ContentChangeObserver::didFinishTransition):
(WebCore::ContentChangeObserver::didRemoveTransition):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::setShouldObserveTransitions):
(WebCore::ContentChangeObserver::clearObservedTransitions):
(WebCore::ContentChangeObserver::hasObservedTransition const):
(WebCore::ContentChangeObserver::hasPendingActivity const):
2019-03-21 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Track hidden elements only while transitioning.
https://bugs.webkit.org/show_bug.cgi?id=196050
<rdar://problem/49092037>
Reviewed by Simon Fraser.
Use the existing isConsideredHidden() logic to decide whether the current transition should be tracked.
* page/ios/ContentChangeObserver.cpp:
(WebCore::isConsideredHidden):
(WebCore::ContentChangeObserver::didAddTransition):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Deleted.
* page/ios/ContentChangeObserver.h:
2019-03-21 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Add support for observing implicit transitions
https://bugs.webkit.org/show_bug.cgi?id=195914
<rdar://problem/49091959>
Reviewed by Simon Fraser.
This patch is in preparation for observing elements with property "left" implicit transitions.
This is not a continuous tracking, we are only interested in the start and the end state.
The idea here is to register hidden elements only and check if they become visible by
the end of the transition (and ignore if the transition gets "canceled").
* page/animation/AnimationBase.h:
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::ImplicitAnimation):
(WebCore::ImplicitAnimation::~ImplicitAnimation):
(WebCore::ImplicitAnimation::clear):
(WebCore::ImplicitAnimation::onAnimationEnd):
* page/animation/ImplicitAnimation.h:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didAddTransition):
(WebCore::ContentChangeObserver::removeTransitionIfNeeded):
(WebCore::ContentChangeObserver::didFinishTransition):
(WebCore::ContentChangeObserver::didRemoveTransition):
(WebCore::ContentChangeObserver::didInstallDOMTimer):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingTransitions const):
(WebCore::ContentChangeObserver::isObservedPropertyForTransition const):
2019-03-21 Devin Rousso <drousso@apple.com>
Web Inspector: Page: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195592
<rdar://problem/48791916>
Reviewed by Timothy Hatcher.
No change in functionality.
Have more agents save the inspected `Page` so they don't need to access it via the
`InspectorPageAgent`. Make some of `InspectorPageAgent`'s functions `static` so other
agents can use them without needing to have access to an enabled `InspectorPageAgent`.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
* inspector/agents/InspectorPageAgent.h:
(WebCore::InspectorPageAgent::page): Deleted.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::InspectorPageAgent):
(WebCore::InspectorPageAgent::enable):
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::reload):
(WebCore::InspectorPageAgent::navigate):
(WebCore::InspectorPageAgent::overrideSetting):
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
(WebCore::InspectorPageAgent::getResourceTree):
(WebCore::InspectorPageAgent::searchInResources):
(WebCore::InspectorPageAgent::didPaint):
(WebCore::InspectorPageAgent::didLayout):
(WebCore::InspectorPageAgent::didScroll):
(WebCore::InspectorPageAgent::didRecalculateStyle):
(WebCore::InspectorPageAgent::setEmulatedMedia):
(WebCore::InspectorPageAgent::setForcedAppearance):
(WebCore::InspectorPageAgent::getCompositingBordersVisible):
(WebCore::InspectorPageAgent::setCompositingBordersVisible):
(WebCore::InspectorPageAgent::snapshotNode):
(WebCore::InspectorPageAgent::snapshotRect):
(WebCore::InspectorPageAgent::archive):
(WebCore::InspectorPageAgent::mainFrame): Deleted.
(WebCore::InspectorPageAgent::hasIdForFrame const): Deleted.
* inspector/agents/InspectorApplicationCacheAgent.h:
* inspector/agents/InspectorApplicationCacheAgent.cpp:
(WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
(WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus):
(WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
(WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
(WebCore::InspectorCanvasAgent::enable):
* inspector/agents/InspectorDOMStorageAgent.h:
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
* inspector/agents/InspectorIndexedDBAgent.h:
* inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
(WebCore::InspectorIndexedDBAgent::requestDatabase):
(WebCore::InspectorIndexedDBAgent::requestData):
(WebCore::InspectorIndexedDBAgent::clearObjectStore):
* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
(WebCore::PageDebuggerAgent::breakpointActionLog):
(WebCore::PageDebuggerAgent::injectedScriptForEval):
* inspector/agents/page/PageNetworkAgent.h:
* inspector/agents/page/PageNetworkAgent.cpp:
(WebCore::PageNetworkAgent::PageNetworkAgent):
(WebCore::PageNetworkAgent::loaderIdentifier):
(WebCore::PageNetworkAgent::frameIdentifier):
(WebCore::PageNetworkAgent::setResourceCachingDisabled):
(WebCore::PageNetworkAgent::scriptExecutionContext):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
2019-03-21 Brent Fulgham <bfulgham@apple.com>
Hardening: Use WeakPtrs in VideoFullscreenInterface{Mac,AVKit}
https://bugs.webkit.org/show_bug.cgi?id=196052
<rdar://problem/48778571>
Reviewed by Eric Carlson.
The VideoFullscreenInterface{Mac,AVKit} implementations store their fullscreen model
and fullscreen change observer members as bare pointers, something we've been working
to eliminate.
This patch corrects this oversight.
No new tests since no changes in behavior.
* platform/cocoa/VideoFullscreenChangeObserver.h:
* platform/cocoa/VideoFullscreenModel.h:
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::invalidate):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
(WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
(WebCore::VideoFullscreenInterfaceMac::invalidate):
2019-03-21 Megan Gardner <megan_gardner@apple.com>
Smart delete for paragraphs.
https://bugs.webkit.org/show_bug.cgi?id=195837
Reviewed by Ryosuke Niwa.
Remove additional newlines to maintain spacing around paragraphs.
Tests: editing/pasteboard/smart-delete-paragraph-001.html
editing/pasteboard/smart-delete-paragraph-002.html
editing/pasteboard/smart-delete-paragraph-003.html
editing/pasteboard/smart-delete-paragraph-004.html
* editing/DeleteSelectionCommand.cpp:
(WebCore::isBlankLine):
(WebCore::DeleteSelectionCommand::initializePositionData):
2019-03-21 Cathie Chen <cathiechen@igalia.com>
Fixed ContentChangeObserver build error.
https://bugs.webkit.org/show_bug.cgi?id=195993
Reviewed by Rob Buis.
EWS IOS compiler complains after adding new files in Bug 157743.
ContentChangeObserver.h should have forward declaration for Element.
* page/ios/ContentChangeObserver.cpp:
* page/ios/ContentChangeObserver.h:
2019-03-21 Charlie Turner <cturner@igalia.com>
[GStreamer][EME][Clearkey] Take a lock in keys() method
https://bugs.webkit.org/show_bug.cgi?id=195900
Reviewed by Xabier Rodriguez-Calvar.
This isn't ideal, since we're taking a lock for every frame to
decode. But there's no good way around it when keys can be
made unavailable at any time via an update() call, so we can't
cache key IDs in the decryptor.
Covered by test imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-multikey.https.html
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceClearKey::keys const): This method is called
from GStreamer's decode() method, which runs off the main thread,
therefore we need to take a lock.
* platform/encryptedmedia/clearkey/CDMClearKey.h:
2019-03-21 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Add API to provide geolocation information
https://bugs.webkit.org/show_bug.cgi?id=195940
Reviewed by Michael Catanzaro.
Replace ENABLE(GEOLOCATION) with USE(GEOCLUE).
* PlatformGTK.cmake:
* platform/geoclue/GeolocationProviderGeoclue.cpp:
* platform/geoclue/GeolocationProviderGeoclue.h:
* platform/geoclue/GeolocationProviderGeoclueClient.h:
2019-03-21 Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Confusing messages in stderr when surfaceless context is not supported
https://bugs.webkit.org/show_bug.cgi?id=195742
Reviewed by Žan Doberšek.
The messages shown are:
Cannot create EGL surfaceless context: missing EGL_KHR_surfaceless_{context,opengl} extension.
Cannot create EGL WPE context: EGL_SUCCESS
It seems like there's anything wrong, while there isn't. It's also confusing an error message where the error is
EGL_SUCCESS. I think we should not show those messages at all, not suporting surfaceless contexts is not an
error and it's correctly handled. Failing to get a native window handle from render backend offscreen egl target
is not an error either, since most of the backends don't implement the interface (they actually have an empty
implementation).
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createSurfacelessContext): Remove the message when extensions are not present
* platform/graphics/egl/GLContextEGLLibWPE.cpp:
(WebCore::GLContextEGL::createWPEContext): Handle the case of wpe_renderer_backend_egl_offscreen_target_create()
returning nullptr, which can happen if the backend doesn't implement the interface. Move the context creation
after the target initialization, to avoid leaking the context when the target doesn't have a native window.
2019-03-20 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Use finalizer in JSGlobalLexicalEnvironment and JSGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=195992
Reviewed by Keith Miller and Mark Lam.
Use cellHeapCellType since JSSegmentedVariableObject already set finalizer.
* bindings/js/WebCoreJSClientData.cpp:
(WebCore::JSVMClientData::JSVMClientData):
2019-03-20 Youenn Fablet <youenn@apple.com>
Compute quota after network process restart based on default quota and space used
https://bugs.webkit.org/show_bug.cgi?id=195804
Reviewed by Chris Dumez.
At creation of quota manager, a default quota will be assigned.
This value is the same for all origins.
Some origins may have been granted a bigger quota by the user.
In that case, the space used might be greater for these origins.
Update at initialization time the quota according the space used as follows:
- If space used is below default quota, stick with default quota.
- If space used is above, set quota to space used rounded by one tenth of the default quota.
The rounding ensures that quota requests will not happen too quickly after a page is loaded.
Test: http/wpt/cache-storage/cache-quota-after-restart.any.html
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::setQuotaBasedOnSpaceUsage):
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::setQuotaBasedOnSpaceUsage):
(WebCore::StorageQuotaManager::addUser):
* storage/StorageQuotaManager.h:
* testing/Internals.cpp:
(WebCore::Internals::updateQuotaBasedOnSpaceUsage):
* testing/Internals.h:
* testing/Internals.idl:
2019-03-20 Simon Fraser <simon.fraser@apple.com>
Rename ENABLE_ACCELERATED_OVERFLOW_SCROLLING macro to ENABLE_OVERFLOW_SCROLLING_TOUCH
https://bugs.webkit.org/show_bug.cgi?id=196049
Reviewed by Tim Horton.
This macro is about the -webkit-overflow-scrolling CSS property, not accelerated
overflow scrolling in general, so rename it.
* Configurations/FeatureDefines.xcconfig:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* dom/Element.cpp:
* dom/Element.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::canUseCompositedScrolling const):
* rendering/style/RenderStyle.cpp:
(WebCore::rareInheritedDataChangeRequiresLayout):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/WillChangeData.cpp:
(WebCore::WillChangeData::propertyCreatesStackingContext):
2019-03-20 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195589
<rdar://problem/48791742>
Reviewed by Timothy Hatcher.
No change in functionality.
* inspector/agents/InspectorDOMAgent.h:
(WebCore::InspectorDOMAgent::DOMListener): Deleted.
(WebCore::InspectorDOMAgent::pageAgent): Deleted.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::unbind):
(WebCore::InspectorDOMAgent::setSearchingForNode):
(WebCore::InspectorDOMAgent::highlightSelector):
(WebCore::InspectorDOMAgent::highlightFrame):
(WebCore::InspectorDOMAgent::buildObjectForNode):
(WebCore::InspectorDOMAgent::didModifyDOMAttr):
(WebCore::InspectorDOMAgent::didRemoveDOMAttr):
(WebCore::InspectorDOMAgent::styleAttributeInvalidated):
(WebCore::InspectorDOMAgent::didInvalidateStyleAttr):
(WebCore::InspectorDOMAgent::setDOMListener): Deleted.
* inspector/agents/InspectorCSSAgent.h:
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::InspectorCSSAgent):
(WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorCSSAgent::reset):
(WebCore::InspectorCSSAgent::enable):
(WebCore::InspectorCSSAgent::disable):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::collectAllStyleSheets):
(WebCore::InspectorCSSAgent::setStyleSheetText):
(WebCore::InspectorCSSAgent::setStyleText):
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::createStyleSheet):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::asInspectorStyleSheet):
(WebCore::InspectorCSSAgent::elementForId):
(WebCore::InspectorCSSAgent::bindStyleSheet):
(WebCore::InspectorCSSAgent::~InspectorCSSAgent): Deleted.
(WebCore::InspectorCSSAgent::discardAgent): Deleted.
(WebCore::InspectorCSSAgent::resetNonPersistentData): Deleted.
* inspector/InspectorStyleSheet.cpp:
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::setDOMBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::removeDOMBreakpoint):
(WebCore::InspectorDOMDebuggerAgent::descriptionForDOMEvent):
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
* inspector/agents/page/PageConsoleAgent.h:
* inspector/agents/page/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::PageConsoleAgent):
(WebCore::PageConsoleAgent::clearMessages):
* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::inspect):
(WebCore::InspectorController::hideHighlight):
2019-03-20 Youenn Fablet <youenn@apple.com>
Include WAL and SHM file size in IDB database size computation
https://bugs.webkit.org/show_bug.cgi?id=195688
Reviewed by Brady Eidson.
Count WAL and SHM files as part of IDB quota checks.
This makes some IDB tests go over the testing quota which then
triggers some IDB tasks to happen sooner than other write IDB tasks.
The IDB implementation requires these tasks to remain ordered.
In case a write task is pending quota check, queue all tasks,
write or read, to keep the order.
This patch specials case aborting a transaction.
In case it is called as part of clearing a database,
the task should not be queued and all pending tasks are errored.
When transaction is aborted by the web page, queue the task.
When we can make a decision to run tasks with size 0,
do not check quota. This ensures that read operations
succeed even if we are above quota.
Covered by existing tests.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::waitForRequestSpaceCompletion):
(WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::clearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::getRecord):
(WebCore::IDBServer::UniqueIDBDatabase::getAllRecords):
(WebCore::IDBServer::UniqueIDBDatabase::getCount):
(WebCore::IDBServer::UniqueIDBDatabase::deleteRecord):
(WebCore::IDBServer::UniqueIDBDatabase::openCursor):
(WebCore::IDBServer::UniqueIDBDatabase::iterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::usage):
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::getDatabaseFileSize):
* storage/StorageQuotaManager.h:
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::requestSpace):
2019-03-20 Devin Rousso <drousso@apple.com>
Web Inspector: Timeline should show when events preventDefault() was called on an event or not
https://bugs.webkit.org/show_bug.cgi?id=176824
<rdar://problem/34290931>
Reviewed by Timothy Hatcher.
Original patch by Joseph Pecoraro <pecoraro@apple.com>.
Tests: inspector/timeline/timeline-event-CancelAnimationFrame.html
inspector/timeline/timeline-event-EventDispatch.html
inspector/timeline/timeline-event-FireAnimationFrame.html
inspector/timeline/timeline-event-RequestAnimationFrame.html
inspector/timeline/timeline-event-TimerFire.html
inspector/timeline/timeline-event-TimerInstall.html
inspector/timeline/timeline-event-TimerRemove.html
* dom/EventTarget.cpp:
(WebCore::EventTarget::innerInvokeEventListeners):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent):
Include `defaultPrevented` when notifying inspector.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didDispatchEvent):
(WebCore::InspectorInstrumentation::didDispatchEventOnWindow):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didDispatchEventImpl):
(WebCore::InspectorInstrumentation::didDispatchEventOnWindowImpl):
Pass `defaultPrevented` on to agent.
* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::didDispatchEvent):
Append a boolean `defaultPrevented` property on the `EventDispatch` timeline record's data.
2019-03-20 Antoine Quint <graouts@apple.com>
DumpRenderTree crashes under WebAnimation::isRelevant when running imported/mozilla/css-transitions/test_document-get-animations.html in GuardMalloc
https://bugs.webkit.org/show_bug.cgi?id=196028
<rdar://problem/46842707>
Reviewed by Dean Jackson.
Instead of keeping a ListHashSet of raw pointers, we are now using a Vector of WeakPtrs.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::forgetAnimation):
(WebCore::AnimationTimeline::animationTimingDidChange):
(WebCore::AnimationTimeline::cancelDeclarativeAnimation):
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
2019-03-20 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG property tear off objects for SVGAnimatedNumber
https://bugs.webkit.org/show_bug.cgi?id=196037
Reviewed by Simon Fraser.
-- Define SVGAnimatedNumber to be SVGAnimatedPrimitiveProperty<float>.
-- Add SVGAnimatedNumberAccessor to associate an attribute name with a
pointer to an SVGAnimatedNumber. Given a pointer to an SVGElement,
this accessor will and create an animator for the animated property.
-- Add SVGAnimatedNumberPairAccessor to associate an attribute name
with a pair of pointers to SVGAnimatedNumbers. Given a pointer to an
SVGElement, this accessor will and create an animator for these
animated properties.
-- Add SVGAnimatedNumberAnimator to animated an SVGAnimatedNumber.
-- Add SVGAnimatedNumberPairAnimator to animated a pair of SVGAnimatedNumbers.
-- Add SVGAnimationNumberFunction which will be responsible for progressing
a float over a period of time.
-- Define SVGNumberAnimator to be SVGPrimitivePropertyAnimator<float,
SVGAnimationNumberFunction>. SVGNumberAnimator will be responsible
for animating attributes with no reflecting animated properties, e.g.
"fill-opacity".
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimatedLength.cpp:
* svg/SVGAnimatedLengthList.cpp:
* svg/SVGAnimatedNumber.cpp: Removed.
* svg/SVGAnimatedNumber.h: Removed.
* svg/SVGAnimatedNumberList.cpp:
* svg/SVGAnimatedNumberOptionalNumber.cpp: Removed.
* svg/SVGAnimatedNumberOptionalNumber.h: Removed.
* svg/SVGAnimatedTransformList.cpp:
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGComponentTransferFunctionElement.cpp:
(WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
(WebCore::SVGComponentTransferFunctionElement::registerAttributes):
(WebCore::SVGComponentTransferFunctionElement::parseAttribute):
* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGComponentTransferFunctionElement::slope const):
(WebCore::SVGComponentTransferFunctionElement::intercept const):
(WebCore::SVGComponentTransferFunctionElement::amplitude const):
(WebCore::SVGComponentTransferFunctionElement::exponent const):
(WebCore::SVGComponentTransferFunctionElement::offset const):
(WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
(WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
(WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
(WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
(WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::SVGFECompositeElement):
(WebCore::SVGFECompositeElement::registerAttributes):
(WebCore::SVGFECompositeElement::parseAttribute):
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
(WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthXIdentifier): Deleted.
(WebCore::SVGFEConvolveMatrixElement::kernelUnitLengthYIdentifier): Deleted.
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
(WebCore::SVGFEDiffuseLightingElement::registerAttributes):
(WebCore::SVGFEDiffuseLightingElement::parseAttribute):
(WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthXIdentifier): Deleted.
(WebCore::SVGFEDiffuseLightingElement::kernelUnitLengthYIdentifier): Deleted.
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
(WebCore::SVGFEDisplacementMapElement::registerAttributes):
(WebCore::SVGFEDisplacementMapElement::parseAttribute):
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
(WebCore::SVGFEDropShadowElement::setStdDeviation):
(WebCore::SVGFEDropShadowElement::registerAttributes):
(WebCore::SVGFEDropShadowElement::parseAttribute):
(WebCore::SVGFEDropShadowElement::stdDeviationXIdentifier): Deleted.
(WebCore::SVGFEDropShadowElement::stdDeviationYIdentifier): Deleted.
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
(WebCore::SVGFEGaussianBlurElement::setStdDeviation):
(WebCore::SVGFEGaussianBlurElement::registerAttributes):
(WebCore::SVGFEGaussianBlurElement::parseAttribute):
(WebCore::SVGFEGaussianBlurElement::stdDeviationXIdentifier): Deleted.
(WebCore::SVGFEGaussianBlurElement::stdDeviationYIdentifier): Deleted.
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::SVGFELightElement):
(WebCore::SVGFELightElement::parseAttribute):
(WebCore::SVGFELightElement::svgAttributeChanged):
(WebCore::SVGFELightElement::registerAttributes): Deleted.
* svg/SVGFELightElement.h:
(WebCore::SVGFELightElement::azimuth const):
(WebCore::SVGFELightElement::elevation const):
(WebCore::SVGFELightElement::x const):
(WebCore::SVGFELightElement::y const):
(WebCore::SVGFELightElement::z const):
(WebCore::SVGFELightElement::pointsAtX const):
(WebCore::SVGFELightElement::pointsAtY const):
(WebCore::SVGFELightElement::pointsAtZ const):
(WebCore::SVGFELightElement::specularExponent const):
(WebCore::SVGFELightElement::limitingConeAngle const):
(WebCore::SVGFELightElement::azimuthAnimated):
(WebCore::SVGFELightElement::elevationAnimated):
(WebCore::SVGFELightElement::xAnimated):
(WebCore::SVGFELightElement::yAnimated):
(WebCore::SVGFELightElement::zAnimated):
(WebCore::SVGFELightElement::pointsAtXAnimated):
(WebCore::SVGFELightElement::pointsAtYAnimated):
(WebCore::SVGFELightElement::pointsAtZAnimated):
(WebCore::SVGFELightElement::specularExponentAnimated):
(WebCore::SVGFELightElement::limitingConeAngleAnimated):
(WebCore::SVGFELightElement::attributeRegistry): Deleted.
(WebCore::SVGFELightElement::isKnownAttribute): Deleted.
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
(WebCore::SVGFEMorphologyElement::setRadius):
(WebCore::SVGFEMorphologyElement::registerAttributes):
(WebCore::SVGFEMorphologyElement::parseAttribute):
(WebCore::SVGFEMorphologyElement::radiusXIdentifier): Deleted.
(WebCore::SVGFEMorphologyElement::radiusYIdentifier): Deleted.
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
(WebCore::SVGFEOffsetElement::registerAttributes):
(WebCore::SVGFEOffsetElement::parseAttribute):
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
(WebCore::SVGFESpecularLightingElement::registerAttributes):
(WebCore::SVGFESpecularLightingElement::parseAttribute):
(WebCore::SVGFESpecularLightingElement::kernelUnitLengthXIdentifier): Deleted.
(WebCore::SVGFESpecularLightingElement::kernelUnitLengthYIdentifier): Deleted.
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
(WebCore::SVGFETurbulenceElement::registerAttributes):
(WebCore::SVGFETurbulenceElement::parseAttribute):
(WebCore::SVGFETurbulenceElement::baseFrequencyXIdentifier): Deleted.
(WebCore::SVGFETurbulenceElement::baseFrequencyYIdentifier): Deleted.
* svg/SVGFETurbulenceElement.h:
* svg/SVGGeometryElement.cpp:
(WebCore::SVGGeometryElement::SVGGeometryElement):
(WebCore::SVGGeometryElement::parseAttribute):
(WebCore::SVGGeometryElement::registerAttributes): Deleted.
* svg/SVGGeometryElement.h:
(WebCore::SVGGeometryElement::pathLength const):
(WebCore::SVGGeometryElement::pathLengthAnimated):
(WebCore::SVGGeometryElement::attributeRegistry): Deleted.
(WebCore::SVGGeometryElement::isKnownAttribute): Deleted.
* svg/SVGPathElement.h:
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::SVGStopElement):
(WebCore::SVGStopElement::parseAttribute):
(WebCore::SVGStopElement::registerAttributes): Deleted.
* svg/SVGStopElement.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimatedPropertyPairAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h:
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationNumberFunction::progress):
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPrimitivePropertyAnimatorImpl.h:
* svg/properties/SVGPropertyAnimatorCreator.h:
(WebCore::SVGPropertyAnimatorCreator::createNumberAnimator):
(WebCore::SVGPropertyAnimatorCreator::attributeAnimatorCreator):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-03-20 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG tear off objects for SVGColorAnimator
https://bugs.webkit.org/show_bug.cgi?id=196025
Reviewed by Simon Fraser.
SVG attributes like "fill" and "stroke" do not have reflecting properties
in SVGElement but they are animatable by SMIL. Animating such attributes
is different from animating the SVG animated properties. These new classes
will be added to handle the first type of this kind of attribute: the Color:
-- SVGPropertyAnimatorCreator is added to SVGElement. It is responsible
for creating SVGPropertyAnimators for the attribute which do not have
reflecting animated properties stored by SVGElement. It will maintain
a HashMap for the animated values for these attributes which is indexed
by the attribute name. The animated values has to be RefCounted because
the same attribute can be animated by multiple animators. So the values
of this HashMap will be of type Ref<SVGProperty>, e.g.
<circle cx="80" cy="120" r="35">
<animate attributeName="fill" values="#080" begin="2s" />
<animate attributeName="fill" values="#602;#004" begin="4s" dur="5s"/>
</circle>
-- SVGPropertyAnimator is the a new type which animates an attribute with
no reflecting animated property.
-- SVGPrimitivePropertyAnimator is a template class which is responsible
for animating attributes with primitive types, e.g. Color, string and
float. It is derived form SVGPropertyAnimator and it is initialized
with a Ref<SVGValueProperty<PropertyType>> which is created and maintained
by SVGPropertyAnimatorFactory.
-- SVGAnimationColorFunction is the animation function that animates the
attributes whose type are Color. Note the conversion form String to
Color in this class has to handle the case when its value is "attributeName="
e.g. <animate attributeName="fill" from="attributeName="r"/>
-- SVGColorAnimator will be defined to be
SVGPrimitivePropertyAnimator<Color, SVGAnimationColorFunction>.
The life cycle of the RefCounted properties can be explained as follows:
-- SVGPropertyAnimatorFactory checks whether its HashMap has an entry
for the given attribute name. If it does not have, it will create a
new value through the value creation method for this attribute.
-- SVGPropertyAnimatorFactory passes the shared animated value to the
animator creation method. So multiple animators will be accessing the
same value through their RefCounted pointers.
-- When the animator is about to be deleted, it will notify the target
SVGElement which will notify its SVGPropertyAnimatorFactory.
SVGPropertyAnimatorFactory will check its HashMap and retrieves the
entry for the given attribute name. If the refCount is 2, it is going
to remove the entry form the HashMap.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimateColorElement.cpp:
(WebCore::attributeValueIsCurrentColor): Deleted.
(WebCore::SVGAnimateColorElement::determinePropertyValueTypes): Deleted.
* svg/SVGAnimateColorElement.h:
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::attributeAnimationController):
* svg/SVGAnimatedColor.cpp: Removed.
* svg/SVGAnimatedColor.h: Removed.
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGAttributeAnimationController.cpp:
(WebCore::SVGAttributeAnimationController::~SVGAttributeAnimationController):
* svg/SVGAttributeAnimationController.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::SVGElement):
(WebCore::SVGElement::isAnimatedAttribute const):
(WebCore::SVGElement::createAnimator):
(WebCore::SVGElement::animatorWillBeDeleted):
* svg/SVGElement.h:
(WebCore::SVGElement::propertyAnimatorFactory):
* svg/SVGFitToViewBox.h:
* svg/SVGMPathElement.cpp:
* svg/graphics/filters/SVGFEImage.h:
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.cpp: Added.
(WebCore::SVGAnimationColorFunction::colorFromString):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationColorFunction::progress):
* svg/properties/SVGAnimationFunction.h:
* svg/properties/SVGAttributeAnimator.cpp:
(WebCore::SVGAttributeAnimator::applyAnimatedStylePropertyChange):
(WebCore::SVGAttributeAnimator::removeAnimatedStyleProperty):
* svg/properties/SVGAttributeAnimator.h:
* svg/properties/SVGPrimitivePropertyAnimator.h: Added.
(WebCore::SVGPrimitivePropertyAnimator::create):
(WebCore::SVGPrimitivePropertyAnimator::SVGPrimitivePropertyAnimator):
* svg/properties/SVGPrimitivePropertyAnimatorImpl.h: Added.
* svg/properties/SVGPropertyAnimator.h: Added.
(WebCore::SVGPropertyAnimator::SVGPropertyAnimator):
(WebCore::SVGPropertyAnimator::adjustForInheritance const):
(WebCore::SVGPropertyAnimator::computeCSSPropertyValue const):
(WebCore::SVGPropertyAnimator::computeInheritedCSSPropertyValue const):
* svg/properties/SVGPropertyAnimatorFactory.h: Added.
(WebCore::SVGPropertyAnimatorFactory::isKnownAttribute):
(WebCore::SVGPropertyAnimatorFactory::createAnimator):
(WebCore::SVGPropertyAnimatorFactory::animatorWillBeDeleted):
(WebCore::SVGPropertyAnimatorFactory::createColorAnimator):
(WebCore::SVGPropertyAnimatorFactory::attributeAnimatorCreator):
2019-03-20 Alex Christensen <achristensen@webkit.org>
Use WeakPtr instead of storing raw pointers in WebSocket code
https://bugs.webkit.org/show_bug.cgi?id=196034
Reviewed by Geoff Garen.
This could prevent using freed memory if we forget to reset a pointer somewhere.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::WebSocketChannel):
(WebCore::WebSocketChannel::connect):
(WebCore::WebSocketChannel::fail):
(WebCore::WebSocketChannel::disconnect):
(WebCore::WebSocketChannel::didOpenSocketStream):
(WebCore::WebSocketChannel::didCloseSocketStream):
(WebCore::WebSocketChannel::didFailSocketStream):
(WebCore::WebSocketChannel::processBuffer):
(WebCore::WebSocketChannel::processFrame):
(WebCore::WebSocketChannel::processOutgoingFrameQueue):
(WebCore::WebSocketChannel::sendFrame):
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WebSocketChannelClient.h:
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::WebSocketHandshake):
* Modules/websockets/WebSocketHandshake.h:
2019-03-20 Dean Jackson <dino@apple.com>
[iOS] Crash in WebCore::Node::renderRect
https://bugs.webkit.org/show_bug.cgi?id=196035
<rdar://problem/49076783>
Reviewed by Antoine Quint.
When renderRect was called on an HTMLAreaElement, it would
ASSERT because it doesn't have a renderer. We hadn't noticed
this before because none of our tests were hitting this in
debug mode.
The fix is to ask the corresponding HTMLImageElement for
its renderer, and use that for the returned rectangle.
Covered by these tests that had become flakey:
fast/images/imagemap-in-shadow-tree.html
http/tests/download/area-download.html
* dom/Node.cpp:
(WebCore::Node::renderRect):
2019-03-20 Youenn Fablet <youenn@apple.com>
Have smaller default quotas for third party frames
https://bugs.webkit.org/show_bug.cgi?id=195841
Reviewed by Geoffrey Garen.
Test: http/wpt/cache-storage/quota-third-party.https.html
* storage/StorageQuotaManager.h:
(WebCore::StorageQuotaManager::defaultQuota):
Change default quota to 1GB.
2019-03-20 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: include window as part of any event listener chain
https://bugs.webkit.org/show_bug.cgi?id=195730
<rdar://problem/48916872>
Reviewed by Timothy Hatcher.
Test: inspector/dom/getEventListenersForNode.html
* inspector/agents/InspectorDOMAgent.h:
(WebCore::EventListenerInfo::EventListenerInfo): Deleted.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
(WebCore::InspectorDOMAgent::getEventListeners): Deleted.
2019-03-20 Devin Rousso <drousso@apple.com>
Web Inspector: Runtime: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195972
<rdar://problem/49039655>
Reviewed by Timothy Hatcher.
No change in functionality.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::createLazyAgents):
* inspector/agents/page/PageRuntimeAgent.h:
* inspector/agents/page/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::PageRuntimeAgent):
(WebCore::PageRuntimeAgent::enable):
(WebCore::PageRuntimeAgent::disable):
(WebCore::PageRuntimeAgent::didCreateMainWorldContext):
(WebCore::PageRuntimeAgent::reportExecutionContextCreation):
(WebCore::PageRuntimeAgent::didCreateFrontendAndBackend): Deleted.
(WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
* inspector/agents/worker/WorkerRuntimeAgent.h:
* inspector/agents/worker/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend): Deleted.
(WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend): Deleted.
2019-03-19 Ryosuke Niwa <rniwa@webkit.org>
[CSS OM] StyledElementInlineStylePropertyMap creates a Ref cycle with its owner element
https://bugs.webkit.org/show_bug.cgi?id=195987
Reviewed by Simon Fraser.
StyledElementInlineStylePropertyMap was leaking every element for which it was created because due to
a reference cycle. The StyledElementInlineStylePropertyMap holds onto its element using Ref and
the element also stores StyledElementInlineStylePropertyMap in ElementRareData using RefPtr.
Fixed the cycle by making the reference from StyledElementInlineStylePropertyMap weak. For now we use
a raw pointer because we can't create a WeakPtr of an element yet.
Test: css-typedom/attribute-style-map-should-not-leak-every-element.html
* css/typedom/StylePropertyMap.h:
(WebCore::StylePropertyMap): Added clearElement as a virtual function.
* dom/Element.cpp:
(WebCore::Element::~Element): Clear the element pointer in StyledElementInlineStylePropertyMap.
* dom/StyledElement.cpp:
(WebCore::StyledElementInlineStylePropertyMap::get): Added a null check for m_element.
(WebCore::StyledElementInlineStylePropertyMap::StyledElementInlineStylePropertyMap):
(WebCore::StyledElementInlineStylePropertyMap::clearElement): Added.
(WebCore::StyledElementInlineStylePropertyMap): Use a raw pointer instead of Ref to StyledElement
to avoid the leak.
* platform/graphics/CustomPaintImage.cpp:
(WebCore::HashMapStylePropertyMap::clearElement): Added.
2019-03-19 Ryosuke Niwa <rniwa@webkit.org>
appendChild should throw when inserting an ancestor of a template into its content adopted to another document
https://bugs.webkit.org/show_bug.cgi?id=195984
Reviewed by Darin Adler.
The WPT test caught a bug that appendChild and other DOM insertion functions were incorrectly assuming that
any node that's in a HTML template element has the current document's template document as its owner.
The assumption is wrong when the template element's content DocumentFragment is adopted to another document.
Fixed the bug by always checking the ancestor host elements in checkAcceptChild. Also
Test: fast/dom/insert-template-parent-into-adopted-content.html
* dom/ContainerNode.cpp:
(WebCore::isInTemplateContent): Deleted. This code is simply wrong.
(WebCore::containsConsideringHostElements): Deleted. Call sites are updated to use containsIncludingHostElements.
(WebCore::containsIncludingHostElements): Moved from Node.cpp and optimized this code a bit. It's more efficient
to get the parent node and check for ShadowRoot and DocumentFragment only when the parent is null than to check
for those two node types before getting the parent node.
(WebCore::checkAcceptChild): Merged two code paths to call containsIncludingHostElements. The early return for
a pseudo element is there only to prevent tree corruption in release build even in the presence of a major bug
so it shouldn't be an spec compliance issue.
* dom/Node.cpp:
(WebCore::Node::containsIncludingHostElements const): Deleted.
* dom/Node.h:
2019-03-20 Timothy Hatcher <timothy@apple.com>
Unreviewed followup to r243169 to fix test failures.
* DerivedSources.make: Add HAVE_OS_DARK_MODE_SUPPORT to FEATURE_AND_PLATFORM_DEFINES.
2019-03-20 Keith Rollin <krollin@apple.com>
Update the location for XProtect.meta.plist file
https://bugs.webkit.org/show_bug.cgi?id=195764
Reviewed by Alexey Proskuryakov.
The location of this file is changing in the future, so adjust for
that.
No new tests since there should be no observable behavior difference.
* platform/mac/BlacklistUpdater.mm:
2019-03-20 Devin Rousso <drousso@apple.com>
Web Inspector: Database: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195587
<rdar://problem/48791735>
Reviewed by Timothy Hatcher.
No change in functionality.
* inspector/agents/InspectorDatabaseAgent.h:
* inspector/agents/InspectorDatabaseAgent.cpp:
(WebCore::InspectorDatabaseAgent::didCommitLoad): Added.
(WebCore::InspectorDatabaseAgent::didOpenDatabase):
(WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
(WebCore::InspectorDatabaseAgent::enable):
(WebCore::InspectorDatabaseAgent::disable):
(WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
(WebCore::InspectorDatabaseAgent::executeSQL):
(WebCore::InspectorDatabaseAgent::databaseId):
(WebCore::InspectorDatabaseAgent::findByFileName):
(WebCore::InspectorDatabaseAgent::databaseForId):
(WebCore::InspectorDatabaseAgent::clearResources): Deleted.
(WebCore::InspectorDatabaseAgent::~InspectorDatabaseAgent): Deleted.
* inspector/InspectorDatabaseResource.h:
(WebCore::InspectorDatabaseResource::database const):
(WebCore::InspectorDatabaseResource::setDatabase):
(WebCore::InspectorDatabaseResource::database): Deleted.
* inspector/InspectorDatabaseResource.cpp:
(WebCore::InspectorDatabaseResource::create):
(WebCore::InspectorDatabaseResource::InspectorDatabaseResource):
(WebCore::InspectorDatabaseResource::bind):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didOpenDatabase):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didCommitLoadImpl):
(WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
Pass the `Database` as a reference instead of a pointer. Retrieve any information directly
from the `Database`, rather than using the arguments that were used to create it.
* Modules/webdatabase/Database.h:
(WebCore::Database::expectedVersion const): Deleted.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::expectedVersion const): Added.
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
* Modules/webdatabase/DatabaseTracker.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::closeAllDatabases):
(WebCore::DatabaseTracker::openDatabases): Added.
Expose various values used by `InspectorDatabaseAgent` and `InspectorDatabaseResource`.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
* inspector/CommandLineAPIHost.h:
(WebCore::CommandLineAPIHost::init):
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::disconnect):
(WebCore::CommandLineAPIHost::inspect):
(WebCore::CommandLineAPIHost::clearConsoleMessages):
(WebCore::CommandLineAPIHost::databaseId):
(WebCore::CommandLineAPIHost::storageId):
Rather than pass each agent individually, pass the entire `InstrumentingAgents` so that the
current agent can be used instead of whatever was initially created.
2019-03-20 Oriol Brufau <obrufau@igalia.com>
[css-grid] Always consider baseline shim for the minimum contribution
https://bugs.webkit.org/show_bug.cgi?id=195964
Reviewed by Javier Fernandez.
Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-lr.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim-vertical-rl.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-minimum-contribution-baseline-shim.html
Before this patch, the shim used for baseline alignment is not taken
into consideration when calculating the minimum contribution of a grid
item if its preferred size is auto, its minimum size is auto, and the
max track sizing function is a fixed small value. In this case, the
auto minimum size can produce a smaller track than if it was 0.
The specification needs to clarify how baseline shims interact with
minimum contributions (https://github.com/w3c/csswg-drafts/issues/3660),
but the above doesn't make sense.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
2019-03-20 Simon Fraser <simon.fraser@apple.com>
Some elements lag behind async overflow scrolling on palace-games.com
https://bugs.webkit.org/show_bug.cgi?id=195934
Reviewed by Zalan Bujtas.
The logic added in r242997 was wrong for an absolutely-positioned layer whose containig block was
inside an overflow:scroll, but whose compositing ancestor was outside. This is a case where
we need to make a Positioning node for the absolute layer, because it needs to move along
with the scrolled content.
There are six permutations of overflow, containing block and compositing ancestor that we care about.
Showing renderer (aka DOM) order, they are (where <- indicates child <- parent):
layer <- cb <- ca <- os -- no positioned node required
layer <- cb <- os <- ca -- compositing parent skips overflow, need a "Moved" Positioned node.
layer <- ov <- cb <- ca -- no positioned node required
layer <- ov <- ca <- cb -- no positioned node required
layer <- ca <- cb <- ov -- no positioned node required
layer <- ca <- ov <- cb -- containing block skips overflow, need a "Stationary" Positioned node.
[cb = containing block, ca = compositing ancestor, ov = overflow scroll]
Test: scrollingcoordinator/scrolling-tree/positioned-nodes-complex.html
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
2019-03-20 Simon Fraser <simon.fraser@apple.com>
Explicitly trigger compositing for layers that need to be moved by ScrollingTreePositionedNodes
https://bugs.webkit.org/show_bug.cgi?id=195710
<rdar://problem/48867502>
Reviewed by Zalan Bujtas.
A position:absolute layer whose containing block is outside an enclosing overflow:scroll, but
whose compositing ancestor is the overflow or is inside it, needs to be composited so that
we can make a Positioning scrolling tree node for it.
Handle this case as a "OverflowScrollPositioning" indirect compositing reason.
Test: compositing/layer-creation/absolute-in-async-overflow-scroll.html
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::logReasonsForCompositing):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
(WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary): Deleted.
* rendering/RenderLayerCompositor.h: Generalize OverflowScrollingTouch to OverflowScrolling.
2019-03-20 Devin Rousso <drousso@apple.com>
Web Inspector: Search: allow DOM searches to be case sensitive
https://bugs.webkit.org/show_bug.cgi?id=194673
<rdar://problem/48087577>
Reviewed by Timothy Hatcher.
Tests: inspector/dom/dom-search.html
inspector/dom/dom-search-caseSensitive.html
Since `DOM.performSearch` also searches by selector and XPath, some results may appear
as unexpected. As an example, searching for "BoDy" will still return the <body> as a result,
as although the literal node name ("BODY") didn't match, it did match via selector/XPath.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::performSearch):
* inspector/InspectorNodeFinder.h:
* inspector/InspectorNodeFinder.cpp:
(WebCore::InspectorNodeFinder::InspectorNodeFinder):
(WebCore::InspectorNodeFinder::searchUsingDOMTreeTraversal):
(WebCore::InspectorNodeFinder::checkEquals): Added.
(WebCore::InspectorNodeFinder::checkContains): Added.
(WebCore::InspectorNodeFinder::checkStartsWith): Added.
(WebCore::InspectorNodeFinder::checkEndsWith): Added.
(WebCore::InspectorNodeFinder::matchesAttribute):
(WebCore::InspectorNodeFinder::matchesElement):
(WebCore::InspectorNodeFinder::searchUsingXPath):
(WebCore::InspectorNodeFinder::searchUsingCSSSelectors):
2019-03-20 Michael Catanzaro <mcatanzaro@igalia.com>
Remove copyRef() calls added in r243163
https://bugs.webkit.org/show_bug.cgi?id=195962
Reviewed by Chris Dumez.
The first two cases here can just directly return the RefPtr.
In the third case, we have to work around a GCC 6 bug because GCC 6 is unable to pick the
right constructor to use, unlike modern compilers.
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::bodyAsFormData const):
(WebCore::FetchBody::take):
2019-03-20 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Fix handling of resolution changes in AppendPipeline
https://bugs.webkit.org/show_bug.cgi?id=195855
Reviewed by Xabier Rodriguez-Calvar.
MediaSample instances produced by the AppendPipeline were not
accounting for resolution changes. The causes of this are twofold:
1) m_presentationSize is set by connectDemuxerSrcPadToAppsink() (by
calling parseDemuxerSrcPadCaps()), but not by appsinkCapsChanged().
2) appsinkCapsChanged() was being called in the main thread as an
asynchronous task. In consequence, even if m_presentationSize is set
there, many samples with the new resolution would still be wrapped in
a MediaSampleGStreamer using the old resolution by the main thread
running consumeAppsinkAvailableSamples() before appsinkCapsChanged()
is dispatched.
This patch fixes these problems by updating m_presentationSize in
appsinkCapsChanged() and making the streaming thread block until the
main thread has dispatched appsinkCapsChanged(). This way the handling
of caps changes is serialized with the handling of frames.
Test: media/media-source/media-source-samples-resolution-change.html
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::appsinkCapsChanged):
2019-03-20 Joanmarie Diggs <jdiggs@igalia.com>
AX: Implement support for new meter ARIA role
https://bugs.webkit.org/show_bug.cgi?id=195966
Reviewed by Chris Fleizach.
Add the new ARIA role to the internal rolemap so that it is treated
in the same fashion as its HTML element counterpart.
No new tests. Instead add the role to the existing role-exposure tests.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isMeter const):
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString const):
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
2019-03-20 Philippe Normand <pnormand@igalia.com>
[GStreamer] Switch back to webkitwebsrc for adaptive streaming fragments downloading
https://bugs.webkit.org/show_bug.cgi?id=195948
Reviewed by Xabier Rodriguez-Calvar.
The webkitwebsrc element now behaves much better when used through
GStreamer's adaptivedemux, so use it for all WebKit media
downloads. The MediaPlayer needed by the webkitwebsrc element now
travels through GstContext messages and queries so that it can be
shared by multiple elements, typically the first webkitwebsrc
element downloads the HLS manifest and then adaptivedemux, through
uridownloader, will create new webkitwebsrc elements for fragments
downloading. Those new elements will query the first webkitwebsrc
element for its context.
The previous hack used to check SecurityOrigins can
also be cleaned-up. The origins are now cached upon reception of
the HTTP headers message from webkitwebsrc.
No new tests, existing http/tests/media/hls tests cover this change.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
(WebCore::convertToInternalProtocol): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_class_init):
(webKitWebSrcSetContext):
(webKitWebSrcStart):
(webKitWebSrcGetProtocols):
(webKitWebSrcSetUri):
(CachedResourceStreamingClient::responseReceived):
(convertPlaybinURI): Deleted.
(webKitSrcWouldTaintOrigin): Deleted.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2019-03-20 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC]: Refactor to make the encoding happen synchronously
https://bugs.webkit.org/show_bug.cgi?id=195674
This simplifies the code and make sure that everything is called from the right
thread. It also makes it so we follow the same way of doing things as other libwebrtc
encoders.
Also "s/codecSpecifiInfos/codecSpecificInfos/"
Reviewed by Philippe Normand.
No new test as this is just a refactoring
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::returnFromFlowReturn):
2019-03-20 Tim Horton <timothy_horton@apple.com>
Add an platform-driven spell-checking mechanism
https://bugs.webkit.org/show_bug.cgi?id=195795
Reviewed by Ryosuke Niwa.
* dom/Document.cpp:
(WebCore::Document::textInserted):
PlatformTextChecking markers are not expected
to propagate to newly inserted text, so remove them.
* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):
Add a new type of DocumentMarker, PlatformTextChecking,
and a new data variant that stores a key value pair of strings.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addPlatformTextCheckingMarker):
(WebCore::DocumentMarkerController::removeMarkers):
(WebCore::DocumentMarkerController::filterMarkers):
(WebCore::shouldInsertAsSeparateMarker):
* dom/DocumentMarkerController.h:
Export some things.
Add addPlatformTextCheckingMarker, like the others.
Make it possible to filter out markers of a particular type
in a range with a predicate function.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
Propagate PlatformTextChecking data.
A future change should probably make it possible for
any DocumentMarker to copy its data here, instead of
special-casing each type that is important.
* editing/Editor.cpp:
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
(WebCore::Editor::markMisspellingsAndBadGrammar):
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
(WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
(WebCore::platformDrivenTextCheckerEnabled):
* editing/TextCheckingHelper.h:
Bail from traditional spell checking if this mechanism is
enabled. (I wrote it this way to make it runtime switchable
in the near future, and to be similar to unifiedTextCheckerEnabled).
2019-03-19 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement FIDO AppID extension
https://bugs.webkit.org/show_bug.cgi?id=143491
<rdar://problem/48298273>
Reviewed by Brent Fulgham.
This patch adds support for FIDO AppID extension: https://www.w3.org/TR/webauthn/#sctn-appid-extension.
To be noticed, this implementation follows what spec suggested in the 'Note' session and what Chrome/Firefox
do in practice to avoid some unnecessary steps of
https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-appid-and-facets-v2.0-id-20180227.html#determining-if-a-caller-s-facetid-is-authorized-for-an-appid.
In fido::convertToU2fSignCommand, the checkOnly flag is deleted as it is never used.
Covered by new tests in existing files.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webauthn/AuthenticationExtensionsClientInputs.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
(WebCore::AuthenticationExtensionsClientInputs::encode const):
(WebCore::AuthenticationExtensionsClientInputs::decode):
* Modules/webauthn/AuthenticationExtensionsClientInputs.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::processAppIdExtension):
(WebCore::AuthenticatorCoordinator::create const):
(WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::tryCreate):
(WebCore::PublicKeyCredential::PublicKeyCredential):
(WebCore::PublicKeyCredential::getClientExtensionResults const):
(WebCore::PublicKeyCredential::create): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialData.h:
(WebCore::PublicKeyCredentialData::encode const):
(WebCore::PublicKeyCredentialData::decode):
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPMakeCredentialResponse):
(fido::readCTAPGetAssertionResponse):
* Modules/webauthn/fido/U2fCommandConstructor.cpp:
(fido::convertToU2fSignCommand):
* Modules/webauthn/fido/U2fCommandConstructor.h:
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::readU2fRegisterResponse):
(fido::readU2fSignResponse):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-03-19 Devin Rousso <drousso@apple.com>
Web Inspector: Debugger: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195973
<rdar://problem/49039674>
Reviewed by Joseph Pecoraro.
No change in functionality.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::createLazyAgents):
* inspector/agents/WebDebuggerAgent.cpp:
(WebCore::WebDebuggerAgent::disable):
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::discardAgent):
2019-03-18 Maciej Stachowiak <mjs@apple.com>
Simplify Cocoa platform user agent logic by using string constants instead of function calls for the frozen parts
https://bugs.webkit.org/show_bug.cgi?id=195936
Reviewed by Dean Jackson.
No new tests because no behavior changes. Existing behavior is tested by fast/dom/navigator-userAgent-frozen.html
* platform/UserAgent.h: Remove prototype of removed function.
* platform/cocoa/UserAgentCocoa.mm:
(WebCore::userAgentBundleVersion): Deleted.
* platform/ios/UserAgentIOS.mm:
* platform/ios/UserAgentIOS.mm:
(WebCore::osNameForUserAgent): Use WTF String instead of NSString
(WebCore::deviceNameForUserAgent): dutto
(WebCore::standardUserAgentWithApplicationName): Simplify this
function to account for WebKit version now being frozen. Also
use String instead of NSString.
* platform/mac/UserAgentMac.mm:
(WebCore::standardUserAgentWithApplicationName): Simplify this
function to account for CPU and WEbKit version now being
frozen. Also avoid two separate but very similar calls to
makeString().
2019-03-19 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed adjustment to r242842 per Darin's request.
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
2019-03-19 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG property tear off objects of SVGAnimatedPreserveAspectRatio
https://bugs.webkit.org/show_bug.cgi?id=195960
Reviewed by Simon Fraser.
-- Define SVGAnimatedPreserveAspectRatio to be SVGAnimatedValueProperty<
SVGPreserveAspectRatio>.
-- Make SVGPreserveAspectRatio be derived form SVGValueProperty<
SVGPreserveAspectRatioValue>.
-- Add SVGAnimatedPreserveAspectRatioAccessor to access the animated
property.
-- Add SVGAnimatedPreserveAspectRatioAnimator to animate the animated
property of the target element and all its instances.
-- Add SVGAnimationPreserveAspectRatioFunction to progress animVal of
animated property in a period of time.
SVGFilterPrimitiveStandardAttributes::build() should be const function.
This is required for this patch because SVGFEImageElement::build() calls
SVGFEImageElement::preserveAspectRatio() which is const.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimatedPreserveAspectRatio.cpp: Removed.
* svg/SVGAnimatedPreserveAspectRatio.h: Removed.
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::build const):
(WebCore::SVGFEBlendElement::build): Deleted.
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::build const):
(WebCore::SVGFEColorMatrixElement::build): Deleted.
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::build const):
(WebCore::SVGFEComponentTransferElement::build): Deleted.
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::build const):
(WebCore::SVGFECompositeElement::build): Deleted.
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::build const):
(WebCore::SVGFEConvolveMatrixElement::build): Deleted.
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build const):
(WebCore::SVGFEDiffuseLightingElement::build): Deleted.
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::build const):
(WebCore::SVGFEDisplacementMapElement::build): Deleted.
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build const):
(WebCore::SVGFEDropShadowElement::build): Deleted.
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEFloodElement.cpp:
(WebCore::SVGFEFloodElement::build const):
(WebCore::SVGFEFloodElement::build): Deleted.
* svg/SVGFEFloodElement.h:
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::build const):
(WebCore::SVGFEGaussianBlurElement::build): Deleted.
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::SVGFEImageElement):
(WebCore::SVGFEImageElement::parseAttribute):
(WebCore::SVGFEImageElement::build const):
(WebCore::SVGFEImageElement::registerAttributes): Deleted.
(WebCore::SVGFEImageElement::build): Deleted.
* svg/SVGFEImageElement.h:
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::build const):
(WebCore::SVGFEMergeElement::build): Deleted.
* svg/SVGFEMergeElement.h:
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::build const):
(WebCore::SVGFEMorphologyElement::build): Deleted.
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::build const):
(WebCore::SVGFEOffsetElement::build): Deleted.
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build const):
(WebCore::SVGFESpecularLightingElement::build): Deleted.
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::build const):
(WebCore::SVGFETileElement::build): Deleted.
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::build const):
(WebCore::SVGFETurbulenceElement::build): Deleted.
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.h:
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::SVGFitToViewBox):
(WebCore::SVGFitToViewBox::parseViewBox):
(WebCore::SVGFitToViewBox::registerAttributes): Deleted.
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::preserveAspectRatio const):
(WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
(WebCore::SVGFitToViewBox::setPreserveAspectRatio):
(WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
(WebCore::SVGFitToViewBox::preserveAspectRatioString const):
* svg/SVGImageElement.cpp:
(WebCore::SVGImageElement::SVGImageElement):
(WebCore::SVGImageElement::registerAttributes):
(WebCore::SVGImageElement::parseAttribute):
* svg/SVGImageElement.h:
* svg/SVGMarkerElement.h:
* svg/SVGPatternElement.h:
* svg/SVGPreserveAspectRatio.h:
(WebCore::SVGPreserveAspectRatio::create):
(WebCore::SVGPreserveAspectRatio::align const):
(WebCore::SVGPreserveAspectRatio::setAlign):
(WebCore::SVGPreserveAspectRatio::meetOrSlice const):
(WebCore::SVGPreserveAspectRatio::setMeetOrSlice):
(WebCore::SVGPreserveAspectRatio::align): Deleted.
(WebCore::SVGPreserveAspectRatio::meetOrSlice): Deleted.
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio): Deleted.
* svg/SVGSVGElement.h:
* svg/SVGStringList.h:
* svg/SVGSymbolElement.h:
* svg/SVGViewSpec.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimationDiscreteFunctionImpl.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-03-19 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG property tear off objects of SVGAnimatedRect
https://bugs.webkit.org/show_bug.cgi?id=195949
Reviewed by Simon Fraser.
SVGRect is an SVG type, so we need to introduce two classes to represent
it and its animated property SVGAnimatedRect.
-- SVGValueProperty: It is derived from SVGProperty and it will be the
base class of all the SVG type based properties. It is basically a
RefCounted object with m_value member. For SVGRect, m_value will be
of type FloatRect.
-- SVGAnimatedValueProperty: It is derived from SVGAnimatedProperty and
it will be the base class of all the animated SVG type based properties.
It is RefCounted object with two RefCounted members: baseVal and animVal.
These two members are of type SVGValueProperty. For SVGAnimatedRect,
baseVal and animVal will be of type SVGRect.
SVGAnimatedValueProperty will be responsible for:
1) Providing access to its baseVal and animVal. Note the same interface
is used internally and used by the DOM.
2) Managing the animation of the property by starting and stopping it.
3) Coordinating the changes in its baseVal and animVal with the owner
element.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimatedRect.cpp: Removed.
* svg/SVGAnimatedRect.h: Removed.
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGAttributeAnimationController.cpp:
(WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
This is a bug from r243036. The <set> can be the tag of m_animationElement
not m_targetElement.
* svg/SVGAttributeAnimationController.h:
* svg/SVGAttributeAnimationControllerBase.h:
* svg/SVGFitToViewBox.cpp:
(WebCore::SVGFitToViewBox::SVGFitToViewBox):
(WebCore::SVGFitToViewBox::registerAttributes):
(WebCore::SVGFitToViewBox::setViewBox):
(WebCore::SVGFitToViewBox::resetViewBox):
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::viewBox const):
(WebCore::SVGFitToViewBox::viewBoxAnimated):
(WebCore::SVGFitToViewBox::viewBoxString const):
* svg/SVGMarkerElement.h:
* svg/SVGPatternElement.h:
* svg/SVGRect.h:
(WebCore::SVGRect::create):
(WebCore::SVGRect::x):
(WebCore::SVGRect::setX):
(WebCore::SVGRect::y):
(WebCore::SVGRect::setY):
(WebCore::SVGRect::width):
(WebCore::SVGRect::setWidth):
(WebCore::SVGRect::height):
(WebCore::SVGRect::setHeight):
(WebCore::SVGRect::SVGRect): Deleted.
* svg/SVGSVGElement.cpp:
(WebCore::checkIntersectionWithoutUpdatingLayout):
(WebCore::checkEnclosureWithoutUpdatingLayout):
* svg/SVGSVGElement.h:
* svg/SVGSymbolElement.h:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec):
* svg/SVGViewSpec.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimatedValueProperty.h: Added.
(WebCore::SVGAnimatedValueProperty::create):
(WebCore::SVGAnimatedValueProperty::~SVGAnimatedValueProperty):
(WebCore::SVGAnimatedValueProperty::setBaseValInternal):
(WebCore::SVGAnimatedValueProperty::baseVal const):
(WebCore::SVGAnimatedValueProperty::baseVal):
(WebCore::SVGAnimatedValueProperty::setAnimVal):
(WebCore::SVGAnimatedValueProperty::animVal const):
(WebCore::SVGAnimatedValueProperty::animVal):
(WebCore::SVGAnimatedValueProperty::currentValue const):
(WebCore::SVGAnimatedValueProperty::SVGAnimatedValueProperty):
(WebCore::SVGAnimatedValueProperty::ensureAnimVal):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h:
(WebCore::SVGAnimationRectFunction::progress):
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
* svg/properties/SVGValueProperty.h: Added.
(WebCore::SVGValueProperty::create):
(WebCore::SVGValueProperty::value const):
(WebCore::SVGValueProperty::setValue):
(WebCore::SVGValueProperty::value):
(WebCore::SVGValueProperty::SVGValueProperty):
2019-03-19 John Wilander <wilander@apple.com>
Resource Load Statistics (experimental): Clear non-cookie website data for sites that have been navigated to, with link decoration, by a prevalent resource
https://bugs.webkit.org/show_bug.cgi?id=195923
<rdar://problem/49001272>
Reviewed by Alex Christensen.
Adds a new experimental feature.
Test: http/tests/resourceLoadStatistics/website-data-removal-for-site-navigated-to-with-link-decoration.html
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setIsITPFirstPartyWebsiteDataRemovalEnabled):
(WebCore::RuntimeEnabledFeatures::isITPFirstPartyWebsiteDataRemovalEnabled const):
2019-03-19 Ryosuke Niwa <rniwa@webkit.org>
Reparenting during a mutation event inside appendChild could result in a circular DOM tree
https://bugs.webkit.org/show_bug.cgi?id=192825
Reviewed by Zalan Bujtas.
The bug was caused by appendChildWithoutPreInsertionValidityCheck, insertBefore and replaceChild
checking the circular dependency against newChild instead of targets even though when newChild
is a document fragment, appendChildWithoutPreInsertionValidityCheck inserts the children of
the document fragment. Fixed the bug by checking the circular dependency against each target child.
Also fixed the bug that checkAcceptChildGuaranteedNodeTypes was not considering shadow inclusive
ancestors or template host elements.
Tests: fast/dom/append-child-with-mutation-event-removal-and-circular-insertion.html
fast/dom/append-child-with-mutation-event-removal-and-circular-shadow-insertion.html
fast/dom/append-child-with-mutation-event-removal-and-circular-template-insertion.html
fast/dom/insert-child-with-mutation-event-removal-and-circular-insertion.html
fast/dom/insert-child-with-mutation-event-removal-and-circular-shadow-insertion.html
fast/dom/insert-child-with-mutation-event-removal-and-circular-template-insertion.html
fast/dom/replace-child-with-mutation-event-removal-and-circular-insertion.html
fast/dom/replace-child-with-mutation-event-removal-and-circular-shadow-insertion.html
fast/dom/replace-child-with-mutation-event-removal-and-circular-template-insertion.html
* dom/ContainerNode.cpp:
(WebCore::checkAcceptChildGuaranteedNodeTypes):
(WebCore::ContainerNode::insertBefore):
(WebCore::ContainerNode::replaceChild):
(WebCore::ContainerNode::appendChildWithoutPreInsertionValidityCheck):
2019-03-19 Brent Fulgham <bfulgham@apple.com>
Add default prompt implementation for the Storage Access API
https://bugs.webkit.org/show_bug.cgi?id=195866
<rdar://problem/45150009>
Reviewed by Chris Dumez.
* en.lproj/Localizable.strings: Update with new strings used by the
Storage Access API dialog.
2019-03-19 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Create sps/pps for all frames to please libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=195677
Reviewed by Xabier Rodriguez-Calvar.
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_set_format):
(register_known_encoder):
(setup_x264enc):
(setup_openh264enc):
(setup_omxh264enc):
(set_bitrate_bit_per_sec):
(gst_webrtc_video_encoder_class_init):
2019-03-19 Timothy Hatcher <timothy@apple.com>
REGRESSION (r239904): Update dark mode defines in a few places that got missed.
https://bugs.webkit.org/show_bug.cgi?id=195958
Reviewed by Megan Gardner.
* DerivedSources.make: Support HAVE_OS_DARK_MODE_SUPPORT in html.css.
* css/html.css: Update dark mode defines.
* page/FrameView.cpp:
(WebCore::FrameView::updateBackgroundRecursively): Ditto.
2019-03-19 Chris Dumez <cdumez@apple.com>
media/track/track-in-band-style.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=195922
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processCueAttributes):
Small optimization: some of the if checks were missing their "continue;"
statement. This would cause us to keep checking following keys even though
we already got a match.
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Build cleanly with GCC 9
https://bugs.webkit.org/show_bug.cgi?id=195920
Reviewed by Chris Dumez.
WebKit triggers three new GCC 9 warnings:
"""
-Wdeprecated-copy, implied by -Wextra, warns about the C++11 deprecation of implicitly
declared copy constructor and assignment operator if one of them is user-provided.
"""
Solution is to either add a copy constructor or copy assignment operator, if required, or
else remove one if it is redundant.
"""
-Wredundant-move, implied by -Wextra, warns about redundant calls to std::move.
-Wpessimizing-move, implied by -Wall, warns when a call to std::move prevents copy elision.
"""
These account for most of this patch. Solution is to just remove the bad WTFMove().
Additionally, -Wclass-memaccess has been enhanced to catch a few cases that GCC 8 didn't.
These are solved by casting nontrivial types to void* before using memcpy. (Of course, it
would be safer to not use memcpy on nontrivial types, but that's too complex for this
patch. Searching for memcpy used with static_cast<void*> will reveal other cases to fix.)
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedConfiguration):
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* Modules/entriesapi/DOMFileSystem.cpp:
(WebCore::listDirectoryWithMetadata):
(WebCore::toFileSystemEntries):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::fromFormData):
(WebCore::FetchBody::bodyAsFormData const):
(WebCore::FetchBody::take):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::create):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
(WebCore::FetchResponse::redirect):
(WebCore::FetchResponse::clone):
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::deleteFunction):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::decode):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::decode):
* Modules/indexeddb/shared/IDBError.cpp:
(WebCore::IDBError::operator=): Deleted.
* Modules/indexeddb/shared/IDBError.h:
* Modules/indexeddb/shared/IDBResultData.h:
(WebCore::IDBResultData::decode):
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addSourceBuffer):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::certificatesFromConfiguration):
(WebCore::certificateTypeFromAlgorithmIdentifier):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::create):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::createMediaElementSource):
(WebCore::AudioContext::createMediaStreamSource):
(WebCore::AudioContext::createScriptProcessor):
* Modules/webaudio/OfflineAudioContext.cpp:
(WebCore::OfflineAudioContext::create):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::tryToOpenDatabaseBackend):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::canEstablishDatabase):
(WebCore::DatabaseTracker::retryCanEstablishDatabase):
* Modules/webdatabase/SQLResultSetRowList.cpp:
(WebCore::SQLResultSetRowList::item const):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::create):
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::rangeForNodeContents):
(WebCore::AXObjectCache::rangeForUnorderedCharacterOffsets):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructElementWithFallback):
* bindings/js/JSDOMConvertVariadic.h:
(WebCore::VariadicConverter::convert):
(WebCore::convertVariadicArguments):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readDOMPointInit):
(WebCore::transferArrayBuffers):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallbackImplementationContent):
* bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
(WebCore::JSTestCallbackFunction::handleEvent):
* bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
(WebCore::JSTestCallbackFunctionRethrow::handleEvent):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::JSTestCallbackInterface::callbackWithAReturnValue):
(WebCore::JSTestCallbackInterface::callbackThatRethrowsExceptions):
(WebCore::JSTestCallbackInterface::callbackThatSkipsInvokeCheck):
(WebCore::JSTestCallbackInterface::callbackWithThisObject):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getStringList):
(WebCore::ContentExtensions::loadTrigger):
(WebCore::ContentExtensions::loadEncodedRules):
(WebCore::ContentExtensions::parseRuleList):
* crypto/SubtleCrypto.cpp:
(WebCore::normalizeCryptoAlgorithmParameters):
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
(WebCore::calculateSignature):
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::exportJwk const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedTransform):
(WebCore::ComputedStyleExtractor::valueForShadow):
(WebCore::ComputedStyleExtractor::valueForFilter):
(WebCore::specifiedValueForGridTrackSize):
(WebCore::valueForGridTrackList):
(WebCore::valueForGridPosition):
(WebCore::willChangePropertyValue):
(WebCore::fontVariantLigaturesPropertyValue):
(WebCore::fontVariantNumericPropertyValue):
(WebCore::fontVariantEastAsianPropertyValue):
(WebCore::touchActionFlagsToCSSValue):
(WebCore::renderTextDecorationFlagsToCSSValue):
(WebCore::renderEmphasisPositionFlagsToCSSValue):
(WebCore::speakAsToCSSValue):
(WebCore::hangingPunctuationToCSSValue):
(WebCore::fillRepeatToCSSValue):
(WebCore::fillSizeToCSSValue):
(WebCore::counterToCSSValue):
(WebCore::fontVariantFromStyle):
(WebCore::fontSynthesisFromStyle):
(WebCore::shapePropertyValue):
(WebCore::paintOrder):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::matchingFacesExcludingPreinstalledFonts):
* css/CSSGradientValue.cpp:
(WebCore::CSSGradientValue::image):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::rules):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::parseStringIntoAbstractMatrix):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* css/FontVariantBuilder.cpp:
(WebCore::computeFontVariant):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::removeProperty):
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::strokeDashArrayToCSSValueList):
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertReflection):
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::create):
(WebCore::WebKitCSSMatrix::multiply const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontVariationSettings):
(WebCore::consumeBasicShapePath):
(WebCore::consumeImplicitGridAutoFlow):
* cssjit/StackAllocator.h:
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* dom/Document.cpp:
(WebCore::Document::cloneNodeInternal):
* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::cloneNodeInternal):
* dom/Element.cpp:
(WebCore::Element::setAttributeNode):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::removeAttributeNode):
(WebCore::Element::parseAttributeName):
(WebCore::Element::animate):
* dom/MessagePort.cpp:
(WebCore::MessagePort::disentanglePorts):
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::nextNode):
(WebCore::NodeIterator::previousNode):
* dom/Range.cpp:
(WebCore::Range::processContents):
(WebCore::processContentsBetweenOffsets):
(WebCore::processAncestorsAndTheirSiblings):
* dom/RangeBoundaryPoint.h:
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::operator=):
* dom/Text.cpp:
(WebCore::Text::splitText):
* dom/TextDecoder.cpp:
(WebCore::TextDecoder::create):
(WebCore::TextDecoder::decode):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::insertBlockPlaceholder):
(WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
* editing/Editing.cpp:
(WebCore::createTabSpanElement):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleAtSelectionStart):
* editing/TextIterator.cpp:
(WebCore::TextIterator::rangeFromLocationAndLength):
* editing/VisibleSelection.cpp:
(WebCore::makeSearchRange):
* editing/markup.cpp:
(WebCore::styleFromMatchedRulesAndInlineDecl):
(WebCore::createFragmentForInnerOuterHTML):
(WebCore::createContextualFragment):
* html/FormController.cpp:
(WebCore::deserializeFormControlState):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::captureStream):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::createForJSConstructor):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::createSharedCellStyle):
* html/HTMLTableRowElement.cpp:
(WebCore::HTMLTableRowElement::insertCell):
* html/ImageData.cpp:
(WebCore::ImageData::create):
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::transferToImageBitmap):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createLinearGradient):
(WebCore::CanvasRenderingContext2DBase::createRadialGradient):
* html/canvas/OESVertexArrayObject.cpp:
(WebCore::OESVertexArrayObject::createVertexArrayOES):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::createBuffer):
(WebCore::WebGLRenderingContextBase::createFramebuffer):
(WebCore::WebGLRenderingContextBase::createTexture):
(WebCore::WebGLRenderingContextBase::createProgram):
(WebCore::WebGLRenderingContextBase::createRenderbuffer):
(WebCore::WebGLRenderingContextBase::createShader):
(WebCore::WebGLRenderingContextBase::getContextAttributes):
(WebCore::WebGLRenderingContextBase::getUniform):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerContainer::resolveCustomStyle):
(WebCore::TextControlPlaceholderElement::resolveCustomStyle):
* html/track/BufferedLineReader.cpp:
(WebCore::BufferedLineReader::nextLine):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getCueAsHTML):
(WebCore::VTTCue::createCueRenderingTree):
* html/track/WebVTTElement.cpp:
(WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
* inspector/InspectorStyleSheet.cpp:
(WebCore::asCSSRuleList):
(WebCore::InspectorStyle::buildObjectForStyle const):
(WebCore::InspectorStyleSheet::buildObjectForStyleSheet):
(WebCore::InspectorStyleSheet::buildObjectForRule):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildArrayForPseudoElements):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
* loader/FetchOptions.h:
(WebCore::FetchOptions::decode):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCache):
(WebCore::ApplicationCacheStorage::manifestURLs):
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::parseArchiveWithHeader):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules const):
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData):
* page/EventSource.cpp:
(WebCore::EventSource::create):
* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::mark):
(WebCore::UserTiming::measure):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::decode):
* page/scrolling/ScrollingConstraints.h:
(WebCore::FixedPositionViewportConstraints::FixedPositionViewportConstraints):
(WebCore::LayoutConstraints::LayoutConstraints): Deleted.
* platform/Length.h:
(WebCore::Length::Length):
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::createFromCSSText):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat):
* platform/graphics/FloatPoint3D.h:
* platform/graphics/Font.cpp:
(WebCore::createAndFillGlyphPage):
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow):
(WebCore::GLContext::createSharingContext):
* platform/graphics/GraphicsContext.cpp:
* platform/graphics/HEVCUtilities.cpp:
(WebCore::parseHEVCCodecParameters):
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::loadImageFromGResource):
(WebCore::loadMissingImageIconFromTheme):
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::create):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaTrackConstraintSetMap::decode):
* platform/mediastream/MediaStreamRequest.h:
(WebCore::MediaStreamRequest::decode):
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::GStreamerSampleFromLibWebRTCVideoFrame):
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingAudioSource::create):
* platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingVideoSource::create):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::createNonDisplayingCopy const):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::createResourceHandle):
* platform/network/CookieRequestHeaderFieldProxy.h:
(WebCore::CookieRequestHeaderFieldProxy::decode):
* platform/network/FormData.h:
(WebCore::FormData::decode):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::create):
* platform/network/soup/DNSResolveQueueSoup.cpp:
(WebCore::DNSResolveQueueSoup::takeCompletionAndCancelHandlers):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::createFor):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
(WebCore::Shape::createBoxShape):
* rendering/style/BasicShapes.cpp:
(WebCore::BasicShapeCircle::blend const):
(WebCore::BasicShapeEllipse::blend const):
(WebCore::BasicShapePolygon::blend const):
(WebCore::BasicShapePath::blend const):
(WebCore::BasicShapeInset::blend const):
* rendering/style/BasicShapes.h:
(WebCore::BasicShapeRadius::BasicShapeRadius):
* rendering/style/ContentData.cpp:
(WebCore::ImageContentData::createContentRenderer const):
(WebCore::TextContentData::createContentRenderer const):
(WebCore::QuoteContentData::createContentRenderer const):
* rendering/style/ContentData.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::createInlineFlowBox):
* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::createTextBox):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::createRootInlineBox):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::build):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::build):
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::build):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::build):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::build):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::build):
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::build):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::build):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::build):
* svg/SVGTransformList.h:
* svg/properties/SVGList.h:
(WebCore::SVGList::initialize):
(WebCore::SVGList::insertItemBefore):
(WebCore::SVGList::replaceItem):
(WebCore::SVGList::removeItem):
(WebCore::SVGList::appendItem):
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValues):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
* svg/properties/SVGPrimitiveList.h:
* testing/Internals.cpp:
(WebCore::Internals::elementRenderTreeAsText):
(WebCore::parseFindOptions):
* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::resolveURL):
* workers/Worker.cpp:
(WebCore::Worker::create):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::decode):
* xml/DOMParser.cpp:
(WebCore::DOMParser::parseFromString):
* xml/XPathExpression.cpp:
(WebCore::XPathExpression::evaluate):
2019-03-19 Devin Rousso <drousso@apple.com>
Web Inspector: Provide $event in the console when paused on an event listener
https://bugs.webkit.org/show_bug.cgi?id=188672
Reviewed by Timothy Hatcher.
Implement similiar methods/logic as to the way that `$exception` is set.
* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPI):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willHandleEvent):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willHandleEventImpl):
(WebCore::InspectorInstrumentation::didHandleEventImpl):
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
* inspector/agents/InspectorDOMDebuggerAgent.h:
(WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
(WebCore::InspectorDOMDebuggerAgent::didHandleEvent): Added.
2019-03-19 Devin Rousso <drousso@apple.com>
Web Inspector: ScriptProfiler: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195591
<rdar://problem/48791756>
Reviewed by Joseph Pecoraro.
No change in functionality.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
2019-03-19 Devin Rousso <drousso@apple.com>
Web Inspector: DOMStorage: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195588
<rdar://problem/48791878>
Reviewed by Joseph Pecoraro.
No change in functionality.
Make functions used by `CommandLineAPIHost` static so that an `InspectorDOMStorageAgent`
doesn't need to be created to call them.
* inspector/agents/InspectorDOMStorageAgent.h:
* inspector/agents/InspectorDOMStorageAgent.cpp:
(WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
(WebCore::InspectorDOMStorageAgent::enable):
(WebCore::InspectorDOMStorageAgent::disable):
(WebCore::InspectorDOMStorageAgent::storageId):
(WebCore::InspectorDOMStorageAgent::didDispatchDOMStorageEvent):
(WebCore::InspectorDOMStorageAgent::findStorageArea):
(WebCore::InspectorDOMStorageAgent::~InspectorDOMStorageAgent): Deleted.
* inspector/CommandLineAPIHost.h:
(WebCore::CommandLineAPIHost::init):
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::disconnect):
(WebCore::CommandLineAPIHost::storageId):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
2019-03-19 Youenn Fablet <youenn@apple.com>
REGRESSION: Layout Test http/tests/security/cross-origin-indexeddb.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=195779
Reviewed by Chris Dumez.
When requesting space, we might delay execution of the task.
In such a case, a task to close the database might be done before the task continues.
Check that the database is not closing to continue the task.
This should ensure that the cross thread queue is not already killed.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
2019-03-19 Zalan Bujtas <zalan@apple.com>
RenderElement::startAnimation should take const Animation&
https://bugs.webkit.org/show_bug.cgi?id=195929
Reviewed by Daniel Bates.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::startAnimation):
(WebCore::KeyframeAnimation::endAnimation):
* rendering/RenderElement.h:
(WebCore::RenderElement::startAnimation):
(WebCore::RenderElement::animationFinished):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::startAnimation):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::startAnimation):
(WebCore::RenderLayerModelObject::animationFinished):
* rendering/RenderLayerModelObject.h:
2019-03-19 Devin Rousso <drousso@apple.com>
Web Inspector: Heap: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195590
<rdar://problem/48791750>
Reviewed by Joseph Pecoraro.
No change in functionality.
* inspector/agents/page/PageHeapAgent.cpp:
(WebCore::PageHeapAgent::disable):
* inspector/agents/WebHeapAgent.h:
* inspector/agents/WebHeapAgent.cpp:
(WebCore::WebHeapAgent::WebHeapAgent):
(WebCore::WebHeapAgent::enable): Added.
(WebCore::WebHeapAgent::disable):
* inspector/agents/page/PageConsoleAgent.h:
* inspector/agents/page/PageConsoleAgent.cpp:
(WebCore::PageConsoleAgent::PageConsoleAgent):
* inspector/agents/WebConsoleAgent.h:
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::WebConsoleAgent):
* inspector/agents/worker/WorkerConsoleAgent.h:
* inspector/agents/worker/WorkerConsoleAgent.cpp:
(WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
(WebCore::WorkerInspectorController::createLazyAgents):
2019-03-19 Simon Fraser <simon.fraser@apple.com>
Fix GraphicsLayer-related crashes after r243129
https://bugs.webkit.org/show_bug.cgi?id=195953
Reviewed by Dean Jackson.
Extending the lifetime of GraphicsLayers by referencing them in the scrolling tree (r243129)
revealed a bug where RenderLayerCompositor was failing to clear itself as the client of
GraphicsLayers that it owned, causing crashes.
Fix by using the GraphicsLayer::unparentAndClear() helper to clean up all the GraphicsLayers
owned by RenderLayerCompositor.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::~RenderLayerCompositor):
* rendering/RenderLayerCompositor.h:
2019-03-19 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Handle positioned nodes in a few more places
https://bugs.webkit.org/show_bug.cgi?id=195946
Reviewed by Zalan Bujtas.
When I added support for positioned nodes in the scrolling tree I missed handling
the ScrollCoordinationRole::Positioning in a few places.
I wasn't able to come up with a test for this; when a positioned node toggles between
tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
update the node with the new layer.
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive): Logging.
* rendering/RenderLayerBacking.cpp:
(WebCore::operator<<): Logging.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
2019-03-19 Alex Christensen <achristensen@webkit.org>
Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904
Reviewed by Eric Carlson.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
(WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
* dom/Document.cpp:
(WebCore::messageLevelFromWTFLogLevel):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::sourceWasRemoved):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels):
(WebCore::channelConfigurationForString):
* platform/Logging.cpp:
(WebCore::isLogChannelEnabled):
(WebCore::setLogChannelToAccumulate):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads):
* rendering/RenderLayerCompositor.cpp:
(WebCore::compositingLogEnabled):
2019-03-19 Philippe Normand <pnormand@igalia.com>
REGRESSION(r243058): [GStreamer] 3 tests now timing out
https://bugs.webkit.org/show_bug.cgi?id=195888
Reviewed by Xabier Rodriguez-Calvar.
A breaking change was introduced in r243058. Now on-disk-buffering
is disabled when the reported Content-Length is 0 or not present
at all. This broke the progress event logic in didLoadProgress()
because leading to progress events not being fired as expected.
The proposed solution is to make webkitwebsrc notify the player
every time the network process receives data from the network. So
the player can now easily determine if the load progressed by
checking the reported statistics.
No new tests, existing media tests cover this change.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::dataReceived):
2019-03-19 Alicia Boya García <aboya@igalia.com>
[MSE] Use tolerance in eraseBeginTime
https://bugs.webkit.org/show_bug.cgi?id=195911
Reviewed by Jer Noble.
https://bugs.webkit.org/show_bug.cgi?id=190085 introduced tolerance
when erasing frames during the Coded Frame Processing algorithm in
such a way that, in files with less than perfect timestamps, a frame
existing before after the current append is not erased accidentally
due to small overlaps.
This patch takes care of the opposite problem: we don't want an old
frame being accidentally NOT erased by a new one with the same
timestamps just because these overlaps make
highestPresentationTimestamp very slightly higher than the frame PTS.
This bug in practice causes some frames of the old quality to not be
erased when the new quality is appended, resulting in some seemingly
still frames from a different quality appearing at some points during
WebM video in presence of quality changes.
This bug can be reduced to this minimal test case that illustrates the
timestamp imprecission of a typical WebM file:
function sampleRun(generation) {
return concatenateSamples([
makeASample( 0, 0, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation),
makeASample(167000, 167000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
makeASample(333000, 333000, 166667, 1000000, 1, SAMPLE_FLAG.SYNC, generation), // overlaps previous frame
makeASample(500000, 500000, 166667, 1000000, 1, SAMPLE_FLAG.NONE, generation),
]);
}
After appending this twice it would be expected that the second
generation takes fully over the first, since the timestamps are
completely the same. Due to the bug, sync frames with an overlap, like
the third one in that list, actually persist from the first
generation, due to lack of tolerance when comparing the start of a new
frame with highestPresentationTimestamp.
This patch introduces the tolerance in that case too to fix this
problem.
Test: media/media-source/media-source-append-twice-overlapping-sync-frame.html
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed GTK build fix
https://bugs.webkit.org/show_bug.cgi?id=195863
<rdar://problem/49006248>
Patch by Diego Pino.
* svg/SVGTests.h:
2019-03-19 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r243132.
Broke GTK build
Reverted changeset:
"Make WTFLogChannelState and WTFLogLevel enum classes"
https://bugs.webkit.org/show_bug.cgi?id=195904
https://trac.webkit.org/changeset/243132
2019-03-19 Antti Koivisto <antti@apple.com>
Layer with no backing store should still hit-test over a scroller
https://bugs.webkit.org/show_bug.cgi?id=195378
<rdar://problem/48652078>
Reviewed by Simon Fraser.
Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
fast/scrolling/ios/overflow-scroll-overlap-4.html
Move collecting event region from paint to compositing update time.
This solves a number of problems including regions for non-painting layers.
* platform/graphics/GraphicsLayer.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
Use the existing visibleToHitTesting() helper.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
Use flag for event region collecting, don't paint content.
(WebCore::RenderLayer::paintList):
We can bail out immediately if there is no overflow.
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::collectEventRegionForFragments):
Move to a separate function.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
(WebCore::RenderLayerBacking::updateEventRegion):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:
2019-03-18 Alex Christensen <achristensen@webkit.org>
Make WTFLogChannelState and WTFLogLevel enum classes
https://bugs.webkit.org/show_bug.cgi?id=195904
Reviewed by Eric Carlson.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
(WebCore::LibWebRTCMediaEndpoint::statsLogInterval const):
* dom/Document.cpp:
(WebCore::messageLevelFromWTFLogLevel):
* html/FTPDirectoryDocument.cpp:
(WebCore::FTPDirectoryDocument::FTPDirectoryDocument):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::sourceWasRemoved):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels):
(WebCore::channelConfigurationForString):
* platform/Logging.cpp:
(WebCore::isLogChannelEnabled):
(WebCore::setLogChannelToAccumulate):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::initializePeerConnectionFactoryAndThreads):
* rendering/RenderLayerCompositor.cpp:
(WebCore::compositingLogEnabled):
2019-03-18 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG property tear off objects for SVGStringList
https://bugs.webkit.org/show_bug.cgi?id=195863
Reviewed by Simon Fraser.
SVGStringList is not animated list. So we need to introduce two new classes:
-- SVGProperty: This will be the base of all the non-animated properties.
Like the SVGAnimatedProperty, SVGProperty will be registered with the
attribute name in SVGPropertyRegistery. It will also commit changes
to the reflecting attribute. And it will provide a synchronize string
for lazy attribute update.
-- SVGList: It will be the base of all the list properties. It can hold
primitive types or SVG types. In this patch primitive types will be
supported only. To do that, a superclass called SVGPrimitiveList is
added. Its items are of primitive type such as String type.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
(WebCore::SVGElement::commitPropertyChange):
* svg/SVGElement.h:
* svg/SVGStringList.h:
* svg/SVGStringListValues.cpp: Removed.
* svg/SVGStringListValues.h: Removed.
* svg/SVGTests.cpp:
(WebCore::SVGTests::SVGTests):
(WebCore::SVGTests::isKnownAttribute):
(WebCore::SVGTests::isValid const):
(WebCore::SVGTests::parseAttribute):
(WebCore::SVGTests::registerAttributes): Deleted.
(WebCore::SVGTests::requiredFeatures): Deleted.
(WebCore::SVGTests::requiredExtensions): Deleted.
(WebCore::SVGTests::systemLanguage): Deleted.
* svg/SVGTests.h:
(WebCore::SVGTests::requiredFeatures):
(WebCore::SVGTests::requiredExtensions):
(WebCore::SVGTests::systemLanguage):
(): Deleted.
* svg/SVGTests.idl:
* svg/SVGTextPositioningElement.h:
* svg/SVGViewElement.cpp:
(WebCore::SVGViewElement::SVGViewElement):
(WebCore::SVGViewElement::parseAttribute):
(WebCore::SVGViewElement::viewTarget): Deleted.
* svg/SVGViewElement.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h:
* svg/properties/SVGAnimatedPrimitiveProperty.h:
(WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
* svg/properties/SVGAnimatedProperty.cpp:
(WebCore::SVGAnimatedProperty::commitPropertyChange):
* svg/properties/SVGAnimatedProperty.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGList.h: Added.
(WebCore::SVGList::numberOfItems const):
(WebCore::SVGList::clear):
(WebCore::SVGList::getItem):
(WebCore::SVGList::initialize):
(WebCore::SVGList::insertItemBefore):
(WebCore::SVGList::replaceItem):
(WebCore::SVGList::removeItem):
(WebCore::SVGList::appendItem):
(WebCore::SVGList::items):
(WebCore::SVGList::items const):
(WebCore::SVGList::size const):
(WebCore::SVGList::isEmpty const):
(WebCore::SVGList::clearItems):
(WebCore::SVGList::canAlterList const):
(WebCore::SVGList::canGetItem):
(WebCore::SVGList::canReplaceItem):
(WebCore::SVGList::canRemoveItem):
(WebCore::SVGList::detachItems):
* svg/properties/SVGMemberAccessor.h:
(WebCore::SVGMemberAccessor::matches const):
* svg/properties/SVGPrimitiveList.h: Added.
* svg/properties/SVGProperty.h:
(WebCore::SVGProperty::isAttached const):
(WebCore::SVGProperty::attach):
(WebCore::SVGProperty::detach):
(WebCore::SVGProperty::contextElement const):
(WebCore::SVGProperty::commitChange):
(WebCore::SVGProperty::access const):
(WebCore::SVGProperty::isReadOnly const):
(WebCore::SVGProperty::isDirty const):
(WebCore::SVGProperty::setDirty):
(WebCore::SVGProperty::synchronize):
(WebCore::SVGProperty::valueAsString const):
(WebCore::SVGProperty::SVGProperty):
* svg/properties/SVGPropertyAccessor.h: Added.
* svg/properties/SVGPropertyAccessorImpl.h: Added.
* svg/properties/SVGPropertyOwner.h:
(WebCore::SVGPropertyOwner::commitPropertyChange):
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
* svg/properties/SVGPropertyRegistry.h:
* svg/properties/SVGStaticListPropertyTearOff.h: Removed.
2019-03-18 Simon Fraser <simon.fraser@apple.com>
Unreviewed followup to r243126.
LayerRepresentation operator=() needs to copy m_graphicsLayer now that it doesn't
share a pointer with m_typelessPlatformLayer. Also make the LayerRepresentation construction
from a GraphiscLayer* explicit.
* page/scrolling/ScrollingStateNode.h:
(WebCore::LayerRepresentation::operator=):
(WebCore::LayerRepresentation::toRepresentation const):
2019-03-18 Simon Fraser <simon.fraser@apple.com>
Scrolling state nodes should hold references to GraphicsLayers
https://bugs.webkit.org/show_bug.cgi?id=195844
<rdar://problem/48949634>
Reviewed by Tim Horton.
GraphicsLayers are refcounted, and the scrolling tree keeps GraphicsLayer pointers,
so for safely the scrolling tree should store RefPtr<GraphicsLayer> instead.
I removed the union (since it would be weird with a RefPtr and raw pointer). This code
should probably use WTF::Variant<> in future.
* page/scrolling/ScrollingStateNode.h:
(WebCore::LayerRepresentation::LayerRepresentation):
(WebCore::LayerRepresentation::operator GraphicsLayer* const):
2019-03-18 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r243092 and r243096.
https://bugs.webkit.org/show_bug.cgi?id=195926
Caused assertions in tests (Requested by smfr on #webkit).
Reverted changesets:
"Layer with no backing store should still hit-test over a
scroller"
https://bugs.webkit.org/show_bug.cgi?id=195378
https://trac.webkit.org/changeset/243092
"Try to fix Windows build."
https://trac.webkit.org/changeset/243096
2019-03-18 Megan Gardner <megan_gardner@apple.com>
Smart Insert for paragraphs.
https://bugs.webkit.org/show_bug.cgi?id=194880
Reviewed by Ryosuke Niwa.
Add additional newlines to maintain spacing around paragraphs.
Tests: editing/pasteboard/smart-paste-paragraph-001.html
editing/pasteboard/smart-paste-paragraph-002.html
editing/pasteboard/smart-paste-paragraph-003.html
editing/pasteboard/smart-paste-paragraph-004.html
* dom/Document.cpp:
(WebCore::Document::editingBehavior const):
* dom/Document.h:
Expose editing behaviour through document so that is can be access from the selection commands
and allow the editing behaviour to be used.
* editing/CompositeEditCommand.h:
* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldSmartInsertDeleteParagraphs const):
Only have editing insert paragraphs on iOS and in editing elements that support multiple lines.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
(WebCore::ReplaceSelectionCommand::shouldPerformSmartParagraphReplace const):
(WebCore::ReplaceSelectionCommand::addNewLinesForSmartReplace):
* editing/ReplaceSelectionCommand.h:
Add addititional newlines when pasting full paragraphs to maintian two newlines between paragraphs
if that is what the original document had. If there are not multiple lines between paragraphs, do not
add additional new lines.
2019-03-18 Ryosuke Niwa <rniwa@webkit.org>
Reduce the size of Node::deref by eliminating an explicit parentNode check
https://bugs.webkit.org/show_bug.cgi?id=195776
Reviewed by Geoffrey Garen.
This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
is identically equal to 0.
For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
or not when m_referencingNodeCount becomes 0.
No new tests since there should be no behavioral change.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
* dom/Document.h:
(WebCore::Document::decrementReferencingNodeCount):
* dom/Node.cpp:
(WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
(WebCore::Node::~Node):
(WebCore::Node::removedLastRef):
* dom/Node.h:
(WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
unsigned int to signed int back in r11492 but I don't think the signedness is needed.
(WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
(WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
(WebCore::Node::hasOneRef const):
(WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
(WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
2019-03-18 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG property tear off objects for SVGAnimatedBoolean
https://bugs.webkit.org/show_bug.cgi?id=195862
Reviewed by Simon Fraser.
-- SVGAnimatedBoolean will be defined as SVGAnimatedPrimitiveProperty<bool>.
-- SVGAnimatedBooleanAccessor is added to access a member of this type.
-- A function registerProperty() is added to SVGPropertyOwnerRegistry
to register this type.
-- SVGAnimatedBooleanAnimator is added to animate a member of this type.
-- SVGAnimationBooleanFunction is added to handle the progress of this
new type over a period of time.
SVGAnimationDiscreteFunction is the base class of SVGAnimationBooleanFunction.
It will be the base class of all the discrete animation function types:
string, bool, enum and PreserveAspectRatio types.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAnimationElement.h:
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGClipPathElement.h:
* svg/SVGCursorElement.h:
* svg/SVGDefsElement.h:
* svg/SVGExternalResourcesRequired.cpp:
(WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
(WebCore::SVGExternalResourcesRequired::parseAttribute):
(WebCore::SVGExternalResourcesRequired::registerAttributes): Deleted.
* svg/SVGExternalResourcesRequired.h:
(WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
(WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
(WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired): Deleted.
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEImageElement.h:
* svg/SVGFontElement.h:
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.h:
* svg/SVGGradientElement.h:
* svg/SVGMPathElement.h:
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.h:
* svg/SVGPathElement.h:
* svg/SVGPatternElement.h:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.h:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.h:
* svg/SVGTextContentElement.h:
* svg/SVGUseElement.h:
* svg/properties/SVGAnimatedPropertyAccessorImpl.h:
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h:
* svg/properties/SVGAnimatedPropertyImpl.h:
* svg/properties/SVGAnimationDiscreteFunction.h: Added.
(WebCore::SVGAnimationDiscreteFunction::SVGAnimationDiscreteFunction):
(WebCore::SVGAnimationDiscreteFunction::progress):
* svg/properties/SVGAnimationDiscreteFunctionImpl.h: Added.
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGPropertyOwnerRegistry.h:
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
2019-03-18 Simon Fraser <simon.fraser@apple.com>
Crash when reloading test with async overflow scrolling
https://bugs.webkit.org/show_bug.cgi?id=195629
<rdar://problem/48814045>
Reviewed by Antoine Quint.
RenderLayerCompositor::removeFromScrollCoordinatedLayers needs to pass the Positioning
bit to make sure we remove RenderLayers added m_scrollingNodeToLayerMap for Positioning
scrolling nodes.
Fixes crashes seen in compositing/clipping/border-radius-async-overflow-non-stacking.html
and scrollingcoordinator/scrolling-tree/remove-coordinated-frame.html.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
2019-03-18 Devin Rousso <drousso@apple.com>
Web Inspector: Timeline: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195865
<rdar://problem/48965403>
Reviewed by Joseph Pecoraro.
No change in functionality.
* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
(WebCore::InspectorTimelineAgent::toggleScriptProfilerInstrument):
(WebCore::InspectorTimelineAgent::toggleHeapInstrument):
(WebCore::InspectorTimelineAgent::setFrameIdentifier):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::startProfiling):
(WebCore::InspectorInstrumentation::stopProfiling):
(WebCore::InspectorInstrumentation::didRequestAnimationFrame):
(WebCore::InspectorInstrumentation::didCancelAnimationFrame):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorScriptProfilerAgent const): Added.
(WebCore::InstrumentingAgents::setInspectorScriptProfilerAgent): Added.
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
2019-03-18 Darin Adler <darin@apple.com>
Cut down on use of StringBuffer, possibly leading toward removing it entirely
https://bugs.webkit.org/show_bug.cgi?id=195870
Reviewed by Daniel Bates.
* dom/Document.cpp:
(WebCore::canonicalizedTitle): Fixed all the problems mentioned in "FIXME".
Made this a single function rather than a function template. Switch to
StringBuilder instead of StringBuffer. Return the original string if the
canonicalize operation doesn't change anything.
(WebCore::Document::updateTitle): Updated for the change above.
* platform/Length.cpp:
(WebCore::newCoordsArray): Use createUninitialized instead of StringBuffer.
Also got rid of unneeded use of upconvertedCharacters on a temporary string
that we explicitly created with 16-bit characters. The performance of this
function could be considerably simplified by not copying the original string
at all, but didn't do that at this time.
* platform/text/TextCodecUTF16.cpp:
(WebCore::TextCodecUTF16::decode): Use createUninitialized instead of
StringBuffer. Also renamed numChars to numCodeUnits to both switch to complete
words and to be slightly more accurate.
* rendering/RenderText.cpp:
(WebCore::convertNoBreakSpace): Added.
(WebCore::capitalize): Use Vector instead of StringBuffer. Simplify code by
using convertNoBreakSpace function. Removed code that was using StringImpl
directly for a tiny speed boost; if we want to optimize the performance of
this function we would need to do more than that. Return the original string
if it happens to already be capitalized.
2019-03-18 Timothy Hatcher <timothy@apple.com>
WKWebView.GetContentsShouldReturnAttributedString is crashing on iOS Simulator.
https://bugs.webkit.org/show_bug.cgi?id=195916
Reviewed by Tim Horton.
* WebCore.xcodeproj/project.pbxproj: Make ColorIOS.h a private header.
* platform/ios/ColorIOS.h: Export colorFromUIColor.
2019-03-18 Said Abou-Hallawa <sabouhallawa@apple.com>
Define the type of SVGPropertyOwnerRegistry for all SVG elements
https://bugs.webkit.org/show_bug.cgi?id=195859
Reviewed by Simon Fraser.
SVGPropertyOwnerRegistry will eventually replace SVGAttributeOwnerProxyImpl.
* svg/SVGAElement.h:
* svg/SVGAltGlyphElement.h:
* svg/SVGAnimationElement.h:
* svg/SVGCircleElement.h:
* svg/SVGClipPathElement.h:
* svg/SVGComponentTransferFunctionElement.h:
(WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
(WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
* svg/SVGCursorElement.h:
* svg/SVGDefsElement.h:
* svg/SVGElement.h:
* svg/SVGEllipseElement.h:
* svg/SVGExternalResourcesRequired.h:
(WebCore::SVGExternalResourcesRequired::isKnownAttribute):
* svg/SVGFEBlendElement.h:
* svg/SVGFEColorMatrixElement.h:
* svg/SVGFEComponentTransferElement.h:
* svg/SVGFECompositeElement.h:
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFEDiffuseLightingElement.h:
* svg/SVGFEDisplacementMapElement.h:
* svg/SVGFEDropShadowElement.h:
* svg/SVGFEGaussianBlurElement.h:
* svg/SVGFEImageElement.h:
* svg/SVGFELightElement.h:
(WebCore::SVGFELightElement::attributeRegistry):
(WebCore::SVGFELightElement::isKnownAttribute):
* svg/SVGFEMergeNodeElement.h:
* svg/SVGFEMorphologyElement.h:
* svg/SVGFEOffsetElement.h:
* svg/SVGFESpecularLightingElement.h:
* svg/SVGFETileElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::svgAttributeChanged):
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.h:
* svg/SVGFilterPrimitiveStandardAttributes.h:
(WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
* svg/SVGFitToViewBox.h:
(WebCore::SVGFitToViewBox::isKnownAttribute):
* svg/SVGFontElement.h:
* svg/SVGForeignObjectElement.h:
* svg/SVGGElement.h:
* svg/SVGGeometryElement.h:
(WebCore::SVGGeometryElement::isKnownAttribute):
* svg/SVGGlyphRefElement.h:
* svg/SVGGradientElement.h:
(WebCore::SVGGradientElement::isKnownAttribute):
* svg/SVGGraphicsElement.h:
(WebCore::SVGGraphicsElement::isKnownAttribute):
* svg/SVGImageElement.h:
* svg/SVGLineElement.h:
* svg/SVGLinearGradientElement.h:
* svg/SVGMPathElement.h:
* svg/SVGMarkerElement.h:
* svg/SVGMaskElement.h:
* svg/SVGPathElement.h:
* svg/SVGPatternElement.h:
* svg/SVGPolyElement.h:
(WebCore::SVGPolyElement::attributeRegistry):
(WebCore::SVGPolyElement::isKnownAttribute):
* svg/SVGRadialGradientElement.h:
* svg/SVGRectElement.h:
* svg/SVGSVGElement.h:
* svg/SVGScriptElement.h:
* svg/SVGStopElement.h:
* svg/SVGSwitchElement.h:
* svg/SVGSymbolElement.h:
* svg/SVGTRefElement.h:
* svg/SVGTests.h:
* svg/SVGTextContentElement.h:
(WebCore::SVGTextContentElement::isKnownAttribute):
* svg/SVGTextPathElement.h:
* svg/SVGTextPositioningElement.h:
(WebCore::SVGTextPositioningElement::isKnownAttribute):
* svg/SVGURIReference.h:
* svg/SVGUseElement.h:
* svg/SVGViewElement.h:
* svg/SVGViewSpec.h:
* svg/SVGZoomAndPan.cpp:
(WebCore::SVGZoomAndPan::parseZoomAndPan):
(WebCore::SVGZoomAndPan::parseAttribute):
(WebCore::SVGZoomAndPan::SVGZoomAndPan): Deleted.
(WebCore::SVGZoomAndPan::registerAttributes): Deleted.
* svg/SVGZoomAndPan.h:
(WebCore::SVGZoomAndPan::zoomAndPan const):
(WebCore::SVGZoomAndPan::setZoomAndPan):
(WebCore::SVGZoomAndPan::reset):
(WebCore::SVGZoomAndPan::attributeRegistry): Deleted.
(WebCore::SVGZoomAndPan::isKnownAttribute): Deleted.
2019-03-18 Timothy Hatcher <timothy@apple.com>
Add new NSAttributedString API for converting HTML.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697
Reviewed by Tim Horton.
* en.lproj/Localizable.strings: Updated.
2019-03-18 Zalan Bujtas <zalan@apple.com>
Call transition and animation callbacks on non-composited renderers too.
https://bugs.webkit.org/show_bug.cgi?id=195907
Reviewed by Simon Fraser.
These callbacks are not composited specific functions.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::freezeAtTime):
(WebCore::AnimationBase::compositedRenderer const): Deleted.
* page/animation/AnimationBase.h:
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::startAnimation):
(WebCore::ImplicitAnimation::pauseAnimation):
(WebCore::ImplicitAnimation::endAnimation):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::startAnimation):
(WebCore::KeyframeAnimation::pauseAnimation):
(WebCore::KeyframeAnimation::endAnimation):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::startTransition):
(WebCore::RenderLayerModelObject::transitionPaused):
(WebCore::RenderLayerModelObject::transitionFinished):
(WebCore::RenderLayerModelObject::startAnimation):
(WebCore::RenderLayerModelObject::animationPaused):
(WebCore::RenderLayerModelObject::animationSeeked):
(WebCore::RenderLayerModelObject::animationFinished):
(WebCore::RenderLayerModelObject::suspendAnimations):
2019-03-18 Jer Noble <jer.noble@apple.com>
Add experimental "alphaChannel" property to VideoConfiguration
https://bugs.webkit.org/show_bug.cgi?id=195853
Reviewed by Eric Carlson.
Test: media/mediacapabilities/mock-decodingInfo-alphaChannel.html
Add a new, experimental addition to Media Capabilities to allow pages to query for
alpha channel support.
* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::MediaCapabilities::decodingInfo):
* Modules/mediacapabilities/MediaCapabilities.h:
* Modules/mediacapabilities/MediaCapabilities.idl:
* Modules/mediacapabilities/VideoConfiguration.idl:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/cocoa/HEVCUtilitiesCocoa.h:
* platform/graphics/cocoa/HEVCUtilitiesCocoa.mm: Renamed from Source/WebCore/platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp.
(WebCore::validateHEVCParameters):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/mediacapabilities/VideoConfiguration.h:
* platform/mock/MediaEngineConfigurationFactoryMock.cpp:
(WebCore::canDecodeMedia):
(WebCore::canEncodeMedia):
2019-03-18 Ryosuke Niwa <rniwa@webkit.org>
Remove unused webkitEditableContentChanged event
https://bugs.webkit.org/show_bug.cgi?id=195909
Reviewed by Wenson Hsieh.
Removed webkitEditableContentChanged event which is no longer used after r206944.
Note that only WebKit's C++ code can fire events in TextControlInnerElements
since the element is an implementation detail of input and textarea elements.
* dom/EventNames.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerTextElement::defaultEventHandler):
2019-03-18 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Hook up the compiler to our WebGPU implementation
https://bugs.webkit.org/show_bug.cgi?id=195509
Unreviewed.
Update after r243091.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
2019-03-18 Chris Dumez <cdumez@apple.com>
REGRESSION(r236862): early frame decoupling leaves JSC ArrayBuffer objects lingering
https://bugs.webkit.org/show_bug.cgi?id=195322
Reviewed by Ryosuke Niwa.
Since r236862, DOMWindow objects get disconnected from their Frame object as soon as
their iframe element gets removed from the document. Previously, DOMWindow was a
FrameDestructionObserver and would stay connected to its frame until the frame died.
This means that some of the work that we were doing in DOMWindow::frameDestroyed() and
Document::willDetachPage() no longer happens for subframe windows because they get
disconnected from their frame because they get a chance to get such notifications.
To address this issue, we now also do this work in DOMWindow::willDetachDocumentFromFrame()
which gets called when the iframe gets removed from the document and the document / window
get disconnected from the Frame element.
No new tests, verified locally that the leak is gone on JetStream.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachDocumentFromFrame):
2019-03-18 Zalan Bujtas <zalan@apple.com>
Move animation and transition functions from RenderBoxModelObject to RenderElement
https://bugs.webkit.org/show_bug.cgi?id=195903
Reviewed by Simon Fraser.
Transitions and animations do not require RenderBoxModelObject. Move these functions to RenderElement and override them at RenderLayerModelObject to support
composition related callbacks.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::compositedRenderer const):
* page/animation/AnimationBase.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::startTransition): Deleted.
(WebCore::RenderBoxModelObject::transitionPaused): Deleted.
(WebCore::RenderBoxModelObject::transitionFinished): Deleted.
(WebCore::RenderBoxModelObject::startAnimation): Deleted.
(WebCore::RenderBoxModelObject::animationPaused): Deleted.
(WebCore::RenderBoxModelObject::animationSeeked): Deleted.
(WebCore::RenderBoxModelObject::animationFinished): Deleted.
(WebCore::RenderBoxModelObject::suspendAnimations): Deleted.
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::startTransition):
(WebCore::RenderElement::transitionPaused):
(WebCore::RenderElement::transitionFinished):
(WebCore::RenderElement::startAnimation):
(WebCore::RenderElement::animationPaused):
(WebCore::RenderElement::animationSeeked):
(WebCore::RenderElement::animationFinished):
(WebCore::RenderElement::suspendAnimations):
* rendering/RenderElement.h:
2019-03-18 Antti Koivisto <antti@apple.com>
Try to fix Windows build.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
2019-03-18 Antti Koivisto <antti@apple.com>
Layer with no backing store should still hit-test over a scroller
https://bugs.webkit.org/show_bug.cgi?id=195378
<rdar://problem/48652078>
Reviewed by Simon Fraser.
Tests: fast/scrolling/ios/overflow-scroll-overlap-3.html
fast/scrolling/ios/overflow-scroll-overlap-4.html
Move collecting event region from paint to compositing update time.
This solves a number of problems including regions for non-painting layers.
* platform/graphics/GraphicsLayer.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
Use the existing visibleToHitTesting() helper.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
Use flag for event region collecting, don't paint content.
(WebCore::RenderLayer::paintList):
We can bail out immediately if there is no overflow.
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::collectEventRegionForFragments):
Move to a separate function.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Update event region on backing configuration update. This is called after anything interesting changes on a sublayer.
(WebCore::RenderLayerBacking::updateEventRegion):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:
2019-03-18 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Hook up the compiler to our WebGPU implementation
https://bugs.webkit.org/show_bug.cgi?id=195509
Reviewed by Dean Jackson.
This represents a collection of changes necessary to compile and run the first WHLSL program in WebKit.
Because WHLSL isn't fully implemented yet, this patch doesn't remove the existing method for supplying
Metal shaders to WebGPU. Instead, it adds a new boolean to WebGPUShaderModuleDescriptor, "isWHLSL" which
causes us to run the WHLSL compiler.
More details below.
Test: webgpu/whlsl.html
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Use raw pointer instead of Optional<std::reference_wrapper>.
(WebCore::WHLSL::AST::CallExpression::setCastData):
(WebCore::WHLSL::AST::CallExpression::isCast):
(WebCore::WHLSL::AST::CallExpression::castReturnType):
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h:
(WebCore::WHLSL::AST::NativeTypeDeclaration::isAtomic const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsAtomic):
(WebCore::WHLSL::AST::NativeTypeDeclaration::name const): Deleted. The parent class already has a name string.
(WebCore::WHLSL::AST::NativeTypeDeclaration::name): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h:
(WebCore::WHLSL::AST::TypeReference::cloneTypeReference const): When cloning a type reference, make sure to
clone the pointer to its resolved type, too.
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h:
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Incorporate resolution from
https://github.com/gpuweb/gpuweb/pull/188.
(WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack): Support semantics being placed directly on the
entry point, instead of being placed on a structure member.
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack): Ditto.
(WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
(WebCore::WHLSL::Metal::metalFunctions):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups): Deleted. After
https://github.com/gpuweb/gpuweb/pull/188, we don't need the mappings.
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups): Deleted. Ditto.
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups): Deleted. Ditto.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Ditto.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Ditto.
(WebCore::WHLSL::Metal::generateMetalCodeShared):
(WebCore::WHLSL::Metal::generateMetalCode):
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Ditto.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Support compiler-generated functions. Change
CRASH() to notImplemented().
(WebCore::WHLSL::Metal::writeNativeFunction):
(WebCore::WHLSL::Metal::getNativeName): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h:
* Modules/webgpu/WHLSL/Metal/WHLSLNativeTypeWriter.cpp:
(WebCore::WHLSL::Metal::writeNativeType):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: The dependency graph needs to track all unnamed types. Also,
we need to track types that are the results of expressions (not just types literally spelled out in the
program). Enumerations need to be emitted after their base types are emitted.
(WebCore::WHLSL::Metal::TypeNamer::visit):
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
(WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitAllUnnamedTypeDefinitions):
(WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h:
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp: Wrap ResolvingType in a class to make sure it plays nicely with
HashMap. Also, use raw pointers instead of Optional<std::reference_wrapper>s.
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::checkOperatorOverload):
(WebCore::WHLSL::Checker::assignTypes):
(WebCore::WHLSL::Checker::checkShaderType):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::Checker::recurseAndGetInfo):
(WebCore::WHLSL::Checker::assignType):
(WebCore::WHLSL::Checker::forwardType):
(WebCore::WHLSL::getUnnamedType):
(WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
(WebCore::WHLSL::Checker::isBoolType):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
(WebCore::WHLSL::Gatherer::visit):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::inferTypesForCall):
* Modules/webgpu/WHLSL/WHLSLInferTypes.h:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
(WebCore::WHLSL::Intrinsics::addPrimitive):
(WebCore::WHLSL::Intrinsics::addFullTexture):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
(WebCore::WHLSL::Intrinsics::ucharType const):
(WebCore::WHLSL::Intrinsics::ushortType const):
(WebCore::WHLSL::Intrinsics::charType const):
(WebCore::WHLSL::Intrinsics::shortType const):
(WebCore::WHLSL::Intrinsics::intType const):
(WebCore::WHLSL::Intrinsics::uchar2Type const):
(WebCore::WHLSL::Intrinsics::uchar4Type const):
(WebCore::WHLSL::Intrinsics::ushort2Type const):
(WebCore::WHLSL::Intrinsics::ushort4Type const):
(WebCore::WHLSL::Intrinsics::uint2Type const):
(WebCore::WHLSL::Intrinsics::uint4Type const):
(WebCore::WHLSL::Intrinsics::char2Type const):
(WebCore::WHLSL::Intrinsics::char4Type const):
(WebCore::WHLSL::Intrinsics::short2Type const):
(WebCore::WHLSL::Intrinsics::short4Type const):
(WebCore::WHLSL::Intrinsics::int2Type const):
(WebCore::WHLSL::Intrinsics::int4Type const):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
(WebCore::WHLSL::Lexer::recognizeKeyword):
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
(WebCore::WHLSL::NameContext::add):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit): Don't visit recursive types.
Also, make sure we preserve the CurrentFunction in our recursive scopes.
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::fail):
(WebCore::WHLSL::Parser::peek):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseBuiltInSemantic):
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h:
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
(WebCore::WHLSL::prepareShared):
(WebCore::WHLSL::prepare):
* Modules/webgpu/WHLSL/WHLSLPrepare.h:
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Move big inline functions out-of-line.
(WebCore::WHLSL::RecursiveTypeChecker::visit):
(WebCore::WHLSL::checkRecursiveTypes):
(): Deleted.
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
(WebCore::WHLSL::conversionCost):
(WebCore::WHLSL::resolveFunctionOverloadImpl):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h:
* Modules/webgpu/WHLSL/WHLSLResolvingType.h:
(WebCore::WHLSL::ResolvingType::ResolvingType):
(WebCore::WHLSL::ResolvingType::operator=):
(WebCore::WHLSL::ResolvingType::getUnnamedType):
(WebCore::WHLSL::ResolvingType::visit):
* Modules/webgpu/WHLSL/WHLSLScopedSetAdder.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h.
(WebCore::WHLSL::ScopedSetAdder::ScopedSetAdder):
(WebCore::WHLSL::ScopedSetAdder::~ScopedSetAdder):
(WebCore::WHLSL::ScopedSetAdder::isNewEntry const):
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp:
(WebCore::WHLSL::isAcceptableFormat):
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Turns out a bunch of texture types don't exist in MSL.
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h:
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Adding to the program can fail.
(WebCore::WHLSL::synthesizeConstructors): Some constructors shouldn't be generated for "void" and for atomic types.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Adding to the program can fail.
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Ditto.
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Ditto.
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Ditto.
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Ditto.
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):
* Modules/webgpu/WebGPUDevice.cpp: Add flag that triggers the WHLSL compiler.
(WebCore::WebGPUDevice::createShaderModule const):
* Modules/webgpu/WebGPUShaderModuleDescriptor.h: Ditto.
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl: Ditto.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUPipelineLayout.h:
(WebCore::GPUPipelineLayout::bindGroupLayouts const):
* platform/graphics/gpu/GPUShaderModule.h: Add a string that represents the WHLSL shader source. The compiler currently
needs the rest of the pipeline state descriptor, so we defer compilation until create*Pipeline().
(WebCore::GPUShaderModule::platformShaderModule const):
(WebCore::GPUShaderModule::whlslSource const):
* platform/graphics/gpu/GPUShaderModuleDescriptor.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert GPU types into WHLSL types, and invoke the compiler.
(WebCore::convertVertexFormat):
(WebCore::convertShaderStageFlags):
(WebCore::convertBindingType):
(WebCore::convertTextureFormat):
(WebCore::convertLayout):
(WebCore::convertRenderPipelineDescriptor):
(WebCore::trySetMetalFunctionsForPipelineDescriptor):
(WebCore::trySetWHLSLFunctionsForPipelineDescriptor):
(WebCore::trySetFunctionsForPipelineDescriptor):
(WebCore::tryCreateMtlRenderPipelineState):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
2019-03-18 Justin Fan <justin_fan@apple.com>
[Web GPU] GPUAdapter.createDevice -> GPUAdapter.requestDevice
https://bugs.webkit.org/show_bug.cgi?id=195781
Reviewed by Myles C. Maxfield.
A Web GPU device is now acquired via a promise returned from GPUAdapter.requestDevice().
Existing tests updated for new behavior.
* Modules/webgpu/WebGPUAdapter.cpp:
(WebCore::WebGPUAdapter::requestDevice const):
(WebCore::WebGPUAdapter::createDevice): Deleted.
* Modules/webgpu/WebGPUAdapter.h:
* Modules/webgpu/WebGPUAdapter.idl:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::tryCreate):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::create): Deleted.
* Modules/webgpu/WebGPUDevice.h:
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::tryCreate):
(WebCore::GPUDevice::create): Deleted.
2019-03-18 Justin Fan <justin_fan@apple.com>
[Web GPU] API updates: GPUTexture.createDefaultView and type-safe GPURenderPassEncoder.setPipeline
https://bugs.webkit.org/show_bug.cgi?id=195896
Reviewed by Jon Lee.
Rename createDefaultTextureView -> createDefaultView and move setPipeline from GPUProgrammablePassEncoder to GPURenderPassEncoder.
Existing tests updated for createDefaultView name.
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setPipeline): Deleted.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setPipeline):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::createDefaultView):
(WebCore::WebGPUTexture::createDefaultTextureView): Deleted.
* Modules/webgpu/WebGPUTexture.h:
* Modules/webgpu/WebGPUTexture.idl:
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
* platform/graphics/gpu/GPURenderPassEncoder.h:
2019-03-18 Chris Dumez <cdumez@apple.com>
[iOS] The network process sometimes gets killed for trying to suspend while holding locked files
https://bugs.webkit.org/show_bug.cgi?id=195890
<rdar://problem/48934338>
Reviewed by Geoffrey Garen.
The network process sometimes gets killed for trying to suspend while holding locked files while
under SQLiteDatabase::open(). The SQLiteDatabaseTracker normally keeps tracking of "transactions"
in progress so we know that we're holding locked files and the WebSQLiteDatabaseTracker takes
care of notifying the UIProcess via IPC that it should hold a background assertion on our behalf
to avoid trying to suspend while holding locked files.
However, we were missing a SQLiteTransactionInProgressAutoCounter when trying to execute the
PRAGMA statement.
Note that we have a similar SQLiteTransactionInProgressAutoCounter in SQLiteDatabase::useWALJournalMode()
when executing such PRAGMA statement already.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
2019-03-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r243037.
Broke the Windows build
Reverted changeset:
"Reduce the size of Node::deref by eliminating an explicit
parentNode check"
https://bugs.webkit.org/show_bug.cgi?id=195776
https://trac.webkit.org/changeset/243037
2019-03-18 Eric Carlson <eric.carlson@apple.com>
Change some logging levels
https://bugs.webkit.org/show_bug.cgi?id=195861
<rdar://problem/48961669>
Reviewed by Jer Noble.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::dispatchEvent):
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::addInput):
(WebCore::AudioNode::addOutput):
(WebCore::AudioNode::connect):
(WebCore::AudioNode::disconnect):
* Modules/webaudio/AudioParam.cpp:
(WebCore::AudioParam::connect):
(WebCore::AudioParam::disconnect):
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::WaveShaperNode::setOversample):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::dispatchEvent):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor):
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::addGenericCue):
(WebCore::InbandGenericTextTrack::removeGenericCue):
(WebCore::InbandGenericTextTrack::newCuesParsed):
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newCuesParsed):
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable):
* html/track/TextTrack.cpp:
(WebCore::TextTrack::removeCue):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels):
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
(WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
(WebCore::InbandTextTrackPrivateAVF::removeCompletedCues):
(WebCore::InbandTextTrackPrivateAVF::processNativeSamples):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
2019-03-15 Antoine Quint <graouts@apple.com>
Make mouse event simulation a quirk
https://bugs.webkit.org/show_bug.cgi?id=195218
<rdar://problem/48516794>
Reviewed by Dean Jackson.
Add new quirks to control whether we should dispatch simulated mouse events and whether we should assume
preventDefault() was called when a simulated "mousemove" event was handled. Currently both return false
but will be made to return more interesting results as we determine heuristics or specific sites that
may require such quirks.
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulateMouseEvents const):
(WebCore::Quirks::shouldMousemoveEventHandlingPreventDefault const):
* page/Quirks.h:
2019-03-18 Philippe Normand <pnormand@igalia.com>
[GStreamer] Rewrite HTTP source element using pushsrc base class
https://bugs.webkit.org/show_bug.cgi?id=195631
Reviewed by Xabier Rodriguez-Calvar.
If we want to use webkitwebsrc in adaptivedemux (HLS, DASH, etc)
we need a source element that behaves like souphttpsrc, which is
implemented using pushsrc. This rewrite might also fix some seek
issues.
No new tests, existing http/tests/media tests cover this patch.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_class_init):
(webkitWebSrcReset):
(webkit_web_src_init):
(webKitWebSrcCreate):
(webKitWebSrcStart):
(webKitWebSrcCloseSession):
(webKitWebSrcStop):
(webKitWebSrcGetSize):
(webKitWebSrcIsSeekable):
(webKitWebSrcDoSeek):
(webKitWebSrcQuery):
(webKitWebSrcUnLock):
(webKitWebSrcUnLockStop):
(webKitWebSrcChangeState):
(CachedResourceStreamingClient::checkUpdateBlocksize):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):
(CachedResourceStreamingClient::accessControlCheckFailed):
(CachedResourceStreamingClient::loadFailed):
(CachedResourceStreamingClient::loadFinished):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2019-03-18 Gyuyoung Kim <gyuyoung.kim@webkit.org>
[WPE][GTK] Fix a build warning because of missing to handle an enum value
https://bugs.webkit.org/show_bug.cgi?id=195876
Reviewed by Žan Doberšek.
When building WPE or GTK port, there is a build warning. The switch-case needs to
handle *Positioned* enum value as well in order to avoid the build warning.
* page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
(WebCore::ScrollingTreeNicosia::createScrollingTreeNode): Add case ScrollingNodeType::Positioned.
2019-03-17 Yusuke Suzuki <ysuzuki@apple.com>
REGRESSION: !vm.isInitializingObject() void* JSC::tryAllocateCellHelper<JSC::Structure> JSC::Structure::create
https://bugs.webkit.org/show_bug.cgi?id=195858
Reviewed by Mark Lam.
Changed the accessor names.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
2019-03-16 Darin Adler <darin@apple.com>
Improve normalization code, including moving from unorm.h to unorm2.h
https://bugs.webkit.org/show_bug.cgi?id=195330
Reviewed by Michael Catanzaro.
* editing/TextIterator.cpp: Include unorm2.h.
(WebCore::normalizeCharacters): Rewrote to use unorm2_normalize rather than
unorm_normalize, but left the logic otherwise the same.
* platform/graphics/SurrogatePairAwareTextIterator.cpp: Include unorm2.h.
(WebCore::SurrogatePairAwareTextIterator::normalizeVoicingMarks):
Use unorm2_composePair instead of unorm_normalize.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(characterSequenceIsEmoji): Changed to use existing SurrogatePairAwareTextIterator.
(FontCascade::fontForCombiningCharacterSequence): Use normalizedNFC instead of
calling unorm2_normalize directly.
* WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp:
Removed unneeded include of <unicode/normlzr.h>.
* platform/text/TextEncoding.cpp:
(WebCore::TextEncoding::encode const): Use normalizedNFC instead of the
code that was here. The normalizedNFC function is better in multiple ways,
but primarily it handles 8-bit strings and other already-normalized
strings much more efficiently.
2019-03-16 Jer Noble <jer.noble@apple.com>
Unreviewed unified-build fix; GPUBindGroupMetal uses symbols from the Metal.framework; it should import it.
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
2019-03-16 Jer Noble <jer.noble@apple.com>
Add a new MediaCapabilitiesExtensionsEnabled setting
https://bugs.webkit.org/show_bug.cgi?id=195843
Reviewed by Geoffrey Garen.
Add a new setting, MediaCapabilitiesExtensionsEnabled, which controls whether extensions
to the Media Capabilities API are available.
Drive-by fix: make sure that the configuration is passed through to MediaCapabilitiesInfo
when no factory can support the configuration.
* Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
* Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/IDLAttributes.json:
* page/Settings.yaml:
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
2019-03-16 Zalan Bujtas <zalan@apple.com>
[iOS] Unable to close trending window on naver.com.
https://bugs.webkit.org/show_bug.cgi?id=195842
<rdar://problem/48067338>
This patch issues a synthetic mouse move to the tap location after we decided to hover.
It ensures that the node under the mouse is up-to-date and when a new tap comes in we can
send the mouseout event to the correct node. It fixes the case when the hover content is positioned over
the tap target so that the tap target is no longer "under the mouse".
On desktop this "transition" happens automatically since the mouse is always present.
Reviewed by Simon Fraser.
Tests: fast/events/touch/ios/content-observation/new-content-covers-tap-target.html
fast/events/touch/ios/content-observation/prevent-default-on-touch-start.html
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::dispatchSyntheticMouseMove):
2019-03-16 Sihui Liu <sihui_liu@apple.com>
Layout tests imported/w3c/web-platform-tests/IndexedDB/*-exception-order.html are failing
https://bugs.webkit.org/show_bug.cgi?id=195650
Reviewed by Ryosuke Niwa.
Fix some exception orders in IDB.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
Step 6 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-createobjectstore.
(WebCore::IDBDatabase::transaction):
Step 1 of https://www.w3.org/TR/IndexedDB-2/#dom-idbdatabase-transaction.
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::doOpenCursor):
(WebCore::IDBIndex::openCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-opencursor.
(WebCore::IDBIndex::doOpenKeyCursor):
(WebCore::IDBIndex::openKeyCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-openkeycursor.
(WebCore::IDBIndex::count):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-count.
(WebCore::IDBIndex::doCount):
(WebCore::IDBIndex::get):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-get.
(WebCore::IDBIndex::doGet):
(WebCore::IDBIndex::getKey):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
(WebCore::IDBIndex::doGetKey):
(WebCore::IDBIndex::doGetAll):
(WebCore::IDBIndex::getAll):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getkey.
(WebCore::IDBIndex::doGetAllKeys):
(WebCore::IDBIndex::getAllKeys):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbindex-getallkeys.
* Modules/indexeddb/IDBIndex.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::doOpenCursor):
(WebCore::IDBObjectStore::openCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-opencursor.
(WebCore::IDBObjectStore::doOpenKeyCursor):
(WebCore::IDBObjectStore::openKeyCursor):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-openkeycursor.
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::doDelete):
(WebCore::IDBObjectStore::count):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-count.
(WebCore::IDBObjectStore::doCount):
(WebCore::IDBObjectStore::doGetAll):
(WebCore::IDBObjectStore::getAll):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getall.
(WebCore::IDBObjectStore::doGetAllKeys):
(WebCore::IDBObjectStore::getAllKeys):
Step 5 of https://www.w3.org/TR/IndexedDB-2/#dom-idbobjectstore-getallkeys.
* Modules/indexeddb/IDBObjectStore.h:
2019-03-16 Ryosuke Niwa <rniwa@webkit.org>
Reduce the size of Node::deref by eliminating an explicit parentNode check
https://bugs.webkit.org/show_bug.cgi?id=195776
Reviewed by Geoffrey Garen.
This patch eliminates the nullity check of m_parentNode in Node::deref as well as the store to
m_refCount in the case of invoking Node::removedLastRef() as done for RefCounted in r30042.
Together, this patch shrinks WebCore's size by 46KB or ~0.7%.
To do this, we take we take a similar approach as WTF::String by using the lowest bit of m_refCount
to indicate whether a node has a parent or not. Regular ref-counting is done on the upper 31 bits.
Node::setParentNode updates this flag, and Node::deref() would only `delete this` if m_refCount
is identically equal to 0.
For a Document, we set m_refCounted to 0 before in the case of non-zero m_referencingNodeCount
since decrementReferencingNodeCount needs to be able to tell if there is an outstanding Ref/RefPtr
or not when m_referencingNodeCount becomes 0.
No new tests since there should be no behavioral change.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
* dom/Document.h:
(WebCore::Document::decrementReferencingNodeCount):
* dom/Node.cpp:
(WebCore::Node::Node): Moved the initialization of m_refCount to the member variable declaration.
(WebCore::Node::~Node):
(WebCore::Node::removedLastRef):
* dom/Node.h:
(WebCore::Node): Changed the type of m_refCount from signed int to uint32_t. It was changed from
unsigned int to signed int back in r11492 but I don't think the signedness is needed.
(WebCore::Node::ref): Increment the ref count by 2 (upper 31-bit).
(WebCore::Node::deref): Implemented the optimization. This is what shrinks the WebCore binary size.
(WebCore::Node::hasOneRef const):
(WebCore::Node::refCount const): Ignore the lowest bit. Without this fix, the optimization in
replaceChildrenWithFragment to avoid replacing the text node is disabled whenever there is a parent.
(WebCore::Node::setParentNode): Sets the lowest bit to 1 if the node has a parent and 0 otherwise.
2019-03-16 Said Abou-Hallawa <sabouhallawa@apple.com>
Remove the SVG property tear off objects for SVGAnimatedInteger
https://bugs.webkit.org/show_bug.cgi?id=195722
Reviewed by Simon Fraser.
Instead of saving a raw integer value in the SVGElement and then wrapping
the pointer to this raw data in a tear off object, we will represent the
integer as Ref<SVGAnimatedInteger> in SVGElement. This will make the
representation of the property in IDL file match the C++ header file.
When the DOM requests the SVGAnimatedInteger, we get return a reference
to the new animated property. When the rendering code asks for the current
value of the this animated property, we return the animVal() or the
baseVal() depending on whether the property is animating or not.
A pointer to a member in the SVGElement will be registered along with the
associated attribute name in SVGPropertyRegistry. Registering the property
creates an SVGMemberAccessor and links to the associated attribute. The
function of SVGMemberAccessor is to retrieve the value of the property
given a pointer to an SVGElement.
SVGPropertyRegistry manages all the properties of SVGElement. It takes
into account the inherited properties as well.
SVGElement will have a virtual method called propertyRegistry(). Every
superclass will override this method to return a reference to its registry
which includes all the registered properties of this class and its bases.
One important function of the SVGPropertyRegistry and SVGAccessor is they
create the appropriate SVGAttributeAnimator for this property.
SVGAttributeAnimator is just a connection between the animated property
and SVGAnimationFunction. SVGAnimationFunction calculates the values of
the animated property within a time interval. SVGAnimatedPropertyAnimator
updates animVal of the animated property and invalidates the associated
SVGElement and all the instances that references this element.
The plan is to remove all the SVG tear off objects like what this patch
does for SVGAnimatedInteger. So for a period of time the old code and the
new code will co-exist together. These things to consider when reviewing
this patch:
-- SVGAnimatedElementBase was re-factored to use SVGAttributeAnimationControllerBase
which is inherited by SVGLegacyAttributeAnimationController and
SVGAttributeAnimationController. The tear-off properties code which uses
SVGAnimatedType now lives in SVGLegacyAttributeAnimationController. The
new code was added to SVGAttributeAnimationController. The plan is to
remove the three animation controllers and to move the code of
SVGAttributeAnimationController to SVGAnimatedElementBase when all the tear
off code is removed.
-- SVGElement now keeps two registries one for the tear-off world and the
other for the new world. Eventually we need to get rid of tear-off registry.
-- SVGElement will differentiate between the type of the property by the
the method isAnimatedAttribute().
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::SVGAnimateElementBase):
(WebCore::SVGAnimateElementBase::attributeAnimationController):
(WebCore::SVGAnimateElementBase::attributeAnimationControllerIfExists):
(WebCore::SVGAnimateElementBase::hasValidAttributeType const):
(WebCore::SVGAnimateElementBase::determineAnimatedPropertyType const):
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
(WebCore::SVGAnimateElementBase::calculateToAtEndOfDurationValue):
(WebCore::SVGAnimateElementBase::calculateFromAndToValues):
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::resetAnimatedType):
(WebCore::SVGAnimateElementBase::clearAnimatedType):
(WebCore::SVGAnimateElementBase::applyResultsToTarget):
(WebCore::SVGAnimateElementBase::isAdditive const):
(WebCore::SVGAnimateElementBase::calculateDistance):
(WebCore::SVGAnimateElementBase::setTargetElement):
(WebCore::SVGAnimateElementBase::setAttributeName):
(WebCore::SVGAnimateElementBase::resetAnimation):
(WebCore::SVGAnimateElementBase::hasInvalidCSSAttributeType const):
(WebCore::SVGAnimateElementBase::hasValidAttributeType): Deleted.
(WebCore::propertyTypesAreConsistent): Deleted.
(WebCore::applyCSSPropertyToTarget): Deleted.
(WebCore::removeCSSPropertyFromTarget): Deleted.
(WebCore::applyCSSPropertyToTargetAndInstances): Deleted.
(WebCore::removeCSSPropertyFromTargetAndInstances): Deleted.
(WebCore::notifyTargetAboutAnimValChange): Deleted.
(WebCore::notifyTargetAndInstancesAboutAnimValChange): Deleted.
(WebCore::SVGAnimateElementBase::animatedPropertyTypeSupportsAddition const): Deleted.
(WebCore::SVGAnimateElementBase::resetAnimatedPropertyType): Deleted.
(WebCore::SVGAnimateElementBase::ensureAnimator): Deleted.
* svg/SVGAnimateElementBase.h:
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::hasValidAttributeType const):
(WebCore::SVGAnimateMotionElement::hasValidAttributeName const):
(WebCore::SVGAnimateMotionElement::hasValidAttributeType): Deleted.
(WebCore::SVGAnimateMotionElement::hasValidAttributeName): Deleted.
* svg/SVGAnimateMotionElement.h:
* svg/SVGAnimateTransformElement.cpp:
(WebCore::SVGAnimateTransformElement::hasValidAttributeType const):
(WebCore::SVGAnimateTransformElement::hasValidAttributeType): Deleted.
* svg/SVGAnimateTransformElement.h:
* svg/SVGAnimatedInteger.cpp: Removed.
* svg/SVGAnimatedInteger.h: Removed.
* svg/SVGAnimatedIntegerOptionalInteger.cpp: Removed.
* svg/SVGAnimatedIntegerOptionalInteger.h: Removed.
* svg/SVGAnimatedPointList.h:
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::setAttributeType):
(WebCore::SVGAnimationElement::resetAnimation):
(WebCore::SVGAnimationElement::resetAnimatedPropertyType): Deleted.
(WebCore::SVGAnimationElement::setTargetElement): Deleted.
(WebCore::SVGAnimationElement::checkInvalidCSSAttributeType): Deleted.
* svg/SVGAnimationElement.h:
(WebCore::SVGAnimationElement::attributeType const):
(WebCore::SVGAnimationElement::hasInvalidCSSAttributeType const): Deleted.
* svg/SVGAnimatorFactory.h:
(WebCore::SVGAnimatorFactory::create):
* svg/SVGAttributeAnimationController.cpp: Added.
(WebCore::SVGAttributeAnimationController::SVGAttributeAnimationController):
(WebCore::SVGAttributeAnimationController::animator const):
(WebCore::SVGAttributeAnimationController::isDiscreteAnimator const):
(WebCore::SVGAttributeAnimationController::isAdditive const):
(WebCore::SVGAttributeAnimationController::hasValidAttributeType const):
(WebCore::SVGAttributeAnimationController::calculateFromAndToValues):
(WebCore::SVGAttributeAnimationController::calculateFromAndByValues):
(WebCore::SVGAttributeAnimationController::calculateToAtEndOfDurationValue):
(WebCore::SVGAttributeAnimationController::resetAnimatedType):
(WebCore::SVGAttributeAnimationController::calculateAnimatedValue):
(WebCore::SVGAttributeAnimationController::applyResultsToTarget):
(WebCore::SVGAttributeAnimationController::clearAnimatedType):
(WebCore::SVGAttributeAnimationController::calculateDistance):
* svg/SVGAttributeAnimationController.h: Added.
(WebCore::SVGAttributeAnimationController::animatorIfExists const):
* svg/SVGAttributeAnimationControllerBase.cpp: Added.
(WebCore::SVGAttributeAnimationControllerBase::SVGAttributeAnimationControllerBase):
(WebCore::SVGAttributeAnimationControllerBase::determineAnimatedPropertyType):
* svg/SVGAttributeAnimationControllerBase.h: Added.
* svg/SVGElement.cpp:
(WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
(WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
(WebCore::SVGElement::commitPropertyChange):
(WebCore::SVGElement::isAnimatedPropertyAttribute const):
(WebCore::SVGElement::isAnimatedAttribute const):
(WebCore::SVGElement::createAnimator):
* svg/SVGElement.h:
(WebCore::SVGElement::propertyRegistry const):
* svg/SVGFEConvolveMatrixElement.cpp:
(WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
(WebCore::SVGFEConvolveMatrixElement::registerAttributes):
(WebCore::SVGFEConvolveMatrixElement::parseAttribute):
(WebCore::SVGFEConvolveMatrixElement::setOrder):
(WebCore::SVGFEConvolveMatrixElement::orderXIdentifier): Deleted.
(WebCore::SVGFEConvolveMatrixElement::orderYIdentifier): Deleted.
* svg/SVGFEConvolveMatrixElement.h:
* svg/SVGFETurbulenceElement.cpp:
(WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
(WebCore::SVGFETurbulenceElement::registerAttributes):
(WebCore::SVGFETurbulenceElement::parseAttribute):
(WebCore::SVGFETurbulenceElement::svgAttributeChanged):
* svg/SVGFETurbulenceElement.h:
* svg/SVGFilterElement.h:
* svg/SVGLegacyAttributeAnimationController.cpp: Added.
(WebCore::SVGLegacyAttributeAnimationController::SVGLegacyAttributeAnimationController):
(WebCore::SVGLegacyAttributeAnimationController::animatedTypeAnimator):
(WebCore::SVGLegacyAttributeAnimationController::isAdditive const):
(WebCore::SVGLegacyAttributeAnimationController::hasValidAttributeType const):
(WebCore::SVGLegacyAttributeAnimationController::calculateFromAndToValues):
(WebCore::SVGLegacyAttributeAnimationController::calculateFromAndByValues):
(WebCore::SVGLegacyAttributeAnimationController::calculateToAtEndOfDurationValue):
(WebCore::propertyTypesAreConsistent):
(WebCore::SVGLegacyAttributeAnimationController::resetAnimatedType):
(WebCore::SVGLegacyAttributeAnimationController::calculateAnimatedValue):
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
(WebCore::applyCSSPropertyToTargetAndInstances):
(WebCore::removeCSSPropertyFromTargetAndInstances):
(WebCore::notifyTargetAboutAnimValChange):
(WebCore::notifyTargetAndInstancesAboutAnimValChange):
(WebCore::SVGLegacyAttributeAnimationController::applyResultsToTarget):
(WebCore::SVGLegacyAttributeAnimationController::clearAnimatedType):
(WebCore::SVGLegacyAttributeAnimationController::calculateDistance):
* svg/SVGLegacyAttributeAnimationController.h: Added.
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::hasValidAttributeName const):
(WebCore::SVGSMILElement::hasValidAttributeName): Deleted.
* svg/animation/SVGSMILElement.h:
* svg/properties/SVGAnimatedPrimitiveProperty.h: Added.
(WebCore::SVGAnimatedPrimitiveProperty::create):
(WebCore::SVGAnimatedPrimitiveProperty::setBaseVal):
(WebCore::SVGAnimatedPrimitiveProperty::setBaseValInternal):
(WebCore::SVGAnimatedPrimitiveProperty::baseVal const):
(WebCore::SVGAnimatedPrimitiveProperty::setAnimVal):
(WebCore::SVGAnimatedPrimitiveProperty::animVal const):
(WebCore::SVGAnimatedPrimitiveProperty::animVal):
(WebCore::SVGAnimatedPrimitiveProperty::currentValue const):
(WebCore::SVGAnimatedPrimitiveProperty::SVGAnimatedPrimitiveProperty):
* svg/properties/SVGAnimatedProperty.cpp: Added.
(WebCore::SVGAnimatedProperty::owner const):
(WebCore::SVGAnimatedProperty::commitPropertyChange):
* svg/properties/SVGAnimatedProperty.h: Added.
(WebCore::SVGAnimatedProperty::isAttached const):
(WebCore::SVGAnimatedProperty::detach):
(WebCore::SVGAnimatedProperty::contextElement const):
(WebCore::SVGAnimatedProperty::baseValAsString const):
(WebCore::SVGAnimatedProperty::animValAsString const):
(WebCore::SVGAnimatedProperty::isDirty const):
(WebCore::SVGAnimatedProperty::setDirty):
(WebCore::SVGAnimatedProperty::synchronize):
(WebCore::SVGAnimatedProperty::isAnimating const):
(WebCore::SVGAnimatedProperty::startAnimation):
(WebCore::SVGAnimatedProperty::stopAnimation):
(WebCore::SVGAnimatedProperty::instanceStartAnimation):
(WebCore::SVGAnimatedProperty::instanceStopAnimation):
(WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
* svg/properties/SVGAnimatedPropertyAccessor.h: Added.
* svg/properties/SVGAnimatedPropertyAccessorImpl.h: Added.
* svg/properties/SVGAnimatedPropertyAnimator.h: Added.
(WebCore::SVGAnimatedPropertyAnimator::appendAnimatedInstance):
(WebCore::SVGAnimatedPropertyAnimator::SVGAnimatedPropertyAnimator):
* svg/properties/SVGAnimatedPropertyAnimatorImpl.h: Added.
* svg/properties/SVGAnimatedPropertyImpl.h: Added.
* svg/properties/SVGAnimatedPropertyPairAccessor.h: Added.
(WebCore::SVGAnimatedPropertyPairAccessor::SVGAnimatedPropertyPairAccessor):
(WebCore::SVGAnimatedPropertyPairAccessor::singleton):
(WebCore::SVGAnimatedPropertyPairAccessor::property1 const):
(WebCore::SVGAnimatedPropertyPairAccessor::property2 const):
* svg/properties/SVGAnimatedPropertyPairAccessorImpl.h: Added.
* svg/properties/SVGAnimatedPropertyPairAnimator.h: Added.
(WebCore::SVGAnimatedPropertyPairAnimator::appendAnimatedInstance):
(WebCore::SVGAnimatedPropertyPairAnimator::SVGAnimatedPropertyPairAnimator):
* svg/properties/SVGAnimatedPropertyPairAnimatorImpl.h: Added.
* svg/properties/SVGAnimationAdditiveFunction.h: Added.
(WebCore::SVGAnimationAdditiveFunction::SVGAnimationAdditiveFunction):
(WebCore::SVGAnimationAdditiveFunction::progress):
* svg/properties/SVGAnimationAdditiveValueFunction.h: Added.
(WebCore::SVGAnimationAdditiveValueFunction::toAtEndOfDuration const):
* svg/properties/SVGAnimationAdditiveValueFunctionImpl.h: Added.
(WebCore::SVGAnimationIntegerFunction::progress):
* svg/properties/SVGAnimationFunction.h: Added.
(WebCore::SVGAnimationFunction::isDiscrete const):
(WebCore::SVGAnimationFunction::calculateDistance const):
(WebCore::SVGAnimationFunction::SVGAnimationFunction):
(WebCore::SVGAnimationFunction::addFromAndToValues):
* svg/properties/SVGAttributeAnimator.cpp: Added.
(WebCore::SVGAttributeAnimator::applyAnimatedPropertyChange):
* svg/properties/SVGAttributeAnimator.h: Added.
(WebCore::SVGAttributeAnimator::SVGAttributeAnimator):
(WebCore::SVGAttributeAnimator::isDiscrete const):
(WebCore::SVGAttributeAnimator::setFromAndToValues):
(WebCore::SVGAttributeAnimator::setFromAndByValues):
(WebCore::SVGAttributeAnimator::setToAtEndOfDurationValue):
(WebCore::SVGAttributeAnimator::calculateDistance const):
* svg/properties/SVGAttributeOwnerProxy.cpp:
* svg/properties/SVGAttributeOwnerProxy.h:
* svg/properties/SVGAttributeRegistry.h:
* svg/properties/SVGMemberAccessor.h: Added.
(WebCore::SVGMemberAccessor::detach const):
(WebCore::SVGMemberAccessor::isAnimatedProperty const):
(WebCore::SVGMemberAccessor::isAnimatedLength const):
(WebCore::SVGMemberAccessor::matches const):
(WebCore::SVGMemberAccessor::synchronize const):
(WebCore::SVGMemberAccessor::createAnimator const):
(WebCore::SVGMemberAccessor::appendAnimatedInstance const):
* svg/properties/SVGPointerMemberAccessor.h: Added.
(WebCore::SVGPointerMemberAccessor::SVGPointerMemberAccessor):
(WebCore::SVGPointerMemberAccessor::property const):
(WebCore::SVGPointerMemberAccessor::singleton):
* svg/properties/SVGProperty.h: Added.
* svg/properties/SVGPropertyOwner.h: Added.
(WebCore::SVGPropertyOwner::owner const):
(WebCore::SVGPropertyOwner::attributeContextElement const):
(WebCore::SVGPropertyOwner::commitPropertyChange):
* svg/properties/SVGPropertyOwnerRegistry.h: Added.
(WebCore::SVGPropertyOwnerRegistry::SVGPropertyOwnerRegistry):
(WebCore::SVGPropertyOwnerRegistry::registerProperty):
(WebCore::SVGPropertyOwnerRegistry::enumerateRecursively):
(WebCore::SVGPropertyOwnerRegistry::isKnownAttribute):
(WebCore::SVGPropertyOwnerRegistry::enumerateRecursivelyBaseTypes):
(WebCore::SVGPropertyOwnerRegistry::findAccessor):
* svg/properties/SVGPropertyRegistry.h: Added.
2019-03-16 Ryosuke Niwa <rniwa@webkit.org>
Remove LayoutAssertionDisableScope after r241289
https://bugs.webkit.org/show_bug.cgi?id=195848
Reviewed by Antti Koivisto.
Remove LayoutAssertionDisableScope for good now that the underlying bug has been fixed in r241289.
* dom/Document.cpp:
(WebCore::isSafeToUpdateStyleOrLayout):
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
2019-03-15 Eric Carlson <eric.carlson@apple.com>
Add media stream release logging
https://bugs.webkit.org/show_bug.cgi?id=195823
<rdar://problem/48939406>
Reviewed by Youenn Fablet.
No new tests, no behavioral change.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::clone):
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
(WebCore::MediaStream::addTrackFromPlatform):
(WebCore::MediaStream::setIsActive):
(WebCore::MediaStream::mediaCanStart):
(WebCore::MediaStream::startProducingData):
(WebCore::MediaStream::stopProducingData):
(WebCore::MediaStream::endCaptureTracks):
(WebCore::MediaStream::stop):
(WebCore::MediaStream::logChannel const):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack):
(WebCore::MediaStreamTrack::logChannel const):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
(WebCore::nextLogIdentifier): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::nextLogIdentifier): Deleted.
* html/HTMLMediaElement.h:
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::PlatformMediaSession):
(WebCore::nextLogIdentifier): Deleted.
* platform/audio/PlatformMediaSession.h:
* platform/graphics/IntSize.cpp:
(WebCore::IntSize::toJSONObject const):
(WebCore::IntSize::toJSONString const):
* platform/graphics/IntSize.h:
(WTF::LogArgument<WebCore::IntSize>::toString):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
(WebCore::MediaStreamPrivate::startProducingData):
(WebCore::MediaStreamPrivate::stopProducingData):
(WebCore::MediaStreamPrivate::setCaptureTracksMuted):
(WebCore::MediaStreamPrivate::trackMutedChanged):
(WebCore::MediaStreamPrivate::trackEnabledChanged):
(WebCore::MediaStreamPrivate::trackStarted):
(WebCore::MediaStreamPrivate::trackEnded):
(WebCore::MediaStreamPrivate::setLogger):
(WebCore::MediaStreamPrivate::logChannel const):
* platform/mediastream/MediaStreamPrivate.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setLogger):
(WebCore::MediaStreamTrackPrivate::logChannel const):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::logChannel const): Deleted.
(WebCore::RealtimeIncomingAudioSource::logger const): Deleted.
* platform/mediastream/RealtimeIncomingAudioSource.h:
(WebCore::RealtimeIncomingAudioSource::setLogger): Deleted.
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::logChannel const): Deleted.
(WebCore::RealtimeIncomingVideoSource::logger const): Deleted.
* platform/mediastream/RealtimeIncomingVideoSource.h:
(WebCore::RealtimeIncomingVideoSource::setLogger): Deleted.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource):
(WebCore::RealtimeMediaSource::setInterrupted):
(WebCore::RealtimeMediaSource::setMuted):
(WebCore::RealtimeMediaSource::notifyMutedChange):
(WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
(WebCore::RealtimeMediaSource::videoSampleAvailable):
(WebCore::RealtimeMediaSource::start):
(WebCore::RealtimeMediaSource::stop):
(WebCore::RealtimeMediaSource::captureFailed):
(WebCore::RealtimeMediaSource::applyConstraint):
(WebCore::RealtimeMediaSource::supportsConstraints):
(WebCore::RealtimeMediaSource::applyConstraints):
(WebCore::RealtimeMediaSource::setSize):
(WebCore::RealtimeMediaSource::setIntrinsicSize):
(WebCore::RealtimeMediaSource::setFrameRate):
(WebCore::RealtimeMediaSource::setAspectRatio):
(WebCore::RealtimeMediaSource::setFacingMode):
(WebCore::RealtimeMediaSource::setVolume):
(WebCore::RealtimeMediaSource::setSampleRate):
(WebCore::RealtimeMediaSource::setSampleSize):
(WebCore::RealtimeMediaSource::setEchoCancellation):
(WebCore::RealtimeMediaSource::setLogger):
(WebCore::RealtimeMediaSource::logChannel const):
(WebCore::convertEnumerationToString):
* platform/mediastream/RealtimeMediaSource.h:
(WTF::LogArgument<WebCore::RealtimeMediaSource::Type>::toString):
* platform/mediastream/RealtimeMediaSourceSettings.cpp:
(WebCore::RealtimeMediaSourceSettings::convertFlagsToString):
(WebCore::convertEnumerationToString):
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WTF::LogArgument<WebCore::RealtimeMediaSourceSettings::VideoFacingMode>::toString):
(WTF::LogArgument<OptionSet<WebCore::RealtimeMediaSourceSettings::Flag>>::toString):
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::logChannel const):
(WebCore::RealtimeOutgoingAudioSource::logger const): Deleted.
* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::setLogger): Deleted.
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
(WebCore::RealtimeOutgoingVideoSource::logChannel const):
(WebCore::RealtimeOutgoingVideoSource::logger const): Deleted.
* platform/mediastream/RealtimeOutgoingVideoSource.h:
(WebCore::RealtimeOutgoingVideoSource::setLogger): Deleted.
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::setSizeAndFrameRate):
(WebCore::SizeAndFrameRate::toJSONObject const):
(WebCore::SizeAndFrameRate::toJSONString const):
* platform/mediastream/RealtimeVideoSource.h:
(WTF::LogArgument<WebCore::SizeAndFrameRate>::toString):
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::clearSession):
(WebCore::AVVideoCaptureSource::startProducingData):
(WebCore::AVVideoCaptureSource::stopProducingData):
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::setupSession):
(WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
(WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
(WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
(WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
(WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
(WebCore::AVVideoCaptureSource::deviceDisconnected):
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
(-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
(-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
(-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
(WebCore::AVVideoCaptureSource::initializeSession): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::verifyIsCapturing):
(WebCore::CoreAudioSharedUnit::captureFailed):
(WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
(WebCore::CoreAudioCaptureSource::addEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::removeEchoCancellationSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
(WebCore::CoreAudioCaptureSource::stopProducingData):
(WebCore::CoreAudioCaptureSource::scheduleReconfiguration):
(WebCore::CoreAudioCaptureSource::beginInterruption):
(WebCore::CoreAudioCaptureSource::endInterruption):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
(WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
2019-03-15 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: remove agent as observer when disabling
https://bugs.webkit.org/show_bug.cgi?id=195825
<rdar://problem/48940255>
Reviewed by Joseph Pecoraro.
No change in functionality.
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::disable):
2019-03-15 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r239814): Most classes that user Timer have 7 bytes of padding after the Timer
https://bugs.webkit.org/show_bug.cgi?id=194196
Reviewed by Simon Fraser.
Use std::nan as the value of m_unalignedNextFireTime to indicate the timer had been deleted
instead of having a dedicated boolean, which consumes 7 extra bytes for padding.
Note that some code in WebKit uses +Infinity as a fire time so we can't use that.
* platform/Timer.cpp:
(WebCore::TimerBase::TimerBase):
(WebCore::TimerBase::~TimerBase):
(WebCore::TimerBase::setNextFireTime):
(WebCore::TimerBase::nextUnalignedFireInterval const):
* platform/Timer.h:
2019-03-15 Sihui Liu <sihui_liu@apple.com>
[ Mojave WK1 ] Layout Test storage/indexeddb/database-odd-names.html is failing
https://bugs.webkit.org/show_bug.cgi?id=190350
<rdar://problem/45089503>
Reviewed by Geoffrey Garen.
Start to use hash for database file names so that the files can work on any filesystem.
We created v0 folder in IndexedDB directory to put the legacy databases, and v1 folder to put the upgraded
databases.
Tests: TestWebKitAPI.IndexedDB.IndexedDBFileName
TestWebKitAPI.IndexedDB.IndexedDBFileNameV0
TestWebKitAPI.IndexedDB.IndexedDBFileNameV1
TestWebKitAPI.IndexedDB.IndexedDBFileNameAPI
TestWebKitAPI.IndexedDB.HashCollision
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::m_quotaManagerGetter):
(WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
(WebCore::IDBServer::removeAllDatabasesForFullOriginPath):
(WebCore::IDBServer::removeAllDatabasesForOriginPath):
(WebCore::IDBServer::IDBServer::removeDatabasesModifiedSinceForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::removeDatabasesWithOriginsForVersion):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::upgradeFilesIfNecessary):
* Modules/indexeddb/server/IDBServer.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePathForDirectory):
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabasePath const):
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromFile):
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectoryWithUpgrade):
(WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
(WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::fullDatabaseDirectory const): Deleted.
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
(WebCore::IDBServer::SQLiteIDBBackingStore::databaseDirectory const):
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::computeHashForFileName):
* platform/sql/SQLiteFileSystem.h:
2019-03-15 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] HTMLImageElement::willRespondToMouseClickEvents returns quirk value.
https://bugs.webkit.org/show_bug.cgi?id=195657
<rdar://problem/48834987>
Reviewed by Simon Fraser.
Images should not trigger hover by default (only when they actually respond to mouse events).
Test: fast/events/touch/ios/content-observation/visibility-change-with-image-content.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
2019-03-15 Jer Noble <jer.noble@apple.com>
Add a "supportedConfiguration" dictionary to MediaCapabilitiesDecodingInfo and MediaCapabilitiesEncodingInfo
https://bugs.webkit.org/show_bug.cgi?id=195763
Reviewed by Jon Lee.
Test: media/mediacapabilities/mock-decodingInfo-supportedConfiguration.html
Add support for a proposed addition to the Media Capabilities spec that would future-proof additional changes
to Media Capabilities by allowing sites to check exactly what properties were queried by the browser when
answering a decodeInfo() or enocdeInfo() query.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/mediacapabilities/AudioConfiguration.idl:
* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::MediaCapabilities::decodingInfo):
(WebCore::MediaCapabilities::encodingInfo):
* Modules/mediacapabilities/MediaCapabilities.idl:
* Modules/mediacapabilities/MediaCapabilitiesDecodingInfo.idl:
* Modules/mediacapabilities/MediaCapabilitiesEncodingInfo.idl:
* Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
* Modules/mediacapabilities/MediaDecodingConfiguration.idl:
* Modules/mediacapabilities/MediaEncodingConfiguration.idl:
* Modules/mediacapabilities/VideoConfiguration.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/MediaCapabilitiesDecodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
(WebCore::MediaCapabilitiesDecodingInfo::MediaCapabilitiesDecodingInfo):
* platform/MediaCapabilitiesEncodingInfo.h: Copied from Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h.
(WebCore::MediaCapabilitiesEncodingInfo::MediaCapabilitiesEncodingInfo):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h:
* platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp:
(WebCore::createMediaPlayerDecodingConfigurationGStreamer):
* platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h:
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* platform/mediacapabilities/MediaEngineConfigurationFactory.h:
* platform/mock/MediaEngineConfigurationFactoryMock.cpp:
(WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
* platform/mock/MediaEngineConfigurationFactoryMock.h:
2019-03-15 Antti Koivisto <antti@apple.com>
Use Region for event region even when it is a rectangle
https://bugs.webkit.org/show_bug.cgi?id=195803
Reviewed by Simon Fraser.
Region type is now optimized for the common single-rectangle case so we can simplify code.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setEventRegion):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::eventRegion const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setEventRegion):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
2019-03-15 Jer Noble <jer.noble@apple.com>
Unreviewed unified build fix: GPUBindGroup has a default public constructor and destructor, so all its member
variables must be fully defined.
* platform/graphics/gpu/GPUBindGroup.h:
2019-03-15 Per Arne Vollan <pvollan@apple.com>
[macOS] Broker access to Speech Synthesis
https://bugs.webkit.org/show_bug.cgi?id=195645
<rdar://problem/35369026>
Reviewed by Brent Fulgham.
To be able to close the connection to the speech synthesis daemon in the WebContent process,
speech synthesis should be performed in the UI process. This patch forwards speech synthesis
requests to the UI process by sending messages. On the UI process side, the speech synthesis
is performed by simply using the existing platform speech synthesizer. Speech synthesis
events are sent back to the WebContent process. All messages are async, except for the
message to get the list of available voices.
No new tests, covered by existing tests.
* Modules/speech/DOMWindowSpeechSynthesis.cpp:
(WebCore::DOMWindowSpeechSynthesis::speechSynthesis):
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::create):
(WebCore::SpeechSynthesis::SpeechSynthesis):
(WebCore::SpeechSynthesis::setPlatformSynthesizer):
(WebCore::SpeechSynthesis::getVoices):
(WebCore::SpeechSynthesis::startSpeakingImmediately):
(WebCore::SpeechSynthesis::cancel):
(WebCore::SpeechSynthesis::pause):
(WebCore::SpeechSynthesis::resume):
(WebCore::SpeechSynthesis::boundaryEventOccurred):
(WebCore::SpeechSynthesis::didStartSpeaking):
(WebCore::SpeechSynthesis::didFinishSpeaking):
(WebCore::SpeechSynthesis::didPauseSpeaking):
(WebCore::SpeechSynthesis::didResumeSpeaking):
(WebCore::SpeechSynthesis::speakingErrorOccurred):
(WebCore::SpeechSynthesis::voicesChanged):
* Modules/speech/SpeechSynthesis.h:
* WebCore.xcodeproj/project.pbxproj:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::speechSynthesisClient const):
* page/PageConfiguration.cpp:
* page/PageConfiguration.h:
* page/SpeechSynthesisClient.h: Added.
* platform/PlatformSpeechSynthesisUtterance.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
(-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakRangeOfSpeechString:utterance:]):
* platform/mac/PlatformSpeechSynthesizerMac.mm:
(-[WebSpeechSynthesisWrapper speechSynthesizer:willSpeakWord:ofString:]):
* platform/mock/PlatformSpeechSynthesizerMock.cpp:
(WebCore::PlatformSpeechSynthesizerMock::speak):
2019-03-15 Antti Koivisto <antti@apple.com>
Try to fix watchOS build.
* platform/graphics/Region.h:
(WebCore::Region::Span::decode):
2019-03-15 Simon Fraser <simon.fraser@apple.com>
[Async overflow Scrolling] Update positioned node layers when overflows are scrolled
https://bugs.webkit.org/show_bug.cgi?id=195733
rdar://problem/11642295
Reviewed by Antti Koivisto.
Make ScrollingTree positioned nodes in the two cases where we need them, as
detected by RenderLayerCompositor::computeCoordinatedPositioningForLayer().
For "Moves" layers we know that the overflow is not in the z-order ancestor chain,
so ScrollingTree needs a map of overflow node -> affected positioned nodes which
notifyRelatedNodesAfterScrollPositionChange() uses to find nodes to update after
a scroll. Computing these dependent nodes in RenderLayerCompositor() would require
correct dependency analysis between an overflow layers and "positioned" layers which
is hard. It's easier to have "positioned" layers figure out which overflow nodes
affect them, then compute the inverse relationship when the scrolling tree is updated
which happens in ScrollingTreePositionedNode::commitStateBeforeChildren().
Tests: scrollingcoordinator/ios/absolute-layer-should-not-move-with-scroll.html
scrollingcoordinator/ios/relative-layer-should-move-with-scroll.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::applyLayerPositions):
(WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
(WebCore::ScrollingTree::scrollingTreeAsText):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::overflowRelatedNodes):
* page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
(WebCore::ScrollingTreeOverflowScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeOverflowScrollingNode.h:
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm:
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreePositionedNode::applyLayerPositions):
(WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
* rendering/RenderLayerCompositor.cpp:
(WebCore::layerContainingBlockCrossesCoordinatedScrollingBoundary):
(WebCore::layerParentedAcrossCoordinatedScrollingBoundary):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::collectRelatedCoordinatedScrollingNodes):
(WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
2019-03-15 Antti Koivisto <antti@apple.com>
Optimize Region for single rectangle case
https://bugs.webkit.org/show_bug.cgi?id=195743
Reviewed by Simon Fraser.
Instrumentation shows vast majority of Region objects consist of a single rectangle. However it always allocates
the large Shape data structure. This makes it unsuitable to use as a member in any popular objects.
This patch optimizes the single rectangle case by using only the bounds rectangle to describe it.
Shape is allocated on demand. This makes it safe to use Region as a data member where a rectangle is the common case.
The patch also modernizes Region encoding/decoding support.
* platform/graphics/Region.cpp:
(WebCore::Region::Region):
(WebCore::Region::~Region):
(WebCore::Region::operator=):
(WebCore::Region::rects const):
(WebCore::Region::contains const):
(WebCore::Region::intersects const):
(WebCore::Region::Shape::Shape):
(WebCore::Region::Shape::appendSpan):
(WebCore::Region::dump const):
(WebCore::Region::intersect):
(WebCore::Region::unite):
(WebCore::Region::subtract):
(WebCore::Region::translate):
(WebCore::Region::setShape):
(WebCore::Region::Shape::isValid const): Deleted.
(WebCore::Region::Shape::swap): Deleted.
(WebCore::Region::updateBoundsFromShape): Deleted.
Remove some now unused function.
* platform/graphics/Region.h:
(WebCore::Region::isRect const):
(WebCore::Region::gridSize const):
(WebCore::Region::copyShape const):
(WebCore::operator==):
(WebCore::Region::Span::encode const):
(WebCore::Region::Span::decode):
(WebCore::Region::Shape::encode const):
(WebCore::Region::Shape::decode):
(WebCore::Region::encode const):
(WebCore::Region::decode):
This is now part of type.
(WebCore::Region::isValid const): Deleted.
(WebCore::Region::Span::Span): Deleted.
(WebCore::Region::shapeSegments const): Deleted.
(WebCore::Region::shapeSpans const): Deleted.
(WebCore::Region::setShapeSegments): Deleted.
(WebCore::Region::setShapeSpans): Deleted.
(WebCore::Region::Shape::segments const): Deleted.
(WebCore::Region::Shape::spans const): Deleted.
(WebCore::Region::Shape::setSegments): Deleted.
(WebCore::Region::Shape::setSpans): Deleted.
No need to expose these for encoding anymore.
2019-03-15 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to capture a screenshot of a node from within the page
https://bugs.webkit.org/show_bug.cgi?id=194279
<rdar://problem/10731573>
Reviewed by Joseph Pecoraro.
Test: inspector/console/console-screenshot.html
Add `console.screenshot` functionality, which displays a screenshot of a given object (if
able) within Web Inspector's Console tab. From there, it can be viewed and saved.
Currently, `console.screenshot` will
- capture an image of a `Node` (if provided)
- capture an image of the viewport if nothing is provided
* page/PageConsoleClient.h:
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::addMessage):
(WebCore::PageConsoleClient::screenshot): Added.
* workers/WorkerConsoleClient.h:
* workers/WorkerConsoleClient.cpp:
(WebCore::WorkerConsoleClient::screenshot): Added.
* worklets/WorkletConsoleClient.h:
* worklets/WorkletConsoleClient.cpp:
(WebCore::WorkletConsoleClient::screenshot): Added.
* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPIImpl.prototype.screenshot): Added.
* inspector/InspectorInstrumentation.h:
2019-03-14 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Retain PrivateName of Symbol before passing it to operations potentially incurring GC
https://bugs.webkit.org/show_bug.cgi?id=195791
<rdar://problem/48806130>
Reviewed by Mark Lam.
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::setupModuleScriptHandlers):
2019-03-14 Brent Fulgham <bfulgham@apple.com>
Move CoreCrypto SPI declarations to an appropriate PAL/spi header
https://bugs.webkit.org/show_bug.cgi?id=195754
<rdar://problem/48591957>
Reviewed by Jiewen Tan.
Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
Update the const correctness of one function call to match new SDK declaration.
No tests because there are no changes in behavior.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2019-03-14 Sihui Liu <sihui_liu@apple.com>
IndexedDB: re-enable some leak tests
https://bugs.webkit.org/show_bug.cgi?id=194806
Reviewed by Geoffrey Garen.
Protected JSIDBCursor object when advance/continue request on IDBCursor is not finished, because after the
advance operation completes on success, we need to return the same JSIDBCursor object as before the advance,
and during the wait for advance operation to complete, we need to return error as the result.
Covered by existing tests.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::setGetResult):
(WebCore::IDBCursor::clearWrappers):
* Modules/indexeddb/IDBCursor.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::stop):
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
(WebCore::IDBRequest::setResultToUndefined):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::didOpenOrIterateCursor):
(WebCore::IDBRequest::clearWrappers):
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::cursorWrapper):
* bindings/js/JSIDBRequestCustom.cpp:
(WebCore::JSIDBRequest::visitAdditionalChildren):
* bindings/js/JSValueInWrappedObject.h:
(WebCore::JSValueInWrappedObject::JSValueInWrappedObject):
(WebCore::JSValueInWrappedObject::operator=):
(WebCore::JSValueInWrappedObject::clear):
2019-03-14 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r242981.
Causing internal build failures on watch/tv OS
Reverted changeset:
"Move CoreCrypto SPI declarations to an appropriate PAL/spi
header"
https://bugs.webkit.org/show_bug.cgi?id=195754
https://trac.webkit.org/changeset/242981
2019-03-14 Sihui Liu <sihui_liu@apple.com>
Web process is put to suspended when holding locked WebSQL files
https://bugs.webkit.org/show_bug.cgi?id=195768
Reviewed by Geoffrey Garen.
We need to keep processes active during database close, because SQLite database may run a checkpoint operation
and lock database files.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::useWALJournalMode):
(WebCore::SQLiteDatabase::close):
* platform/sql/SQLiteDatabase.h:
2019-03-14 Brent Fulgham <bfulgham@apple.com>
Move CoreCrypto SPI declarations to an appropriate PAL/spi header
https://bugs.webkit.org/show_bug.cgi?id=195754
<rdar://problem/48591957>
Reviewed by Jiewen Tan.
Move the forward declarations of various CoreCrypto SPI to an appropriate PAL/spi header.
Update the const correctness of one function call to match new SDK declaration.
No tests because there are no changes in behavior.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2019-03-14 Said Abou-Hallawa <sabouhallawa@apple.com>
Rename SVGProperty to SVGLegacyProperty and rename SVGAnimatedProperty to SVGLegacyAnimatedProperty
https://bugs.webkit.org/show_bug.cgi?id=195767
Reviewed by Tim Horton.
This is a step towards removing the SVG properties tear off objects.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* svg/SVGAngle.h:
(WebCore::SVGAngle::create):
(WebCore::SVGAngle::SVGAngle):
* svg/SVGAnimateElement.h:
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::castAnimatedPropertyToActualType):
* svg/SVGElement.h:
(WebCore::SVGElement::lookupAnimatedProperty const):
(WebCore::SVGElement::lookupOrCreateAnimatedProperty):
(WebCore::SVGElement::lookupOrCreateAnimatedProperties):
* svg/SVGLength.h:
(WebCore::SVGLength::create):
(WebCore::SVGLength::SVGLength):
* svg/SVGMatrix.h:
(WebCore::SVGMatrix::create):
(WebCore::SVGMatrix::SVGMatrix):
* svg/SVGNumber.h:
(WebCore::SVGNumber::create):
(WebCore::SVGNumber::SVGNumber):
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::lookupOrCreateDWrapper):
* svg/SVGPathElement.h:
* svg/SVGPathSegList.cpp:
(WebCore::SVGPathSegList::processIncomingListItemValue):
* svg/SVGPathSegWithContext.h:
(WebCore::SVGPathSegWithContext::animatedProperty const):
* svg/SVGPoint.h:
(WebCore::SVGPoint::create):
(WebCore::SVGPoint::SVGPoint):
* svg/SVGPreserveAspectRatio.h:
(WebCore::SVGPreserveAspectRatio::create):
(WebCore::SVGPreserveAspectRatio::SVGPreserveAspectRatio):
* svg/SVGRect.h:
(WebCore::SVGRect::create):
(WebCore::SVGRect::SVGRect):
* svg/SVGTransform.h:
(WebCore::SVGTransform::create):
(WebCore::SVGTransform::SVGTransform):
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::findItem):
(WebCore::SVGAnimatedListPropertyTearOff::SVGAnimatedListPropertyTearOff):
* svg/properties/SVGAnimatedProperty.cpp: Removed.
* svg/properties/SVGAnimatedProperty.h: Removed.
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedStaticPropertyTearOff.h:
(WebCore::SVGAnimatedStaticPropertyTearOff::SVGAnimatedStaticPropertyTearOff):
* svg/properties/SVGAttributeAccessor.h:
(WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
(WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
(WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
(WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
(WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
* svg/properties/SVGAttributeOwnerProxy.h:
* svg/properties/SVGAttributeOwnerProxyImpl.h:
* svg/properties/SVGAttributeRegistry.h:
(WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
(WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
(WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
(WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
(WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
(WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
* svg/properties/SVGLegacyAnimatedProperty.cpp: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.cpp.
(WebCore::SVGLegacyAnimatedProperty::SVGLegacyAnimatedProperty):
(WebCore::SVGLegacyAnimatedProperty::~SVGLegacyAnimatedProperty):
(WebCore::SVGLegacyAnimatedProperty::commitChange):
(WebCore::SVGAnimatedProperty::SVGAnimatedProperty): Deleted.
(WebCore::SVGAnimatedProperty::~SVGAnimatedProperty): Deleted.
(WebCore::SVGAnimatedProperty::commitChange): Deleted.
* svg/properties/SVGLegacyAnimatedProperty.h: Copied from Source/WebCore/svg/properties/SVGAnimatedProperty.h.
(WebCore::SVGLegacyAnimatedProperty::lookupOrCreateAnimatedProperty):
(WebCore::SVGLegacyAnimatedProperty::lookupAnimatedProperty):
(WebCore::SVGAnimatedProperty::isAnimating const): Deleted.
(WebCore::SVGAnimatedProperty::isAnimatedListTearOff const): Deleted.
(WebCore::SVGAnimatedProperty::contextElement const): Deleted.
(WebCore::SVGAnimatedProperty::attributeName const): Deleted.
(WebCore::SVGAnimatedProperty::animatedPropertyType const): Deleted.
(WebCore::SVGAnimatedProperty::isReadOnly const): Deleted.
(WebCore::SVGAnimatedProperty::setIsReadOnly): Deleted.
(WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty): Deleted.
(WebCore::SVGAnimatedProperty::lookupAnimatedProperty): Deleted.
(WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
* svg/properties/SVGLegacyProperty.h: Copied from Source/WebCore/svg/properties/SVGProperty.h.
* svg/properties/SVGListProperty.h:
* svg/properties/SVGProperty.h: Removed.
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::create):
(WebCore::SVGPropertyTearOff::animatedProperty const):
(WebCore::SVGPropertyTearOff::setAnimatedProperty):
(WebCore::SVGPropertyTearOff::SVGPropertyTearOff):
2019-03-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242963.
Breaks watchOS build.
Reverted changeset:
"Move CommonCrypto SPI declarations to an appropriate PAL/spi
header"
https://bugs.webkit.org/show_bug.cgi?id=195754
https://trac.webkit.org/changeset/242963
2019-03-14 Chris Dumez <cdumez@apple.com>
Unreviewed, update xcfilelist files as they are out of sync.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2019-03-14 Justin Fan <justin_fan@apple.com>
[Web GPU] Updates to GPUCommandBuffer for new GPUCommandEncoder concept
https://bugs.webkit.org/show_bug.cgi?id=195083
<rdar://problem/48423591>
Reviewed by Dean Jackson.
Fixing build error and re-introducing rolled-out changes.
WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
is now WebGPUCommandEncoder.
Affected Web GPU tests updated to match new API.
New files and symbols:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
(WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
(WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
(WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
(WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
(WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
(WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
(WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
* Modules/webgpu/WebGPUCommandBuffer.h:
(WebCore::WebGPUCommandBuffer::commandBuffer):
(WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
* Modules/webgpu/WebGPUCommandBuffer.idl:
Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
* Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
(WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
(WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
(WebCore::WebGPUCommandEncoder::create):
(WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
(WebCore::WebGPUCommandEncoder::beginRenderPass):
(WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
(WebCore::WebGPUCommandEncoder::copyBufferToTexture):
(WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
(WebCore::WebGPUCommandEncoder::copyTextureToTexture):
(WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
* Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
* Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
(WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
(WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
(WebCore::WebGPUProgrammablePassEncoder::setPipeline):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
* Modules/webgpu/WebGPUQueue.h:
* Modules/webgpu/WebGPUQueue.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
(WebCore::WebGPURenderPassEncoder::draw):
(WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
* platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
(WebCore::GPUDevice::createCommandBuffer): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
(WebCore::GPUCommandBuffer::create): Deleted.
2019-03-14 Justin Fan <justin_fan@apple.com>
[Web GPU] Enum cleanup
https://bugs.webkit.org/show_bug.cgi?id=195766
Reviewed by Myles C. Maxfield.
Clean up enum implementations in Web GPU. Enums referenced by only one class now share implementation files with that class to reduce clutter.
No change in behavior.
* DerivedSources.make:
* Modules/webgpu/GPUBindGroupLayoutBinding.h:
* Modules/webgpu/GPUBindGroupLayoutBinding.idl:
* Modules/webgpu/GPUInputStateDescriptor.idl:
* Modules/webgpu/GPURequestAdapterOptions.idl:
* Modules/webgpu/GPUSamplerDescriptor.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUTextureDimension.idl: Removed.
* Modules/webgpu/GPUVertexAttributeDescriptor.idl:
* Modules/webgpu/GPUVertexInputDescriptor.idl:
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::validateBufferBindingType):
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUInputStateDescriptor.h:
* platform/graphics/gpu/GPURequestAdapterOptions.h:
* platform/graphics/gpu/GPUSamplerDescriptor.h:
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/gpu/GPUTextureDimension.h: Removed.
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::MTLDataTypeForBindingType):
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::GPUBindGroup::tryCreate):
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create):
* platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
(WebCore::mtlAddressModeForAddressMode):
(WebCore::mtlMinMagFilterForFilterMode):
(WebCore::mtlMipFilterForFilterMode):
2019-03-14 Said Abou-Hallawa <sabouhallawa@apple.com>
Use enum class for AnimationMode
https://bugs.webkit.org/show_bug.cgi?id=195762
Reviewed by Tim Horton.
Convert AnimationMode into an enum class.
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateFromAndByValues):
(WebCore::SVGAnimateElementBase::isAdditive const):
* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::calculateFromAndByValues):
(WebCore::SVGAnimateMotionElement::calculateAnimatedValue):
(WebCore::SVGAnimateMotionElement::updateAnimationMode):
* svg/SVGAnimatedAngle.cpp:
(WebCore::SVGAnimatedAngleAnimator::calculateAnimatedValue):
* svg/SVGAnimatedBoolean.cpp:
(WebCore::SVGAnimatedBooleanAnimator::calculateAnimatedValue):
* svg/SVGAnimatedColor.cpp:
(WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue):
* svg/SVGAnimatedEnumeration.cpp:
(WebCore::SVGAnimatedEnumerationAnimator::calculateAnimatedValue):
* svg/SVGAnimatedInteger.cpp:
(WebCore::SVGAnimatedIntegerAnimator::calculateAnimatedValue):
* svg/SVGAnimatedIntegerOptionalInteger.cpp:
(WebCore::SVGAnimatedIntegerOptionalIntegerAnimator::calculateAnimatedValue):
* svg/SVGAnimatedLength.cpp:
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedNumber.cpp:
(WebCore::SVGAnimatedNumberAnimator::calculateAnimatedValue):
* svg/SVGAnimatedNumberList.cpp:
(WebCore::SVGAnimatedNumberListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedNumberOptionalNumber.cpp:
(WebCore::SVGAnimatedNumberOptionalNumberAnimator::calculateAnimatedValue):
* svg/SVGAnimatedPath.cpp:
(WebCore::SVGAnimatedPathAnimator::calculateAnimatedValue):
* svg/SVGAnimatedPointList.cpp:
(WebCore::SVGAnimatedPointListAnimator::calculateAnimatedValue):
* svg/SVGAnimatedPreserveAspectRatio.cpp:
(WebCore::SVGAnimatedPreserveAspectRatioAnimator::calculateAnimatedValue):
* svg/SVGAnimatedRect.cpp:
(WebCore::SVGAnimatedRectAnimator::calculateAnimatedValue):
* svg/SVGAnimatedTransformList.cpp:
(WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
* svg/SVGAnimationElement.cpp:
(WebCore::SVGAnimationElement::updateAnimationMode):
(WebCore::SVGAnimationElement::isAdditive const):
(WebCore::SVGAnimationElement::isAccumulated const):
(WebCore::SVGAnimationElement::calculateKeyTimesForCalcModePaced):
(WebCore::SVGAnimationElement::startedActiveInterval):
(WebCore::SVGAnimationElement::updateAnimation):
* svg/SVGAnimationElement.h:
(WebCore::SVGAnimationElement::adjustFromToListValues):
(WebCore::SVGAnimationElement::animateDiscreteType):
(WebCore::SVGAnimationElement::animateAdditiveNumber):
* svg/SVGSetElement.cpp:
(WebCore::SVGSetElement::SVGSetElement):
(WebCore::SVGSetElement::updateAnimationMode):
2019-03-14 Ryosuke Niwa <rniwa@webkit.org>
Storing a Node in Ref/RefPtr inside its destructor results in double delete
https://bugs.webkit.org/show_bug.cgi?id=195661
Reviewed by Brent Fulgham.
Set Node::m_refCount to 1 before calling its virtual destructor.
This is a security mitigation to prevent any code which ends up storing the node to Ref / RefPtr
inside the destructor, which is a programming error caught by debug assertions, from triggering
a double-delete on the same Node.
Such a code would hit the debug assertions in Node::deref() because m_inRemovedLastRefFunction
had been set to true by then.
* dom/Document.cpp:
(WebCore::Document::removedLastRef):
* dom/Document.h:
(WebCore::Document::decrementReferencingNodeCount):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::removedLastRef):
2019-03-14 Brent Fulgham <bfulgham@apple.com>
Move CommonCrypto SPI declarations to an appropriate PAL/spi header
https://bugs.webkit.org/show_bug.cgi?id=195754
<rdar://problem/48591957>
Reviewed by Jiewen Tan.
Move the forward declarations of various CommonCrypto SPI to an appropriate PAL/spi header.
Update the const correctness of one function call to match new SDK declaration.
No tests because there are no changes in behavior.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
(WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
2019-03-14 Chris Dumez <cdumez@apple.com>
Add WebsitePolicy for the client to specify the device orientation & motion access policy
https://bugs.webkit.org/show_bug.cgi?id=195750
Reviewed by Geoffrey Garen.
Add WebsitePolicy for the client to specify the device orientation & motion access policy. If
the client already knows access to the device motion & orientation API will be granted / denied,
it can let WebKit know via WebsitePolicies so that WebKit will not ask the client when the
permission is requested by JS.
* dom/DeviceOrientationAndMotionAccessController.cpp:
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
(WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
(WebCore::DeviceOrientationAndMotionAccessController::accessState const):
* dom/DeviceOrientationAndMotionAccessController.h:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::deviceOrientationAndMotionAccessState const):
(WebCore::DocumentLoader::setDeviceOrientationAndMotionAccessState):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
2019-03-14 Shawn Roberts <sroberts@apple.com>
Unreviewed, rolling out r242931.
Causing internal watch/tv OS build failures
Reverted changeset:
"[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue
concept"
https://bugs.webkit.org/show_bug.cgi?id=195083
https://trac.webkit.org/changeset/242931
2019-03-14 Chris Dumez <cdumez@apple.com>
Device orientation's permission should only require a user gesture to prompt the user
https://bugs.webkit.org/show_bug.cgi?id=195731
Reviewed by Geoffrey Garen.
Device orientation's permission should only require a user gesture to prompt the user. If the
user already made a decision, we should resolve the promise with this decision, even without
user gesture.
This is useful for JS to figure out if they are access to device orientation or not because
showing UI for the user to give permission.
No new tests, updated existing tests.
* dom/DeviceOrientationAndMotionAccessController.cpp:
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
* dom/DeviceOrientationAndMotionAccessController.h:
* dom/DeviceOrientationOrMotionEvent.cpp:
(WebCore::DeviceOrientationOrMotionEvent::requestPermission):
2019-03-14 Youenn Fablet <youenn@apple.com>
Reset storage quota when clearing IDB/Cache API entries
https://bugs.webkit.org/show_bug.cgi?id=195716
Reviewed by Chris Dumez.
On clearing of databases, reset all quota users.
This will ensure all layout test runs start with a clean state.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::didPerformCloseAndDeleteDatabases):
* storage/StorageQuotaManager.h:
(WebCore::StorageQuotaManager::resetQuota):
2019-03-14 Jer Noble <jer.noble@apple.com>
Certain videos are causing a crash when used as WebGL texture
https://bugs.webkit.org/show_bug.cgi?id=195700
<rdar://problem/48869347>
Reviewed by Eric Carlson.
CFEqual is not null-safe, so perform a null and type check before comparing.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::transferFunctionFromString):
2019-03-14 Zalan Bujtas <zalan@apple.com>
Cleanup inline boxes when list marker gets blockified
https://bugs.webkit.org/show_bug.cgi?id=195746
<rdar://problem/48049175>
Reviewed by Antti Koivisto.
Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
change does not require a new renderer.
This patch takes care of destroying the inline boxtree when the marker gains block display type.
Test: fast/block/float/list-marker-is-float-crash.html
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::styleDidChange):
2019-03-14 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: provide a way to get the contents of resources
https://bugs.webkit.org/show_bug.cgi?id=195266
<rdar://problem/48550911>
Reviewed by Joseph Pecoraro.
Test: inspector/audit/run-resources.html
* inspector/InspectorAuditResourcesObject.idl: Added.
* inspector/InspectorAuditResourcesObject.h: Added.
(WebCore::InspectorAuditResourcesObject::create):
(WebCore::InspectorAuditResourcesObject::Resource):
(WebCore::InspectorAuditResourcesObject::ResourceContent):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedResourceClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedFontClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedImageClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedRawResourceClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedStyleSheetClient):
(WebCore::InspectorAuditResourcesObject::InspectorAuditCachedSVGDocumentClient):
* inspector/InspectorAuditResourcesObject.cpp: Added.
(WebCore::InspectorAuditResourcesObject::InspectorAuditResourcesObject):
(WebCore::InspectorAuditResourcesObject::getResources):
(WebCore::InspectorAuditResourcesObject::getResourceContent):
(WebCore::InspectorAuditResourcesObject::clientForResource):
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourcesForFrame): Added.
(WebCore::allResourcesURLsForFrame):
Moved a file static function to be a class static function so it can be used elsewhere.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-03-14 Devin Rousso <drousso@apple.com>
Web Inspector: Console: getEventListeners should work for any EventTarget
https://bugs.webkit.org/show_bug.cgi?id=195713
Reviewed by Joseph Pecoraro.
Test: inspector/console/command-line-api-getEventListeners.html
* dom/EventTarget.h:
* dom/EventTarget.cpp:
(WebCore::EventTarget::eventTypes): Added.
* inspector/CommandLineAPIHost.idl:
* inspector/CommandLineAPIHost.h:
(WebCore::CommandLineAPIHost::init):
* inspector/CommandLineAPIHost.cpp:
(WebCore::CommandLineAPIHost::disconnect):
(WebCore::CommandLineAPIHost::getEventListeners):
(WebCore::listenerEntriesFromListenerInfo): Deleted.
* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPIImpl.prototype.getEventListeners):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
2019-03-14 Devin Rousso <drousso@apple.com>
Web Inspector: Styles: `::-webkit-scrollbar*` rules aren't shown
https://bugs.webkit.org/show_bug.cgi?id=195123
<rdar://problem/48450148>
Reviewed by Joseph Pecoraro.
Test: inspector/css/getMatchedStylesForNode.html
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::protocolValueForPseudoId): Added.
(WebCore::InspectorCSSAgent::getMatchedStylesForNode):
2019-03-13 Benjamin Poulain <benjamin@webkit.org>
Fix the argument type of RenderView::resumePausedImageAnimationsIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=195659
Reviewed by Saam Barati.
The two callers of resumePausedImageAnimationsIfNeeded() both get the IntRect
as a reference. The rect was going on the stack then used as a reference again.
* rendering/RenderView.cpp:
(WebCore::RenderView::resumePausedImageAnimationsIfNeeded):
* rendering/RenderView.h:
2019-03-13 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Stop content observation when content calls preventDefault() on touch events
https://bugs.webkit.org/show_bug.cgi?id=195724
<rdar://problem/48873456>
Reviewed by Simon Fraser.
Call willNotProceedWithClick on preventDefault. This is very similar to the long press case.
* page/ios/ContentChangeObserver.cpp:
(WebCore::willNotProceedWithClick):
(WebCore::ContentChangeObserver::didRecognizeLongPress):
(WebCore::ContentChangeObserver::didPreventDefaultForEvent):
* page/ios/ContentChangeObserver.h:
2019-03-13 Justin Fan <justin_fan@apple.com>
[Web GPU] Updates to GPUCommandBuffer for new GPUCommandQueue concept
https://bugs.webkit.org/show_bug.cgi?id=195083
<rdar://problem/48423591>
Reviewed by Dean Jackson.
WebGPUCommandBuffer now represents a completed GPUCommandBuffer that can only be used in queue submits. The previous WebGPUCommandBuffer
is now WebGPUCommandEncoder.
Affected Web GPU tests updated to match new API.
New files and symbols:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Implement new WebGPUCommandBuffer, now just a DOM object carrier for a finished GPUCommandBuffer:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
(WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const): Deleted.
(WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const): Deleted.
(WebCore::WebGPUCommandBuffer::beginRenderPass): Deleted.
(WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Deleted.
(WebCore::WebGPUCommandBuffer::copyBufferToTexture): Deleted.
(WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Deleted.
(WebCore::WebGPUCommandBuffer::copyTextureToTexture): Deleted.
* Modules/webgpu/WebGPUCommandBuffer.h:
(WebCore::WebGPUCommandBuffer::commandBuffer):
(WebCore::WebGPUCommandBuffer::commandBuffer const): Deleted.
* Modules/webgpu/WebGPUCommandBuffer.idl:
Rename old WebGPUCommandBuffer to WebGPUCommandEncoder:
* Modules/webgpu/WebGPUCommandEncoder.cpp: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.cpp.
(WebCore::WebGPUBufferCopyView::tryCreateGPUBufferCopyView const):
(WebCore::WebGPUTextureCopyView::tryCreateGPUTextureCopyView const):
(WebCore::WebGPUCommandEncoder::create):
(WebCore::WebGPUCommandEncoder::WebGPUCommandEncoder):
(WebCore::WebGPUCommandEncoder::beginRenderPass):
(WebCore::WebGPUCommandEncoder::copyBufferToBuffer):
(WebCore::WebGPUCommandEncoder::copyBufferToTexture):
(WebCore::WebGPUCommandEncoder::copyTextureToBuffer):
(WebCore::WebGPUCommandEncoder::copyTextureToTexture):
(WebCore::WebGPUCommandEncoder::finish): Added. "Completes" this and invalidates it. Returns its GPUCommandBuffer, ready for submission.
* Modules/webgpu/WebGPUCommandEncoder.h: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.h.
* Modules/webgpu/WebGPUCommandEncoder.idl: Copied from Source/WebCore/Modules/webgpu/WebGPUCommandBuffer.idl.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createCommandEncoder const): Renamed fom createCommandBuffer. Now returns non-nullable.
(WebCore::WebGPUDevice::createCommandBuffer const): Deleted.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
(WebCore::WebGPUProgrammablePassEncoder::endPass): No longer returns the original WebGPUCommandBuffer.
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
(WebCore::WebGPUProgrammablePassEncoder::setPipeline):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::submit): Replace unnecessary rvalue reference parameter.
* Modules/webgpu/WebGPUQueue.h:
* Modules/webgpu/WebGPUQueue.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
(WebCore::WebGPURenderPassEncoder::draw):
(WebCore::WebGPURenderPassEncoder::passEncoder const): Now returns a pointer since it is properly backed by a RefPtr.
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::getCurrentTexture): No longer invalidates m_currentTexture. Doh!
* platform/graphics/gpu/GPUCommandBuffer.h: Missing includes for the *CopyView structs.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateCommandBuffer const): Renamed from createCommandBuffer.
(WebCore::GPUDevice::createCommandBuffer): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::tryCreate): Renamed from create.
(WebCore::GPUCommandBuffer::create): Deleted.
2019-03-13 Zalan Bujtas <zalan@apple.com>
[WeakPtr] RenderListMarker::m_listItem should be a WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=195704
<rdar://problem/48486278>
Reviewed by Simon Fraser.
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::RenderListMarker):
(WebCore::RenderListMarker::paint):
(WebCore::RenderListMarker::layout):
(WebCore::RenderListMarker::updateContent):
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::lineHeight const):
(WebCore::RenderListMarker::baselinePosition const):
(WebCore::RenderListMarker::suffix const):
(WebCore::RenderListMarker::isInside const):
(WebCore::RenderListMarker::getRelativeMarkerRect):
* rendering/RenderListMarker.h:
2019-03-13 Dean Jackson <dino@apple.com>
Block all plugins smaller than 5x5px
https://bugs.webkit.org/show_bug.cgi?id=195702
<rdar://problem/28435204>
Reviewed by Sam Weinig.
Block all plugins that are smaller than a threshold, in this case
5px x 5px. Other browsers have implemented this for a while, and now
that we have Intersection Observers, small plugins are no longer
necessary.
Test: plugins/small-plugin-blocked.html
* en.lproj/Localizable.strings: New message for a small plugin.
* platform/LocalizedStrings.cpp:
(WebCore::pluginTooSmallText):
* platform/LocalizedStrings.h:
* html/HTMLPlugInElement.cpp: Helper function for Internals testing.
(WebCore::HTMLPlugInElement::isBelowSizeThreshold const):
* html/HTMLPlugInElement.h:
* loader/EmptyClients.cpp: Removed an unused function.
(WebCore::EmptyFrameLoaderClient::recreatePlugin): Deleted.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* page/Settings.yaml: Add flag for new feature.
* rendering/RenderEmbeddedObject.cpp: New unavailability reason for
embedded objects.
(WebCore::unavailablePluginReplacementText):
* rendering/RenderEmbeddedObject.h:
(WebCore::RenderEmbeddedObject::pluginUnavailabilityReason const):
* testing/Internals.cpp: Helper function for testing.
(WebCore::Internals::pluginIsBelowSizeThreshold):
* testing/Internals.h:
* testing/Internals.idl:
2019-03-13 Zalan Bujtas <zalan@apple.com>
Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow
https://bugs.webkit.org/show_bug.cgi?id=195701
<rdar://problem/48448658>
Reviewed by Simon Fraser.
It's safer to use existing RenderBox functions to get sibling boxes.
Test: fast/ruby/crash-when-paginated-ruby.html
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::nextColumnSetOrSpannerSiblingOf):
(WebCore::RenderMultiColumnFlow::previousColumnSetOrSpannerSiblingOf):
2019-03-13 Keith Rollin <krollin@apple.com>
Add support for new StagedFrameworks layout
https://bugs.webkit.org/show_bug.cgi?id=195543
Reviewed by Alexey Proskuryakov.
When creating the WebKit layout for out-of-band Safari/WebKit updates,
use an optional path prefix when called for.
No new tests since there should be no observable behavior difference.
* Configurations/WebCore.xcconfig:
2019-03-13 Wenson Hsieh <wenson_hsieh@apple.com>
Fix an edge case where HTMLFormElement::removeFormElement is invoked twice with the same element
https://bugs.webkit.org/show_bug.cgi?id=195663
<rdar://problem/48576391>
Reviewed by Ryosuke Niwa.
Currently, it's possible for HTMLFormControlElement's destructor to be reentrant. This may happen if the form
control element is ref'd while carrying out its destructor's logic. This may happen in two places in
HTMLFormControlElement (didChangeForm and resetDefaultButton), both of which actually don't require ensuring a
protected reference to the form control element since they should never result in any script execution.
To fix the bug, convert these strong references into raw pointers, and add ScriptDisallowedScope to ensure that
we don't change these codepaths in the future, such that they trigger arbitrary script execution.
Test: fast/forms/remove-associated-element-after-gc.html
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::didChangeForm):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::resetDefaultButton):
2019-03-13 Daniel Bates <dabates@apple.com>
Remove some unnecessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards
https://bugs.webkit.org/show_bug.cgi?id=195703
Reviewed by Tim Horton.
Remove out-of-date comment and unncessary !USE(UIKIT_KEYBOARD_ADDITIONS) guards. Following
r240604 we now make use of WebCore::windowsKeyCodeForCharCode() even for hardware key events
when USE(UIKIT_KEYBOARD_ADDITIONS) is enabled.
No functionality changed. So, no new tests.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode):
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping):
2019-03-13 Simon Fraser <simon.fraser@apple.com>
Scrolling tree should reposition non-stacking order descendents of overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=195608
Reviewed by Zalan Bujtas.
Step 1: add scrolling tree positioning nodes classes (but don't create them yet).
Add Scrolling{State,Tree}PositionedNode to track composited layers that have to be repositioned when
an async overflow:scroll scrolls. There are two instances in which this is necessary, reflected by
the values of ScrollPositioningBehavior:
ScrollPositioningBehavior::Moves - a composited layer whose containing block chain includes an
async overflow scroller, but whose composited (i.e. z-order) parent is outside of the overflow.
When the overflow scrolls, this layer has to move along with the overflow.
ScrollPositioningBehavior::Stationary - a composited layer whose containing block chain skips the
overflow scroller, but whose compositing (z-order) parent is the scroller, or inside the scroller.
This only applies to position:absolute, on, for example, an overflow:scroll ith opacity.
PositionedNodes are modeled after Fixed/Sticky nodes, with a new type of layout constraint just called LayoutConstraints.
This patch adds support for PositionedNodes in the scrolling trees, but RenderLayerCompositor::computeCoordinatedPositioningForLayer()
is just a stub so the new node types aren't created yet.
RenderLayerBacking stores a ScrollingNodeID for the positioning role (just like the other roles). Since the Positioning
role is about position relative to ancestors, a node with both Positioning and FrameHosting or Scrolling roles treats
the Positioning node as the parent of the other types. A node should never have both Positioning and ViewportConstrained roles.
Test: scrollingcoordinator/scrolling-tree/positioned-nodes.html
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setPositionedNodeGeometry):
(WebCore::AsyncScrollingCoordinator::setRelatedOverflowScrollingNodes):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingConstraints.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingConstraints.h:
(WebCore::LayoutConstraints::LayoutConstraints):
(WebCore::LayoutConstraints::operator== const):
(WebCore::LayoutConstraints::operator!= const):
(WebCore::LayoutConstraints::alignmentOffset const):
(WebCore::LayoutConstraints::setAlignmentOffset):
(WebCore::LayoutConstraints::layerPositionAtLastLayout const):
(WebCore::LayoutConstraints::setLayerPositionAtLastLayout):
(WebCore::LayoutConstraints::scrollPositioningBehavior const):
(WebCore::LayoutConstraints::setScrollPositioningBehavior):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setPositionedNodeGeometry):
(WebCore::ScrollingCoordinator::setRelatedOverflowScrollingNodes):
* page/scrolling/ScrollingCoordinatorTypes.h:
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isPositionedNode const):
* page/scrolling/ScrollingStatePositionedNode.cpp: Added.
(WebCore::ScrollingStatePositionedNode::create):
(WebCore::ScrollingStatePositionedNode::ScrollingStatePositionedNode):
(WebCore::ScrollingStatePositionedNode::clone):
(WebCore::ScrollingStatePositionedNode::setAllPropertiesChanged):
(WebCore::ScrollingStatePositionedNode::setRelatedOverflowScrollingNodes):
(WebCore::ScrollingStatePositionedNode::updateConstraints):
(WebCore::ScrollingStatePositionedNode::dumpProperties const):
* page/scrolling/ScrollingStatePositionedNode.h: Added.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isPositionedNode const):
* page/scrolling/cocoa/ScrollingTreePositionedNode.h: Copied from Source/WebCore/page/scrolling/cocoa/ScrollingTreeStickyNode.h.
* page/scrolling/cocoa/ScrollingTreePositionedNode.mm: Added.
(WebCore::ScrollingTreePositionedNode::create):
(WebCore::ScrollingTreePositionedNode::ScrollingTreePositionedNode):
(WebCore::ScrollingTreePositionedNode::~ScrollingTreePositionedNode):
(WebCore::ScrollingTreePositionedNode::commitStateBeforeChildren):
(WebCore::ScrollingTreePositionedNode::applyLayerPositions):
(WebCore::ScrollingTreePositionedNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreePositionedNode::dumpProperties const):
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* platform/ScrollTypes.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
(WebCore::RenderLayerCompositor::updateScrollingNodeForPositioningRole):
* rendering/RenderLayerCompositor.h:
2019-03-13 Youenn Fablet <youenn@apple.com>
Check IDB quota usage through QuotaManager
https://bugs.webkit.org/show_bug.cgi?id=195302
Reviewed by Chris Dumez.
For every write operation, compute an estimate size and check for quota before proceeding.
When proceeding, store the estimate size in a map.
If size of the database is to be computed when the task is not done,
the estimate size will be added to the current size of the databases.
At the end of the task, the estimate size is removed from the map,
and the databases size is refreshed.
This patch implements size estimation for write tasks.
Put/add operations might overestimate the size
when an old value will be replaced by a new value.
In that case, we do not substract the old value size since we do not know it.
This patch implements database opening by adding a fixed small cost,
as we do not know whether the database is new or not.
For the first IDB request, we have not computed the size of the database.
To do so, we need to go to a background thread and do that file size computation.
For that purpose, we add support for being-initialized quota user.
Quota manager is calling whenInitialized on its quota user and will
delay any quota check requests until its quota user is answering this callback.
For in process IDB, use the default storage quota per origin and do not increase it.
Future work should move it to NetworkProcess and implement some quota checking.
Cache API and IDB quota management are not yet fully unified.
If IDB is used on start-up, we should check for Cache API storage size.
Conversely, on Cache API first wite task, even if IDB is not being used,
we should compute the size of the IDB data for the given origin.
Test: http/tests/IndexedDB/storage-limit.https.html
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::m_quotaManagerGetter):
(WebCore::IDBServer::IDBServer::QuotaUser::QuotaUser):
(WebCore::IDBServer::IDBServer::QuotaUser::~QuotaUser):
(WebCore::IDBServer::IDBServer::QuotaUser::clearSpaceUsed):
(WebCore::IDBServer::IDBServer::QuotaUser::whenInitialized):
(WebCore::IDBServer::IDBServer::QuotaUser::initializeSpaceUsed):
(WebCore::IDBServer::IDBServer::quotaUser):
(WebCore::IDBServer::IDBServer::startComputingSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::computeSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::finishComputingSpaceUsedForOrigin):
(WebCore::IDBServer::IDBServer::requestSpace):
(WebCore::IDBServer::IDBServer::clearSpaceUsed):
(WebCore::IDBServer::IDBServer::setSpaceUsed):
(WebCore::IDBServer::IDBServer::increasePotentialSpaceUsed):
(WebCore::IDBServer::IDBServer::decreasePotentialSpaceUsed):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::create):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::databasesSizeForOrigin const):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForFolder):
(WebCore::IDBServer::SQLiteIDBBackingStore::databasesSizeForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::estimateSize):
(WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
(WebCore::IDBServer::quotaErrorMessageName):
(WebCore::IDBServer::UniqueIDBDatabase::requestSpace):
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
(WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::createObjectStoreAfterQuotaCheck):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStoreAfterQuotaCheck):
(WebCore::IDBServer::UniqueIDBDatabase::createIndex):
(WebCore::IDBServer::UniqueIDBDatabase::createIndexAfterQuotaCheck):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
(WebCore::IDBServer::UniqueIDBDatabase::renameIndexAfterQuotaCheck):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAdd):
(WebCore::IDBServer::UniqueIDBDatabase::putOrAddAfterQuotaCheck):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::updateSpaceUsedIfNeeded):
(WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
(WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
(WebCore::IDBServer::UniqueIDBDatabase::server):
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::create):
(WebCore::InProcessIDBServer::quotaManager):
(WebCore::storageQuotaManagerGetter):
(WebCore::InProcessIDBServer::InProcessIDBServer):
* Modules/indexeddb/shared/InProcessIDBServer.h:
* loader/EmptyClients.cpp:
* storage/StorageQuotaManager.cpp:
(WebCore::StorageQuotaManager::addUser):
(WebCore::StorageQuotaManager::requestSpace):
* storage/StorageQuotaManager.h:
(WebCore::StorageQuotaManager::defaultQuota):
(WebCore::StorageQuotaManager::removeUser):
* storage/StorageQuotaUser.h:
(WebCore::StorageQuotaUser::whenInitialized):
2019-03-13 Chris Dumez <cdumez@apple.com>
Better build fix after r242901.
Reviewed by Jer Noble.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
2019-03-13 Timothy Hatcher <timothy@apple.com>
Consolidate ArgumentCodersMac and ArgumentCodersCocoa.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697
Reviewed by Ryosuke Niwa.
* editing/DictionaryPopupInfo.h:
(WebCore::DictionaryPopupInfo::encodingRequiresPlatformData const): Added.
* editing/FontAttributes.h:
(WebCore::FontAttributes::encodingRequiresPlatformData const): Added.
2019-03-13 Chris Dumez <cdumez@apple.com>
Unreviewed build fix after r242901.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::updateNowPlayingInfo):
2019-03-13 Chris Dumez <cdumez@apple.com>
Use a ServiceWorker process per registrable domain
https://bugs.webkit.org/show_bug.cgi?id=195649
Reviewed by Youenn Fablet.
Use a ServiceWorker process per registrable domain instead of one per security origin. This is
more in line with PSON and avoids launching too many processes.
* page/ClientOrigin.h:
(WebCore::ClientOrigin::clientRegistrableDomain const):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::serverToContextConnectionCreated):
(WebCore::SWServer::runServiceWorkerIfNecessary):
(WebCore::SWServer::markAllWorkersForRegistrableDomainAsTerminated):
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForRegistrableDomain const):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::SWServerToContextConnection::SWServerToContextConnection):
(WebCore::SWServerToContextConnection::~SWServerToContextConnection):
(WebCore::SWServerToContextConnection::connectionForRegistrableDomain):
* workers/service/server/SWServerToContextConnection.h:
(WebCore::SWServerToContextConnection::registrableDomain const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextConnection):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::registrableDomain const):
2019-03-13 Chris Dumez <cdumez@apple.com>
REGRESSION(PSON, r240660): Navigation over process boundary is flashy when using Cmd-left/right arrow to navigate
https://bugs.webkit.org/show_bug.cgi?id=195684
<rdar://problem/48294714>
Reviewed by Antti Koivisto.
The issue was caused by us failing to suspend the current page on navigation because the source and
target WebBackForwardListItem are identical. The source WebBackForwardListItem was wrong.
When a navigation is triggered by the WebContent process (and not the UIProcess), we create the Navigation
object in WebPageProxy::decidePolicyForNavigationAction(). For the navigation's targetItem, we use the
target item identifier provided by the WebContent process via the NavigationActionData. However,
for the source item, we would use the WebBackForwardList's currentItem in the UIProcess. The issue
is that the WebBackForwardList's currentItem usually has already been updated to be the target
item via a WebPageProxy::BackForwardGoToItem() synchronous IPC.
To avoid raciness and given that the current history management is fragile (as it is managed by
both the UIProcess and the WebProcess), I am now passing the source item identifier in
addition to the target item identifier in the NavigationActionData that is sent by the WebProcess.
This is a lot less error prone, the WebProcess knows more accurately which history items it is going
from and to.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::loadItem):
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::recursiveGoToItem):
* loader/NavigationAction.cpp:
(WebCore::NavigationAction::setSourceBackForwardItem):
* loader/NavigationAction.h:
(WebCore::NavigationAction::sourceBackForwardItemIdentifier const):
2019-03-13 Jer Noble <jer.noble@apple.com>
Add AggregateLogger, a Logger specialization for singleton classes.
https://bugs.webkit.org/show_bug.cgi?id=195644
Reviewed by Eric Carlson.
Convert debug logging over to release logging through the use of AggregateLogger.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::client const):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
(WebCore::PlatformMediaSessionManager::beginInterruption):
(WebCore::PlatformMediaSessionManager::endInterruption):
(WebCore::PlatformMediaSessionManager::addSession):
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::setCurrentSession):
(WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
(WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
(WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
(WebCore::PlatformMediaSessionManager::logChannel const):
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
2019-03-13 Chris Dumez <cdumez@apple.com>
Drop legacy WebCore::toRegistrableDomain() utility function
https://bugs.webkit.org/show_bug.cgi?id=195637
Reviewed by Geoffrey Garen.
Drop legacy toRegistrableDomain() / registrableDomainAreEqual() utility functions.
Update call sites to use modern RegistrableDomain type instead.
* loader/CrossOriginAccessControl.cpp:
(WebCore::shouldCrossOriginResourcePolicyCancelLoad):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setFirstPartyForCookies):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
* platform/RegistrableDomain.h:
(WebCore::registrableDomainsAreEqual):
* platform/network/ResourceRequestBase.h:
* platform/network/cf/ResourceRequestCFNet.cpp:
* platform/network/cocoa/ResourceRequestCocoa.mm:
2019-03-13 Alex Christensen <achristensen@webkit.org>
Prevent checked_cf_cast crashes in ResourceResponse::platformCertificateInfo
https://bugs.webkit.org/show_bug.cgi?id=195686
Reviewed by Tim Horton.
This covers up a type confusion bug on some OSes until rdar://problem/48853137 is resolved.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/network/cocoa/ResourceResponseCocoa.mm:
2019-03-13 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add support for omxh264enc encoder
https://bugs.webkit.org/show_bug.cgi?id=195676
Reviewed by Philippe Normand.
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(setup_omxh264enc):
(set_bitrate_bit_per_sec):
(gst_webrtc_video_encoder_class_init):
2019-03-13 Antoine Quint <graouts@apple.com>
REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
https://bugs.webkit.org/show_bug.cgi?id=195683
<rdar://problem/48659950>
Reviewed by Alex Christensen.
While PointerID is defined as int32_t, we now use int64_t as the key of the HashMap mapping PointerID to CapturingData so that we use
a value outside of the int32_t range as a safe empty and removed values, allowing any int32_t to be provided through the API for
lookup in this HashMap.
Test: pointerevents/pointer-id-crash.html
* page/PointerCaptureController.h:
2019-03-12 Brady Eidson <beidson@apple.com>
Take UnboundedNetworking assertion when a file upload is in progress.
https://bugs.webkit.org/show_bug.cgi?id=195497
Reviewed by Geoff Garen.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::hasUpload const):
* platform/network/ResourceRequestBase.h:
2019-03-13 Youenn Fablet <youenn@apple.com>
Enable libwebrtc logging control through WebCore
https://bugs.webkit.org/show_bug.cgi?id=195658
Reviewed by Eric Carlson.
Add support for WebCore logging of libwebrtc messages.
This is controlled by WebRTC log channel state and level.
In case of private browsing mode, any logging is disabled.
This will stay for the lifetime of the process.
No change of behavior.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::doReleaseLogging):
(WebCore::setLogging):
(WebCore::computeLogLevel):
(WebCore::initializePeerConnectionFactoryAndThreads):
(WebCore::LibWebRTCProvider::setEnableLogging):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2019-03-13 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Do not sync encoder on the clock
https://bugs.webkit.org/show_bug.cgi?id=195673
we should encode as fast as possible and totally ignore timestamp while
doing so.
Reviewed by Philippe Normand.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2019-03-13 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC]: Use codec setting video height/width as fallback
https://bugs.webkit.org/show_bug.cgi?id=195675
Reviewed by Philippe Normand.
In some cases the frame height and width is not set (not sure why/ in
what conditions but it happens) so make sure to get the information from
the VideoCodec when configuring the encoder.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GStreamerVideoDecoder):
(WebCore::GStreamerVideoDecoder::GetCapsForFrame):
2019-03-13 Miguel Gomez <magomez@igalia.com>
[CoordinatedGraphics] Null dereference in CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=195615
Reviewed by Carlos Garcia Campos.
Exit early if we don't receive a valid coordinator.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
2019-03-13 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][PlayStation] Remove WebCore::standardUserAgentForURL
https://bugs.webkit.org/show_bug.cgi?id=195662
Reviewed by Ryosuke Niwa.
WebCore::standardUserAgentForURL is just a stub in Windows port.
No new tests because there is no behavior change.
* platform/win/UserAgentWin.cpp:
(WebCore::standardUserAgentForURL): Deleted.
* platform/playstation/UserAgentPlayStation.cpp:
(WebCore::standardUserAgentForURL): Deleted.
2019-03-12 Ross Kirsling <ross.kirsling@sony.com>
[Win] Fix a slew of simple clang-cl warnings.
https://bugs.webkit.org/show_bug.cgi?id=195652
Reviewed by Don Olmstead.
* page/AutoscrollController.cpp:
(WebCore::AutoscrollController::handleMouseReleaseEvent): -Wswitch
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::willSetupSslCtx):
(WebCore::CurlHandle::appendRequestHeaders): -Wunused-variable
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::computeContentLength): -Wunused-variable
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest): -Wreorder
(WebCore::CurlRequest::setupTransfer): -Wunused-variable
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
* platform/network/curl/CurlSSLVerifier.h: -Wunused-private-field
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString): -Wwritable-strings
* rendering/RenderThemeWin.cpp: -Wunused-const-variable (x2)
(WebCore::RenderThemeWin::getThemeData): -Wswitch
2019-03-12 Ryosuke Niwa <rniwa@webkit.org>
Move the code for determining the need for touch bar quirks to Quirks class
https://bugs.webkit.org/show_bug.cgi?id=195654
Reviewed by Brent Fulgham.
Moved the code to determine whether the touch bar quirks are needed or not from WebKit2.
* WebCore.xcodeproj/project.pbxproj:
* page/Quirks.cpp:
(WebCore::Quirks::isTouchBarUpdateSupressedForHiddenContentEditable const):
(WebCore::Quirks::isNeverRichlyEditableForTouchBar const):
* page/Quirks.h:
2019-03-12 Justin Fan <justin_fan@apple.com>
[Web GPU] Update GPURenderPipelineDescriptor and add GPUColorStateDescriptor.format
https://bugs.webkit.org/show_bug.cgi?id=195518
<rdar://problem/46322356>
Reviewed by Myles C. Maxfield.
Upgrade the implementation of GPURenderPipelineDescriptor and GPURenderPipeline and match the updated Web GPU API.
Add stubs for GPUColorStateDescriptor so attachment format can be provided by GPURenderPipelineDescriptor.
All affected Web GPU tests updated to cover existing behavior.
Update file names and symbols:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Updates to GPURenderPipeline, GPURenderPipelineDescriptor, and its components:
* Modules/webgpu/GPUColorStateDescriptor.idl: Added. Provide the expected texture format of the render pipeline's color attachments.
* Modules/webgpu/GPUInputStateDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUInputStateDescriptor.idl.
* Modules/webgpu/GPUTextureFormat.idl: Update the existing values to match the new style.
* Modules/webgpu/GPUVertexAttributeDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexAttributeDescriptor.idl.
* Modules/webgpu/GPUVertexInputDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUVertexInputDescriptor.idl.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createPipelineLayout const): Remove unnecessary comment.
(WebCore::WebGPUDevice::createRenderPipeline const): Descriptor validation and conversion moved into WebGPURenderPipelineDescriptor.
(WebCore::validateAndConvertPipelineStage): Deleted.
* Modules/webgpu/WebGPUDevice.h: create* functions should not return nullable.
* Modules/webgpu/WebGPUIndexFormat.h: Removed. Moved into GPUInputStateDescriptor.idl.
* Modules/webgpu/WebGPUInputStateDescriptor.h: Removed.
* Modules/webgpu/WebGPUInputStepMode.idl: Removed. Moved into GPUVertexInputDescriptor.idl.
* Modules/webgpu/WebGPUPipelineLayout.h:
(WebCore::WebGPUPipelineLayout::pipelineLayout): Getters should return raw references.
* Modules/webgpu/WebGPUPipelineStageDescriptor.h: Now shares a common base with GPUPipelineStageDescriptor.
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h: Now internally nullable.
(WebCore::WebGPURenderPipeline::renderPipeline const):
(WebCore::WebGPURenderPipeline::renderPipeline): Deleted.
* Modules/webgpu/WebGPURenderPipelineDescriptor.cpp:
(WebCore::WebGPUPipelineStageDescriptor::asGPUPipelineStageDescriptor const): Validate and convert a WebGPUPipelineStageDescriptor to GPU version.
(WebCore::WebGPURenderPipelineDescriptor::asGPURenderPipelineDescriptor const): Ditto for WebGPURenderPipelineDescriptor.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Now shares a base class and some instance variables with GPURenderPipelineDescriptor.
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Update GPUPrimitiveTopology for new style and add colorStates.
* Modules/webgpu/WebGPUShaderModule.idl: Small pilot to test using InterfaceName to easily rename DOM-facing interfaces.
* Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Removed.
* Modules/webgpu/WebGPUVertexFormat.idl: Removed. Moved and updated in GPUVertexAttributeDescriptor.idl.
* Modules/webgpu/WebGPUVertexInputDescriptor.h: Removed.
* platform/graphics/gpu/GPUInputStateDescriptor.h:
* platform/graphics/gpu/GPUPipelineStageDescriptor.h:
(WebCore::GPUPipelineStageDescriptor::GPUPipelineStageDescriptor):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Add shared base class for Web/GPURenderPipelineDescriptor.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
* platform/graphics/gpu/GPUTextureFormat.h:
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setFunctionsForPipelineDescriptor): Make fragment required since descriptor validation fails if fragment function is not found right now.
(WebCore::mtlVertexFormatForGPUVertexFormat): Renamed from validateAndConvertVertexFormatToMTLVertexFormat.
(WebCore::mtlStepFunctionForGPUInputStepMode): Renamed from validateAndConvertStepModeToMTLStepFunction
(WebCore::trySetInputStateForPipelineDescriptor):
(WebCore::trySetColorStatesForColorAttachmentArray):
(WebCore::tryCreateMtlRenderPipelineState):
(WebCore::GPURenderPipeline::create):
(WebCore::validateAndConvertVertexFormatToMTLVertexFormat): Deleted.
(WebCore::validateAndConvertStepModeToMTLStepFunction): Deleted.
* platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
(WebCore::platformTextureFormatForGPUTextureFormat):
* platform/graphics/gpu/GPUColorStateDescriptor.h: Added.
Misc:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setPipeline):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::primitiveTopology const):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setPipeline):
(WebCore::primitiveTypeForGPUPrimitiveTopology):
2019-03-12 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Reset state when touchStart does not turn into click.
https://bugs.webkit.org/show_bug.cgi?id=195603
<rdar://problem/48796582>
Reviewed by Simon Fraser.
Add reset() function to assert and reset the current state.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::willNotProceedWithClick):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
2019-03-12 Timothy Hatcher <timothy@apple.com>
Expose document attributes and body background color through HTMLConverter.
https://bugs.webkit.org/show_bug.cgi?id=195636
rdar://problem/45055697
Reviewed by Tim Horton.
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::convert):
(WebCore::attributedStringFromRange):
(WebCore::attributedStringFromSelection):
(WebCore::attributedStringBetweenStartAndEnd):
2019-03-12 Antti Koivisto <antti@apple.com>
Compositing layer that renders two positioned elements should not hit test
https://bugs.webkit.org/show_bug.cgi?id=195371
<rdar://problem/48649586>
Reviewed by Simon Fraser.
Followup to fix the test case (fast/scrolling/ios/overflow-scroll-overlap-2.html)
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setEventRegion):
Revert a last minute change (that was done to fix a Mac displaylist test).
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
Compute the region on iOS only for now (it is not used on other platforms).
2019-03-12 Dean Jackson <dino@apple.com>
[WebGL] WebGLBuffer can be too large
https://bugs.webkit.org/show_bug.cgi?id=195068
<rdar://problem/48414289>
Reviewed by Antoine Quint.
When creating an element array buffer, make sure to
test against the maximum size of an ArrayBuffer, rather
than just assume it can be created.
Test: fast/canvas/webgl/largeBuffer.html
* html/canvas/WebGLBuffer.cpp:
(WebCore::WebGLBuffer::associateBufferDataImpl):
2019-03-12 Sihui Liu <sihui_liu@apple.com>
Layout Test imported/w3c/web-platform-tests/IndexedDB/fire-*-event-exception.html are failing
https://bugs.webkit.org/show_bug.cgi?id=195581
Reviewed by Brady Eidson.
Uncaught exceptions should be handled after IDBRequest dispatches events so that IDBTransaction would stay
active during event dispatch.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
* Modules/indexeddb/IDBRequest.h:
2019-03-12 Sihui Liu <sihui_liu@apple.com>
Layout Test imported/w3c/web-platform-tests/IndexedDB/transaction-abort-request-error.html is failing
https://bugs.webkit.org/show_bug.cgi?id=195570
Reviewed by Brady Eidson.
IDBRequest result should be undefined if it is never set.
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
2019-03-12 Youenn Fablet <youenn@apple.com>
Rename originsMatch in originSerializationsMatch
https://bugs.webkit.org/show_bug.cgi?id=195572
Reviewed by Jiewen Tan.
In addition to renaming, make use of SecurityOrigin::isSameOriginAs
where it makes more sense than to compare origin serialization.
The main difference is that isSameOriginAs will return false for two different unique origins
while originsSerializationsMatch will not.
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::doesHaveSameOriginAsItsAncestors):
* Modules/mediastream/RTCController.cpp:
(WebCore::matchDocumentOrigin):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::certificatesFromConfiguration):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
* page/SecurityOrigin.cpp:
(WebCore::serializedOriginsMatch):
(WebCore::originsMatch): Deleted.
* page/SecurityOrigin.h:
2019-03-12 Zalan Bujtas <zalan@apple.com>
[Synthetic Click] Dispatch mouseout soon after mouseup
https://bugs.webkit.org/show_bug.cgi?id=195575
<rdar://problem/47093049>
Reviewed by Simon Fraser.
Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::dispatchFakeMouseOut):
2019-03-12 Ryosuke Niwa <rniwa@webkit.org>
In CachedFrame's constructor, release-assert that DOMWindow still has a frame after page-caching subframes
https://bugs.webkit.org/show_bug.cgi?id=195609
Reviewed by Chris Dumez.
r242677 added release assertions to DOMWindow::suspendForPageCache. But when the first release assert in
that function is hit, we still can't tell whether active DOM objects are detaching frames, or if creating
CachedFrame's on one of subframes is causing the frame to go way.
Add a release assertion immediately after creating CachedFrame on subframes to detect this case.
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
2019-03-12 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Stop content change observation when the touch event turns into long press
https://bugs.webkit.org/show_bug.cgi?id=195601
<rdar://problem/48796324>
Reviewed by Wenson Hsieh.
Cancel the ongoing content observation (started at touchStart) when the touch event does not turn into a tap gesture.
Not testable because any subsequent tap would reset the state anyway (though it might be measurable through some code triggering heavy content change).
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didRecognizeLongPress):
(WebCore::ContentChangeObserver::willNotProceedWithClick):
* page/ios/ContentChangeObserver.h:
2019-03-12 Antti Koivisto <antti@apple.com>
Compositing layer that renders two positioned elements should not hit test
https://bugs.webkit.org/show_bug.cgi?id=195371
<rdar://problem/48649586>
Reviewed by Simon Fraser.
Compute and pass an event region for layers if it differs from layer bounds.
This patch fixes various block overflow and layer expansion cases. It does not handle
overflowing line boxes yet (it adds tests for those too).
Test: fast/scrolling/ios/overflow-scroll-overlap-2.html
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setEventRegion):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::eventRegion):
* platform/graphics/Region.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setEventRegion):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateEventRegion):
Pass the region via the main platform layer of the graphics layer.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* rendering/PaintInfo.h:
* rendering/PaintPhase.h:
Add EventRegion paint phase that computes the region instead of painting anything.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintObject):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintForegroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
Invoke EventRegion paint phase.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintIntoLayer):
Request event region when pointing a layer.
2019-03-12 Philippe Normand <pnormand@igalia.com>
[GStreamer][v4l2] Synchronous video texture flushing support
https://bugs.webkit.org/show_bug.cgi?id=195453
Reviewed by Xabier Rodriguez-Calvar.
The v4l2 video decoder currently requires that downstream users of
the graphics resources complete any pending draw call and release
resources before returning from the DRAIN query.
To accomplish this the player monitors the pipeline and whenever a
v4l2 decoder is added, synchronous video texture flushing support
is enabled. Additionally and for all decoder configurations, a
flush is performed before disposing of the player.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
Monitor elements added to the decodebin bin.
(WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
a flag if a v4l2 decoder was added in decodebin.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
to the deep-element-added signal so as to monitor pipeline
topology updates.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
Flush video texture before disposing of the player.
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
Synchronously flush if the pipeline contains a v4l2 decoder.
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
boolean flag used mostly to trigger synchronous flush conditions.
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
Optionally drop the current buffer in a synchronous manner. By
default the method keeps operating asynchronously.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2019-03-12 Ryosuke Niwa <rniwa@webkit.org>
Move the remaining code to decide whether site specific quirks are needed to Quirks class
https://bugs.webkit.org/show_bug.cgi?id=195610
Reviewed by Antti Koivisto.
Moved the remaining code scattered across WebCore to decide whether a site specific quirk
is needed or not to Quirks class introduced in r236818.
* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk): Deleted.
(WebCore::processInvalidSignal):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::needsMouseFocusableQuirk const):
* html/HTMLMediaElement.cpp:
(WebCore::needsAutoplayPlayPauseEventsQuirk): Deleted.
(WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks):
(WebCore::needsSeekingSupportQuirk): Deleted.
(WebCore::HTMLMediaElement::supportsSeeking const):
* html/MediaElementSession.cpp:
(WebCore::needsArbitraryUserGestureAutoplayQuirk): Deleted.
(WebCore::needsPerDocumentAutoplayBehaviorQuirk): Deleted.
(WebCore::MediaElementSession::playbackPermitted const):
* page/Quirks.cpp:
(WebCore::allowedAutoplayQuirks): Added.
(WebCore::Quirks::needsQuirks const): Added.
(WebCore::Quirks::shouldIgnoreInvalidSignal const): Added.
(WebCore::Quirks::needsFormControlToBeMouseFocusable const): Added.
(WebCore::Quirks::needsAutoplayPlayPauseEvents const): Added.
(WebCore::Quirks::needsSeekingSupportDisabled const): Addd.
(WebCore::Quirks::needsPerDocumentAutoplayBehavior const): Added.
(WebCore::Quirks::shouldAutoplayForArbitraryUserGesture const): Added.
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): Added.
(WebCore::Quirks::hasWebSQLSupportQuirk const): Fixed the coding style.
* page/Quirks.h:
2019-03-12 Enrique Ocaña González <eocanha@igalia.com>
[Media][MSE] Don't emit timeUpdate after play() if currentTime hasn't changed
https://bugs.webkit.org/show_bug.cgi?id=195454
Reviewed by Jer Noble.
This change fixes YouTube 2019 MSE Conformance Tests "26. SFRPausedAccuracy"
and "27. HFRPausedAccuracy".
The first timeUpdate event after play() is omitted, because currentTime
doesn't actually change in that scenario.
Tests 26 and 27 measure the time drift (real time vs. media time) on playback
and start counting since the first timeUpdate event. In WebKit, that event
happens at play(), before the pipeline has completed the transition to playing.
Therefore, the real time inherits this startup delay and the test thinks that
the player has drifted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal): Don't emit a timeUpdated event unless currentTime has changed.
2019-03-12 Enrique Ocaña González <eocanha@igalia.com>
[EME][GStreamer] Speculative build fix
https://bugs.webkit.org/show_bug.cgi?id=195614
Unreviewed speculative WPE build fix after r242776.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: Added missing include.
2019-03-12 Philippe Normand <pnormand@igalia.com>
[GStreamer] remove legacy GStreamer version checks
https://bugs.webkit.org/show_bug.cgi?id=195552
Reviewed by Xabier Rodriguez-Calvar.
We require GStreamer 1.8.x so version checks below that make
little sense. Also checks for odd minor version numbers make sense
only for the latest GStreamer git development version.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitElements):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2019-03-12 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] generateRequest was not using the sanitized init data
https://bugs.webkit.org/show_bug.cgi?id=195555
Reviewed by Jer Noble.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::generateRequest): Use sanitized init
data instead of the original one.
2019-03-12 Rob Buis <rbuis@igalia.com>
Implement further CORS restrictions
https://bugs.webkit.org/show_bug.cgi?id=188644
Reviewed by Darin Adler.
Verify that header value length is not greater than 128 [1]. Also implement
Step 5 of [2] to append values to existing header value when calling
Headers.append.
Tests: fetch/api/cors/cors-preflight-not-cors-safelisted.any.html
fetch/api/cors/cors-preflight-not-cors-safelisted.any.worker.html
fetch/api/headers/headers-no-cors.window.html
[1] https://fetch.spec.whatwg.org/#cors-safelisted-request-header
[2] https://fetch.spec.whatwg.org/#concept-headers-append
* Modules/fetch/FetchHeaders.cpp:
(WebCore::canWriteHeader):
(WebCore::appendToHeaderMap):
(WebCore::FetchHeaders::remove):
(WebCore::FetchHeaders::set):
(WebCore::FetchHeaders::filterAndFill):
* platform/network/HTTPParsers.cpp:
(WebCore::isCrossOriginSafeRequestHeader): verify that header length is not greater than 128
2019-03-11 Ryosuke Niwa <rniwa@webkit.org>
Remove OS X Server QuickTime plugin quirks
https://bugs.webkit.org/show_bug.cgi?id=195607
Reviewed by Brent Fulgham.
r87244 added a site specific quirk for Mac OS X Sever wiki pages.
However, the issue has since been resolved as of OS X Mountain Lion,
of which Apple has ended the support in September 2015.
Because the latest versions of Safari no longer supports non-Flash plugins,
the only scenario in which this quirk comes into play is when a third party app
which embeds WKWebView or WebKitLegacy loaded web pages on a OS X Server
running OS X Mountain Lion or earlier.
Given these observations, it's probably safe to remove this quirk from WebKit.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::hasFallbackContent const):
(WebCore::HTMLObjectElement::hasValidClassId):
(WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk): Deleted.
* html/HTMLObjectElement.h:
2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed speculative WPE build fix after r195586.
* platform/encryptedmedia/CDMInstance.h:
2019-03-12 Ryosuke Niwa <rniwa@webkit.org>
Remove MediaWiki site specific quirks
https://bugs.webkit.org/show_bug.cgi?id=195597
Reviewed by Simon Fraser.
r47383 added a site specific quirk for the KHTML workaround in MediaWiki.
Blink since removed this workaround:
https://github.com/chromium/chromium/commit/ecf84fc9c1a51c8ede7adfd0b0cba446d9a8caa0
Given Chrome has been shipping without this quirk for six years, it's safe to assume
this site specific quirk is no longer neeed for Web compatibility.
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
2019-03-11 Ryosuke Niwa <rniwa@webkit.org>
Remove OpenCube QuickMenu quirks from navigator.appVersion
https://bugs.webkit.org/show_bug.cgi?id=195600
Reviewed by Simon Fraser.
Remove the site specific quirk added in r35050 for OpenCube QuickMenu library for nwa.com
Blink removed this code back in 2013. The fact Chrome has been shipping successfully without
this quirk for six years is a good evidence that it's no longer needed for the Web compatibility.
* page/Navigator.cpp:
(WebCore::Navigator::appVersion const):
(WebCore::shouldHideFourDot): Deleted.
2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242763.
Causes layout test crashes on iOS simulator
Reverted changeset:
"[Synthetic Click] Dispatch mouseout soon after mouseup"
https://bugs.webkit.org/show_bug.cgi?id=195575
https://trac.webkit.org/changeset/242763
2019-03-11 Ross Kirsling <ross.kirsling@sony.com>
Add Optional to Forward.h.
https://bugs.webkit.org/show_bug.cgi?id=195586
Reviewed by Darin Adler.
* Modules/encryptedmedia/MediaKeyStatusMap.cpp:
* Modules/encryptedmedia/MediaKeyStatusMap.h:
* Modules/webauthn/apdu/ApduCommand.cpp:
* Modules/webauthn/apdu/ApduCommand.h:
* Modules/webauthn/apdu/ApduResponse.cpp:
* Modules/webauthn/apdu/ApduResponse.h:
* Modules/webauthn/fido/FidoHidMessage.cpp:
* Modules/webauthn/fido/FidoHidMessage.h:
* Modules/webauthn/fido/U2fCommandConstructor.cpp:
* Modules/webauthn/fido/U2fCommandConstructor.h:
* Modules/webdatabase/SQLTransaction.cpp:
* Modules/webdatabase/SQLTransaction.h:
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp:
* Modules/webgpu/WHLSL/WHLSLPrepare.h:
* Modules/webgpu/WebGPU.cpp:
* Modules/webgpu/WebGPU.h:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
* Modules/webgpu/WebGPUCommandBuffer.h:
* animation/WebAnimation.cpp:
* animation/WebAnimation.h:
* crypto/gcrypt/GCryptUtilities.cpp:
* crypto/gcrypt/GCryptUtilities.h:
* css/CSSStyleDeclaration.cpp:
* css/CSSStyleDeclaration.h:
* dom/TextDecoder.cpp:
* dom/TextDecoder.h:
* dom/UserGestureIndicator.cpp:
* dom/UserGestureIndicator.h:
* editing/ChangeListTypeCommand.cpp:
* editing/ChangeListTypeCommand.h:
* editing/EditingStyle.cpp:
* editing/EditingStyle.h:
* html/DOMFormData.cpp:
* html/DOMFormData.h:
* html/HTMLAllCollection.cpp:
* html/HTMLAllCollection.h:
* html/HTMLAnchorElement.cpp:
* html/HTMLAnchorElement.h:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
* html/canvas/Path2D.h:
* html/canvas/WebMetalEnums.cpp:
* html/canvas/WebMetalEnums.h:
* html/parser/HTMLParserIdioms.cpp:
* html/parser/HTMLParserIdioms.h:
* loader/ResourceCryptographicDigest.cpp:
* loader/ResourceCryptographicDigest.h:
* mathml/MathMLOperatorDictionary.cpp:
* mathml/MathMLOperatorDictionary.h:
* page/PerformanceEntry.cpp:
* page/PerformanceEntry.h:
* page/ResourceUsageData.h:
* platform/ReferrerPolicy.cpp:
* platform/ReferrerPolicy.h:
* platform/Theme.cpp:
* platform/Theme.h:
* platform/encryptedmedia/CDMInstance.h:
* platform/graphics/gpu/GPUDevice.cpp:
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/transforms/AffineTransform.cpp:
* platform/graphics/transforms/AffineTransform.h:
* platform/graphics/transforms/TransformState.cpp:
* platform/graphics/transforms/TransformState.h:
* platform/graphics/transforms/TransformationMatrix.cpp:
* platform/graphics/transforms/TransformationMatrix.h:
* platform/graphics/win/ImageDecoderDirect2D.cpp:
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/mediacapabilities/AudioConfiguration.h:
* platform/network/CacheValidation.cpp:
* platform/network/CacheValidation.h:
* platform/network/DataURLDecoder.cpp:
* platform/network/DataURLDecoder.h:
* platform/network/HTTPParsers.cpp:
* platform/network/HTTPParsers.h:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/CookieJarDB.h:
* platform/win/SearchPopupMenuDB.cpp:
* platform/win/SearchPopupMenuDB.h:
* rendering/ImageQualityController.cpp:
* rendering/ImageQualityController.h:
* svg/SVGToOTFFontConversion.cpp:
* svg/SVGToOTFFontConversion.h:
Remove unnecessary includes from headers.
2019-03-11 Jer Noble <jer.noble@apple.com>
REGRESSION(r236281): YouTube Movies fail with "video format" error
https://bugs.webkit.org/show_bug.cgi?id=195598
<rdar://problem/48782842>
Reviewed by Jon Lee.
Partially revert r236281 for YouTube.com.
* page/Quirks.cpp:
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
2019-03-11 Justin Fan <justin_fan@apple.com>
[Web GPU] BindGroups/Argument buffers: Move MTLBuffer creation from and GPUBindGroup validation to GPUDevice.createBindGroup
https://bugs.webkit.org/show_bug.cgi?id=195519
<rdar://problem/48781297>
Reviewed by Myles C. Maxfield.
Metal's Argument Buffers should not be tied directly to GPUBindGroupLayout; rather, create the MTLBuffer
in GPUBindGroup creation process.
Move GPUBindGroup validation out of setBindGroup and to GPUBindGroup creation for performance.
Covered by existing tests. No behavior change.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroup const):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBindGroup.cpp: Removed.
* platform/graphics/gpu/GPUBindGroup.h:
(WebCore::GPUBindGroup::vertexArgsBuffer): A buffer that arguments will be encoded into during setBindGroup.
(WebCore::GPUBindGroup::fragmentArgsBuffer): Ditto.
(WebCore::GPUBindGroup::boundBuffers const): A list of resources that are bound by this GPUBindGroup.
(WebCore::GPUBindGroup::boundTextures const): Ditto.
(WebCore::GPUBindGroup::layout const): Deleted.
(WebCore::GPUBindGroup::bindings const): Deleted.
* platform/graphics/gpu/GPUBindGroupLayout.h: No longer creating and retaining MTLBuffers.
(WebCore::GPUBindGroupLayout::vertexEncoder const):
(WebCore::GPUBindGroupLayout::fragmentEncoder const):
(WebCore::GPUBindGroupLayout::computeEncoder const):
(WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::isValid const): Deleted.
(WebCore::GPUBindGroupLayout::vertexArguments const): Deleted.
(WebCore::GPUBindGroupLayout::fragmentArguments const): Deleted.
(WebCore::GPUBindGroupLayout::computeArguments const): Deleted.
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::tryCreateMtlArgumentEncoder):
(WebCore::GPUBindGroupLayout::tryCreate):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
(WebCore::tryCreateArgumentEncoderAndBuffer): Deleted.
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm: Added.
(WebCore::tryCreateArgumentBuffer): Create and associate the MTLBuffer that backs the MTLArgumentEncoder.
(WebCore::tryGetResourceAsBufferBinding): Validate a GPUBindingResource.
(WebCore::trySetBufferOnEncoder): Encodes a GPUBufferBinding's MTLBuffer on a MTLArgumentEncoder.
(WebCore::tryGetResourceAsSampler): Ditto, for GPUSamplers.
(WebCore::trySetSamplerOnEncoder):
(WebCore::tryGetResourceAsTexture): Ditto, for GPUTextures.
(WebCore::trySetTextureOnEncoder):
(WebCore::GPUBindGroup::tryCreate): Most setBindGroup validation moved here.
(WebCore::GPUBindGroup::GPUBindGroup): Retains the resource references needed for setBindGroup.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setBindGroup): Most validation moved to GPUBindGroup::tryCreate().
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Deleted.
(WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Deleted.
(WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder): Deleted.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::useResource):
(WebCore::GPURenderPassEncoder::setVertexBuffer):
(WebCore::GPURenderPassEncoder::setFragmentBuffer):
Misc:
* platform/graphics/gpu/GPUCommandBuffer.cpp/h: Move missing includes to header.
2019-03-11 Zalan Bujtas <zalan@apple.com>
[Synthetic Click] Dispatch mouseout soon after mouseup
https://bugs.webkit.org/show_bug.cgi?id=195575
<rdar://problem/47093049>
Reviewed by Simon Fraser.
Let's fire a mouseout event when a click is submitted as the result of a tap. It helps to dismiss content which would otherwise require you to move the mouse (cases like control bar on youtube.com).
Test: fast/events/touch/ios/content-observation/mouse-out-event-should-fire-on-click.html
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::dispatchFakeMouseOut):
2019-03-11 Youenn Fablet <youenn@apple.com>
REGRESSION: (r242181) API test DragAndDropTests.ExternalSourcePlainTextToIFrame is Timing out
https://bugs.webkit.org/show_bug.cgi?id=195362
Reviewed by Alexey Proskuryakov.
Covered by API test no longer crashing.
* page/SecurityOrigin.cpp:
(WebCore::originsMatch):
String representation should only match if originsMatch returns true.
2019-03-11 Justin Fan <justin_fan@apple.com>
[Web GPU] Update GPUSwapChainDescriptor, GPUSwapChain and implement GPUCanvasContext
https://bugs.webkit.org/show_bug.cgi?id=194406
<rdar://problem/47892466>
Reviewed by Myles C. Maxfield.
GPUSwapChain no longer inherits from GPUBasedRenderingContext, and is now created from a GPUDevice.
WebGPURenderingContext is now GPUCanvasContext and delegates functionality to the GPUSwapChain, if it exists.
GPUQueue now implicitly presents the GPUSwapChain's current drawable at the task boundary, if one exists.
Creating a new GPUSwapChain with the same GPUCanvasContext invalidates the previous one and its drawable and pipeline attachments.
Calling GPUSwapChain::getCurrentTexture returns the same drawable within one task cycle.
Some mentions of "WebGPU" have been renamed to "Web GPU" and "gpu".
All Web GPU tests updated to match.
Add new files and symbols.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Rename some mentions of "webgpu" to "gpu".
* Modules/webgpu/DOMWindowWebGPU.cpp:
(WebCore::DOMWindowWebGPU::gpu):
(WebCore::DOMWindowWebGPU::gpu const):
* Modules/webgpu/DOMWindowWebGPU.h:
* Modules/webgpu/DOMWindowWebGPU.idl:
Replace WebGPURenderingContext with GPUCanvasContext.
* Modules/webgpu/GPUCanvasContext.cpp: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.cpp.
(WebCore::GPUCanvasContext::create):
(WebCore::GPUCanvasContext::GPUCanvasContext):
(WebCore::GPUCanvasContext::replaceSwapChain):
(WebCore::GPUCanvasContext::platformLayer const):
(WebCore::GPUCanvasContext::reshape):
(WebCore::GPUCanvasContext::markLayerComposited):
* Modules/webgpu/GPUCanvasContext.h: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.h.
* Modules/webgpu/GPUCanvasContext.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPURenderingContext.idl.
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebGPUType):
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::getContextWebGPU):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::contextAsScriptValue):
Update WebGPUSwapChain.
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUTextureFormat.idl: Add the other two texture formats supported by CAMetalLayer.
* Modules/webgpu/WebGPUDevice.cpp: Implement createSwapChain.
(WebCore::WebGPUDevice::createSwapChain const):
(WebCore::WebGPUDevice::getQueue const):
(WebCore::WebGPUDevice::getQueue): Deleted.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::create):
(WebCore::WebGPUSwapChain::WebGPUSwapChain):
(WebCore::WebGPUSwapChain::getCurrentTexture): Renamed from getNextTexture. Only returns the next drawable if the last was presented.
(WebCore::WebGPUSwapChain::destroy): Invalidate this GPUSwapChain and its textures and views.
(WebCore::WebGPUSwapChain::configure): Deleted.
(WebCore::WebGPUSwapChain::getNextTexture): Deleted.
(WebCore::WebGPUSwapChain::present): Deleted.
(WebCore::WebGPUSwapChain::reshape): Deleted.
(WebCore::WebGPUSwapChain::markLayerComposited): Deleted.
* Modules/webgpu/WebGPUSwapChain.h: Now a device-based object rather than a rendering context.
(WebCore::WebGPUSwapChain::swapChain const):
(WebCore::WebGPUSwapChain::WebGPUSwapChain): Deleted.
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
* platform/graphics/gpu/GPUDevice.cpp: Implement tryCreateSwapChain.
(WebCore::GPUDevice::tryCreateSwapChain const):
(WebCore::GPUDevice::getQueue const):
(WebCore::GPUDevice::getQueue): Deleted.
* platform/graphics/gpu/GPUDevice.h: Retain a reference to the current GPUSwapChain, if one exists.
(WebCore::GPUDevice::swapChain const):
* platform/graphics/gpu/GPUQueue.h:
* platform/graphics/gpu/GPUSwapChain.h:
(WebCore::GPUSwapChain::destroy):
* platform/graphics/gpu/GPUSwapChainDescriptor.h: Added.
* platform/graphics/gpu/GPUTextureFormat.h: Add the other two texture formats supported by CAMetalLayer.
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::commandBufferCommitted):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::tryCreate): Renamed from create to better fit functionality. Now retain a reference to the GPUDevice.
(WebCore::GPUQueue::GPUQueue):
(WebCore::GPUQueue::submit): Now checks state of all resources before marking them as committed or committing any resource.
In addition, schedules the current drawable to be presented after all commands have been submitted during this task cycle.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::useAttachments): Ensure that the command buffer is aware of any texture resources used as attachments.
(WebCore::GPURenderPassEncoder::tryCreate):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::tryGetSupportedPixelFormat): Supported texture formats are the intersection of Web GPU's texture formats and CAMetalLayer's.
(WebCore::setLayerShape):
(WebCore::tryCreateSwapLayer): Create and configure the CAMetalLayer backing the swap chain.
(WebCore::GPUSwapChain::tryCreate):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::tryGetCurrentTexture): Renamed from getNextTexture. Only returns a texture if the last one was presented.
(WebCore::GPUSwapChain::present):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::takeDrawable): Swaps out the current drawable so that it can be presented. The GPUSwapChain thus releases its reference to it.
(WebCore::GPUSwapChain::create): Deleted.
(WebCore::GPUSwapChain::setDevice): Deleted.
(WebCore::GPUSwapChain::setFormat): Deleted.
(WebCore::GPUSwapChain::getNextTexture): Deleted.
* platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
(WebCore::platformTextureFormatForGPUTextureFormat):
Misc:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Missing include.
2019-03-11 Chris Dumez <cdumez@apple.com>
Update device orientation & motion permission native SPI as per latest proposal
https://bugs.webkit.org/show_bug.cgi?id=195567
Reviewed by Youenn Fablet.
* dom/DeviceOrientationAndMotionAccessController.cpp:
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
* page/ChromeClient.h:
2019-03-11 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Dispatching reentrant "contextmenu" events may cause crashes
https://bugs.webkit.org/show_bug.cgi?id=195571
<rdar://problem/48086046>
Reviewed by Andy Estes.
Make ContextMenuController::handleContextMenuEvent robust against reentrancy by guarding it with a boolean flag.
As demonstrated in the test case, it is currently possible to force WebKit into a bad state by dispatching a
synthetic "contextmenu" event from within the scope of one of the "before(copy|cut|paste)" events triggered as
a result of handling a context menu event.
Test: fast/events/contextmenu-reentrancy-crash.html
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::handleContextMenuEvent):
* page/ContextMenuController.h:
2019-03-11 Andy Estes <aestes@apple.com>
[Apple Pay] Use PKPaymentAuthorizationController to present the Apple Pay UI remotely from the Networking service on iOS
https://bugs.webkit.org/show_bug.cgi?id=195530
<rdar://problem/48747164>
Reviewed by Alex Christensen.
* Modules/applepay/PaymentCoordinatorClient.h: Defined isWebPaymentCoordinator.
* page/Settings.yaml: Defined the applePayRemoteUIEnabled setting and reordered the other
Apple Pay settings.
2019-03-11 Alex Christensen <achristensen@webkit.org>
Soft linking to Reveal framework should be optional
https://bugs.webkit.org/show_bug.cgi?id=195576
<rdar://problem/46822452>
Reviewed by Megan Gardner.
Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.
* editing/cocoa/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
2019-03-11 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Reduce # of structures in JSGlobalObject initialization
https://bugs.webkit.org/show_bug.cgi?id=195498
Reviewed by Darin Adler.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
2019-03-11 Brent Fulgham <bfulgham@apple.com>
Remove obsolete runtime flag for StorageAccess API Prompt
https://bugs.webkit.org/show_bug.cgi?id=195564
<rdar://problem/37279014>
Reviewed by Chris Dumez.
This bug tracks the work of removing the obsolete flag that had been used to optionally
prevent display of the StorageAccess API prompt. We have since shipped the final version
of this feature with an always-on prompt, and should have removed this runtime flag.
No test changes because this has no change in behavior. Tests already assume the prompt
behavior, and did not test turning the flag off.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setStorageAccessPromptsEnabled): Deleted.
* testing/InternalSettings.h:
(): Deleted.
* testing/InternalSettings.idl:
2019-03-11 Eric Carlson <eric.carlson@apple.com>
Add web audio release logging
https://bugs.webkit.org/show_bug.cgi?id=195554
<rdar://problem/48767211>
Reviewed by Jer Noble.
No new tests, no functional change.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::AudioBasicInspectorNode):
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::setBuffer):
(WebCore::AudioBufferSourceNode::startPlaying):
* Modules/webaudio/AudioContext.cpp:
(WebCore::nextLogIdentifier):
(WebCore::AudioContext::AudioContext):
(WebCore::AudioContext::uninitialize):
(WebCore::AudioContext::stop):
(WebCore::AudioContext::createBufferSource):
(WebCore::AudioContext::createMediaElementSource):
(WebCore::AudioContext::createMediaStreamSource):
(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::willBeginPlayback):
(WebCore::AudioContext::startRendering):
(WebCore::AudioContext::fireCompletionEvent):
(WebCore::AudioContext::logChannel const):
* Modules/webaudio/AudioContext.h:
(WebCore::AudioContext::nextAudioNodeLogIdentifier):
(WebCore::AudioContext::nextAudioParameterLogIdentifier):
* Modules/webaudio/AudioDestinationNode.cpp:
(WebCore::AudioDestinationNode::AudioDestinationNode):
* Modules/webaudio/AudioNode.cpp:
(WebCore::convertEnumerationToString):
(WebCore::AudioNode::AudioNode):
(WebCore::AudioNode::~AudioNode):
(WebCore::AudioNode::setNodeType):
(WebCore::AudioNode::addInput):
(WebCore::AudioNode::addOutput):
(WebCore::AudioNode::connect):
(WebCore::AudioNode::disconnect):
(WebCore::AudioNode::setChannelCount):
(WebCore::AudioNode::setChannelCountMode):
(WebCore::AudioNode::setChannelInterpretation):
(WebCore::AudioNode::logChannel const):
* Modules/webaudio/AudioNode.h:
(WTF::LogArgument<WebCore::AudioNode::NodeType>::toString):
* Modules/webaudio/AudioParam.cpp:
(WebCore::AudioParam::AudioParam):
(WebCore::AudioParam::setValue):
(WebCore::AudioParam::connect):
(WebCore::AudioParam::disconnect):
(WebCore::AudioParam::logChannel const):
* Modules/webaudio/AudioParam.h:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::start):
(WebCore::AudioScheduledSourceNode::stop):
* Modules/webaudio/BiquadFilterNode.cpp:
(WebCore::BiquadFilterNode::BiquadFilterNode):
* Modules/webaudio/ChannelMergerNode.cpp:
(WebCore::ChannelMergerNode::ChannelMergerNode):
* Modules/webaudio/ChannelSplitterNode.cpp:
(WebCore::ChannelSplitterNode::ChannelSplitterNode):
* Modules/webaudio/ConvolverNode.cpp:
(WebCore::ConvolverNode::ConvolverNode):
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::initialize):
(WebCore::DefaultAudioDestinationNode::uninitialize):
(WebCore::DefaultAudioDestinationNode::enableInput):
(WebCore::DefaultAudioDestinationNode::setChannelCount):
* Modules/webaudio/DelayNode.cpp:
(WebCore::DelayNode::DelayNode):
* Modules/webaudio/DynamicsCompressorNode.cpp:
(WebCore::DynamicsCompressorNode::DynamicsCompressorNode):
* Modules/webaudio/GainNode.cpp:
(WebCore::GainNode::GainNode):
* Modules/webaudio/MediaElementAudioSourceNode.cpp:
(WebCore::MediaElementAudioSourceNode::MediaElementAudioSourceNode):
* Modules/webaudio/MediaStreamAudioSourceNode.cpp:
(WebCore::MediaStreamAudioSourceNode::MediaStreamAudioSourceNode):
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::startRendering):
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::setType):
(WebCore::OscillatorNode::setPeriodicWave):
* Modules/webaudio/OscillatorNode.h:
(WTF::LogArgument<WebCore::OscillatorNode::Type>::toString):
* Modules/webaudio/PannerNode.cpp:
(WebCore::PannerNode::PannerNode):
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::ScriptProcessorNode):
* Modules/webaudio/WaveShaperNode.cpp:
(WebCore::WaveShaperNode::WaveShaperNode):
(WebCore::WaveShaperNode::setCurve):
(WebCore::WaveShaperNode::setOversample):
* Modules/webaudio/WaveShaperNode.h:
(WTF::LogArgument<WebCore::WaveShaperNode::OverSampleType>::toString):
2019-03-11 Youenn Fablet <youenn@apple.com>
Make IDBDatabaseIdentifier take a ClientOrigin as member
https://bugs.webkit.org/show_bug.cgi?id=195544
Reviewed by Geoffrey Garen.
Instead of taking a top and a frame origin, make
make IDBDatabaseIdentifier take a ClientOrigin.
This allows reusing some ClientOrigin code
and will ease implementation of storage quota checking in
NetworkProcess, as quota managers are keyed by client origins.
No change of behavior.
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
(WebCore::IDBDatabaseIdentifier::databaseDirectoryRelativeToRoot const):
(WebCore::IDBDatabaseIdentifier::debugString const):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
(WebCore::IDBDatabaseIdentifier::operator== const):
(WebCore::IDBDatabaseIdentifier::origin const):
(WebCore::IDBDatabaseIdentifier::isRelatedToOrigin const):
(WebCore::IDBDatabaseIdentifier::encode const):
(WebCore::IDBDatabaseIdentifier::decode):
* page/ClientOrigin.h:
(WebCore::ClientOrigin::isRelated const):
2019-03-11 Zan Dobersek <zdobersek@igalia.com>
Unreviewed. Manually rolling out r242701 and r242703 since the changes
are causing test timeouts and crashes on GTK and WPE.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer):
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
(): Deleted.
2019-03-11 Jer Noble <jer.noble@apple.com>
Use AVContentKeySession for "com.apple.fps.2_0" CDM version when AVStreamSession is absent
https://bugs.webkit.org/show_bug.cgi?id=195462
<rdar://problem/48712306>
Reviewed by Eric Carlson.
The difference between "com.apple.fps.2_0" and "3_0" is a protocol difference more than an
implementation difference. In "2_0", the "EME nitialization" data comes in the form of a "content
identifier", while the true initialization data is retrieved through a side channel directly from
the attached element. In "3_0", the "EME initialization data" is the exact initialization data
given by the parser, with no "content identifier" at all.
In the original implementation, the "2_0" used AVStreamSession, and "3_0" used AVContentKeySession,
but in the absense of AVStreamSession, those protocol differences are minor and can be implemented
using AVContentKeySession.
Changes:
- Add a new helper struct in CDMPrivateMediaSourceAVFObjC that represents the parsed parameters
of the CDM string.
- Add an "initData()" accessor to SourceBufferPrivateAVFObjC so that the "2_0" path can implement
the side channel access to the necessary initialization data.
- Refactor some of the SPI code to not re-declare unnecessary APIs.
- In CDMSessionAVContentKeySession::generateKeyRequest(), this function can never be called twice
so it is a logical impossibility to have a certificate at this point. Remove all this if() code.
* Modules/encryptedmedia/legacy/LegacyCDM.cpp:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::parseKeySystem):
(WebCore::queryDecoderAvailability):
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystem):
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
(WebCore::validKeySystemRE): Deleted.
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::CDMSessionAVContentKeySession):
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::addParser):
(WebCore::CDMSessionAVContentKeySession::removeParser):
(WebCore::CDMSessionAVContentKeySession::contentKeySession):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::CDMSessionAVStreamSession):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2019-03-11 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242688, r242643, r242624.
Caused multiple layout test failures and crashes on iOS and macOS.
Reverted changeset:
"requestAnimationFrame should execute before the next frame"
https://bugs.webkit.org/show_bug.cgi?id=177484
https://trac.webkit.org/changeset/242624/webkit
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
* animation/DocumentAnimationScheduler.cpp: Added.
(WebCore::DocumentAnimationScheduler::create):
(WebCore::DocumentAnimationScheduler::DocumentAnimationScheduler):
(WebCore::DocumentAnimationScheduler::detachFromDocument):
(WebCore::DocumentAnimationScheduler::scheduleWebAnimationsResolution):
(WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution):
(WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution):
(WebCore::DocumentAnimationScheduler::displayRefreshFired):
(WebCore::DocumentAnimationScheduler::windowScreenDidChange):
(WebCore::DocumentAnimationScheduler::createDisplayRefreshMonitor const):
* animation/DocumentAnimationScheduler.h: Renamed from Source/WebCore/page/RenderingUpdateScheduler.h.
(WebCore::DocumentAnimationScheduler::lastTimestamp):
(WebCore::DocumentAnimationScheduler::isFiring const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::cacheCurrentTime):
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded):
(WebCore::DocumentTimeline::animationTimingDidChange):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::unscheduleAnimationResolution):
(WebCore::DocumentTimeline::animationResolutionTimerFired):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::scheduleNextTick):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
(WebCore::DocumentTimeline::resolveAnimationsForElement):
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted.
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::windowScreenDidChange):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate):
(WebCore::Document::animationScheduler):
(WebCore::Document::updateAnimationsAndSendEvents): Deleted.
(WebCore::Document::serviceRequestAnimationFrameCallbacks): Deleted.
* dom/Document.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceScriptedAnimations):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks): Deleted.
* dom/ScriptedAnimationController.h:
* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::willDisplayPage):
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
(WebCore::Page::updateIntersectionObservations):
(WebCore::Page::scheduleForcedIntersectionObservationUpdate):
(WebCore::Page::layoutIfNeeded): Deleted.
(WebCore::Page::renderingUpdate): Deleted.
(WebCore::Page::renderingUpdateScheduler): Deleted.
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::notifyFlushRequired):
* page/RenderingUpdateScheduler.cpp: Removed.
* page/ios/ContentChangeObserver.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
2019-03-11 Darin Adler <darin@apple.com>
Specify fixed precision explicitly to prepare to change String::number and StringBuilder::appendNumber floating point behavior
https://bugs.webkit.org/show_bug.cgi?id=195533
Reviewed by Brent Fulgham.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::changeValueByStep): Use numberToStringFixedPrecision.
(WebCore::AccessibilityNodeObject::changeValueByPercent): Ditto.
* accessibility/AccessibilityScrollbar.cpp:
(WebCore::AccessibilityScrollbar::setValue): Ditto.
* css/CSSFontVariationValue.cpp:
(WebCore::CSSFontVariationValue::customCSSText const): Use appendFixedPrecisionNumber.
* css/CSSGradientValue.cpp:
(WebCore::CSSLinearGradientValue::customCSSText const): Ditto.
(WebCore::CSSRadialGradientValue::customCSSText const): Ditto.
* css/CSSKeyframeRule.cpp:
(WebCore::StyleRuleKeyframe::keyText const): Ditto.
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSCubicBezierTimingFunctionValue::customCSSText const): Ditto.
(WebCore::CSSSpringTimingFunctionValue::customCSSText const): Ditto.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const): Ditto.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::completeURLsInAttributeValue const): Ditto.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::drawRulers): Use numberToStringFixedPrecision.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::toString const): Use appendFixedPrecisionNumber.
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Use numberToStringFixedPrecision.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::gcTimerString): Use numberToStringFixedPrecision.
* platform/LayoutUnit.h:
(WTF::ValueToString<WebCore::LayoutUnit>::string): Ditto.
* platform/graphics/Color.cpp:
(WebCore::Color::cssText const): Use appendFixedPrecisionNumber.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText const): Ditto.
* svg/SVGAngleValue.cpp:
(WebCore::SVGAngleValue::valueAsString const): Use numberToStringFixedPrecision.
* svg/SVGNumberListValues.cpp:
(WebCore::SVGNumberListValues::valueAsString const): Use appendFixedPrecisionNumber.
* svg/SVGPathStringBuilder.cpp:
(WebCore::appendNumber): Ditto.
(WebCore::appendPoint): Ditto.
* svg/SVGPointListValues.cpp:
(WebCore::SVGPointListValues::valueAsString const): Ditto.
* svg/SVGTransformValue.cpp:
(WebCore::SVGTransformValue::valueAsString const): Ditto.
* svg/properties/SVGPropertyTraits.h:
(WebCore::SVGPropertyTraits<float>::toString): Use numberToStringFixedPrecision.
(WebCore::SVGPropertyTraits<FloatPoint>::toString): Use appendFixedPrecisionNumber.
(WebCore::SVGPropertyTraits<FloatRect>::toString): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::dumpMarkerRects): Use appendFixedPrecisionNumber.
(WebCore::Internals::getCurrentCursorInfo): Ditto.
* xml/XPathValue.cpp:
(WebCore::XPath::Value::toString const): Use numberToStringFixedPrecision.
2019-03-11 Philippe Normand <pnormand@igalia.com>
Unreviewed, Non-GStreamer-GL build fix after r242701.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
2019-03-11 Philippe Normand <pnormand@igalia.com>
[GStreamer][v4l2] Synchronous video texture flushing support
https://bugs.webkit.org/show_bug.cgi?id=195453
Reviewed by Xabier Rodriguez-Calvar.
The v4l2 video decoder currently requires that downstream users of
the graphics resources complete any pending draw call and release
resources before returning from the DRAIN query.
To accomplish this the player monitors the pipeline and whenever a
v4l2 decoder is added, synchronous video texture flushing support
is enabled. Additionally and for all decoder configurations, a
flush is performed before disposing of the player.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbinDeepElementAddedCallback):
Monitor elements added to the decodebin bin.
(WebCore::MediaPlayerPrivateGStreamer::decodebinElementAdded): Set
a flag if a v4l2 decoder was added in decodebin.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Connect
to the deep-element-added signal so as to monitor pipeline
topology updates.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
Flush video texture before disposing of the player.
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
Synchronously flush if the pipeline contains a v4l2 decoder.
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): Monitor push events only.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::pushNextBuffer): New
boolean flag used mostly to trigger synchronous flush conditions.
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
Optionally drop the current buffer in a synchronous manner. By
default the method keeps operating asynchronously.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
2019-03-11 Antti Koivisto <antti@apple.com>
Rename contentOffsetInCompostingLayer to contentOffsetInCompositingLayer
https://bugs.webkit.org/show_bug.cgi?id=195553
Reviewed by Simon Fraser.
Less composting, more compositing.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::RenderLayerBacking::resetContentsRect):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateImageContents):
(WebCore::RenderLayerBacking::contentOffsetInCompositingLayer const):
(WebCore::RenderLayerBacking::contentsBox const):
(WebCore::RenderLayerBacking::backgroundBoxForSimpleContainerPainting const):
(WebCore::RenderLayerBacking::contentOffsetInCompostingLayer const): Deleted.
* rendering/RenderLayerBacking.h:
2019-03-10 Ross Kirsling <ross.kirsling@sony.com>
Invalid flags in a RegExp literal should be an early SyntaxError
https://bugs.webkit.org/show_bug.cgi?id=195514
Reviewed by Darin Adler.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
Consume YarrFlags.
2019-03-10 Tim Horton <timothy_horton@apple.com>
Add SPI to retrieve the set of text inputs in a given rect, and later focus one
https://bugs.webkit.org/show_bug.cgi?id=195499
Reviewed by Darin Adler.
New API tests: WebKit.RequestTextInputContext and WebKit.FocusTextInputContext
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::identifierForElement):
(WebCore::Document::elementWithIdentifier):
(WebCore::Document::identifiedElementWasRemovedFromDocument):
* dom/Document.h:
Add a mechanism where Document will vend an ObjectIdentifier for a given
element, and can (if possible) retrieve that element later.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
If an Element has an identifier created for it, inform Document to remove
it from the identifier map when the element is detached.
(WebCore::Element::createElementIdentifier):
* dom/Element.h:
* dom/ElementIdentifier.h: Added.
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::hasElementIdentifier const):
(WebCore::ElementRareData::setHasElementIdentifier):
(WebCore::ElementRareData::ElementRareData):
Store a bit indicating if the Element has had a identifier created for it,
so that we can avoid a hash lookup on every Element removal.
* dom/Node.h:
* html/HTMLTextFormControlElement.h:
2019-03-10 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Fix failing test cases
https://bugs.webkit.org/show_bug.cgi?id=195524
<rdar://problem/48745101>
Reviewed by Simon Fraser.
1. Do not start DOM timer install observation when we already detected change at touchstart.
2. hasPendingActivity() should only care about ContentChangeObserver flags.
3. Do not try to notify the client when we are in the mouseMoved dispatch call (currently it could happen
when a timer gets intalled and removed right away).
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::hasPendingActivity const):
(WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
2019-03-10 Simon Fraser <simon.fraser@apple.com>
ScrollingTree should have the final say on where layers go
https://bugs.webkit.org/show_bug.cgi?id=195507
Reviewed by Antti Koivisto.
Main thread layer flushing can race with scrolling tree layer changes on macOS, causing
flashing as layers jump around sometimes. We go to some lengths to avoid this by trying
not to touch properties on layers that are being interacted with (scrollableArea->setIsUserScroll in
updateScrollPositionAfterAsyncScroll()), but that's fragile.
This patch adds ScrollingTree::applyScrollingTreeLayerPositions(), which enters
ScrollingTree::applyLayerPositions() on the main thread/UI process. This traverses
the tree allowing each node to run their layer positioning logic.
For macOS WK2, this is called from TiledCoreAnimationDrawingArea::flushLayers() after flushCompositingStateIncludingSubframes().
For macOS WK2 with UI-side compositing, RemoteLayerTreeDrawingAreaProxy::commitLayerTree()
calls m_webPageProxy.scrollingCoordinatorProxy()->applyScrollingTreeLayerPositions().
iOS WK2 is unchanged, using viewportChangedViaDelegatedScrolling() which does the same thing, allowing
for the dynamic viewport changes that happen when zooming on iOS.
Testing this requires infrastructure that we don't have yet.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::applyScrollingTreeLayerPositions):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::applyScrollingTreeLayerPositions):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::applyLayerPositions):
(WebCore::ScrollingTree::applyLayerPositionsRecursive):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::applyLayerPositions):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* 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::relatedNodeScrollPositionDidChange):
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::applyLayerPositions):
(WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::applyLayerPositions):
2019-03-09 Andy Estes <aestes@apple.com>
[Apple Pay] CanMakePaymentsWithActiveCard and OpenPaymentSetup should be async messages
https://bugs.webkit.org/show_bug.cgi?id=195526
<rdar://problem/48745636>
Reviewed by Chris Dumez.
* Modules/applepay/PaymentCoordinatorClient.h:
* loader/EmptyClients.cpp:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
(WebCore::MockPaymentCoordinator::openPaymentSetup):
* testing/MockPaymentCoordinator.h:
2019-03-09 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Click event fires immediately on hover menu at seriouseats.com
https://bugs.webkit.org/show_bug.cgi?id=195520
<rdar://problem/48740098>
Reviewed by Simon Fraser.
Unfortunately seriouseats has a 300ms hover intent delay to deal with accidental menupane pop-ups. This page also hides this
non-fixed width menupane using absolute positioning and negative left.
Test: fast/events/touch/ios/content-observation/move-content-from-offscreen.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const): Content auhtors tend to use x - 1 values (where x = 10^y)
2019-03-09 Chris Dumez <cdumez@apple.com>
Add assertions to help debug crash under DOMWindowExtension::suspendForPageCache()
https://bugs.webkit.org/show_bug.cgi?id=195488
Reviewed by Ryosuke Niwa.
Try and figure out how the document can be detached from its frame while we're suspending
DOMWindowExtensions.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::suspendForPageCache):
* page/DOMWindow.h:
2019-03-09 Chris Dumez <cdumez@apple.com>
Simplify DOMWindowProperty code / handling
https://bugs.webkit.org/show_bug.cgi?id=195495
Reviewed by Ryosuke Niwa.
DOMWindowProperty code was unnecessarily complex because DOMWindowExtension inherited
from it and DOMWindowExtension needs a lot of information about the global object's
lifetime to communicate to the injected bbundle client. This subclassing is also
very confusing because a DOMWindowExtension is not a *property* on the Window object.
This patch updates DOMWindowExtension to stop subclassing DOMWindowProperty and
moves all the complexity from DOMWindowProperty to DOMWindowExtension.
DOMWindowProperty is now a very simple base class which merely has a WeakPtr to
the window and getters for the window and the frame.
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
(WebCore::DOMWindowIndexedDatabase::indexedDB):
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
There is no reason for DOMWindowIndexedDatabase to move its IDBFactory to a
separate data member which in PageCache. Script do not run while in PageCache.
Also, frames are nulled out while in the PageCache so the indexedDB() getter
would return null anyway while in PageCache.
* css/StyleMedia.idl:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::setDOMApplicationCache):
Store a WeakPtr to the DOMApplicationCache for safety.
(WebCore::ApplicationCacheHost::dispatchDOMEvent):
Do not fire events on the DOMApplicationCache if it is frameless to maintain
previous behavior. Previously, the DOMApplicationCache would have been nulled
out when detached from its frame so we would not have fired events.
* loader/appcache/ApplicationCacheHost.h:
* loader/appcache/DOMApplicationCache.cpp:
* loader/appcache/DOMApplicationCache.h:
Remove some unnecessary complexity. The ApplicationCacheHost is owned by the
DocumentLoader, which changes on navigation. There is therefore no reason to
null out the DOMApplicationCache on the ApplicationCacheHost when its gets
detached from its frame or enters PageCache.
* page/BarProp.idl:
* page/DOMSelection.idl:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDestroyCachedFrame):
(WebCore::DOMWindow::willDestroyDocumentInFrame):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::registerExtension):
(WebCore::DOMWindow::unregisterExtension):
(WebCore::DOMWindow::resetDOMWindowProperties): Removed.
Stop clearing some of the DOMWindow's properties when the document gets destroyed or when
the Window for the initial empty document gets reused on navigation. I think we used to
need this because DOMWindowProperty used to hold pointers to their frame. However, this
is no longer the case nowadays as DOMWindowProperty objects get their frame from their
Window.
(WebCore::DOMWindow::resetUnlessSuspendedForDocumentSuspension):
(WebCore::DOMWindow::suspendForPageCache):
(WebCore::DOMWindow::resumeFromPageCache):
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::DOMWindowExtension):
(WebCore::DOMWindowExtension::~DOMWindowExtension):
(WebCore::DOMWindowExtension::frame const):
(WebCore::DOMWindowExtension::suspendForPageCache):
(WebCore::DOMWindowExtension::resumeFromPageCache):
(WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
(WebCore::DOMWindowExtension::willDestroyGlobalObjectInFrame):
(WebCore::DOMWindowExtension::willDetachGlobalObjectFromFrame):
* page/DOMWindowExtension.h:
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::DOMWindowProperty):
* page/DOMWindowProperty.h:
(WebCore::DOMWindowProperty::window const):
* page/History.idl:
* page/Location.idl:
* page/Navigator.cpp:
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
* page/PerformanceNavigation.idl:
* page/PerformanceTiming.idl:
* page/Screen.idl:
* page/VisualViewport.cpp:
(WebCore::VisualViewport::scriptExecutionContext const):
* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPluginArray.idl:
2019-03-09 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Start observing for content change between touchEnd and mouseMoved start
https://bugs.webkit.org/show_bug.cgi?id=195510
<rdar://problem/48735695>
Reviewed by Simon Fraser.
This patch covers the observation of async changes triggered by touchStart/touchEnd (animations, timers, style recalcs).
Test: fast/events/touch/ios/content-observation/visibility-change-after-touch-end.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didCancelTouchEvent):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::setIsInBetweenTouchEndAndMouseMoved):
(WebCore::ContentChangeObserver::isInBetweenTouchEndAndMouseMoved const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
2019-03-08 Simon Fraser <simon.fraser@apple.com>
Make it clearer which data is protected by the two locks in ScrollingTree
https://bugs.webkit.org/show_bug.cgi?id=195501
Reviewed by Tim Horton.
Gather ScrollingTree member variables into two structs, and name the struct
members and the locks to make it clear which data is protected by each lock.
We only need to protect data read by multiple threads; these are the scrolling
thread, the event handling thread (which runs ThreadedScrollingTree::tryToHandleWheelEvent()),
and the main thread, which pokes various bits of pin/rubber-banding state.
Ideally the main thread would always push data to the scrolling thread via a commit,
but that's not what happens now.
Suspiciously, ScrollingTree::shouldHandleWheelEventSynchronously() uses the root node,
so should probably hold a lock shared with the scrolling thread (webkit.org/b/195502).
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
(WebCore::ScrollingTree::setMainFrameScrollPosition):
(WebCore::ScrollingTree::eventTrackingTypeForPoint):
(WebCore::ScrollingTree::isRubberBandInProgress):
(WebCore::ScrollingTree::setMainFrameIsRubberBanding):
(WebCore::ScrollingTree::isScrollSnapInProgress):
(WebCore::ScrollingTree::setMainFrameIsScrollSnapping):
(WebCore::ScrollingTree::setMainFramePinState):
(WebCore::ScrollingTree::setCanRubberBandState):
(WebCore::ScrollingTree::setScrollPinningBehavior):
(WebCore::ScrollingTree::scrollPinningBehavior):
(WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
(WebCore::ScrollingTree::latchedNode):
(WebCore::ScrollingTree::setLatchedNode):
(WebCore::ScrollingTree::clearLatchedNode):
(WebCore::ScrollingTree::scrollingTreeAsText):
(WebCore::ScrollingTree::touchActionDataAtPoint const):
(WebCore::ScrollingTree::mainFrameScrollPosition): Deleted.
(WebCore::ScrollingTree::mainFrameLayoutViewport): Deleted.
(WebCore::ScrollingTree::rubberBandsAtLeft): Deleted.
(WebCore::ScrollingTree::rubberBandsAtRight): Deleted.
(WebCore::ScrollingTree::rubberBandsAtBottom): Deleted.
(WebCore::ScrollingTree::rubberBandsAtTop): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::hasLatchedNode const):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
* platform/graphics/FloatPoint.h:
(WebCore::FloatPoint::isZero const):
2019-03-08 Simon Fraser <simon.fraser@apple.com>
Share some code that sets CALayer positions
https://bugs.webkit.org/show_bug.cgi?id=195485
Reviewed by Zalan Bujtas.
Share some code between ScrollingTreeStickyNode and ScrollingTreeFixedNode that sets the position
of a CALayer given the top-left location.
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeFixedNodeInternal::operator*): Deleted.
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeStickyNodeInternal::operator*): Deleted.
* platform/graphics/cocoa/WebCoreCALayerExtras.h:
* platform/graphics/cocoa/WebCoreCALayerExtras.mm:
(-[CALayer _web_setLayerTopLeftPosition:]):
2019-03-08 Chris Dumez <cdumez@apple.com>
Add support for Device Orientation / Motion permission API
https://bugs.webkit.org/show_bug.cgi?id=195329
<rdar://problem/47645367>
Reviewed by Geoffrey Garen.
Add support for Device Orientation / Motion permission API:
- https://github.com/w3c/deviceorientation/issues/57
Pages can add event listeners for 'deviceorientation' / 'devicemotion' events but
such events will not be fired until the page's JavaScript calls
DeviceOrientationEvent.requestPermission() / DeviceMotionEvent.requestPermission()
and the user grants the request.
The feature is currently behind an experimental feature flag, off by default.
Tests: fast/device-orientation/device-motion-request-permission-denied.html
fast/device-orientation/device-motion-request-permission-granted.html
fast/device-orientation/device-motion-request-permission-user-gesture.html
fast/device-orientation/device-orientation-request-permission-denied.html
fast/device-orientation/device-orientation-request-permission-granted.html
fast/device-orientation/device-orientation-request-permission-user-gesture.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/DeviceMotionEvent.h:
* dom/DeviceMotionEvent.idl:
* dom/DeviceOrientationAndMotionAccessController.cpp: Added.
(WebCore::DeviceOrientationAndMotionAccessController::DeviceOrientationAndMotionAccessController):
(WebCore::DeviceOrientationAndMotionAccessController::shouldAllowAccess):
(WebCore::DeviceOrientationAndMotionAccessController::setAccessState):
* dom/DeviceOrientationAndMotionAccessController.h: Added.
(WebCore::DeviceOrientationAndMotionAccessController::accessState const):
* dom/DeviceOrientationEvent.h:
* dom/DeviceOrientationEvent.idl:
* dom/DeviceOrientationOrMotionEvent.cpp: Added.
(WebCore::DeviceOrientationOrMotionEvent::requestPermission):
* dom/DeviceOrientationOrMotionEvent.h: Added.
* dom/DeviceOrientationOrMotionEvent.idl: Added.
* dom/DeviceOrientationOrMotionPermissionState.h: Added.
* dom/DeviceOrientationOrMotionPermissionState.idl: Added.
* dom/Document.cpp:
(WebCore::Document::deviceOrientationAndMotionAccessController):
* dom/Document.h:
* dom/Event.cpp:
* dom/MessagePort.cpp:
* dom/Microtasks.cpp:
* page/ChromeClient.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::deviceOrientationController const):
(WebCore::DOMWindow::deviceMotionController const):
(WebCore::DOMWindow::isAllowedToUseDeviceMotionOrientation const):
(WebCore::DOMWindow::isAllowedToAddDeviceMotionOrientationListener const):
(WebCore::DOMWindow::startListeningForDeviceOrientationIfNecessary):
(WebCore::DOMWindow::stopListeningForDeviceOrientationIfNecessary):
(WebCore::DOMWindow::startListeningForDeviceMotionIfNecessary):
(WebCore::DOMWindow::stopListeningForDeviceMotionIfNecessary):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.h:
* page/DeviceController.cpp:
(WebCore::DeviceController::hasDeviceEventListener const):
* page/DeviceController.h:
* page/Settings.yaml:
2019-03-08 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Expand "isConsideredClickable" to descendants
https://bugs.webkit.org/show_bug.cgi?id=195478
<rdar://problem/48724935>
Reviewed by Simon Fraser.
In StyleChangeScope we try to figure out whether newly visible content should stick (menu panes etc) by checking if it is clickable.
This works fine as long as all the visible elements are gaining new renderers through this style update processs.
However when an element becomes visible by a change other than display: (not)none, it's not sufficient to just check the element itself,
since it might not respond to click at all, while its descendants do.
A concrete example is a max-height value change on usps.com, where the max-height is on a container (menu pane).
This container itself is not clickable while most of its children are (menu items).
Test: fast/events/touch/ios/content-observation/clickable-content-is-inside-a-container.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredHidden const):
(WebCore::ContentChangeObserver::StyleChangeScope::isConsideredClickable const):
(WebCore::isConsideredHidden): Deleted.
* page/ios/ContentChangeObserver.h:
2019-03-08 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Cleanup adjustObservedState
https://bugs.webkit.org/show_bug.cgi?id=195470
<rdar://problem/48717823>
Reviewed by Simon Fraser.
This is in preparation for introducing an observation window from touchStart -> mouseMoved.
1. Cancel pending activities (future timers, pending stylesheet recalcs) when visible content change is detected.
2. The fixed time window takes care of notifying the client -timers, style recalcs during the window should not signal themselves.
3. Reset m_isObservingPendingStyleRecalc at StartedStyleRecalc instead of EndedStyleRecalc.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
(WebCore::ContentChangeObserver::styleRecalcDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::hasPendingActivity const):
(WebCore::ContentChangeObserver::isObservationTimeWindowActive const):
2019-03-08 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Add StartedDOMTimerExecution and StartedStyleRecalc
https://bugs.webkit.org/show_bug.cgi?id=195463
<rdar://problem/48714762>
Reviewed by Simon Fraser.
This is in preparation for introducing m_isObservingContentChanges flag to track observing state across events (touchStart -> mouseMoved).
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::domTimerExecuteDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingPendingStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingStyleRecalc const): Deleted.
2019-03-08 Chris Fleizach <cfleizach@apple.com>
AX: AOM accessibleclick does not work on iOS
https://bugs.webkit.org/show_bug.cgi?id=195423
<rdar://problem/48682110>
Reviewed by Joanmarie Diggs.
Return this value of this method so it can be surfaced to a higher level.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityActivate]):
2019-03-08 Chris Dumez <cdumez@apple.com>
imported/w3c/web-platform-tests/FileAPI/reading-data-section/filereader_error.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=195441
<rdar://problem/43437394>
Reviewed by Alexey Proskuryakov.
FileReader is an ActiveDOMObject, which means that FileReader::stop() gets called when
its script execution context is about to get destroyed. FileReader::stop() sets m_state
to DONE. FileReader::abort() would schedule an asynchronous task and then ASSERT that
m_state is not DONE, which would hit if FileReader::stop() had been called in between
the task being scheduled and its execution. To address the issue, have the task abort
early if isContextStopped() returns true.
Also replace calls to setPendingActivity() / unsetPendingActivity() with a
PendingActivity data member as mismatched call to those can lead to leaks.
* fileapi/FileReader.cpp:
(WebCore::FileReader::canSuspendForDocumentSuspension const):
No reason not to suspend if there is no pending read.
(WebCore::FileReader::stop):
(WebCore::FileReader::readInternal):
(WebCore::FileReader::abort):
(WebCore::FileReader::didFinishLoading):
(WebCore::FileReader::didFail):
* fileapi/FileReader.h:
2019-03-08 Zan Dobersek <zdobersek@igalia.com>
GLContextEGL: desired EGL config should search for 8-bit components by default
https://bugs.webkit.org/show_bug.cgi?id=195413
Reviewed by Carlos Garcia Campos.
The EGL config search in GLContextEGL should by default look for
RGBA8888 configurations while allowing RGB565 as an alternative.
This prevents from accidentally landing on an RGBA1010102
configuration that is available with some graphics stacks, and which is
not expected in e.g. window snapshotting that's done for layout test
output comparison.
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig): EGL config search should by
default request 8-bit color channels.
2019-03-08 Miguel Gomez <magomez@igalia.com>
Use a thread safe refcounter for FilterOperation.
https://bugs.webkit.org/show_bug.cgi?id=194149
Reviewed by Carlos Garcia Campos.
Use a thread safe refcounter for FilterOperation.
* platform/graphics/filters/FilterOperation.h:
2019-03-07 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Make more fields lazy in JSGlobalObject
https://bugs.webkit.org/show_bug.cgi?id=195449
Reviewed by Mark Lam.
Use arrayBufferConstructor() since getDirect does not work with lazy property.
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver][REGRESSION] Check if visibility change happens while dispatching mouseMoved
https://bugs.webkit.org/show_bug.cgi?id=195421
<rdar://problem/48682004>
Reviewed by Simon Fraser.
Visibility change might be triggered synchronously while dispatching mouseMoved event.
Test: fast/events/touch/ios/content-observation/visibility-change-happens-while-in-mousemoved.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::mouseMovedDidStart):
(WebCore::ContentChangeObserver::mouseMovedDidFinish):
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingContentChanges const):
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Check if max-height change triggers visible content change.
https://bugs.webkit.org/show_bug.cgi?id=195417
<rdar://problem/48680631>
Reviewed by Simon Fraser.
A fixed max-height non-zero value could indicate visible content change. usps.com uses this technique to show menu panes.
Test: fast/events/touch/ios/content-observation/visibility-change-is-max-height-change.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::isConsideredHidden):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::elementImplicitVisibility): Deleted.
* page/ios/ContentChangeObserver.h:
2019-03-07 Yusuke Suzuki <ysuzuki@apple.com>
Unreviewed, fix failing EWS build for ios-sim
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::touchEventDidStart):
2019-03-07 Eric Carlson <eric.carlson@apple.com>
[MSE] Adopt new AVSampleBufferDisplayLayer SPI
https://bugs.webkit.org/show_bug.cgi?id=195445
<rdar://problem/48480516>
Reviewed by Jer Noble.
No new tests, no functional change.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): Only register for
kCMSampleBufferConsumerNotification_BufferConsumed notiication when
-[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] isn't available.
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): Ditto, for unregistering.
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Use
-[AVSampleBufferDisplayLayer prerollDecodeWithCompletionHandler:] when possible.
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Click event fires immediately on hover menu at Ebbets.com
https://bugs.webkit.org/show_bug.cgi?id=195397
Reviewed by Simon Fraser.
This patch introduces TouchEventScope to track changes triggered by touch start.
Test: fast/events/touch/ios/content-observation/visibility-change-on-touch-start-simple.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::touchEventDidStart):
(WebCore::ContentChangeObserver::touchEventDidFinish):
(WebCore::ContentChangeObserver::mouseMovedDidStart):
(WebCore::ContentChangeObserver::mouseMovedDidFinish):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::TouchEventScope::TouchEventScope):
(WebCore::ContentChangeObserver::TouchEventScope::~TouchEventScope):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingContentChanges const):
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce fixed duration content observation
https://bugs.webkit.org/show_bug.cgi?id=195295
<rdar://problem/48579913>
Reviewed by Simon Fraser.
Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
we stop observing for content changes before they even get fired.
Test: fast/events/touch/ios/content-observation/visibility-change-happens-on-timer-hops.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::ContentChangeObserver):
(WebCore::ContentChangeObserver::startContentObservationForDuration):
(WebCore::ContentChangeObserver::completeDurationBasedContentObservation):
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::domTimerExecuteDidStart):
(WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
(WebCore::ContentChangeObserver::styleRecalcDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::cancelPendingActivities):
(WebCore::ContentChangeObserver::didSuspendActiveDOMObjects):
(WebCore::ContentChangeObserver::willDetachPage):
(WebCore::ContentChangeObserver::contentVisibilityDidChange):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::hasPendingActivity const):
2019-03-07 Said Abou-Hallawa <sabouhallawa@apple.com>
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484
Reviewed by Simon Fraser.
This change fixes two issues with animation timing:
1. Calling the requestAnimationFrame callbacks would have happened when
the DisplayLink fires. This may have happened even if the frame is
missed and no display is committed.
2. Style changes and layout triggered by script could trigger painting
at more than 60fps. CoreAnimation commits could happen at more than
60fps, although WindowServer will throttle those, and only some will
be shown on the screen.
This change introduces a new paint scheduling model where painting is
driven by a "RenderingUpdateScheduler", which only triggers paints once
per 16.7ms frame.
Code that previously scheduled a compositing layer flush now schedules a
"RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
callback. When the render happens, we service requestAnimationFrame callbacks,
Web Animations and intersection observations per the "Update the rendering"
step of the HTML Event Loop specification
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.
In the future, more rendering steps will be added to this code.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/AXObjectCacheMac.mm:
Fix layout tests by adding null check.
* animation/DocumentAnimationScheduler.cpp: Removed.
* animation/DocumentAnimationScheduler.h: Removed.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::animationTimingDidChange):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::unscheduleAnimationResolution):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::scheduleNextTick):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
Simplify this function by handling the case of no-animations separately.
(WebCore::DocumentTimeline::resolveAnimationsForElement):
Simplify the loop and delete hasPendingAcceleratedAnimations because it
is initialized to true and is not changed inside the loop.
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
(WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
There is no need to force update in resolveStyle(). notifyFlushRequired()
will be called eventually which will scheduleRenderingUpdate().
(WebCore::Document::prepareForDestruction):
(WebCore::Document::updateAnimationsAndSendEvents):
(WebCore::Document::serviceRequestAnimationFrameCallbacks):
(WebCore::Document::windowScreenDidChange):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Document::animationScheduler): Deleted.
* dom/Document.h:
(WebCore::Document::numberOfIntersectionObservers const):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
* dom/ScriptedAnimationController.h:
* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::layoutIfNeeded):
(WebCore::Page::renderingUpdate):
(WebCore::Page::renderingUpdateScheduler):
(WebCore::Page::willDisplayPage): Deleted.
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
(WebCore::Page::updateIntersectionObservations): Deleted.
(WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::notifyFlushRequired):
* page/ResourceUsageData.h:
Include header files that become missing because of adding
RenderingUpdateScheduler.cpp.
* page/RenderingUpdateScheduler.cpp: Added.
(WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
(WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
(WebCore::RenderingUpdateScheduler::startTimer):
(WebCore::RenderingUpdateScheduler::clearTimer):
(WebCore::RenderingUpdateScheduler::windowScreenDidChange):
(WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
(WebCore::RenderingUpdateScheduler::displayRefreshFired):
* page/RenderingUpdateScheduler.h: Added.
(WebCore::RenderingUpdateScheduler::create):
* page/ios/ContentChangeObserver.h:
Include header files that become missing because of adding
RenderingUpdateScheduler.cpp.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
2019-03-07 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Add a setting to be able to turn content change observation on/off
https://bugs.webkit.org/show_bug.cgi?id=195353
<rdar://problem/48626394>
Reviewed by Simon Fraser.
Move content observation tests to a dedicated directory.
Tests: fast/events/touch/ios/content-observation/click-instead-of-hover-simple.html
fast/events/touch/ios/content-observation/hover-when-style-change-is-async.html
fast/events/touch/ios/content-observation/stuck-with-hover-state.html
fast/events/touch/ios/content-observation/style-recalc-schedule-and-force-relalc.html
fast/events/touch/ios/content-observation/visibility-change-happens-at-the-second-timer.html
* page/Settings.yaml:
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const): Deleted.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState):
2019-03-07 John Wilander <wilander@apple.com>
Make sure an empty host matches the internal representation "nullOrigin" in WebCore::RegistrableDomain::matches()
https://bugs.webkit.org/show_bug.cgi?id=195435
Reviewed by Brent Fulgham.
No new tests. Tests are currently failing and will pass again with
this patch.
WebCore::RegistrableDomain::matches() is a quick way to compare a
RegistrableDomain with a URL. Since RegistrableDomain represents the
empty host as "nullOrigin," a URL with an empty host needs to match
that representation in WebCore::RegistrableDomain::matches().
Failure to do so caused debug assertions in fast/ layout tests after
https://trac.webkit.org/changeset/242603/webkit.
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::matches const):
2019-03-07 Justin Fan <justin_fan@apple.com>
Unreviewed build fixes since MTLClampToBorderColor is only supported on macOS.
* Modules/webgpu/GPUSamplerDescriptor.idl:
* platform/graphics/gpu/GPUSamplerDescriptor.h:
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Forgot include.
* platform/graphics/gpu/cocoa/GPUSamplerMetal.mm:
(WebCore::mtlAddressModeForAddressMode):
(WebCore::tryCreateMtlSamplerState):
(WebCore::mtlBorderColorForBorderColor): Deleted.
2019-03-07 Justin Fan <justin_fan@apple.com>
[Web GPU] GPUSampler implementation
https://bugs.webkit.org/show_bug.cgi?id=195427
<rdar://problem/48686011>
Reviewed by Dean Jackson.
Implement ability to create GPUSamplers and use them as pipeline resource bindings.
Test: texture-triangle-strip.html updated.
Add symbols to project:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
GPUSampler creation:
* Modules/webgpu/GPUSamplerDescriptor.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createSampler const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUSampler.cpp: Added.
(WebCore::WebGPUSampler::create):
(WebCore::WebGPUSampler::WebGPUSampler):
* Modules/webgpu/WebGPUSampler.h: Added.
(WebCore::WebGPUSampler::sampler const):
* Modules/webgpu/WebGPUSampler.idl: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateSampler const): Added.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUSampler.h: Added.
(WebCore::GPUSampler::platformSampler const):
* platform/graphics/gpu/GPUSamplerDescriptor.h: Added.
* platform/graphics/gpu/cocoa/GPUSamplerMetal.mm: Added.
(WebCore::mtlAddressModeForAddressMode):
(WebCore::mtlBorderColorForBorderColor):
(WebCore::mtlMinMagFilterForFilterMode):
(WebCore::mtlMipFilterForFilterMode):
(WebCore::tryCreateMtlSamplerState):
(WebCore::GPUSampler::tryCreate):
(WebCore::GPUSampler::GPUSampler):
Move GPUCompareFunction to Utils for shared use.
* platform/graphics/gpu/GPUCompareFunction.h:
* platform/graphics/gpu/GPUUtils.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlDepthStencilState):
(WebCore::validateAndConvertDepthCompareFunctionToMtl): Deleted.
* platform/graphics/gpu/cocoa/GPUUtilsMetal.mm:
(WebCore::platformTextureFormatForGPUTextureFormat):
(WebCore::platformCompareFunctionForGPUCompareFunction):
Expand bind groups to accept GPUSamplers:
* Modules/webgpu/WebGPUBindGroupBinding.h:
* Modules/webgpu/WebGPUBindGroupBinding.idl:
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const):
* platform/graphics/gpu/GPUBindGroupBinding.h:
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
(WebCore::GPUProgrammablePassEncoder::setResourceAsSamplerOnEncoder): Added.
(WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
Misc:
* Modules/webgpu/WebGPUTexture.cpp: Missing includes.
* Modules/webgpu/WebGPUTexture.h:
* Modules/webgpu/WebGPUSwapChain.cpp: Removed extra include.
2019-03-07 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242297.
https://bugs.webkit.org/show_bug.cgi?id=195430
Broke Microsoft Visio. (Requested by dydz on #webkit).
Reverted changeset:
"[iOS] Turn mouse event simulation on by default"
https://bugs.webkit.org/show_bug.cgi?id=195218
https://trac.webkit.org/changeset/242297
2019-03-07 Sihui Liu <sihui_liu@apple.com>
Crash in com.apple.WebCore: WebCore::IDBTransaction::pendingOperationTimerFired + 72
https://bugs.webkit.org/show_bug.cgi?id=195214
<rdar://problem/48461116>
Reviewed by Geoffrey Garen.
When IDBTransaction is ready to commit, a commit operation would be schedule to
m_pendingTransactionOperationQueue. If connection to IDBServer is lost, pending operations are moved to
m_transactionOperationsInProgressQueue and will be completed with TransactionOperation::doComplete. doComplete
executes complete function of the operation, clears the complete function, and then removes the operation from
m_transactionOperationsInProgressQueue. In doComplete, we do early return when complete function is null,
since the doComplete could be invoked twice due to the race conditions between receiving "operation complete"
message from server and client-side abort.
However, commit operation does not have a complete function because it should be the last operation of
transaction and it gets removed from queue in its perform function. A commit operation would not be removed from
m_transactionOperationsInProgressQueue because of the early return. It would be removed from
m_transactionOperationMap, which may hold the last ref to the commit operation, in
IDBTransaction::connectionClosedFromServer. In this case, when pendingOperationTimerFired is called later, the
commit operation left in m_transactionOperationsInProgressQueue would be used and found to be freed. We should
not use null check of complete function to decide whether an operation is completed.
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete):
2019-03-07 John Wilander <wilander@apple.com>
Resource Load Statistics: Log first-party navigations with link decoration
https://bugs.webkit.org/show_bug.cgi?id=195301
<rdar://problem/48569971>
Reviewed by Brent Fulgham.
Test: http/tests/resourceLoadStatistics/log-cross-site-load-with-link-decoration.html
This patch adds two new members to WebCore::ResourceLoadStatistics:
- topFrameLinkDecorationsFrom, a set of domains
- gotLinkDecorationFromPrevalentResource, a boolean state
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
2019-03-07 Simon Fraser <simon.fraser@apple.com>
[iOS WK] REGRESSION (r242132): Fixed position banners flicker and move when scrolling (Apple, Tesla, YouTube, Reddit)
https://bugs.webkit.org/show_bug.cgi?id=195396
rdar://problem/48518959
Reviewed by Antti Koivisto.
r242132 introduced two issues that contributed to jumpiness of position:fixed layers when scrolling.
First, ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling() would early return if the scroll position
hadn't changed. It also needs to check the supplied layoutViewport (if any), but in some cases running the
notifyRelatedNodesAfterScrollPositionChange() code is necessary even without a scroll position change:
if the web process has committed new scrolling tree state (e.g. with new fixed constraints) since
the last call, we have to run the layer positioning code to have fixed layers re-adjust their position relative
to the root. This was the primary bug fix.
Secondly, a layer tree commit can give ScrollingTreeFrameScrollingNode a new layout viewport, but we need to
adjust this by the scrolling tree's current scroll position in case it gets used before the next scroll.
Currently no way to test this, as it's very timing-dependent.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNode::scrollPositionAndLayoutViewportMatch):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollPositionAndLayoutViewportMatch):
(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
* page/scrolling/ScrollingTreeScrollingNode.h:
2019-03-07 Youenn Fablet <youenn@apple.com>
Introduce a quota manager for Cache API/Service Worker/IDB storage
https://bugs.webkit.org/show_bug.cgi?id=195283
Reviewed by Chris Dumez.
Introduce a generic quota manager and quota users to be used in Network Process.
Quota manager/users are scoped by client origin.
Quota manager is used to check for quota by an entity wanting to execute a storage task of a given taskSize.
Quota manager will check the current space used by all its quota users.
If the size + taskSize is above quota, it will call a function to try extend the quota.
In the meantime, the task (and all tasks that may be added) are queued.
Once the new quota is received, the quota manager will either allow or disallow the first task in the queue.
The quota manager will try to execute as many tasks as possible with the provided quota.
If some tasks are remaining and quota limit is hit, the quota manager will compute the space needed for all remaining requests
and do another quota extension request.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/ClientOrigin.h:
* storage/StorageQuotaManager.cpp: Added.
(WebCore::StorageQuotaManager::~StorageQuotaManager):
(WebCore::StorageQuotaManager::spaceUsage const):
(WebCore::StorageQuotaManager::requestSpace):
(WebCore::StorageQuotaManager::askForMoreSpace):
(WebCore::StorageQuotaManager::processPendingRequests):
* storage/StorageQuotaManager.h: Added.
(WebCore::StorageQuotaManager::StorageQuotaManager):
(WebCore::StorageQuotaManager::addUser):
(WebCore::StorageQuotaManager::removeUser):
* storage/StorageQuotaUser.h: Added.
2019-03-07 John Wilander <wilander@apple.com>
Resource Load Statistics: Make it possible to purge only script-accessible cookies
https://bugs.webkit.org/show_bug.cgi?id=195383
<rdar://problem/48570136>
Reviewed by Brent Fulgham.
Test: http/tests/resourceLoadStatistics/delete-script-accessible-cookies.html
This patch provides the ability to purge all script-accessible cookies while leaving
HttpOnly cookies in place.
* loader/CookieJar.h:
Added boolean enum IncludeHttpOnlyCookies for use as function parameter.
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
Support for the new IncludeHttpOnlyCookies flag.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
Stubbed out the new function and added a FIXME comment.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
Stubbed out the new function and added a FIXME comment.
2019-03-06 Mark Lam <mark.lam@apple.com>
Exception is a JSCell, not a JSObject.
https://bugs.webkit.org/show_bug.cgi?id=195392
Reviewed by Saam Barati.
* bridge/objc/objc_utility.h:
* bridge/objc/objc_utility.mm:
(JSC::Bindings::throwError):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::throwInvalidAccessError):
* bridge/runtime_object.h:
2019-03-07 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195241
Reviewed by Joseph Pecoraro.
No functionality change.
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::instances): Added.
(WebCore::CanvasRenderingContext::instancesMutex): Added.
(WebCore::CanvasRenderingContext::CanvasRenderingContext):
(WebCore::CanvasRenderingContext::~CanvasRenderingContext):
* html/canvas/WebGLProgram.h:
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::instances): Added.
(WebCore::WebGLProgram::instancesMutex): Added.
(WebCore::WebGLProgram::WebGLProgram):
(WebCore::WebGLProgram::~WebGLProgram):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::didCreateProgram):
(WebCore::InspectorCanvasAgent::willDeleteProgram):
(WebCore::InspectorCanvasAgent::bindCanvas): Added.
(WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
(WebCore::InspectorInstrumentation::didCreateProgram):
(WebCore::InspectorInstrumentation::willDeleteProgram):
2019-03-06 Ross Kirsling <ross.kirsling@sony.com>
[Win] Remove -DUCHAR_TYPE=wchar_t stopgap and learn to live with char16_t.
https://bugs.webkit.org/show_bug.cgi?id=195346
Reviewed by Fujii Hironori.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::appendLinkedFonts):
(WebCore::getLinkedFonts):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::fontFromDescriptionAndLogFont):
(WebCore::createGDIFont):
(WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/IconWin.cpp:
(WebCore::Icon::createIconForFiles):
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateMediaFoundation::startCreateMediaSource):
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::itemizeShapeAndPlace):
(WebCore::UniscribeController::shape):
* platform/network/win/DownloadBundleWin.cpp:
(WebCore::DownloadBundle::appendResumeData):
(WebCore::DownloadBundle::extractResumeData):
* platform/text/win/LocaleWin.cpp:
(WebCore::LCIDFromLocaleInternal):
(WebCore::LCIDFromLocale):
(WebCore::LocaleWin::getLocaleInfoString):
* platform/win/BString.cpp:
(WebCore::BString::BString):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::getWebLocData):
(WebCore::createGlobalData):
(WebCore::getFileDescriptorData):
(WebCore::getURL):
(WebCore::getCFData):
(WebCore::setCFData):
* platform/win/DragDataWin.cpp:
(WebCore::DragData::asFilenames const):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageIconForCachedImageFilename):
(WebCore::dragLabelFont):
* platform/win/MIMETypeRegistryWin.cpp:
(WebCore::mimeTypeForExtension):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::read):
(WebCore::filesystemPathFromUrlOrTitle):
(WebCore::Pasteboard::writeURLToDataObject):
(WebCore::createGlobalImageFileDescriptor):
(WebCore::createGlobalHDropContent):
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::signedPublicKeyAndChallengeString):
* platform/win/SharedBufferWin.cpp:
(WebCore::SharedBuffer::createFromReadingFile):
* rendering/RenderThemeWin.cpp:
(WebCore::fillFontDescription):
Use wchar helpers as needed.
2019-03-06 Devin Rousso <drousso@apple.com>
Web Inspector: DOM Debugger: event breakpoints still fire when breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=195377
<rdar://problem/48651645>
Reviewed by Joseph Pecoraro and Matt Baker.
Test: inspector/dom-debugger/event-listener-breakpoints.html
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
(WebCore::InspectorDOMDebuggerAgent::willFireTimer):
(WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame):
2019-03-06 Wenson Hsieh <wenson_hsieh@apple.com>
Crash when attempting to change input type while dismissing datalist suggestions
https://bugs.webkit.org/show_bug.cgi?id=195384
<rdar://problem/48563718>
Reviewed by Brent Fulgham.
When closing a datalist suggestion menu, WebPageProxy sends a message to WebPage instructing it to tell its
active datalist suggestions picker to close. However, for a myriad of reasons, the suggestions picker (kept
alive by its text input type) may have already gone away by this point. To mitigate this, make WebPage weakly
reference its active datalist suggestions picker.
Test: fast/forms/datalist/change-input-type-after-closing-datalist-suggestions.html
* platform/DataListSuggestionPicker.h:
Make DataListSuggestionPicker capable of being weakly referenced. Additionally, fix some minor preexisting
issues in this header (#imports instead of #includes, as well as an unnecessary include of IntRect.h).
2019-03-06 Ryan Haddad <ryanhaddad@apple.com>
Remove an unneeded assert that was added with r242113
https://bugs.webkit.org/show_bug.cgi?id=195391
Reviewed by Simon Fraser.
Many layout tests are failing ASSERT(m_mediaBufferingIsSuspended). Since m_mediaBufferingIsSuspended is
protected by an 'if' statement directly afterwards, the assertion should be safe to remove.
* page/Page.cpp:
(WebCore::Page::resumeAllMediaBuffering):
2019-03-06 Justin Fan <justin_fan@apple.com>
Unreviewed build fix. Replace a forward declaration with an include.
* Modules/webgpu/WebGPUTextureView.cpp:
* Modules/webgpu/WebGPUTextureView.h:
2019-03-06 Justin Fan <justin_fan@apple.com>
[Web GPU] GPUTexture and GPUTextureView updates, and related GPUBindGroup updates
https://bugs.webkit.org/show_bug.cgi?id=195347
Reviewed by Dean Jackson.
Implement the ability to display image data as a GPUTexture in the rendering pipeline. Improve GPUTexture and
GPUTextureView implementations. Rename various bind group classes to GPU* to match API.
Test: webgpu/texture-triangle-strip.html
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Update to validate GPUTextureView resources.
* Modules/webgpu/WebGPUCommandBuffer.cpp: Move instead of copy the converted view objects.
(WebCore::WebGPUCommandBuffer::copyBufferToTexture):
(WebCore::WebGPUCommandBuffer::copyTextureToBuffer):
(WebCore::WebGPUCommandBuffer::copyTextureToTexture):
* Modules/webgpu/WebGPUCommandBuffer.h:
(WebCore::WebGPUCommandBuffer::commandBuffer const): No longer returns const so used resources can be registered on it.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroupLayout const): Rename WebGPUBindGroupLayoutDescriptor and replace unnecessary rvalue reference.
* Modules/webgpu/WebGPUDevice.h: Ditto.
* Modules/webgpu/WebGPUDevice.idl: Ditto.
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::submit):
* Modules/webgpu/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::~WebGPUTexture): Clean up any resources created for and from this WebGPUTexture.
(WebCore::WebGPUTexture::createDefaultTextureView): Now returns an empty object other than null on failure.
(WebCore::WebGPUTexture::destroy):
(WebCore::WebGPUTexture::destroyImpl):
* Modules/webgpu/WebGPUTexture.h: Keep a list of any views created from this texture.
* Modules/webgpu/WebGPUTexture.idl: Enable destroy.
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::create):
(WebCore::WebGPUTextureView::WebGPUTextureView):
(WebCore::WebGPUTextureView::destroy):
* Modules/webgpu/WebGPUTextureView.h:
(WebCore::WebGPUTextureView::~WebGPUTextureView): Clean up any resources backing this WebGPUTextureView.
(WebCore::WebGPUTextureView::texture const):
(WebCore::WebGPUTextureView::texture): Deleted.
* platform/graphics/gpu/GPUBindGroupLayout.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::usedTextures const): Keep a list of all texture resources that will be used by this command buffer on submit.
(WebCore::GPUCommandBuffer::isEncodingPass const): Added to prevent multiple pass encoders from being active on one command buffer.
(WebCore::GPUCommandBuffer::setIsEncodingPass):
(WebCore::GPUCommandBuffer::useTexture):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBindGroupLayout const):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUPipelineLayout.cpp:
(WebCore::GPUPipelineLayout::GPUPipelineLayout):
* platform/graphics/gpu/GPUProgrammablePassEncoder.cpp:
(WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::setVertexBuffer):
(WebCore::GPUProgrammablePassEncoder::setFragmentBuffer):
(): Deleted.
* platform/graphics/gpu/GPUQueue.h:
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/GPUTexture.h:
(WebCore::GPUTexture::isReadOnly const):
(WebCore::GPUTexture::destroy):
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::MTLDataTypeForBindingType):
(WebCore::GPUBindGroupLayout::tryCreate):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::create):
(WebCore::GPUCommandBuffer::~GPUCommandBuffer): Ensure blitEncoder is ended before releasing it.
(WebCore::GPUCommandBuffer::endBlitEncoding):
(WebCore::GPUCommandBuffer::copyBufferToTexture): Ensure textures are marked for usage before submission occurs.
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
(WebCore::GPUCommandBuffer::copyTextureToTexture):
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::GPUDevice):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::endPass):
(WebCore::GPUProgrammablePassEncoder::setBindGroup): Now supports texture resources.
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Just moved.
(WebCore::GPUProgrammablePassEncoder::setResourceAsTextureOnEncoder):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit): Ensures destroyed GPUTextures are not submitted.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::tryCreate): Ensure any other encoders are ended before attempting to activate a new one.
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::endPass): Invalidates the MTLCommandEncoder upon success.
(WebCore::GPURenderPassEncoder::setPipeline):
(WebCore::GPURenderPassEncoder::setVertexBuffers):
(WebCore::GPURenderPassEncoder::draw):
(WebCore::GPURenderPassEncoder::useResource):
(WebCore::GPURenderPassEncoder::setVertexBuffer):
(WebCore::GPURenderPassEncoder::setFragmentBuffer):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::getNextTexture):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::storageModeForPixelFormatAndSampleCount):
Always create MTLStorageModePrivate textures on macOS, as Web GPU doesn't provide CPU access to textures anyway.
(WebCore::tryCreateMtlTextureDescriptor):
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::tryCreateDefaultTextureView): Renamed from createDefaultTextureView.
Update files and symbols in project:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Removed.
* Modules/webgpu/GPUBindGroupLayoutBinding.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutBinding.h.
* Modules/webgpu/GPUBindGroupLayoutBinding.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutBinding.idl.
* Modules/webgpu/GPUBindGroupLayoutDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h.
* Modules/webgpu/GPUBindGroupLayoutDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBindGroupLayoutDescriptor.idl.
* Modules/webgpu/GPUShaderStageBit.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.h.
* Modules/webgpu/GPUShaderStageBit.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUShaderStageBit.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2019-03-06 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Pack and unpack data at entry points and exit points
https://bugs.webkit.org/show_bug.cgi?id=193877
Reviewed by Dean Jackson.
This implements the bulk of the rest of the Metal code generation piece.
Specifically, this patch adds support for the packing and unpacking steps
at the beginning of the entry point functions and all returns from those
functions. It does this by creating an object, EntryPointScaffolding, that
knows how to emit all the helper types, packing / unpacking code, and the
function signature. This patch also accepts parts of the
PipelineStateDescriptor so we know the data layout we should be packing and
unpacking.
This is the last patch before enough of the compiler is present that we can
start testing it. The next patch will start porting the test suite.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp:
(WebCore::WHLSL::Metal::attributeForSemantic):
(WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
(WebCore::WHLSL::Metal::EntryPointScaffolding::mappedBindGroups const):
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceHelperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::resourceSignature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::builtInsSignature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledInputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::mangledOutputPath):
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpackResourcesAndNamedBuiltIns):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::VertexEntryPointScaffolding):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::signature):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::VertexEntryPointScaffolding::pack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::FragmentEntryPointScaffolding):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::signature):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::FragmentEntryPointScaffolding::pack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::ComputeEntryPointScaffolding):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::signature):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::ComputeEntryPointScaffolding::pack):
(WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::signature): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpack): Deleted.
(WebCore::WHLSL::Metal::EntryPointScaffolding::pack): Deleted.
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h:
(WebCore::WHLSL::Metal::EntryPointScaffolding::parameterVariables):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp:
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::visit):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::RenderFunctionDefinitionWriter):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeVertexMappedBindGroups):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::takeFragmentMappedBindGroups):
(WebCore::WHLSL::Metal::RenderFunctionDefinitionWriter::createEntryPointScaffolding):
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::ComputeFunctionDefinitionWriter):
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::takeMappedBindGroups):
(WebCore::WHLSL::Metal::ComputeFunctionDefinitionWriter::createEntryPointScaffolding):
(WebCore::WHLSL::Metal::sharedMetalFunctions):
(WebCore::WHLSL::Metal::metalFunctions):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h:
* Modules/webgpu/WHLSL/Metal/WHLSLMappedBindings.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp:
(WebCore::WHLSL::Metal::generateMetalCodeShared):
(WebCore::WHLSL::Metal::generateMetalCode):
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
(WebCore::WHLSL::Intrinsics::float2Type const):
* Modules/webgpu/WHLSL/WHLSLPipelineDescriptor.h: Added.
* Modules/webgpu/WHLSL/WHLSLPrepare.cpp: Added.
(WebCore::WHLSL::prepareShared):
(WebCore::WHLSL::prepare):
* Modules/webgpu/WHLSL/WHLSLPrepare.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h.
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.cpp: Added.
(WebCore::WHLSL::findEntryPoint):
(WebCore::WHLSL::matchMode):
(WebCore::WHLSL::matchResources):
(WebCore::WHLSL::matchInputsOutputs):
(WebCore::WHLSL::isAcceptableFormat):
(WebCore::WHLSL::matchVertexAttributes):
(WebCore::WHLSL::matchColorAttachments):
(WebCore::WHLSL::matchDepthAttachment):
(WebCore::WHLSL::matchSemantics):
* Modules/webgpu/WHLSL/WHLSLSemanticMatcher.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-03-06 Wenson Hsieh <wenson_hsieh@apple.com>
Move RenderObject::isTransparentOrFullyClippedRespectingParentFrames() to RenderLayer
https://bugs.webkit.org/show_bug.cgi?id=195300
Reviewed by Simon Fraser.
Move isTransparentOrFullyClippedRespectingParentFrames() from RenderObject to RenderLayer, since this function
asks questions about RenderLayers rather than their renderers. No change in behavior.
* rendering/RenderLayer.cpp:
(WebCore::enclosingFrameRenderLayer):
(WebCore::parentLayerCrossFrame):
Some static helpers currently in RenderObject that walk up the layer hierarchy through subframes are redundant
with static helpers in RenderLayer. Now that isTransparentOrFullyClippedRespectingParentFrames exists in
RenderLayer, simply use this existing helper instead and split logic to grab the enclosing layer around the
owner element of a frame into a separate helper.
* rendering/RenderLayer.h:
* rendering/RenderObject.cpp:
(WebCore::enclosingFrameRenderLayer): Deleted.
(WebCore::parentLayerCrossingFrameBoundaries): Deleted.
(WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const): Deleted.
Moved from RenderObject.
* rendering/RenderObject.h:
2019-03-06 Sihui Liu <sihui_liu@apple.com>
Assertion Failed: m_databaseQueue.isKilled() in UniqueIDBDatabase::~UniqueIDBDatabase()
https://bugs.webkit.org/show_bug.cgi?id=195073
<rdar://problem/48285200>
Reviewed by Geoffrey Garen.
r240931 removed a retain cycle between IDBConnectionToServer and IDBConnectionToServerDelegate, so
IDBConnectionToServerDelegate, or InProcessIDBServer would not live forever. When IDBDatabase is gone,
InProcessIDBServer would schedule a notifification to IDBServer with databaseConnectionClosed. IDBServer would
then notify UniqueIDBDatabase. When UniqueIDBDatabase finds all database connections are gone, it would acquires
its only reference pointer from IDBServer schedule and perform a shutdown that kills its database task queue.
The assertion failure tells us UniqueIDBDatabase was destructed at when IDBServer was destructed, which means
UniqueIDBDatabase had not acquired its pointer. It's probably because UniqueIDBDatabase had unfinished tasks or
the operation timer function had not been executed. Since UniqueIDBDatabase needs to complete shutdown process,
we should make IDBServer live as long as UniqueIDBDatabase by keeping a reference pointer of IDBServer in
UniqueIDBDatabase.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::UniqueIDBDatabase):
(WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
(WebCore::IDBServer::UniqueIDBDatabase::server):
2019-03-06 Rob Buis <rbuis@igalia.com>
Consider supporting the `referrerpolicy` attribute.
https://bugs.webkit.org/show_bug.cgi?id=179053
Reviewed by Darin Adler.
This patch adds 'referrerpolicy' attribute support for iframe.
If set, the value is restricted to the ReferrerPolicy enum, and
if valid it is used for the subframe load.
If not set or invalid, the current behavior is kept.
Tests: http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http-http.html
http/tests/referrer-policy-iframe/no-referrer-when-downgrade/cross-origin-http.https.html
http/tests/referrer-policy-iframe/no-referrer-when-downgrade/same-origin.html
http/tests/referrer-policy-iframe/no-referrer/cross-origin-http-http.html
http/tests/referrer-policy-iframe/no-referrer/cross-origin-http.https.html
http/tests/referrer-policy-iframe/no-referrer/same-origin.html
http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http-http.html
http/tests/referrer-policy-iframe/origin-when-cross-origin/cross-origin-http.https.html
http/tests/referrer-policy-iframe/origin-when-cross-origin/same-origin.html
http/tests/referrer-policy-iframe/origin/cross-origin-http-http.html
http/tests/referrer-policy-iframe/origin/cross-origin-http.https.html
http/tests/referrer-policy-iframe/origin/same-origin.html
http/tests/referrer-policy-iframe/same-origin/cross-origin-http-http.html
http/tests/referrer-policy-iframe/same-origin/cross-origin-http.https.html
http/tests/referrer-policy-iframe/same-origin/same-origin.html
http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http-http.html
http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/cross-origin-http.https.html
http/tests/referrer-policy-iframe/strict-origin-when-cross-origin/same-origin.html
http/tests/referrer-policy-iframe/strict-origin/cross-origin-http-http.html
http/tests/referrer-policy-iframe/strict-origin/cross-origin-http.https.html
http/tests/referrer-policy-iframe/strict-origin/same-origin.html
http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http-http.html
http/tests/referrer-policy-iframe/unsafe-url/cross-origin-http.https.html
http/tests/referrer-policy-iframe/unsafe-url/same-origin.html
* html/HTMLAttributeNames.in:
* html/HTMLFrameOwnerElement.h:
(WebCore::HTMLFrameOwnerElement::referrerPolicy const):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::setReferrerPolicyForBindings):
(WebCore::HTMLIFrameElement::referrerPolicyForBindings const):
(WebCore::HTMLIFrameElement::referrerPolicy const):
* html/HTMLIFrameElement.h:
* html/HTMLIFrameElement.idl:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::referrerPolicyAttributeEnabled const):
(WebCore::RuntimeEnabledFeatures::setReferrerPolicyAttributeEnabled):
* platform/ReferrerPolicy.cpp:
(WebCore::parseReferrerPolicy):
* platform/ReferrerPolicy.h:
2019-03-05 Takashi Komori <Takashi.Komori@sony.com>
[curl] Remove unnecessary file.
https://bugs.webkit.org/show_bug.cgi?id=195350
Reviewed by Fujii Hironori.
Removed unused file.
No new tests. No change in behavior.
* platform/network/curl/CookieJarCurlDatabase.cpp: Removed.
2019-03-05 Eric Liang <ericliang@apple.com>
AX: Add remote search support for keyboard focusable element search type
https://bugs.webkit.org/show_bug.cgi?id=195336
Reviewed by Chris Fleizach.
Added AXKeyboardFocusable search key to return default keyboard-focusable elements for accessibility.
Test: accessibility/mac/search-predicate-keyboard-focusable.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
(WebCore::AccessibilityObject::isKeyboardFocusable const):
* accessibility/AccessibilityObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(createAccessibilitySearchKeyMap):
2019-03-05 Don Olmstead <don.olmstead@sony.com>
[WinCairo] Enable CSS Typed OM
https://bugs.webkit.org/show_bug.cgi?id=195340
Reviewed by Myles C. Maxfield.
* bindings/js/CallTracerTypes.h:
2019-03-05 Sihui Liu <sihui_liu@apple.com>
Fix a typo in Web SQL quirk
https://bugs.webkit.org/show_bug.cgi?id=195338
Reviewed by Geoffrey Garen.
* page/Quirks.cpp:
(WebCore::Quirks::hasWebSQLSupportQuirk const):
2019-03-05 Daniel Bates <dabates@apple.com>
[iOS] Should not scroll when checkbox, radio, submit, reset, or button is spacebar activated
https://bugs.webkit.org/show_bug.cgi?id=195281
<rdar://problem/48564347>
Reviewed by Simon Fraser.
Do not call the base class's default event handler (HTMLTextFormControlElement::defaultEventHandler())
when WebCore sees a keydown of the spacebar as we consider such an event as handled.
Otherwise, calling the base class's default event handler ultimately gives the embedding
client a chance to wrongly handle the event. In the case of iOS, keydown of the spacebar
causes the page to scroll.
WebCore implements spacebar activation on keydown for form controls. For IE compatibility
WebCore does not mark such keydown events as handled so that a DOM keypress event will
be subsequently dispatched. The current logic only skips calling the base class's default
event handler if the DOM event was not marked handled. This is insufficient. We need to
know whether WebCore handled the event. If asking the input type to handle the key down
marks the DOM event as handled then, clearly, WebCore handled the event. However, if the
event is not marked as handled, but WebCore actually accounted for this event then we need
to know this so that we do not call the base class's default event handler and ultimately
the embedding client asking for an interpretation of the key event. Towards this, have
InputType::handleKeydownEvent() return a bit whether or not the base class's default
event handler should be invoked.
Tests: fast/events/ios/activating-button-should-not-scroll-page.html
fast/events/ios/activating-checkbox-should-not-scroll-page.html
fast/events/ios/activating-radio-button-should-not-scroll-page.html
fast/events/ios/activating-reset-button-should-not-scroll-page.html
fast/events/ios/activating-submit-button-should-not-scroll-page.html
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::handleKeydownEvent): Return ShouldCallBaseEventHandler::No
if WebCore handled the spacebar activation. Otherewise, return ShouldCallBaseEventHandler::Yes.
* html/BaseCheckableInputType.h:
* html/BaseChooserOnlyDateAndTimeInputType.cpp:
(WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent): Ditto.
* html/BaseChooserOnlyDateAndTimeInputType.h:
* html/BaseClickableWithKeyInputType.cpp:
(WebCore::BaseClickableWithKeyInputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
* html/BaseClickableWithKeyInputType.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::defaultEventHandler): Do not fallthrough and call the base class's default
event handler if the input type told us it handled the event regardless of whether the event was handled
from the perspective of the DOM.
* html/InputType.cpp:
(WebCore::InputType::handleKeydownEvent): Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
* html/InputType.h:
* html/NumberInputType.cpp:
(WebCore::NumberInputType::handleKeydownEvent):
* html/NumberInputType.h:
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
* html/RadioInputType.h:
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleKeydownEvent):
* html/RangeInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::handleKeydownEvent):
* html/SearchInputType.h:
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::handleKeydownEvent):
* html/TextFieldInputType.h:
Keep our current behavior by returning ShouldCallBaseEventHandler::Yes.
2019-03-05 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Implement Cookie Accept Policy.
https://bugs.webkit.org/show_bug.cgi?id=191645
Reviewed by Fujii Hironori.
Make Curl network layer respect to coookie accept policy.
This patch fixes tests below on TestRunner, but doesn't fix tests on DumpRenderTree.
Tests: http/tests/cookies/only-accept-first-party-cookies.html
http/tests/cookies/third-party-cookie-relaxing.html
http/tests/security/cookies/third-party-cookie-blocking-redirect.html
http/tests/security/cookies/third-party-cookie-blocking-user-action.html
http/tests/security/cookies/third-party-cookie-blocking-xslt.xml
http/tests/security/cookies/third-party-cookie-blocking.html
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::cookiesForSession):
(WebCore::CookieJarCurl::setCookiesFromDOM const):
(WebCore::CookieJarCurl::setCookiesFromHTTPResponse const):
(WebCore::CookieJarCurl::setCookieAcceptPolicy const):
(WebCore::CookieJarCurl::cookieAcceptPolicy const):
(WebCore::CookieJarCurl::getRawCookies const):
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::isEnabled const):
(WebCore::CookieJarDB::checkCookieAcceptPolicy):
(WebCore::CookieJarDB::hasCookies):
(WebCore::CookieJarDB::searchCookies):
(WebCore::CookieJarDB::canAcceptCookie):
(WebCore::CookieJarDB::setCookie):
(WebCore::CookieJarDB::setEnabled): Deleted.
* platform/network/curl/CookieJarDB.h:
(WebCore::CookieJarDB::setAcceptPolicy):
(WebCore::CookieJarDB::acceptPolicy const):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieAttributes):
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::handleCookieHeaders):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
2019-03-05 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Assert on if notify content change is allowed
https://bugs.webkit.org/show_bug.cgi?id=195332
<rdar://problem/48603276>
Reviewed by Simon Fraser.
Assert we don't notify the client about the state change while in handleSyntheticClick().
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::domTimerExecuteDidStart):
(WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::isNotifyContentChangeAllowed const):
2019-03-05 Said Abou-Hallawa <sabouhallawa@apple.com>
SVGPathSegList.insertItemBefore() should fail if the newItem belongs to an animating animPathSegList
https://bugs.webkit.org/show_bug.cgi?id=195333
<rdar://problem/48475802>
Reviewed by Simon Fraser.
Because the SVG1.1 specs states that the newItem should be removed from
its original list before adding it to another list,
SVGPathSegList.insertItemBefore() should fail if the new item belongs to
an animating animPathSegList since it is read-only.
Test: svg/dom/SVGPathSegList-insert-from-animating-animPathSegList.svg
* svg/SVGPathSegList.cpp:
(WebCore::SVGPathSegList::processIncomingListItemValue):
2019-03-05 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Send content change notification through adjustObservedState
https://bugs.webkit.org/show_bug.cgi?id=195328
<rdar://problem/48601143>
Reviewed by Simon Fraser.
Have a dedicated place for the notification logic.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::mouseMovedDidStart):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::registerDOMTimer): Deleted.
(WebCore::ContentChangeObserver::unregisterDOMTimer): Deleted.
(WebCore::ContentChangeObserver::notifyContentChangeIfNeeded): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::registerDOMTimer):
(WebCore::ContentChangeObserver::unregisterDOMTimer):
2019-03-05 Youenn Fablet <youenn@apple.com>
MockLibWebRTCPeerConnection is leaking some session description
https://bugs.webkit.org/show_bug.cgi?id=195315
<rdar://problem/47840038>
Reviewed by David Kilzer.
Make sure to release raw pointers given from WebCore to mock libwebrtc layer.
Covered by existing tests when run in leaks mode.
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
(WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
2019-03-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r242403.
Caused layout test crashes on iOS simulator.
Reverted changeset:
"[ContentChangeObserver] Introduce fixed duration content
observation"
https://bugs.webkit.org/show_bug.cgi?id=195295
https://trac.webkit.org/changeset/242403
2019-03-05 Frederic Wang <fwang@igalia.com>
Web Inspector: Better categorize CPU usage per-thread / worker
https://bugs.webkit.org/show_bug.cgi?id=194564
Unreviewed compilation fix.
* page/ResourceUsageData.h: Add missing headers.
2019-03-05 Frederic Wang <fwang@igalia.com>
Share more code for updating the state of frame scrolling nodes
https://bugs.webkit.org/show_bug.cgi?id=195254
Unreviewed compilation warning fix.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated): Add UNUSED_PARAM on non-Cocoa
platforms.
2019-03-05 Cathie Chen <cathiechen@igalia.com>
The include file in ScrollingStateFrameHostingNode.h is wrong.
https://bugs.webkit.org/show_bug.cgi?id=195280
Reviewed by Frédéric Wang.
* page/scrolling/ScrollingStateFrameHostingNode.h:
2019-03-04 Justin Fan <justin_fan@apple.com>
Unreviewed build fix for High Sierra.
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Should fix "global constructor" error.
2019-03-04 Brent Fulgham <bfulgham@apple.com>
Use a SQLite database to hold the ResourceLoadStatistics data
https://bugs.webkit.org/show_bug.cgi?id=194867
<rdar://problem/24240854>
Reviewed by Chris Dumez.
Add a new runtime feature flag to support use of an experimental database
back-end. Also expose some SQLite function calls for use outside of WebCore.
No change in functionality, so no new tests.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setItpDatabaseModeEnabled):
(WebCore::RuntimeEnabledFeatures::itpDatabaseModeEnabled const):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteStatement.h:
2019-03-04 Justin Fan <justin_fan@apple.com>
[Web GPU] Blitting function prototypes
https://bugs.webkit.org/show_bug.cgi?id=195224
<rdar://problem/48538902>
Reviewed by Dean Jackson.
Implement barebones GPUCommandBuffer::copy* prototypes while rounding out GPUTexture implementation details.
Test: webgpu/blit-commands.html
* Modules/webgpu/GPUOrigin3D.h: Added.
* Modules/webgpu/GPUOrigin3D.idl: Added.
* Modules/webgpu/WebGPUCommandBuffer.cpp: Add copy view struct implementations.
(WebCore::WebGPUBufferCopyView::asGPUBufferCopyView const): Added.
(WebCore::WebGPUTextureCopyView::asGPUTextureCopyView const): Added.
(WebCore::WebGPUCommandBuffer::copyBufferToBuffer): Added.
(WebCore::WebGPUCommandBuffer::copyBufferToTexture): Added.
(WebCore::WebGPUCommandBuffer::copyTextureToBuffer): Added.
(WebCore::WebGPUCommandBuffer::copyTextureToTexture): Added.
* Modules/webgpu/WebGPUCommandBuffer.h: Add new functions and supporting structs.
* Modules/webgpu/WebGPUCommandBuffer.idl: Ditto.
* Modules/webgpu/WebGPURenderPassDescriptor.cpp: Refactor constructors to copy the entire base class.
(WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor):
(WebCore::GPURenderPassDepthStencilAttachmentDescriptor::GPURenderPassDepthStencilAttachmentDescriptor):
(WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const):
(WebCore::attachment): Deleted.
* Modules/webgpu/WebGPUTexture.h:
(WebCore::WebGPUTexture::texture const): Added.
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::byteLength const): Added.
(WebCore::GPUBuffer::isTransferSource const): Added.
(WebCore::GPUBuffer::isTransferDestination const): Renamed from isTransferDst. Refactored for OptionSet API.
(WebCore::GPUBuffer::isVertex const): Ditto.
(WebCore::GPUBuffer::isUniform const): Ditto.
(WebCore::GPUBuffer::isStorage const): Ditto.
(WebCore::GPUBuffer::isMappable const): Ditto.
(WebCore::GPUBuffer::isMapWrite const): Ditto.
(WebCore::GPUBuffer::isMapRead const): Ditto.
* platform/graphics/gpu/GPUBufferUsage.h: Refactored for better bit flag style.
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::blitEncoder const): Added.
* platform/graphics/gpu/GPURenderPassDescriptor.h:
* platform/graphics/gpu/GPUTexture.h: Cache usage flags for reference.
(WebCore::GPUTexture::isTransferSrc const): Added.
(WebCore::GPUTexture::isTransferDst const): Added.
(WebCore::GPUTexture::isOutputAttachment const): Added.
* platform/graphics/gpu/GPUTextureUsage.h: Refactor to match GPUBufferUsage.h.
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferUsage): Renamed from validateBufferCreate, refactored for OptionSet.
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::setSubData): Add alignment check according to Metal docs.
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::create): No need to use this alias here.
(WebCore::GPUCommandBuffer::GPUCommandBuffer): Ditto.
(WebCore::GPUCommandBuffer::copyBufferToBuffer): Added.
(WebCore::GPUCommandBuffer::copyBufferToTexture): Added.
(WebCore::GPUCommandBuffer::copyTextureToBuffer): Added.
(WebCore::GPUCommandBuffer::copyTextureToTexture): Added.
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit): End encoding on the MTLCommandBuffer's blitCommandEncoder if it was used.
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::getNextTexture): Now provide usage flags to texture creation.
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::mtlTextureUsageForGPUTextureUsageFlags): Refactor validation.
(WebCore::tryCreateMtlTextureDescriptor): Ditto.
(WebCore::GPUTexture::tryCreate): Now provide usage flags to texture creation.
(WebCore::GPUTexture::create): Ditto.
(WebCore::GPUTexture::GPUTexture): Ditto.
(WebCore::GPUTexture::createDefaultTextureView): Ditto.
2019-03-04 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce fixed duration content observation
https://bugs.webkit.org/show_bug.cgi?id=195295
<rdar://problem/48579913>
Reviewed by Simon Fraser.
Some pages have a runloop-like scheduling setup where the content triggering change happens at a nested timer firing.
This patch helps finding cases like that using a 32ms long fixed window. Currently nested timers get dropped on the floor and
we stop observing for content changes before they even get fired.
Test: fast/events/touch/ios/visibility-change-happens-on-timer-hops.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::ContentChangeObserver):
(WebCore::ContentChangeObserver::startContentObservationForDuration):
(WebCore::ContentChangeObserver::stopDurationBasedContentObservation):
(WebCore::ContentChangeObserver::hasDeterminateState const):
(WebCore::ContentChangeObserver::adjustObservedState):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::hasPendingActivity const):
2019-03-04 Wenson Hsieh <wenson_hsieh@apple.com>
Native text selection UI is incorrectly suppressed in Microsoft Visio
https://bugs.webkit.org/show_bug.cgi?id=195178
<rdar://problem/48519394>
Reviewed by Darin Adler.
Currently, our heuristics for detecting hidden editable areas attempt to search for empty parent renderers with
"overflow: hidden". It does this by ascending the layer tree in search of renderers that have an empty content
size, and whose renderers' styles indicate that they have overflow: hidden in the X or Y directions. This fails
in the case where a child renderer is positioned out of flow, relative to one of its parent layers, since the
child will be visible, but we'll incorrectly believe that it is hidden. This leads to selection UI unexpectedly
disappearing in the online version of Microsoft Visio.
To fix this, we check whether the enclosing layer around the editable element has an empty clip rect; if the
element is inside of a subframe, we additionally walk up to each enclosing frame's layer and check if that
frame's layer has an empty clip rect.
Test: editing/selection/ios/do-not-hide-selection-in-visible-container.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
2019-03-01 Ryosuke Niwa <rniwa@webkit.org>
gPictureOwnerMap is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=195228
Reviewed by Zalan Bujtas.
Just store in HTMLImageElement. An extra pointer isn't going to affect the memory use here.
If anything, we should worry about m_editableImage and m_pendingClonedAttachmentID instead.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::pictureElement const):
(WebCore::HTMLImageElement::setPictureElement):
* html/HTMLImageElement.h:
2019-03-04 Daniel Bates <dabates@apple.com>
[iOS] Caret x-position in empty text area does not match text field
https://bugs.webkit.org/show_bug.cgi?id=195125
<rdar://problem/47161070>
Remove the word "use" in the added comment to make it read well.
* css/html.css:
(textarea):
2019-03-04 Joseph Pecoraro <pecoraro@apple.com>
ITMLKit Inspector: Data Bindings / Associated Data for nodes
https://bugs.webkit.org/show_bug.cgi?id=195290
<rdar://problem/48304019>
Reviewed by Devin Rousso.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getDataBindingsForNode):
(WebCore::InspectorDOMAgent::getAssociatedDataForNode):
Stub these for web pages, they will only be used for ITMLKit right now.
2019-03-04 Daniel Bates <dabates@apple.com>
[iOS] Caret x-position in empty text area does not match text field
https://bugs.webkit.org/show_bug.cgi?id=195125
<rdar://problem/47161070>
Reviewed by Darin Adler.
Fix up User Agent styles for <textarea> on iOS such that they have the same left padding
width and same text-indent as <input type="text">. This makes the x-position of the caret
in an empty textarea match the position of the caret in an empty text field.
Test: fast/forms/textarea/ios/caret-x-position-in-textarea-matches-textfield.html
* css/html.css:
(textarea): For iOS Family, do not use the padding shorthand property. Instead explicitly specify
padding-top and padding-bottom to be 2px to keep our current behavior (because it looks reasonable)
and do not specify left and right padding so that we inherit the padding set earlier in this file.
(textarea::placeholder): Deleted. This was added to "try" to make fix up the position of the placeholder
text so as to match the position of the textarea's inner text and the position of a text field's inner
text. This fix up may have worked out visually when it was added, but based on the discovery of the
hardcoded 3px left and right padding (see below remark) it looks like it was always one pixel too short.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle): Remove hardcoded 3px left and right padding.
2019-03-04 Youenn Fablet <youenn@apple.com>
Make sure to correctly notify of end of a ServiceWorkerJob when the context is stopped
https://bugs.webkit.org/show_bug.cgi?id=195195
Reviewed by Chris Dumez.
Before the patch, we were notifying that some jobs were finished too aggressively at context stop time.
This was confusing the Network Process.
Only notify such jobs that have pending loads.
Improve the tracking of jobs doing registration resolution to ensure the Network Process gets notified
in case of a registration promise being resolved but the settling callback being not yet called while the context is stopped.
Covered by existing tests not crashing anymore, in particular imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting.https.html.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::notifyRegistrationIsSettled):
(WebCore::ServiceWorkerContainer::stop):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::cancelPendingLoad):
* workers/service/ServiceWorkerJob.h:
(WebCore::ServiceWorkerJob::isLoading const):
2019-03-04 Chris Dumez <cdumez@apple.com>
[iOS] Improve our file picker
https://bugs.webkit.org/show_bug.cgi?id=195284
<rdar://problem/45655856>
Reviewed by Tim Horton and Wenson Hsieh.
Export UTIUtilities.h so that it can be used from WebKit2.
* WebCore.xcodeproj/project.pbxproj:
2019-03-04 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Decouple mouseMoved event and the "is observing content change" status.
https://bugs.webkit.org/show_bug.cgi?id=195286
Reviewed by Simon Fraser.
Now isObservingContentChanges returns true only when we are actively observing content change during timer firing and/or style recalculating.
This patch also renames a couple of functions to follow the didStart/didFinish pattern.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::domTimerExecuteDidStart):
(WebCore::ContentChangeObserver::domTimerExecuteDidFinish):
(WebCore::ContentChangeObserver::styleRecalcDidStart):
(WebCore::ContentChangeObserver::styleRecalcDidFinish):
(WebCore::ContentChangeObserver::mouseMovedDidStart):
(WebCore::ContentChangeObserver::mouseMovedDidFinish):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
(WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
(WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute): Deleted.
(WebCore::ContentChangeObserver::startObservingStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::startObservingMouseMoved): Deleted.
(WebCore::ContentChangeObserver::stopObservingMouseMoved): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::setShouldObserveDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::isObservingStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::shouldObserveStyleRecalc const): Deleted.
2019-03-04 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Offer @makeTypeError instead of exposing @TypeError
https://bugs.webkit.org/show_bug.cgi?id=193858
Reviewed by Mark Lam.
Use @makeTypeError instead.
* Modules/mediastream/RTCPeerConnection.js:
* Modules/mediastream/RTCPeerConnectionInternals.js:
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerClose):
(readableByteStreamControllerPullInto):
* Modules/streams/ReadableStream.js:
(cancel):
(pipeTo):
* Modules/streams/ReadableStreamBYOBReader.js:
(cancel):
(read):
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel):
(read):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamReaderGenericRelease):
* Modules/streams/WritableStream.js:
(abort):
(close):
(write):
(getter.closed):
(getter.ready):
2019-03-04 Simon Fraser <simon.fraser@apple.com>
Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
https://bugs.webkit.org/show_bug.cgi?id=195258
Reviewed by Antti Koivisto.
This patch moves management of scrollbar layers and scrollbar painters ("NSScrollerImp") down to
ScrollingStateScrollingNode to be shared between frame and overflow nodes, allowing for
scrolling thread updates of overflow scrollbars. It also moves some scrolling tree-side code
to ScrollingTreeScrollingNodeDelegateMac to be shared between the "tree" nodes for overflow and frames.
Layers for scrollbars are given to scrolling state nodes via setNodeLayers() now, and
RenderLayerCompositor::updateScrollingNodeLayers() is added to provide a bottleneck to call that.
At some point AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() should be relieved
of the responsibility of pushing scrollbar layers (but the scrolling state tree needs to hold
references to GraphicsLayers before that becomes safe).
The actual fix that allows overflow scrollbars to show is the change in
AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange() that calls scrollableArea.*ScrollbarLayerDidChange()
for all ScrollableAreas. This ensures that the CALayer is pushed onto the NSScrollerImp.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::setVerticalScrollbarLayer): Deleted.
(WebCore::ScrollingStateFrameScrollingNode::setHorizontalScrollbarLayer): Deleted.
(WebCore::ScrollingStateFrameScrollingNode::setScrollerImpsFromScrollbars): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateScrollingNode::setHorizontalScrollbarLayer):
(WebCore::ScrollingStateScrollingNode::setVerticalScrollbarLayer):
(WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::horizontalScrollbarLayer const):
(WebCore::ScrollingStateScrollingNode::verticalScrollbarLayer const):
(WebCore::ScrollingStateScrollingNode::verticalScrollerImp const):
(WebCore::ScrollingStateScrollingNode::horizontalScrollerImp const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::setOrClearLatchedNode):
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
(WebCore::ScrollingStateScrollingNode::setScrollerImpsFromScrollbars):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::~ScrollingTreeFrameScrollingNodeMac): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::releaseReferencesToScrollerImpsOnTheMainThread): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionRelatedLayers):
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::~ScrollingTreeScrollingNodeDelegateMac):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollbarPainters):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::releaseReferencesToScrollerImpsOnTheMainThread):
* platform/ScrollbarThemeComposite.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeLayers):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
* rendering/RenderLayerCompositor.h:
2019-03-04 Jer Noble <jer.noble@apple.com>
Remove HEVC as a codec requiring hardware support.
https://bugs.webkit.org/show_bug.cgi?id=194960
<rdar://problem/47741432>
Reviewed by Eric Carlson.
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::defaultMediaContentTypesRequiringHardwareSupport):
2019-03-04 Jer Noble <jer.noble@apple.com>
[iOS] Fullscreen "stay in page" option breaks video playback
https://bugs.webkit.org/show_bug.cgi?id=195277
<rdar://problem/48537317>
Reviewed by Eric Carlson.
Add a LOG entry when playback is rejected due to media playback suspension.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
2019-03-04 Tim Horton <timothy_horton@apple.com>
Fix the build.
* dom/Document.h:
2019-03-03 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Content observation should be limited to the current document.
https://bugs.webkit.org/show_bug.cgi?id=195256
<rdar://problem/48544402>
Move ContentChangeObserver from Page to Document.
It limits content observation to the target node's owner document.
Reviewed by Simon Fraser.
* dom/Document.cpp:
(WebCore::m_contentChangeObserver):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::willDetachPage):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
(WebCore::m_undoManager): Deleted.
* dom/Document.h:
(WebCore::Document::contentChangeObserver):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::removeById):
(WebCore::DOMTimer::fired):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pointerLockController const):
(WebCore::Page::contentChangeObserver): Deleted.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::ContentChangeObserver):
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::startObservingMouseMoved):
(WebCore::ContentChangeObserver::hasDeterminateState const):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::notifyContentChangeIfNeeded):
(WebCore::ContentChangeObserver::StyleChangeScope::StyleChangeScope):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
(WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
(WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::DOMTimerScope::DOMTimerScope):
(WebCore::ContentChangeObserver::DOMTimerScope::~DOMTimerScope):
(WebCore::hasPendingStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
2019-03-02 Simon Fraser <simon.fraser@apple.com>
Share more code for updating the state of frame scrolling nodes
https://bugs.webkit.org/show_bug.cgi?id=195254
Reviewed by Antti Koivisto.
Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
state tree.
We also share code between updating ScrollingStateFrameScrollingNodes and
ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
on macOS.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
(WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
(WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
* platform/ScrollView.h:
(WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
(WebCore::ScrollView::verticalScrollbarMode const): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::reachableTotalContentsSize const):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalScrollbarMode const):
(WebCore::ScrollableArea::verticalScrollbarMode const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::overhangAmount const):
(WebCore::RenderLayer::reachableTotalContentsSize const):
(WebCore::RenderLayer::scrollableContentsSize const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
(WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
(WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
* rendering/RenderLayerCompositor.h:
2019-03-02 Darin Adler <darin@apple.com>
Retire legacy dtoa function and DecimalNumber class
https://bugs.webkit.org/show_bug.cgi?id=195253
Reviewed by Daniel Bates.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberValue const): Use makeString instead
of DecimalNumber. Also changed return type to String and use StringView and
removed special handling of literals.
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText const): Removed an
unnecessary use of StringBuilder.
* css/CSSPrimitiveValue.h: Updated for changes to formatNumberValue.
2019-03-03 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Cleanups in SoupNetworkSession
https://bugs.webkit.org/show_bug.cgi?id=195247
Reviewed by Daniel Bates.
This renames clientCertificates to allowedCertificates, since they are not client
certificates at all, but server certificates. It also adds a using statement to avoid
repeating the long type of the map, and avoids an unnecessary copy.
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::allowedCertificates):
(WebCore::SoupNetworkSession::checkTLSErrors):
(WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
(WebCore::clientCertificates): Deleted.
2019-03-03 Michael Catanzaro <mcatanzaro@igalia.com>
-Wformat error in SharedBuffer::tryCreateArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=195004
Reviewed by Darin Adler.
Seems C++ has no format specifier appropriate for printing the result of sizeof. We should
just not try to print it. Anyway, that's easy in this case, because sizeof(char) is
guaranteed to be 1. This code was an attempt to be pedantic to account for mythical systems
with char larger than one byte, but perhaps it didn't realize sizeof always returns
multiples of char and so sizeof(char) is always one even on such mythical systems.
Note the sizeof(char) use two lines up is left since it's not clear that switching it to 1
would actually be more readable.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::tryCreateArrayBuffer const):
2019-03-03 Tim Horton <timothy_horton@apple.com>
Remove some more unused 32-bit code
https://bugs.webkit.org/show_bug.cgi?id=195255
Reviewed by Darin Adler.
* platform/gamepad/cocoa/GameControllerGamepad.h:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/gamepad/cocoa/GameControllerGamepadProvider.h:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::servicesRolloverButtonCell const):
(WebCore::RenderThemeMac::paintImageControlsButton):
(WebCore::RenderThemeMac::imageControlsButtonSize const):
(WebCore::RenderThemeMac::imageControlsButtonPositionOffset const):
2019-03-02 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce ContentChangeObserver::MouseMovedScope
https://bugs.webkit.org/show_bug.cgi?id=195252
<rdar://problem/48539446>
Reviewed by Simon Fraser.
Scope the mouse-moved event to make the callsites less error-prone.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingMouseMoved):
(WebCore::ContentChangeObserver::stopObservingMouseMoved):
(WebCore::ContentChangeObserver::MouseMovedScope::MouseMovedScope):
(WebCore::ContentChangeObserver::MouseMovedScope::~MouseMovedScope):
(WebCore::ContentChangeObserver::startObservingContentChanges): Deleted.
(WebCore::ContentChangeObserver::stopObservingContentChanges): Deleted.
* page/ios/ContentChangeObserver.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
2019-03-02 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce ContentChangeObserver::adjustObservedState
https://bugs.webkit.org/show_bug.cgi?id=195244
<rdar://problem/48536737>
Reviewed by Simon Fraser.
Move state change handling code to adjustObservedState() and introduce signalContentChangeIfNeeded() to
let the client know about the state change (or lack of state change).
Test: fast/events/touch/ios/visibility-change-happens-at-the-second-timer.html
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::adjustObservedState):
(WebCore::ContentChangeObserver::signalContentChangeIfNeeded):
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc): Deleted.
2019-03-02 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move away from WKContentChange values
https://bugs.webkit.org/show_bug.cgi?id=195240
<rdar://problem/48532358>
Reviewed by Simon Fraser.
This is in preparation for moving towards a state machine-like implementation.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didInstallDOMTimer): Do not install the timer if we are already in "hover" state.
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingStyleRecalc): No need to start observing the style recalc if we are already in "hover" state.
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::observedContentChange const):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
(WebCore::ContentChangeObserver::hasDeterminedState const):
(WebCore::ContentChangeObserver::observedContentChange): Deleted.
(WebCore::ContentChangeObserver::resetObservedContentChange): Deleted.
(WebCore::ContentChangeObserver::setObservedContentChange): Deleted.
(WebCore::ContentChangeObserver::addObservedDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
(WebCore::ContentChangeObserver::hasVisibleChangeState const):
(WebCore::ContentChangeObserver::hasObservedDOMTimer const):
(WebCore::ContentChangeObserver::setHasNoChangeState):
(WebCore::ContentChangeObserver::setHasIndeterminateState):
(WebCore::ContentChangeObserver::setHasVisibleChangeState):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers const): Deleted.
2019-03-02 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Programmatic paste access should be granted when copying and pasting within the same origin
https://bugs.webkit.org/show_bug.cgi?id=195053
<rdar://problem/48134710>
Reviewed by Ryosuke Niwa.
Plumb the document pasteboard identifier through the client when making a DOM paste access request. See WebKit
ChangeLog for more details.
Test: editing/pasteboard/ios/dom-paste-same-origin.html
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPasteAccess.h: Renamed from Source/WebCore/dom/DOMPasteAccessPolicy.h.
Introduce DOMPasteAccessResponse, which is either DeniedForGesture, GrantedForCommand, or GrantedForGesture. In
particular, when pasteboard identifiers match, we only grant access for the current paste command, rather than
throughout the user gesture.
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::didRequestDOMPasteAccess):
* loader/EmptyClients.cpp:
* page/EditorClient.h:
* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):
2019-02-27 Darin Adler <darin@apple.com>
Fixed makeString(float) to do shortest-form serialization without first converting to double
https://bugs.webkit.org/show_bug.cgi?id=195142
Reviewed by Daniel Bates.
* platform/graphics/Color.cpp: Removed unneeded include of DecimalNumber.h.
2019-03-02 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r242132): Incorrect positioning with multiple position:fixed elements
https://bugs.webkit.org/show_bug.cgi?id=195246
Reviewed by Frederic Wang.
r242132 introduced a bug where the management of 'cumulativeDelta' in ScrollingTree::notifyRelatedNodesRecursive
was incorrect. This value should propagate from ancestors to descendants, but not between siblings in the scrolling
tree, which it did, causing sibling position:fixed to behave incorrectly.
Test: scrollingcoordinator/mac/multiple-fixed.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
* page/scrolling/ScrollingTree.h:
2019-03-02 Darin Adler <darin@apple.com>
Improve some comments
https://bugs.webkit.org/show_bug.cgi?id=195243
Reviewed by Daniel Bates.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _addAccessibilityObject:toTextMarkerArray:]):
Fix a typo in a comment.
* dom/RadioButtonGroups.cpp: Fix a typo in a comment.
(WebCore::RadioButtonGroups::checkedButtonForGroup const): Use nullptr instead of 0.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::~HTMLInputElement): Improved a comment, but sadly made
it a bit longer. Use nullptr instead of 0.
(WebCore::HTMLInputElement::didMoveToNewDocument): Added a comment.
2019-03-01 Wenson Hsieh <wenson_hsieh@apple.com>
[Datalist] fast/forms/datalist/datalist-child-validation.html crashes with a debug assertion in isValidFormControlElement()
https://bugs.webkit.org/show_bug.cgi?id=190620
<rdar://problem/19226679>
Reviewed by Ryosuke Niwa.
Fixes and re-enables an existing layout test that is asserting on debug builds (and failing on release builds).
To understand why we hit this assertion, we first note several observations:
- The validity of a form control (`isValid()`) depends on the value of `willValidate()`.
- Both of these results are cached in member variables: `m_isValid` and `m_willValidate`, respectively.
- `willValidate()` changes the cached value of `m_willValidate` if necessary, but `isValid()` uses the
cached value without update.
Now, consider the following scenario:
1. Something changes in the DOM that changes the result of `willValidate()`. This can happen as a result of
several things:
a. The form control changes readonly state
b. The form control changes disabled state
c. The form control is added to a datalist element
d. The form control is removed from a datalist element
2. Call `willValidate()`.
3. Call `isValid()`.
In scenarios (a) - (c), we ensure that cached form control validity (`m_isValid`) is updated alongside
`m_willValidate` by invoking `setNeedsWillValidateCheck()`, such that the result of `isValid()` matches the
result of `m_isValid` in step (3). However, in the last scenario (d), we don't do this, which causes form
control validity to fall out of sync with the result of `isValid()`. To fix the bug, we update willValidate and
isValid when a form control is removed from an ancestor, only if one of its ancestors is a datalist element.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::insertedIntoAncestor):
(WebCore::HTMLFormControlElement::removedFromAncestor):
Make a couple of minor tweaks:
- Currently, we always invalidate `m_dataListAncestorState` by resetting the state to `Unknown` when the form
control is removed from an ancestor or inserted. Instead, we only need to reset it when the form control
already has an ancestor that is a datalist (in the case where it's being removed) or when the form control
does not yet have an ancestor (in the case where it is being added).
- If the form control was inside a datalist prior to removal, recompute its cached value of `m_willValidate`,
as well as its cached validity (`m_isValid`).
2019-03-01 Darin Adler <darin@apple.com>
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893
Reviewed by Daniel Bates.
* dom/Document.cpp:
(WebCore::Document::lastModified const): Use makeString and pad.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.
* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
(WebCore::gcTimerString): Use String::number.
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const): Use makeString and pad.
(WebCore::DateComponents::toString const): Ditto.
* platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
and that was also inaccurate.
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
Use makeString and pad.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2019-03-01 Chris Dumez <cdumez@apple.com>
Do not attempt to set WAL Journal mode on a readonly SQLite database
https://bugs.webkit.org/show_bug.cgi?id=195237
Reviewed by Simon Fraser.
This avoids logging errors when opening the database.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
(WebCore::SQLiteDatabase::useWALJournalMode):
* platform/sql/SQLiteDatabase.h:
2019-03-01 Antoine Quint <graouts@apple.com>
[iOS] Turn mouse event simulation on by default
https://bugs.webkit.org/show_bug.cgi?id=195218
<rdar://problem/48516794>
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2019-03-01 Chris Dumez <cdumez@apple.com>
Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
https://bugs.webkit.org/show_bug.cgi?id=195230
<rdar://problem/47925359>
Reviewed by Ryosuke Niwa.
Disable NetworkStateNotifier::singleton()'s isMainThread() assertion when the WebThread is enabled
to address crashes on iOS WK1.
* platform/network/NetworkStateNotifier.cpp:
(WebCore::shouldSuppressThreadSafetyCheck):
(WebCore::NetworkStateNotifier::singleton):
2019-03-01 Simon Fraser <simon.fraser@apple.com>
Show mouse event regions in the overlay
https://bugs.webkit.org/show_bug.cgi?id=195227
Reviewed by Tim Horton.
Enhance event region overlays to show more kinds of events.
* page/DebugPageOverlays.cpp:
(WebCore::touchEventRegionColors):
(WebCore::NonFastScrollableRegionOverlay::drawRect):
2019-03-01 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Check for pending style recalcs at the end of each timer run.
https://bugs.webkit.org/show_bug.cgi?id=195220
<rdar://problem/48518979>
Reviewed by Simon Fraser.
didScheduleStyleRecalc callback was introduced to see if a style recalc is scheduled while firing the DOM timer. However it does not handle the case
when in addition to this style recalc scheduling, something later (though during the same timer firing) triggers a sync style recalc.
Let's just check if we've got a pending style recalc when the DOM timer comes back.
Test: fast/events/touch/ios/style-recalc-schedule-and-force-relalc.html
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
* page/ios/ContentChangeObserver.cpp:
(WebCore::hasPendingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::didScheduleStyleRecalc): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const): Deleted.
2019-03-01 John Wilander <wilander@apple.com>
Resource Load Statistics: Further restrict client-side cookie persistence after cross-site navigations with link decoration
https://bugs.webkit.org/show_bug.cgi?id=195196
<rdar://problem/48006419>
Reviewed by Brent Fulgham.
Tests: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-decoration-same-site.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html
http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-without-link-decoration-from-prevalent-resource.html
Trackers abuse link query parameters to transport user identifiers cross-site.
This patch detects such navigations and applies further restrictions to
client-site cookies on the destination page.
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
Now sets the regular 7-day cap and a reduced 1-day cap.
(WebCore::NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics):
Renamed NetworkStorageSession::removeStorageAccessForAllFramesOnPage() to
NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics since
it now clears out two types of page-specific data.
(WebCore::NetworkStorageSession::committedCrossSiteLoadWithLinkDecoration):
This function receives a cross-site navigation and checks if the originating
site is a prevalent resource. If so, it marks the page or stricter cookie
rules.
(WebCore::NetworkStorageSession::resetCrossSiteLoadsWithLinkDecorationForTesting):
Test infrastructure. This sets a state that overrides the regular per-page
clear of data. The reason is that the double clear was racy and caused test
failures.
(WebCore::NetworkStorageSession::clientSideCookieCap const):
New function that returns the current cookie lifetime cap.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
Renamed to NetworkStorageSession::clearPageSpecificDataForResourceLoadStatistics().
* platform/network/NetworkStorageSession.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
Now calls NetworkStorageSession::clientSideCookieCap() to set the cap.
2019-03-01 Rob Buis <rbuis@igalia.com>
Adjust XMLHttpRequest Content-Type handling
https://bugs.webkit.org/show_bug.cgi?id=184645
Reviewed by Youenn Fablet.
Implement steps 4.4.1.2 and 4.4.1.3 of send() [1].
Test: web-platform-tests/xhr/send-content-type-charset.htm
[1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send
* platform/network/ParsedContentType.cpp:
(WebCore::ParsedContentType::setCharset):
* platform/network/ParsedContentType.h:
* xml/XMLHttpRequest.cpp:
(WebCore::replaceCharsetInMediaTypeIfNeeded):
(WebCore::XMLHttpRequest::send):
(WebCore::replaceCharsetInMediaType): Deleted.
2019-03-01 Youenn Fablet <youenn@apple.com>
Update originsMatch to handle the case of file origins which enforce file path separation
https://bugs.webkit.org/show_bug.cgi?id=195216
Reviewed by Brady Eidson.
Covered by the assertion and existing tests like fast/xmlhttprequest/xmlhttprequest-no-file-access.html.
Make sure originsMatch returns true if either compared origins are the same object
or they have the same file path separation behavior.
* page/SecurityOrigin.cpp:
(WebCore::areOriginsMatching):
(WebCore::originsMatch):
2019-03-01 Youenn Fablet <youenn@apple.com>
Serialize IndexedDB::ObjectStoreOverwriteMode as an enum
https://bugs.webkit.org/show_bug.cgi?id=195213
Reviewed by Alex Christensen.
Add traits to enable enum IPC encoding.
No change of behavior.
* Modules/indexeddb/IndexedDB.h:
2019-03-01 Don Olmstead <don.olmstead@sony.com>
[WinCairo] Enable service worker
https://bugs.webkit.org/show_bug.cgi?id=188318
Reviewed by Youenn Fablet.
* WebCorePrefix.h:
* testing/ServiceWorkerInternals.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::serviceWorkerFailedToTerminate):
* workers/service/context/SWContextManager.h:
2019-03-01 Sihui Liu <sihui_liu@apple.com>
Add a quirk for bostongloble.com and latimes.com
https://bugs.webkit.org/show_bug.cgi?id=195155
Reviewed by Geoffrey Garen.
Covered by manual testing.
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* page/Quirks.cpp:
(WebCore::Quirks::hasWebSQLSupportQuirk const):
* page/Quirks.h:
2019-03-01 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Rename members and move implementation to header.
https://bugs.webkit.org/show_bug.cgi?id=195198
<rdar://problem/48499967>
Reviewed by Simon Fraser.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::startObservingStyleRecalc):
(WebCore::ContentChangeObserver::stopObservingStyleRecalc):
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::StyleRecalcScope::StyleRecalcScope):
(WebCore::ContentChangeObserver::StyleRecalcScope::~StyleRecalcScope):
(WebCore::ContentChangeObserver::startObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleResolve): Deleted.
(WebCore::ContentChangeObserver::isObservingContentChanges): Deleted.
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling): Deleted.
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling): Deleted.
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc): Deleted.
(WebCore::ContentChangeObserver::countOfObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::clearObservedDOMTimers): Deleted.
(WebCore::ContentChangeObserver::containsObservedDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling const):
(WebCore::ContentChangeObserver::containsObservedDOMTimer const):
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling const):
(WebCore::ContentChangeObserver::setShouldObserveStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveStyleRecalc const):
(WebCore::ContentChangeObserver::isObservingContentChanges const):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers const):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
2019-03-01 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] ContentChangeObserver::StyleChangeScope should not set WKContentVisibilityChange directly
https://bugs.webkit.org/show_bug.cgi?id=195197
<rdar://problem/48498332>
Reviewed by Simon Fraser.
Add didContentVisibilityChange to hide WKContentVisibilityChange value. We might also want to add some logic to didContentVisibilityChange at some point.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::didContentVisibilityChange):
(WebCore::ContentChangeObserver::StyleChangeScope::~StyleChangeScope):
* page/ios/ContentChangeObserver.h:
2019-03-01 Jer Noble <jer.noble@apple.com>
[EME] Make sure the hasSessionSemaphore is set even if HAVE(AVSTREAMSESSION) is false
https://bugs.webkit.org/show_bug.cgi?id=195217
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2019-03-01 Justin Fan <justin_fan@apple.com>
[Web GPU] 32-bit builds broken by attempt to disable WebGPU on 32-bit
https://bugs.webkit.org/show_bug.cgi?id=195191
Rubber-stamped by Dean Jackson.
Dropping support for 32-bit entirely, so I'm intentionally leaving 32-bit broken.
* Configurations/FeatureDefines.xcconfig:
2019-02-28 Fujii Hironori <Hironori.Fujii@sony.com>
HTTPSUpgradeList.db database should be opened in readonly mode
https://bugs.webkit.org/show_bug.cgi?id=195194
<rdar://problem/47103889>
Unreviewed build fix for curl.
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase): Removed the second arguemnt of SQLiteDatabase::open.
2019-02-28 Chris Dumez <cdumez@apple.com>
Unreviewed Windows build fix after r242251.
* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::openDatabase):
2019-02-28 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
https://bugs.webkit.org/show_bug.cgi?id=195143
<rdar://problem/48462351>
Reviewed by Simon Fraser.
Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::removeById):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
2019-02-28 Chris Dumez <cdumez@apple.com>
HTTPSUpgradeList.db database should be opened in readonly mode
https://bugs.webkit.org/show_bug.cgi?id=195194
<rdar://problem/47103889>
Reviewed by Youenn Fablet.
Add parameter to SQLiteDatabase::open() to specific the open flags.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
* platform/sql/SQLiteDatabase.h:
* platform/sql/SQLiteFileSystem.cpp:
* platform/sql/SQLiteFileSystem.h:
2019-02-28 Brady Eidson <beidson@apple.com>
Followup to:
Universal links from Google search results pages don't open the app
https://bugs.webkit.org/show_bug.cgi?id=195126
Unreviewed.
* page/SecurityOrigin.cpp:
(WebCore::originsMatch): Remove a bogus assertion (reasoning in bugzilla)
2019-02-28 Simon Fraser <simon.fraser@apple.com>
[iOS] Dark flash when opening Google AMP pages
https://bugs.webkit.org/show_bug.cgi?id=195193
rdar://problem/48326442
Reviewed by Zalan Bujtas.
After the incremental compositing updates changes, it was possible for a change in the size
of an overflow:hidden element to fail to update the "ancestor clipping layer" geometry on
a composited descendant that is not a descendant in z-order. When Google search results
create the <iframe> that contain AMP contents, we'd fail to update a zero-sized clipping layer,
leaving the #222 background of an intermediate element visible.
Fix by setting a flag in RenderLayer::updateLayerPosition() (which is called in containing block order)
that sets the "needs geometry update" dirty bit on containing-block-descendant layers. Currently
this flag affects all descendants; in future, we might be able to clear it for grand-children.
Tests: compositing/geometry/ancestor-clip-change-interleaved-stacking-context.html
compositing/geometry/ancestor-clip-change.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateLayerPosition):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
* rendering/RenderLayerBacking.h:
2019-02-28 Myles C. Maxfield <mmaxfield@apple.com>
Use-after-move in RenderCombineText::combineTextIfNeeded()
https://bugs.webkit.org/show_bug.cgi?id=195188
Reviewed by Zalan Bujtas.
r241288 uncovered an existing problem with our text-combine code. r242204 alleviated the
symptom, but this patch fixes the source of the problem (and reverts r242204).
The code in RenderCombineText::combineTextIfNeeded() has a bit thats like:
FontDescription bestFitDescription;
while (...) {
FontCascade compressedFont(WTFMove(bestFitDescription), ...);
...
}
Clearly this is wrong.
Test: fast/text/text-combine-crash-2.html
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* rendering/RenderCombineText.cpp:
(WebCore::RenderCombineText::combineTextIfNeeded):
2019-02-28 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Introduce observer subclasses to scope content change observing.
https://bugs.webkit.org/show_bug.cgi?id=195172
<rdar://problem/48479259>
Reviewed by Simon Fraser.
Let's scope start/stopObserving call pairs.
* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::StyleChangeObserver::StyleChangeObserver):
(WebCore::ContentChangeObserver::StyleChangeObserver::~StyleChangeObserver):
(WebCore::ContentChangeObserver::StyleRecalcObserver::StyleRecalcObserver):
(WebCore::ContentChangeObserver::StyleRecalcObserver::~StyleRecalcObserver):
(WebCore::ContentChangeObserver::DOMTimerObserver::DOMTimerObserver):
(WebCore::ContentChangeObserver::DOMTimerObserver::~DOMTimerObserver):
(WebCore::ContentChangeObserver::StyleChange::StyleChange): Deleted.
(WebCore::ContentChangeObserver::StyleChange::~StyleChange): Deleted.
* page/ios/ContentChangeObserver.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
2019-02-28 Antoine Quint <graouts@apple.com>
Enable the Pointer Events runtime flag by default
https://bugs.webkit.org/show_bug.cgi?id=195156
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2019-02-28 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Make observed state reset explicit.
https://bugs.webkit.org/show_bug.cgi?id=195185
<rdar://problem/48488342>
Reviewed by Simon Fraser.
Use setObservedContentChange only for setting the observed change while observing.
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::resetObservedContentChange):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
* page/ios/ContentChangeObserver.h:
2019-02-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r242210.
https://bugs.webkit.org/show_bug.cgi?id=195179
it broke hover menus on losaltosonline.com (Requested by zalan
on #webkit).
Reverted changeset:
"[ContentChangeObserver] Move timer removal code from
DOMWindow::clearTimeout to DOMTimer::removeById"
https://bugs.webkit.org/show_bug.cgi?id=195143
https://trac.webkit.org/changeset/242210
2019-02-28 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move timer removal code from DOMWindow::clearTimeout to DOMTimer::removeById
https://bugs.webkit.org/show_bug.cgi?id=195143
<rdar://problem/48462351>
Reviewed by Simon Fraser.
Currently DOMWindow::clearTimeout() is the only callsite that we are interested in, but this is more future-proof.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::removeById):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.cpp:
(WebCore::ContentChangeObserver::startObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::stopObservingDOMTimerExecute):
(WebCore::ContentChangeObserver::didRemoveDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer): Deleted.
* page/ios/ContentChangeObserver.h:
2019-02-28 Charles Vazac <cvazac@akamai.com>
Fix Resource Timing buffer edge cases for WPT
https://bugs.webkit.org/show_bug.cgi?id=193213
Reviewed by Youenn Fablet.
Test coverage by LayoutTests/imported/w3c/web-platform-tests/resource-timing/buffer*.html
* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired): Only dispatch the
resourcetimingbufferfull event if the buffer is still full (as it may have been cleared or
expanded). Also, avoid infinite loops if we aren't able to decrease the number of entries in
the secondary buffer.
2019-02-28 Takashi Komori <Takashi.Komori@sony.com>
[Curl] HTTP Body is missing with redirection.
https://bugs.webkit.org/show_bug.cgi?id=191651
Reviewed by Don Olmstead.
Implement updateFromDelegatePreservingOldProperties for curl port.
Tests: http/tests/navigation/post-301-response.html
http/tests/navigation/post-302-response.html
http/tests/navigation/post-303-response.html
http/tests/navigation/post-307-response.html
http/tests/navigation/post-308-response.html
* platform/Curl.cmake:
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
* platform/network/curl/ResourceRequestCurl.cpp: Added.
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
2019-02-28 Carlos Garcia Campos <cgarcia@igalia.com>
[CoordinatedGraphics] Remove COORDINATED_GRAPHICS_THREADED option
https://bugs.webkit.org/show_bug.cgi?id=195159
Reviewed by Don Olmstead.
Use COORDINATED_GRAPHICS instead.
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/PlatformLayer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::ImageBufferData):
(WebCore::ImageBufferData::~ImageBufferData):
* platform/graphics/cairo/ImageBufferDataCairo.h:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
* platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
* platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
(Nicosia::GC3DLayer::swapBuffersIfNeeded):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::prepareTexture):
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
* platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
(WebCore::TextureMapperGC3DPlatformLayer::TextureMapperGC3DPlatformLayer):
(WebCore::TextureMapperGC3DPlatformLayer::~TextureMapperGC3DPlatformLayer):
* platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxyProvider.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
(WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintsIntoWindow const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2019-02-28 Myles C. Maxfield <mmaxfield@apple.com>
Locale names can be nullptr
https://bugs.webkit.org/show_bug.cgi?id=195171
<rdar://problem/48262376>
Reviewed by Dean Jackson.
Nullptr can't be used in keys to HashMaps, so take an early out in this case.
This is a partial revert of r241288.
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
2019-02-28 Justin Fan <justin_fan@apple.com>
[Web GPU] Enable Web GPU only on 64-bit
https://bugs.webkit.org/show_bug.cgi?id=195139
Because Metal is only supported on 64 bit apps.
Unreviewed build fix.
* Configurations/FeatureDefines.xcconfig:
2019-02-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move WKSetObservedContentChange logic to ContentChangeObserver class.
https://bugs.webkit.org/show_bug.cgi?id=195128
<rdar://problem/48456752>
Reviewed by Simon Fraser.
Move the final bits over to ContentChangeObserver and delete WKContentObservationInternal.h.
* WebCore.xcodeproj/project.pbxproj:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h: Removed.
2019-02-27 Simon Fraser <simon.fraser@apple.com>
Roll out r242014; it caused crashes in compositing logging (webkit.org/b/195141)
* dom/Document.cpp:
(WebCore::Document::lastModified const):
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString):
* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded):
(WebCore::MathMLElement::collectStyleForPresentationAttribute):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw):
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString):
(WebCore::gcTimerString):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const):
(WebCore::DateComponents::toString const):
* platform/LocalizedStrings.cpp:
(WebCore::localizedString):
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const):
2019-02-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move _WKObservingContentChanges from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195091
<rdar://problem/48427271>
Reviewed by Tim Horton.
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
(WebCore::ContentChangeObserver::isObservingContentChanges):
* platform/ios/wak/WKContentObservation.cpp:
(WKObservingContentChanges): Deleted.
(WKStartObservingContentChanges): Deleted.
(WKStopObservingContentChanges): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:
2019-02-27 Brady Eidson <beidson@apple.com>
Universal links from Google search results pages don't open the app.
<rdar://problem/46887179> and https://bugs.webkit.org/show_bug.cgi?id=195126
Reviewed by Geoffrey Garen.
Covered by new API tests.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate const): Propagate the external URL policy from
an iframe if it is from the same security origin as the main frame.
2019-02-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move DOMTimer schedule handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195090
<rdar://problem/48426771>
Reviewed by Tim Horton.
Also remove some unused functions from WKContentObservationInternal.
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::stopObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::isObservingDOMTimerScheduling):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingDOMTimerScheduling): Deleted.
(WKStopObservingDOMTimerScheduling): Deleted.
(WKIsObservingDOMTimerScheduling): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:
2019-02-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move style recalc handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195087
Reviewed by Simon Fraser.
Add m_observingNextStyleRecalc/m_observingStyleRecalcScheduling to ContentChangeObserver and move the related code over from WK functions.
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::stopObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::isObservingStyleRecalcScheduling):
(WebCore::ContentChangeObserver::setShouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::shouldObserveNextStyleRecalc):
(WebCore::ContentChangeObserver::setObservedContentChange):
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
(WKStartObservingStyleRecalcScheduling): Deleted.
(WKStopObservingStyleRecalcScheduling): Deleted.
(WKIsObservingStyleRecalcScheduling): Deleted.
(WKSetShouldObserveNextStyleRecalc): Deleted.
(WKShouldObserveNextStyleRecalc): Deleted.
* platform/ios/wak/WKContentObservation.h:
2019-02-27 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move DOM timer handling from global to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195070
<rdar://problem/48417650>
Reviewed by Tim Horton.
Add DOM timer list to ContentChangeObserver and move the related code over from WK functions.
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimerScheduling):
(WebCore::ContentChangeObserver::countOfObservedDOMTimers):
(WebCore::ContentChangeObserver::clearObservedDOMTimers):
(WebCore::ContentChangeObserver::setObservedContentChange):
(WebCore::ContentChangeObserver::containsObservedDOMTimer):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingDOMTimerScheduling):
(WKSetObservedContentChange):
(WebThreadGetObservedDOMTimers): Deleted.
(WebThreadCountOfObservedDOMTimers): Deleted.
(WebThreadClearObservedDOMTimers): Deleted.
(WebThreadContainsObservedDOMTimer): Deleted.
(WebThreadAddObservedDOMTimer): Deleted.
(WebThreadRemoveObservedDOMTimer): Deleted.
* platform/ios/wak/WKContentObservation.h:
2019-02-27 Justin Fan <justin_fan@apple.com>
Fix build errors after Web GPU buffer updates changed some IDL fields from unsigned long to unsigned long long.
Unreviewed build fix.
* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::setSubData):
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUBufferBinding.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
2019-02-27 John Wilander <wilander@apple.com>
Adopt WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics and WebKit::NetworkProcessProxy
https://bugs.webkit.org/show_bug.cgi?id=195071
<rdar://problem/48417690>
Reviewed by Alex Christensen and Brent Fulgham.
No new tests. This patch maintains functionality covered by plenty of layout
tests under http/tests/resourceLoadStatistics/ and http/tests/storageAccess.
This patch adopts WebCore::RegistrableDomain in WebCore::ResourceLoadStatistics
and makes the necessary infrastructure changes to support that.
The previous HashCountedSets in WebCore::ResourceLoadStatistics are now just
HashSets since we never used the counts for anything. This change simplified
encoding and decoding for IPC and will eventually simplify encoding and
decoding in loader/ResourceLoadStatistics.cpp when we obsolete statistics
model version 14 and below.
The patch also makes WebCore::RegistrableDomain's String constructor private.
A new create function WebCore::RegistrableDomain::uncheckedCreateFromString()
is introduced to better signal to users that creating a registrable domain
object with a string may create an object that doesn't match a registrable
domain in a valid HTTP-family URL. This change (private String constructor)
motivated a change in WebCore::AdClickAttribution where the Source and
Destination structs now take a URL as parameter instead of a String.
Finally, this patch harmonizes parameter and variable naming, going from
"origin" to "domain" and "mainFrame" to "topFrame."
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Source::deletedValue):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Destination::deletedValue):
(WebCore::AdClickAttribution::decode):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::statisticsForURL):
(WebCore::ResourceLoadObserver::statisticsForOrigin): Deleted.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashSet):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::appendHashSet):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
(WebCore::encodeHashCountedSet): Deleted.
(WebCore::encodeOriginHashSet): Deleted.
(WebCore::decodeOriginHashSet): Deleted.
(WebCore::appendHashCountedSet): Deleted.
* loader/ResourceLoadStatistics.h:
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::uncheckedCreateFromString):
(WebCore::RegistrableDomain::RegistrableDomain):
* testing/Internals.cpp:
(WebCore::Internals::resourceLoadStatisticsForURL):
(WebCore::Internals::resourceLoadStatisticsForOrigin): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2019-02-27 Justin Fan <justin_fan@apple.com>
[Web GPU] Buffer updates part 2: setSubData, GPU/CPU synchronization
https://bugs.webkit.org/show_bug.cgi?id=195077
<rdar://problem/47805229>
Reviewed by Dean Jackson.
Implement GPUBuffer.setSubData and prevent the resolving of mapping promises if the buffer is scheduled to be
used on the GPU, and add handlers to resolve such promises after command buffer execution completes. In addition,
update buffer sizes to u64 (unsigned long in C++) as per the updated Web GPU API.
Tests: webgpu/buffer-command-buffer-races.html
webgpu/map-read-buffers.html
* Modules/webgpu/WebGPUBindGroup.h:
(WebCore::WebGPUBindGroup::bindGroup const):
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp:
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Rename binding -> bufferBinding to reduce confusion.
* Modules/webgpu/WebGPUBuffer.cpp: Small tweaks.
(WebCore::WebGPUBuffer::setSubData):
(WebCore::WebGPUBuffer::unmap): Correctly fail if buffer is destroyed.
(WebCore::WebGPUBuffer::destroy):
(WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback):
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const): Returned buffer is no longer const so that it can be used in completed handler callbacks.
* Modules/webgpu/WebGPUBuffer.idl: Enable setSubData.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::isTransferDst const): Added various state and flag getters.
(WebCore::GPUBuffer::isVertex const):
(WebCore::GPUBuffer::isUniform const):
(WebCore::GPUBuffer::isStorage const):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::isMappable const):
(WebCore::GPUBuffer::isMapWrite const):
(WebCore::GPUBuffer::isMapRead const):
(WebCore::GPUBuffer::isMapWriteable const):
(WebCore::GPUBuffer::isMapReadable const):
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::usedBuffers const):
(WebCore::GPUCommandBuffer::useBuffer):
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer): Pass Ref of itself for Buffer to request the Queue later, if needed.
(WebCore::GPUDevice::tryCreateBuffer const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUProgrammablePassEncoder.cpp: Retain the encoder's commandBuffer to reference its used resource buffers.
(WebCore::GPUProgrammablePassEncoder::GPUProgrammablePassEncoder):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::commandBuffer const):
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferCreate): Move validation out of tryCreate.
(WebCore::GPUBuffer::tryCreate): Create both shared and private buffers, depending on usage.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Call destroy instead of just unmap.
(WebCore::GPUBuffer::state const):
(WebCore::GPUBuffer::setSubData): Uses a cached collection of staging MTLBuffers to encode data copies to the implementation MTLBuffer.
(WebCore::GPUBuffer::commandBufferCommitted): Register on the GPUBuffer that the provided MTLCommandBuffer uses it, and is about to be committed.
(WebCore::GPUBuffer::commandBufferCompleted): MTLCommandBuffer's onCompletedHandler calls this.
(WebCore::GPUBuffer::reuseSubDataBuffer): SetSubData's blit command buffers call this to return a staging buffer to the pool.
(WebCore::GPUBuffer::registerMappingCallback):
(WebCore::GPUBuffer::runMappingCallback):
(WebCore::GPUBuffer::unmap):
(WebCore::GPUBuffer::destroy):
(WebCore::GPUBuffer::tryCreateSharedBuffer): Deleted.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder):
(WebCore::GPUProgrammablePassEncoder::setBindGroup):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit): Ensure submitted buffers are in the correct state, and add completed handlers for synchronization.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::tryCreate):
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder): Retain the commandBuffer for later reference.
(WebCore::GPURenderPassEncoder::setVertexBuffers): Mark vertex buffers as used before submission.
(WebCore::GPURenderPassEncoder::create): Deleted.
Buffer size updates in the IDL:
* Modules/webgpu/GPUBufferDescriptor.idl:
* Modules/webgpu/WebGPUBuffer.idl:
* Modules/webgpu/WebGPUBufferBinding.idl:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPUVertexAttributeDescriptor.idl:
* Modules/webgpu/WebGPUVertexInputDescriptor.idl:
2019-02-27 Youenn Fablet <youenn@apple.com>
Remove LeetCode FetchRequest quirk
https://bugs.webkit.org/show_bug.cgi?id=195100
Reviewed by Alex Christensen.
Covered by manual testing.
* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk):
2019-02-27 Chris Dumez <cdumez@apple.com>
Unable to log into chase.com on iPad when DeviceMotionEvent API is disabled
https://bugs.webkit.org/show_bug.cgi?id=195101
<rdar://problem/48423023>
Reviewed by Geoffrey Garen.
Add site-specific quirk for chase.com on iOS where we fire a dummy DeviceMotionEvent if the page
tries to register a "devicemotion" event listener and fails because the API is disabled. This is
needed to unblock the site and proceed with the login flow.
Unfortunately, document()->settings().needsSiteSpecificQuirks() is false on iOS so I could not
guard the quirk behind this flag.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::failedToRegisterDeviceMotionEventListener):
* page/DOMWindow.h:
2019-02-27 Antoine Quint <graouts@apple.com>
Support Pointer Events on macOS
https://bugs.webkit.org/show_bug.cgi?id=195008
<rdar://problem/47454419>
Reviewed by Dean Jackson.
We now dispatch relevant pointer events as we prepare to dispatch mouse events. In most cases, this means we dispatch
a pointer event of the same type, with "mouse" being substituted by "pointer", and with the same properties with the
exception that if preventDefault() is called for a "pointerdown" event, the matching "mousedown" will not be dispatched,
and the same behavior also extends to "pointerup".
Tests: pointerevents/mouse/over-enter-out-leave.html
pointerevents/mouse/pointer-capture.html
pointerevents/mouse/pointer-event-basic-properties.html
pointerevents/mouse/pointer-events-before-mouse-events.html
pointerevents/mouse/pointerdown-prevent-default.html
* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp: All of the touch-action related members and functions should be iOS-specific since the touch-action
property does not have any effect on macOS.
(WebCore::Document::invalidateRenderingDependentRegions):
(WebCore::Document::nodeWillBeRemoved):
(WebCore::Document::updateTouchActionElements):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::dispatchMouseEvent): Dispatch a pointer event matching the mouse event that is about to be dispatched.
If preventDefault() is called in the event handler for either "pointerdown" or "pointerup", do not proceed with dispatching
the mouse event.
* dom/PointerEvent.cpp:
(WebCore::pointerEventType):
(WebCore::PointerEvent::create):
* dom/PointerEvent.h:
* page/EventHandler.cpp: Check both the pointer and mouse events to see if we need to dispatch "enter" and "leave" events.
(WebCore::hierarchyHasCapturingEventListeners):
(WebCore::EventHandler::updateMouseEventTargetNode):
* page/PointerCaptureController.cpp: Fix a build error which only happened on macOS.
(WebCore::PointerCaptureController::PointerCaptureController): Create the CapturingData for the unique mouse pointer.
(WebCore::PointerCaptureController::hasPointerCapture): The code did not match the spec cited in the comment, only the
pending target override needs to be considered to determine whether a given element has pointer capture enabled.
(WebCore::PointerCaptureController::dispatchEvent): Dispatch the provided pointer event, accounting for pointer capture if
it is set.
* page/PointerLockController.cpp: Fix a build error which only happened on macOS.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement): Code related to touch-action is only relevant to iOS.
2019-02-27 Sihui Liu <sihui_liu@apple.com>
Network Process is put to suspended when holding locked IndexedDB files
https://bugs.webkit.org/show_bug.cgi?id=195024
<rdar://problem/45194169>
Reviewed by Geoffrey Garen.
We found network process was suspended when IDBDatabase was being closed in the background database thread,
holding locks to its database file. To avoid starvation or deadlock, we need to keep network process alive by
taking background assertion in UI process until the closes are done and locks are released.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::create):
(WebCore::IDBServer::IDBServer::IDBServer):
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::closeDatabase):
(WebCore::IDBServer::IDBServer::didCloseDatabase):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::create):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
(WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::notifyServerAboutClose):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2019-02-26 Simon Fraser <simon.fraser@apple.com>
Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
https://bugs.webkit.org/show_bug.cgi?id=194973
Reviewed by Antti Koivisto.
This patch cleans up how the scrolling tree responds to scrolls.
First, ScrollingTreeScrollingNode::m_currentScrollPosition is "truth" for scrolling thread/
UI process scroll position.
On macOS where handleWheelEvent on the scrolling thread changes scroll position, the
bottleneck is ScrollingTreeScrollingNode::scrollTo() which sets the new scroll position,
update the visual viewport (for frame scrolls) updates the scrolledContentsLayer position,
updates related layers on this node (counter-scrolling layers etc), and then tells the
scrolling tree, which recurses through descendant nodes so they can adjust their layer
positions.
On iOS, the bottleneck is ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling(),
which does the above other than setting scrolledContentsLayer (since we're reacting to
layer state changes, not producing them).
updateLayersAfterAncestorChange() is renamed to relatedNodeScrollPositionDidChange(), and
ScrollingTree does the tree walk so classes don't have to implement
updateLayersAfterAncestorChange() just to talk children. The ScrollingTree tree walk knows
how to get the correct layoutViewport and to stop at frame boundaries (layer updates never
need to cross frame boundaries).
We preserve 'cumulativeDelta'; it's necessary for things like fixed inside overflow:scroll,
since the fixed state was computed with the "layout" scroll position, so we have to account
for the scroll delta since the last committed position. It's possible we could improve this
in future.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::notifyRelatedNodesAfterScrollPositionChange):
(WebCore::ScrollingTree::notifyRelatedNodesRecursive):
(WebCore::ScrollingTree::mainFrameLayoutViewport):
(WebCore::ScrollingTree::scrollPositionChangedViaDelegatedScrolling): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::updateViewportForCurrentScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeNode::enclosingScrollingNodeIncludingSelf):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
(WebCore::ScrollingTreeScrollingNode::adjustedScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollTo):
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
(WebCore::ScrollingTreeScrollingNode::wasScrolledByDelegatedScrolling):
(WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeScrollingNode::setScrollPosition): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
(WebCore::ScrollingTreeScrollingNodeDelegate::currentScrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const): Deleted.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::relatedNodeScrollPositionDidChange):
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange): Deleted.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::repositionRelatedLayers):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateLayersAfterViewportChange): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
(): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::adjustedScrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::repositionScrollingLayers):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Deleted.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
2019-02-22 Simon Fraser <simon.fraser@apple.com>
Have a single notion of scroll position in the scrolling tree and derive layoutViewport from it
https://bugs.webkit.org/show_bug.cgi?id=194973
Reviewed by Antti Koivisto.
The "master" value for the scroll position of a ScrollingTreeScrollingNode is now its m_scrollPosition member;
layout viewports and layer positions will be set from this. This allows scrollPosition() to no longer be virtual
and require different code for each scrolling node subclass, and adds a choke point that we can use to update
the layout viewport.
We can remove m_probableMainThreadScrollPosition on ScrollingTreeFrameScrollingNodeMac because this was really just
an alias for the scroll position.
Add some isRootNode() checks for things that should only affect the main frame.
* page/scrolling/ScrollingTree.h: Remove fixedPositionRect() which was unused, and is a per-frame thing so makes
no sense here.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::didChangeScrollPosition):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewport const):
(WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
(WebCore::ScrollingTreeFrameScrollingNode::fixedPositionRect): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPosition):
(WebCore::ScrollingTreeScrollingNode::setScrollPositionInternal):
(WebCore::ScrollingTreeScrollingNode::didChangeScrollPosition):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::scrollPosition const):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::fixedPositionRect): Deleted.
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::updateMainFramePinState):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const): Deleted.
2019-02-27 Ulrich Pflueger <up@nanocosmos.de>
[MSE] SourceBuffer sample time increment vs. last frame duration check is broken
https://bugs.webkit.org/show_bug.cgi?id=194747
<rdar://problem/48148469>
Reviewed by Jer Noble.
Prevent unintended frame drops by including last frame duration in discontinuity check.
Test: media/media-source/media-source-append-variable-frame-lengths-with-matching-durations.html
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2019-02-27 Timothy Hatcher <timothy@apple.com>
REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL).
https://bugs.webkit.org/show_bug.cgi?id=195086
rdar://problem/48419124
Reviewed by Tim Horton.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance.
2019-02-26 Wenson Hsieh <wenson_hsieh@apple.com>
Remove conditional compile guard for InsertIntoTextNodeCommand::doReapply
https://bugs.webkit.org/show_bug.cgi?id=195067
<rdar://problem/44812080>
Reviewed by Tim Horton.
This iOS-specific override was introduced to fix <rdar://problem/7114425>, in which the last typed character
would be revealed when redoing text input on iOS inside a password field. The associated change fixed this bug
by overriding doReapply on iOS to only insert text (instead of additionally handling password echo); however, it
really makes sense to skip password echo when redoing on all platforms, so we can just remove the platform-
specific guards around this logic.
Doing this allows us to add the `hasEditableStyle()` check on iOS when redoing text insertion, which results in
a very subtle behavior change covered by the new layout test below.
Test: editing/undo/redo-text-insertion-in-non-editable-node.html
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doReapply):
* editing/InsertIntoTextNodeCommand.h:
2019-02-26 Keith Miller <keith_miller@apple.com>
Code quality cleanup in NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=194824
Reviewed by Mark Lam.
name_names.pl should not just assume the layout of LazyNeverDestroyed.
* dom/make_names.pl:
(printNamesCppFile):
2019-02-26 Zalan Bujtas <zalan@apple.com>
Do not try to observe the timer when Page is nullptr
https://bugs.webkit.org/show_bug.cgi?id=195076
Reviewed by Tim Horton.
Covered by fast/dom/Window/timer-null-script-execution-context.html.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
2019-02-20 Jer Noble <jer.noble@apple.com>
[Cocoa] Media elements will restart network buffering just before suspending
https://bugs.webkit.org/show_bug.cgi?id=193691
Reviewed by Eric Carlson.
API Test: WebKit.ProcessSuspendMediaBuffering
Allow the Page to suspend all media buffering in its child Documents.
* dom/Document.cpp:
(WebCore::Document::suspendAllMediaBuffering):
(WebCore::Document::resumeAllMediaBuffering):
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::dataBufferingPermitted const):
(WebCore::MediaElementSession::suspendBuffering):
(WebCore::MediaElementSession::resumeBuffering):
(WebCore::MediaElementSession::bufferingSuspended const):
* html/MediaElementSession.h:
* page/Page.cpp:
(WebCore::Page::suspendAllMediaBuffering):
(WebCore::Page::resumeAllMediaBuffering):
* page/Page.h:
(WebCore::Page::mediaPlaybackIsSuspended const):
(WebCore::Page::mediaBufferingIsSuspended const):
(WebCore::Page::mediaPlaybackIsSuspended): Deleted.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::suspendBuffering):
(WebCore::PlatformMediaSession::resumeBuffering):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
(WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
* platform/audio/PlatformMediaSessionManager.h:
2019-02-26 Youenn Fablet <youenn@apple.com>
Move service worker response validation from the service worker client to the service worker itself
https://bugs.webkit.org/show_bug.cgi?id=194716
Reviewed by Geoffrey Garen.
Added response validation at service worker side.
No change of behavior except for now logging validation error messages in the console.
Covered by rebased tests.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::validateResponse):
(WebCore::ServiceWorkerFetch::processResponse):
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
2019-02-26 Sihui Liu <sihui_liu@apple.com>
[Mac WK2] storage/indexeddb/IDBObject-leak.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=195036
Reviewed by Geoffrey Garen.
When connection to IDBServer is lost, IDBDatabase in web process should not only stop active transactions, but
also transactions in committing process.
Also, TransactionOpration should clear its perform function when the operation is being completed, otherwise
there is a reference cycle of TransactionOpration.
Covered by existing tests storage/indexeddb/IDBObject-leak.html.
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost): notify committing transasctions that connection is lost.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::connectionClosedFromServer): notify IDBConnectionProxy that transaction ends.
* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::forgetTransaction): clear finished transactions.
* Modules/indexeddb/client/IDBConnectionProxy.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete): clear perform function unconditionally when the
operation is in completion process.
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] clearContentChangeObservers should be internal to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195066
<rdar://problem/48411682>
Reviewed by Tim Horton.
Now all the empty clearContentChangeObservers() implementations can be removed.
* dom/Document.cpp:
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::clearTimersAndReportContentChange):
(WebCore::ContentChangeObserver::didSuspendActiveDOMObjects): Might need to merge them.
(WebCore::ContentChangeObserver::willDetachPage):
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=195062
<rdar://problem/48409258>
Reviewed by Tim Horton.
Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didScheduleStyleRecalc):
(WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
2019-02-26 Chris Dumez <cdumez@apple.com>
[iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
https://bugs.webkit.org/show_bug.cgi?id=195054
<rdar://problem/48330549>
Reviewed by Geoff Garen.
Add MaintainMemoryCache flag to indicate that the memory cache should not get purged.
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/MemoryRelease.h:
2019-02-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241970.
https://bugs.webkit.org/show_bug.cgi?id=195057
made the QuickLook.LegacyQuickLookContent API test flakey
(Requested by estes on #webkit).
Reverted changeset:
"[iOS] Break a reference cycle between PreviewLoader and
ResourceLoader"
https://bugs.webkit.org/show_bug.cgi?id=194964
https://trac.webkit.org/changeset/241970
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Simplify content observation API by removing explicit DOMTimer observation.
https://bugs.webkit.org/show_bug.cgi?id=195023
<rdar://problem/48381885>
Reviewed by Tim Horton.
In the future we might decide that certain activities don't require DOMTimer observation, but that should
be internal to ContentChangeObserver.
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingContentChanges):
(WebCore::ContentChangeObserver::stopObservingContentChanges):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=195032
<rdar://problem/48388063>
Reviewed by Tim Horton.
This might eventually turn into a regular start/stop content observing call.
* dom/Document.cpp:
(WebCore::Document::updateStyleIfNeeded):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingStyleResolve):
(WebCore::ContentChangeObserver::stopObservingStyleResolve):
2019-02-26 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=195035
<rdar://problem/48389123>
Reviewed by Tim Horton.
Visibility checking logic belongs to ContentChangeObserver.
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::elementImplicitVisibility):
(WebCore::ContentChangeObserver::StyleChange::StyleChange):
(WebCore::ContentChangeObserver::StyleChange::~StyleChange):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::elementImplicitVisibility): Deleted.
(WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
2019-02-26 Philippe Normand <pnormand@igalia.com>
[EGL] Runtime support for RGB565 pixel layout
https://bugs.webkit.org/show_bug.cgi?id=194817
Reviewed by Carlos Garcia Campos.
Currently our graphics pipeline always relies on a ARGB8888 (32
bpp) pixel configuration. On some low-end (old) embedded platforms
the graphics driver is sometimes optimized for 16 bpp
configurations, such as RGB565. On those platforms the application
can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
"RGB565" to adjust to the best pixel configuration supported by
the screen and graphics driver.
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::getEGLConfig):
2019-02-26 Philippe Normand <pnormand@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
[WPE] Add API for webview background color configuration
https://bugs.webkit.org/show_bug.cgi?id=192305
Reviewed by Michael Catanzaro.
Adapt the FrameView API to allow a default non-white background color.
* page/Frame.cpp:
(WebCore::Frame::createView): Replace isTransparent argument with a background color one.
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
(WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
used only in non-dark-mode-css build configurations.
* page/FrameView.h:
* testing/Internals.cpp:
(WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
2019-02-25 Yongjun Zhang <yongjun_zhang@apple.com>
scalableNativeWebpageParameters() is not preserved on new page navigation.
https://bugs.webkit.org/show_bug.cgi?id=194892
<rdar://problem/47538280>
If a page's current default viewport configuration is scalableNativeWebpageParameters due to
the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
configuration until we derive the right values from viewport meta-tag.
Reviewed by Wenson Hsieh.
Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
(WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
(WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
(WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
(WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
* page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
static method to fixedNativeWebpageParameters which better reflects the actual behavior.
2019-02-25 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=194988
<rdar://problem/48343040>
Reviewed by Tim Horton.
ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::startObservingDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimer):
(WebCore::ContentChangeObserver::removeDOMTimer):
2019-02-25 Zalan Bujtas <zalan@apple.com>
[ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=194987
<rdar://problem/48342910>
Reviewed by Tim Horton.
Content obvservation logic should all move to the ContentChangeObserver class.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::contentChangeObserver):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::ContentChangeObserver):
(WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
(WebCore::ContentChangeObserver::startObservingDOMTimer):
(WebCore::ContentChangeObserver::stopObservingDOMTimer):
(WebCore::ContentChangeObserver::containsObservedDOMTimer):
(WebCore::ContentChangeObserver::addObservedDOMTimer):
(WebCore::ContentChangeObserver::removeObservedDOMTimer):
2019-02-25 John Wilander <wilander@apple.com>
Introduce and adopt new class RegistrableDomain for eTLD+1
https://bugs.webkit.org/show_bug.cgi?id=194791
<rdar://problem/48179240>
Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
A new API test was added. Plenty of existing layout tests under
http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
This patch introduces and adopts a new class called WebCore::RegistrableDomain
which represents a domain's eTLD+1 (effective top level domain plus one) and is
the basis for the term "site," as in same-site. Other popular names include
high-level domain, primary domain, and top privately controlled/owned domain.
Effective top level domains are enumerated on the Public Suffix List
(https://publicsuffix.org).
This class just uses the full domain for when the Public Suffix List cannot help
finding the registrable domain and for WebKit ports that haven't enabled
PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
for the null or unique origin (this matches how these origins were handled
before).
The implementation is a wrapper around a String and the functions and class
members that now make use of this new class used to handle regular String
objects which didn't help much in terms of type safety or guarantees that the
string had already been converted to an eTLD+1.
We've at least two bad bugs in the Storage Access API because of confusion
between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
will prohibit such bugs in the future.
Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
WebCore::RegistrableDomain for partitioning in a later patch.
This patch also enhances parameter naming by:
- Removing parts that refer to "primary" as in primaryDomain.
- Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
- Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
- Using the term "domain" consistently instead of e.g. "host."
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
(WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
* dom/Document.h:
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaSessionTitle const):
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::url const):
(WebCore::AdClickAttribution::referrer const):
(WebCore::AdClickAttribution::toString const):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Source::matches const):
(WebCore::AdClickAttribution::Source::deleteValue):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Destination::matches const):
(WebCore::AdClickAttribution::Destination::deleteValue):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
(WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
(WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
(WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
(WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
(WebCore::ResourceLoadObserver::statisticsForOrigin):
(WebCore::primaryDomain): Deleted.
(WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
(WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
* loader/ResourceLoadStatistics.h:
(WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
* page/Page.cpp:
(WebCore::Page::logNavigation):
(WebCore::Page::mainFrameLoadStarted):
* page/Page.h:
* page/PerformanceMonitor.cpp:
(WebCore::reportPageOverPostLoadResourceThreshold):
* platform/RegistrableDomain.h: Added.
(WebCore::RegistrableDomain::RegistrableDomain):
(WebCore::RegistrableDomain::isEmpty const):
(WebCore::RegistrableDomain::string const):
(WebCore::RegistrableDomain::operator!= const):
(WebCore::RegistrableDomain::operator== const):
(WebCore::RegistrableDomain::matches const):
(WebCore::RegistrableDomain::isolatedCopy const):
(WebCore::RegistrableDomain::isHashTableDeletedValue const):
(WebCore::RegistrableDomain::hash const):
(WebCore::RegistrableDomain::RegistrableDomainHash::hash):
(WebCore::RegistrableDomain::RegistrableDomainHash::equal):
(WebCore::RegistrableDomain::encode const):
(WebCore::RegistrableDomain::decode):
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
(WebCore::NetworkStorageSession::removePrevalentDomains):
(WebCore::NetworkStorageSession::hasStorageAccess const):
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
(WebCore::NetworkStorageSession::grantStorageAccess):
(WebCore::getPartitioningDomain): Deleted.
* platform/network/NetworkStorageSession.h:
2019-02-25 Chris Fleizach <cfleizach@apple.com>
AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
https://bugs.webkit.org/show_bug.cgi?id=190138
<rdar://problem/44907695>
Reviewed by Joanmarie Diggs.
Make sure that footer elements use the right role depending on their context.
If scoped to body, they become contentinfo. Otherwise they are just delineated by
a footer subrole.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isLandmark const):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper subrole]):
2019-02-25 Sihui Liu <sihui_liu@apple.com>
IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
https://bugs.webkit.org/show_bug.cgi?id=194709
Reviewed by Geoffrey Garen.
When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so
IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle.
Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
between IDBOpenDBRequest and IDBTransaction.
Test: storage/indexeddb/IDBObject-leak.html
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::~IDBTransaction):
(WebCore::IDBTransaction::connectionClosedFromServer):
* Modules/indexeddb/IDBTransaction.h:
* testing/Internals.cpp:
(WebCore::Internals::numberOfIDBTransactions const):
* testing/Internals.h:
* testing/Internals.idl:
2019-02-25 Zalan Bujtas <zalan@apple.com>
Add missing stream parameter. Unreviewed.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
2019-02-25 Zalan Bujtas <zalan@apple.com>
Unreviewed build fix after r242032.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
2019-02-20 Darin Adler <darin@apple.com>
Incorrect use of String::foldCase for font family names
https://bugs.webkit.org/show_bug.cgi?id=194895
Reviewed by Myles C. Maxfield.
* platform/graphics/FontCascadeDescription.cpp:
(WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
familyNamesAreEqual instead of calling convertToASCIILowercase directly.
(WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
operator== when we want case sensitive family name comparisons. This is a special
case to accomodate CoreText, which uses "."-prefix names for internal fonts that
are treated case sensitively. (Ideally webpages would not use these fonts at all.)
(WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
when we want case sensitive family name hashing.
(WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
AtomicString so we can use this at an additional call site. Converting from an
AtomicString to a String if free and automatic at the existing call sites. Use
convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
must be consistent. 2) this is considerably faster, and 3) font family names don't
need arbitrary Unicode case folding, it's only A-Z that should be folded.
* platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
in the foldedFamilyName function.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
FontCascadeDescription::foldedFamilyName to correctly fold font family names.
2019-02-25 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
https://bugs.webkit.org/show_bug.cgi?id=194992
Reviewed by Xabier Rodriguez-Calvar.
Refactoring, no new tests.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(transformCaps): Simplify the code a little. The idea to use this
utility function came from a review upstream here:
https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
2019-02-25 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Batch player duration updates
https://bugs.webkit.org/show_bug.cgi?id=194220
Reviewed by Xabier Rodriguez-Calvar.
This saves up a ton of CPU cycles doing layout unnecessarily when all
the appended frames extend the duration of the movie, like in
YTTV 2018 59.DASHLatencyVP9.
This patch is an optimization that introduces no new behavior.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
(WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2019-02-25 Miguel Gomez <magomez@igalia.com>
[WPE] Add support for holepunch using an external video player
https://bugs.webkit.org/show_bug.cgi?id=194899
Reviewed by Xabier Rodriguez-Calvar.
Implement the holepunch feature to allow playback using an external player. This creates
a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
whose goal is to just draw a transparent rectangle in the position where the video should be.
This can be used to allow a player placed on a lower plane than the browser to become visible.
Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
* PlatformWPE.cmake:
* platform/HolePunch.cmake: Added.
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
(WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
(WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
(WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
(WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
(WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
(WebCore::MediaPlayerPrivateHolePunch::proxy const):
(WebCore::mimeTypeCache):
(WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
(WebCore::MediaPlayerPrivateHolePunch::supportsType):
(WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
(WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
2019-02-24 Zalan Bujtas <zalan@apple.com>
Introduce ContentChangeObserver class
https://bugs.webkit.org/show_bug.cgi?id=194977
<rdar://problem/48338115>
Reviewed by Simon Fraser.
This patch is about piping through all the related WK* calls.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* loader/FrameLoader.cpp:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* page/Page.h:
(WebCore::Page::contentChangeObserver):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2019-02-24 Simon Fraser <simon.fraser@apple.com>
Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194984
Reviewed by Sam Weinig.
Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
current layout viewport rect. Instead, set the layout viewport on the root
node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
(WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.h:
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
* page/scrolling/cocoa/ScrollingTreeStickyNode.h:
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
2019-02-24 Devin Rousso <drousso@apple.com>
Web Inspector: Change the InspectorOverlay to use native rather than canvas
https://bugs.webkit.org/show_bug.cgi?id=105023
<rdar://problem/13443692>
Reviewed by Brian Burg.
Should be no change in observed functionality.
* inspector/InspectorOverlay.h:
* inspector/InspectorOverlay.cpp:
(WebCore::truncateWithEllipsis): Added.
(WebCore::localPointToRootPoint): Added.
(WebCore::contentsQuadToCoordinateSystem):
(WebCore::effectiveElementForNode): Added.
(WebCore::quadToPath): Added.
(WebCore::drawOutlinedQuadWithClip): Added.
(WebCore::drawOutlinedQuad): Added.
(WebCore::drawFragmentHighlight): Added.
(WebCore::drawShapeHighlight): Added.
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::setIndicating):
(WebCore::InspectorOverlay::shouldShowOverlay const):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::setShowPaintRects): Added.
(WebCore::InspectorOverlay::showPaintRect):
(WebCore::InspectorOverlay::updatePaintRectsTimerFired):
(WebCore::InspectorOverlay::drawNodeHighlight):
(WebCore::InspectorOverlay::drawQuadHighlight):
(WebCore::InspectorOverlay::drawPaintRects):
(WebCore::InspectorOverlay::drawBounds): Added.
(WebCore::InspectorOverlay::drawRulers):
(WebCore::InspectorOverlay::drawElementTitle): Added.
(WebCore::contentsQuadToPage): Deleted.
(WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
(WebCore::buildObjectForPoint): Deleted.
(WebCore::buildObjectForRect): Deleted.
(WebCore::buildArrayForQuad): Deleted.
(WebCore::buildObjectForHighlight): Deleted.
(WebCore::buildObjectForSize): Deleted.
(WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
(WebCore::buildArrayForRendererFragments): Deleted.
(WebCore::localPointToRoot): Deleted.
(WebCore::appendPathCommandAndPoints): Deleted.
(WebCore::appendPathSegment): Deleted.
(WebCore::buildObjectForShapeOutside): Deleted.
(WebCore::buildObjectForElementData): Deleted.
(WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
(WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
(WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
(WebCore::InspectorOverlay::overlayPage): Deleted.
(WebCore::InspectorOverlay::forcePaint): Deleted.
(WebCore::InspectorOverlay::reset): Deleted.
(WebCore::evaluateCommandInOverlay): Deleted.
(WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
(WebCore::InspectorOverlay::freePage): Deleted.
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::setShowPaintRects):
Drive-by: rename `setShowingPaintRects` to better match the protocol.
* inspector/agents/page/PageDebuggerAgent.h:
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::PageDebuggerAgent):
(WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::disconnectAllFrontends):
(WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.cpp:
(WebCore::Internals::inspectorHighlightObject): Deleted.
* inspector/InspectorOverlayPage.css: Removed.
* inspector/InspectorOverlayPage.html: Removed.
* inspector/InspectorOverlayPage.js: Removed.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
2019-02-20 Darin Adler <darin@apple.com>
Finish removing String::format
https://bugs.webkit.org/show_bug.cgi?id=194893
Reviewed by Daniel Bates.
* dom/Document.cpp:
(WebCore::Document::lastModified const): Use makeString and pad.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.
* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
(WebCore::gcTimerString): Use String::number.
* platform/DateComponents.cpp:
(WebCore::DateComponents::toStringForTime const): Use makeString and pad.
(WebCore::DateComponents::toString const): Ditto.
* platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
and that was also inaccurate.
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
Use makeString and pad.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
2019-02-24 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Remove user agent quirk for washingtonpost.com
https://bugs.webkit.org/show_bug.cgi?id=194981
Reviewed by Žan Doberšek.
Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
2019-02-23 Simon Fraser <simon.fraser@apple.com>
Remove remnants of iOS WK1 scrolling tree code
https://bugs.webkit.org/show_bug.cgi?id=194980
Reviewed by Sam Weinig.
Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
to reduce maintenance costs and simplify.
Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
since that was the only concrete subclass, removing code which never applies to iOS WK2
(e.g. the synchronous scrolling code path).
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
(WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
(WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
(WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
(WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
(WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
(WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
(WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
(WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
(WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
(WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
(WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
(WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
(WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
(WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
(WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
* page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
* page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
* page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
* page/scrolling/ios/ScrollingTreeIOS.h: Removed.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
2019-02-23 Justin Fan <justin_fan@apple.com>
[WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
https://bugs.webkit.org/show_bug.cgi?id=194665
Reviewed by Dean Jackson.
Test: map-write-buffers.html. Other tests updated to match new API.
* Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
(WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
(WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
* Modules/webgpu/WebGPUBindGroupDescriptor.h:
* Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
(WebCore::WebGPUBuffer::create):
(WebCore::WebGPUBuffer::WebGPUBuffer):
(WebCore::WebGPUBuffer::mapReadAsync):
(WebCore::WebGPUBuffer::mapWriteAsync):
(WebCore::WebGPUBuffer::unmap):
(WebCore::WebGPUBuffer::destroy):
(WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const):
(WebCore::WebGPUBuffer::mapping const): Deleted.
* Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
(WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPURenderPassDescriptor.cpp:
(WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
* platform/graphics/gpu/GPUBuffer.cpp: Added.
(WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
* platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
(WebCore::GPUBuffer::isVertex const):
(WebCore::GPUBuffer::isUniform const):
(WebCore::GPUBuffer::isStorage const):
(WebCore::GPUBuffer::isReadOnly const):
(WebCore::GPUBuffer::PendingMapPromise::create):
(WebCore::GPUBuffer::isMappable const):
(WebCore::GPUBuffer::isMapWriteable const):
(WebCore::GPUBuffer::isMapReadable const):
(WebCore::GPUBuffer::mapping const): Deleted.
* platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer.
(WebCore::GPUDevice::createBuffer const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
(WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer):
(WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
(WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
(WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
(WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
(WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
(WebCore::GPUBuffer::create): Deleted.
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
Add symbols for new files:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-02-23 Keith Miller <keith_miller@apple.com>
Add new mac target numbers
https://bugs.webkit.org/show_bug.cgi?id=194955
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
2019-02-23 chris fleizach <cfleizach@apple.com>
AX: WebKit is incorrectly mapping the <meter> element to progressbar
https://bugs.webkit.org/show_bug.cgi?id=164051
<rdar://problem/29055615>
Reviewed by Joanmarie Diggs.
Add a specific role for meter and map that to the appropriate mac role.
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canHaveChildren const):
(WebCore::AccessibilityNodeObject::isProgressIndicator const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
(WebCore::AccessibilityObject::isRangeControl const):
(WebCore::AccessibilityObject::computedRoleString const):
* accessibility/AccessibilityObjectInterface.h:
* accessibility/AccessibilityProgressIndicator.cpp:
(WebCore::AccessibilityProgressIndicator::roleValue const):
* accessibility/AccessibilityProgressIndicator.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
2019-02-22 Ryosuke Niwa <rniwa@webkit.org>
Crash in SWServerJobQueue::runNextJobSynchronously
https://bugs.webkit.org/show_bug.cgi?id=194974
Reviewed by Geoffrey Garen.
We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
or there is a timer heap corruption again :(
Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
but convert an existing release assert to a debug assert since this appears to be hitting
too frequently in wild.
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::runNextJobSynchronously):
2019-02-22 Simon Fraser <simon.fraser@apple.com>
Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
https://bugs.webkit.org/show_bug.cgi?id=194968
Reviewed by Antti Koivisto.
Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
reduce that.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::setScrollPosition):
(WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::delta const):
* platform/ScrollTypes.h:
2019-02-22 Eric Liang <ericliang@apple.com>
AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
https://bugs.webkit.org/show_bug.cgi?id=194923
Reviewed by Chris Fleizach.
Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
Test: accessibility/mac/children-in-navigation-order-returns-children.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2019-02-22 Tim Horton <timothy_horton@apple.com>
ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
https://bugs.webkit.org/show_bug.cgi?id=194963
Reviewed by Dean Jackson.
Tested by existing failing API test.
* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged): Deleted.
* page/Page.h:
(WebCore::Page::pageOverlayController):
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::installedPageOverlaysChanged):
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::willDetachRootLayer): Deleted.
* page/PageOverlayController.h:
As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
Also, make it ignore isInWindow state; otherwise, if you install a overlay
and then come into window, nothing installs the root layer. There is no
need for this code to follow in-window state manually anymore since
the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
Make some methods private, and make detachViewOverlayLayers only touch
*view* overlays, so that we don't detach the document-relative root
layer when you drop to having no view overlays. This maintains
existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
Now there are no callers of willDetachRootLayer, so remove it.
2019-02-22 Andy Estes <aestes@apple.com>
[iOS] Break a reference cycle between PreviewLoader and ResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194964
<rdar://problem/48279441>
Reviewed by Alex Christensen.
When a document's QuickLook preview is loaded, a reference cycle is created between
PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
ResourceLoader::releaseResources().
Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::releaseResources):
2019-02-22 Sihui Liu <sihui_liu@apple.com>
Crash under IDBServer::IDBConnectionToClient::identifier() const
https://bugs.webkit.org/show_bug.cgi?id=194843
<rdar://problem/48203102>
Reviewed by Geoffrey Garen.
UniqueIDBDatabase should ignore requests from connections that are already closed.
Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually.
One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
may start a version change transaction and ask for identifier from the connection that is already gone.
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
* Modules/indexeddb/server/IDBConnectionToClient.h:
(WebCore::IDBServer::IDBConnectionToClient::isClosed):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
(WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2019-02-22 Wenson Hsieh <wenson_hsieh@apple.com>
Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
https://bugs.webkit.org/show_bug.cgi?id=194703
<rdar://problem/48111775>
Reviewed by Ryosuke Niwa.
Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
"Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
Tests: fast/events/before-input-events-prevent-block-text-direction.html
fast/events/before-input-events-prevent-inline-text-direction.html
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::apply):
* editing/EditAction.cpp:
(WebCore::undoRedoLabel):
* editing/EditAction.h:
* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):
* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::Editor::setBaseWritingDirection):
* editing/EditorCommand.cpp:
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
2019-02-22 Rob Buis <rbuis@igalia.com>
Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
https://bugs.webkit.org/show_bug.cgi?id=160172
Reviewed by Frédéric Wang.
Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
from HTTPParsers instead.
No new tests, already covered by MathML tests.
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
* mathml/MathMLElement.h:
* mathml/MathMLPresentationElement.cpp:
(WebCore::MathMLPresentationElement::parseMathMLLength):
* mathml/MathMLTokenElement.cpp:
(WebCore::MathMLTokenElement::convertToSingleCodePoint):
2019-02-22 Eric Carlson <eric.carlson@apple.com>
Update some media logging
https://bugs.webkit.org/show_bug.cgi?id=194915
Reviewed by Jer Noble.
No new tests, no functional change.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::evictCodedFrames):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
(WebCore::HTMLMediaElement::seekTask):
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
(WebCore::HTMLMediaElement::setLoop):
(WebCore::HTMLMediaElement::setControls):
(WebCore::HTMLMediaElement::sourceWasRemoved):
* html/MediaElementSession.cpp:
(WebCore::convertEnumerationToString):
* html/MediaElementSession.h:
(WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
2019-02-22 Rob Buis <rbuis@igalia.com>
Fix unitless usage of mathsize
https://bugs.webkit.org/show_bug.cgi?id=194940
Reviewed by Frédéric Wang.
Convert unitless lengths to percentage values to correct the computed
font size.
* mathml/MathMLElement.cpp:
(WebCore::convertToPercentageIfNeeded):
(WebCore::MathMLElement::collectStyleForPresentationAttribute):
2019-02-21 Simon Fraser <simon.fraser@apple.com>
Hardcode Visual Viewports on everywhere except iOS WK1
https://bugs.webkit.org/show_bug.cgi?id=194928
Reviewed by Zalan Bujtas.
Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
change the default value of the Setting to 'true', and hardcode WebView on iOS to
set it to false. The setting has shipped for several years and there's no need to turn
it off now.
Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
Visual Viewports are not enabled.
Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
that only runs in WK2
* page/Settings.yaml:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
(WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
(WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
2019-02-21 Darin Adler <darin@apple.com>
Some refinements for Node and Document
https://bugs.webkit.org/show_bug.cgi?id=194764
Reviewed by Ryosuke Niwa.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press): Use shadowHost instead of
deprecatedShadowAncestorNode.
(WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
(WebCore::AccessibilityObject::focusedUIElement const): Use existing page
function to streamline.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessKey const): Use
attributeWithoutSynchronization for efficiency and consistency with other
code working with the accesskey attribute.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::childrenChanged): Added call to
invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
* dom/DecodedDataDocumentParser.cpp:
(WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
type change of createDecoderIfNeeded to decoder.
(WebCore::DecodedDataDocumentParser::flush): Ditto.
* dom/Document.cpp:
(WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
to match WebKit coding style. Changed to use unique_ptr instead of separate
boolean to keep track of map validity status.
(WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
clarify that this is a cache. Changed to use composedTreeDescendants rather
than explicit calls to shadowRoot. Use add instead of set so that first element
in document order wins, instead of last element in document order. Updated
to make a new map in a new unique_ptr instead of populating a map.
(WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
invalidateAccessKeyMap, and left an inline part in the header so the fast case
of quickly checking for a null pointer can be inlined.
(WebCore::Document::doctype const): Use downcast instead of static_cast.
(WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
from here to childrenChanged and accesskey attribute change handling.
(WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
directly since this is the only place that does it and we don't need to factor
that one line of code into a function.
(WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
that always returns nullptr and can be inlined.
(WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
(WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
the create function, since Document::create now always involves no frame.
(WebCore::Document::didAssociateFormControl): Changed argument type to a reference
and simplified the logic with a local variable.
(WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
checks and rearranged things so that m_associatedFormControls will always
get cleared even if the document is no longer associated with a page.
* dom/Document.h: Removed unnnecessary explicit values for enumerations (first
value is always zero, etc.) and formatted simple enumerations in a single line
for easier reading. Moved Document::create fucntion bodies out of line, removed
the frame argument from the simple "create with URL" overload and made the frame
argument for createNonRenderedPlaceholder be a reference rather than a pointer.
Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
m_elementsByAccessKey to m_accessKeyCache and changed its type.
Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
* dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
placeholder returning null.
* dom/Element.cpp:
(WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
value of the accesskey attribute is changed. Also moved the class attribute code
so the attributes here are in alphabetical order (only class and id were out of
alphabetical order).
* dom/Node.cpp:
(WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
use deprecatedShadowAncestorNode and used boolean operators to make it a
single line and easier to understand. Also added a FIXME since the
containsIncludingShadowDOM function is so similar, yet differently written.
(WebCore::Node::contains const): Rewrote as a single line to make this easier
to read and to *slightly* improve the speed in the "this == node" case.
(WebCore::Node::containsIncludingHostElements const): Use downcast.
(WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
* dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
instead of deprecatedShadowAncestorNode.
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
didAssociateFormControl.
(WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
attribute, because we want to call the base class parseAttribute in that case.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
didAssociateFormControl.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
attribute with mysterious FIXME, because we want to call the base class
parseAttribute in that case. The old code had no effect before; the access key
logic would still find the attribute; if the goal is to ignore the attribute
for these elements we will need a different solution.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
m_frame was always null.
(WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
the passed in frame, which was always nullptr, and initialized some booleans and an
enumeration, which are now initialized in the class definition.
(WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
(WebCore::DocumentWriter::begin): Updated now that State is an enum class.
(WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
to return a reference.
(WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
updated now that State is an enum class.
(WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
enum class.
(WebCore::DocumentWriter::end): Ditto.
* loader/DocumentWriter.h: Removed unneeded include and forward declaration.
Removed the frame pointer argument to the constructor, caller was always passing a
nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
to decoder and changed it to return a reference. Initialized m_frame,
m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
to initialize them in a constructor. Renamed the enum from WriterState to State since
it's a member of DocumentWriter already, and made it an enum class rather than ending
each enumeration value with WritingState.
* page/DragController.cpp:
(WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
function instead.
(WebCore::hasEnabledColorInputAsShadowHost): Added.
(WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
Also added FIXME since it seems this should instead be using parentElementInComposedTree.
(WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
(WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
into a local variable to simplify code.
(WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.
* page/EventHandler.cpp:
(WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.
* page/FocusController.cpp:
(WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
Document::createNonRenderedPlaceholder.
2019-02-21 Daniel Bates <dabates@apple.com>
Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
https://bugs.webkit.org/show_bug.cgi?id=194906
<rdar://problem/44305947>
Reviewed by Brent Fulgham.
Ensure that a request for a top-level navigation is annotated as such regardless of whether
the request has a computed Same Site policy.
"New loads" initiated by a the client (Safari) either by API or a human either explicitly
typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
from an existing page. (Command + click should be thought of as a convenience to the user from
having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
Currently the frame loader marks a request as a top-level navigation if and only if the request
does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.
[1] See Note for (1) in <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
[2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>
Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
level navigation bit.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
level navigation bit.
2019-02-21 Per Arne Vollan <pvollan@apple.com>
Layout Test fast/text/international/khmer-selection.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=191368
Reviewed by Brent Fulgham.
GlyphBuffer's offset array wasn't getting filled by UniscribeController.
Our underlining code requires this array.
Uniscribe gives us a character -> glyph mapping, so we just have to compute
the inverse and give it to the GlyphBuffer.
This patch is written by Myles C. Maxfield.
Test: fast/text/international/khmer-selection.html.
* platform/graphics/GlyphBuffer.h:
(WebCore::GlyphBuffer::add):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::advance):
(WebCore::UniscribeController::itemizeShapeAndPlace):
(WebCore::UniscribeController::shapeAndPlaceItem):
* platform/graphics/win/UniscribeController.h:
2019-02-21 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak UniqueIDBDatabase in layout tests
https://bugs.webkit.org/show_bug.cgi?id=194870
<rdar://problem/48163812>
Reviewed by Geoffrey Garen.
UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it
receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
pointer should be released when a database task finishes, but it didn't perform a check when a confirm message
is received.
No new test as the order of task completion and confirmation arrival is uncertain.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
2019-02-21 Andy Estes <aestes@apple.com>
contentfiltering tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189434
<rdar://44239943>
Reviewed by Simon Fraser.
Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
This fixes world leaks in several tests in LayoutTests/contentfiltering/.
* bindings/js/ScriptController.h:
* loader/ContentFilter.cpp:
(WebCore::ContentFilter::didDecide):
2019-02-21 Don Olmstead <don.olmstead@sony.com>
[CMake][Win] Fix !USE(CF) build of WebCore
https://bugs.webkit.org/show_bug.cgi?id=194879
Reviewed by Konstantin Tokarev.
* PlatformAppleWin.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
2019-02-21 Zalan Bujtas <zalan@apple.com>
[LFC][Floats] Add support for placing formatting roots in-between floats.
https://bugs.webkit.org/show_bug.cgi?id=194902
Reviewed by Antti Koivisto.
This patch add support for placing a formatting root box in-between existing floats.
The initial vertical position of a formatting root is its static position which can make the box
placed above exsiting floats (whereas we can never place a regular float above existing floats.)
Test: fast/block/block-only/floats-and-block-formatting-roots.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
(WebCore::Layout::FloatPair::isEmpty const):
(WebCore::Layout::FloatPair::operator* const):
(WebCore::Layout::Iterator::operator* const):
(WebCore::Layout::begin):
(WebCore::Layout::end):
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
(WebCore::Layout::findAvailablePosition):
(WebCore::Layout::FloatingContext::findPositionForFloatBox const):
(WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
(WebCore::Layout::FloatPair::FloatPair):
(WebCore::Layout::FloatPair::left const):
(WebCore::Layout::FloatPair::right const):
(WebCore::Layout::FloatPair::intersects const):
(WebCore::Layout::FloatPair::operator == const):
(WebCore::Layout::FloatPair::horizontalConstraints const):
(WebCore::Layout::FloatPair::bottom const):
(WebCore::Layout::Iterator::operator++):
(WebCore::Layout::Iterator::set):
(WebCore::Layout::FloatingPair::isEmpty const): Deleted.
(WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
(WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
(WebCore::Layout::FloatingPair::FloatingPair): Deleted.
(WebCore::Layout::FloatingPair::left const): Deleted.
(WebCore::Layout::FloatingPair::right const): Deleted.
(WebCore::Layout::FloatingPair::intersects const): Deleted.
(WebCore::Layout::FloatingPair::operator == const): Deleted.
(WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
(WebCore::Layout::FloatingPair::bottom const): Deleted.
* layout/floats/FloatingContext.h:
2019-02-21 Rob Buis <rbuis@igalia.com>
Update MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=180526
Reviewed by Darin Adler.
Further testing showed the MIME parser needs these fixes:
- stripWhitespace is wrong for removing HTTP whitespace, use
stripLeadingAndTrailingHTTPSpaces instead.
- HTTP Token code points checking for Rfc2045 and Mimesniff were
mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
- Quoted Strings were not unescaped/escaped, this seems ok for
serializing but is wrong when gettings individual parameter values.
Implement [1] and [2] Step 2.4 to properly unescape and escape.
This change also tries to avoid hard to read uses of find.
Test: ParsedContentType.Serialize
[1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
[2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
* platform/network/ParsedContentType.cpp:
(WebCore::skipSpaces):
(WebCore::parseToken):
(WebCore::isNotQuoteOrBackslash):
(WebCore::collectHTTPQuotedString):
(WebCore::containsNonTokenCharacters):
(WebCore::parseQuotedString):
(WebCore::ParsedContentType::parseContentType):
(WebCore::ParsedContentType::create):
(WebCore::ParsedContentType::setContentType):
(WebCore::containsNonQuoteStringTokenCharacters):
(WebCore::ParsedContentType::setContentTypeParameter):
(WebCore::ParsedContentType::serialize const):
(WebCore::substringForRange): Deleted.
(WebCore::isNonTokenCharacter): Deleted.
(WebCore::isNonQuotedStringTokenCharacter): Deleted.
* platform/network/ParsedContentType.h:
2019-02-20 Simon Fraser <simon.fraser@apple.com>
REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
https://bugs.webkit.org/show_bug.cgi?id=194889
rdar://problem/47755552
Reviewed by Tim Horton.
After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
layer.
Not currently testable.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2019-02-20 Dean Jackson <dino@apple.com>
Rotation animations sometimes use the wrong origin (affects apple.com)
https://bugs.webkit.org/show_bug.cgi?id=194878
<rdar://problem/43908047>
Reviewed by Simon Fraser.
Some versions of CoreAnimation apply additive animations in reverse
order. Detect this and reverse the list of animations we provide.
Update the existing animations/additive-transform-animations.html test to
be a ref-test that would identify this failure. Previously it relied on
a pixel test.
* platform/graphics/ca/GraphicsLayerCA.cpp: Use
HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
not to flip the list of animations (and mark the correct ones as
additive).
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
2019-02-20 Don Olmstead <don.olmstead@sony.com>
[Win] Guard CF usage in RenderThemeWin
https://bugs.webkit.org/show_bug.cgi?id=194875
Reviewed by Alex Christensen.
No new tests. No change in behavior.
Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::stringWithContentsOfFile):
(WebCore::RenderThemeWin::mediaControlsStyleSheet):
(WebCore::RenderThemeWin::mediaControlsScript):
* rendering/RenderThemeWin.h:
2019-02-20 Ryosuke Niwa <rniwa@webkit.org>
Crash in DOMWindowExtension::suspendForPageCache
https://bugs.webkit.org/show_bug.cgi?id=194871
Reviewed by Chris Dumez.
This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
to avoid the crash.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDestroyCachedFrame):
(WebCore::DOMWindow::willDestroyDocumentInFrame):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::suspendForPageCache):
(WebCore::DOMWindow::resumeFromPageCache):
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::suspendForPageCache):
2019-02-20 Alex Christensen <achristensen@webkit.org>
Always call CompletionHandlers after r240909
https://bugs.webkit.org/show_bug.cgi?id=194823
Reviewed by Ryosuke Niwa.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
2019-02-20 Andy Estes <aestes@apple.com>
[Xcode] Add SDKVariant.xcconfig to various Xcode projects
https://bugs.webkit.org/show_bug.cgi?id=194869
Rubber-stamped by Jer Noble.
* WebCore.xcodeproj/project.pbxproj:
2019-02-20 Said Abou-Hallawa <sabouhallawa@apple.com>
drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
https://bugs.webkit.org/show_bug.cgi?id=194746
Reviewed by Dean Jackson.
Test: fast/canvas/canvas-drawImage-composite-copy.html
If the source canvas of drawImage() is the same as the destination and
globalCompositeOperation is set to "copy", copy the srcRect from the
canvas to a temporary buffer before calling clearCanvas() then drawImage
from this temporary buffer.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::copyRectToBuffer):
* platform/graphics/ImageBuffer.h:
2019-02-20 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
https://bugs.webkit.org/show_bug.cgi?id=194866
Reviewed by Antti Koivisto.
r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
2019-02-20 Daniel Bates <dabates@apple.com>
[iOS] Tweak UI for focus rings
https://bugs.webkit.org/show_bug.cgi?id=194864
<rdar://problem/47831886>
Reviewed by Brent Fulgham.
Make use of UIKit constants to make focus rings pretty.
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
2019-02-20 Timothy Hatcher <timothy@apple.com>
RenderThemeIOS should use RenderTheme's color cache instead of its own.
https://bugs.webkit.org/show_bug.cgi?id=194822
rdar://problem/48208296
Reviewed by Tim Horton.
Tested by fast/css/apple-system-colors.html.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::isAppleLegacyCssValueKeyword):
* platform/graphics/Color.h:
* platform/graphics/cg/ColorCG.cpp:
(WebCore::makeRGBAFromCGColor):
(WebCore::Color::Color):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::systemColor const):
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
2019-02-20 Loïc Yhuel <loic.yhuel@softathome.com>
Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
https://bugs.webkit.org/show_bug.cgi?id=194819
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
* Modules/websockets/WebSocketChannel.h:
(WebCore::WebSocketChannel::hasCreatedHandshake):
* inspector/agents/page/PageNetworkAgent.cpp:
Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
2019-02-20 Zalan Bujtas <zalan@apple.com>
[LFC][Floats] Make FloatAvoider::resetPosition implicit
https://bugs.webkit.org/show_bug.cgi?id=194855
Reviewed by Antti Koivisto.
Let's compute the initial top/left position during c'tor time.
This is in preparation for fixing formatting root box placement in a float context.
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::resetPosition): Deleted.
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::displayBox):
(WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::FloatBox):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatBox.h:
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::floatingPosition const):
2019-02-20 Don Olmstead <don.olmstead@sony.com>
[MSVC] Fix compilation errors with lambdas in Service Workers
https://bugs.webkit.org/show_bug.cgi?id=194841
Reviewed by Alex Christensen.
No new tests. No change in behavior.
MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
referring to the enclosing lambda according to MSVC. This patch works around this behavior
through by using the `protectedThis` pattern in WebKit code.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::openSQLiteDatabase):
2019-02-20 Adrian Perez de Castro <aperez@igalia.com>
[WPE][GTK] Enable support for CONTENT_EXTENSIONS
https://bugs.webkit.org/show_bug.cgi?id=167941
Reviewed by Carlos Garcia Campos.
* platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
to the list of files with translatable strings.
2019-02-19 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
https://bugs.webkit.org/show_bug.cgi?id=194827
rdar://problem/47620594
Reviewed by Antti Koivisto.
Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
layer configurations, since a repaint implies that a layer gains painted content. This is done
via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
for the root. The configuration state that matters here is whether the layer contains painted content,
and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
and feeds into GraphicsLayer::drawsContent().
However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
to always return false for the RenderView's layer (the root).
Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
respect it.
Test: compositing/visibility/root-visibility-toggle.html
* page/Frame.h:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerTreeAsText):
* testing/Internals.cpp:
(WebCore::toLayerTreeFlags):
* testing/Internals.h:
* testing/Internals.idl:
2019-02-19 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
https://bugs.webkit.org/show_bug.cgi?id=194820
Reviewed by Geoffrey Garen.
This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
doesnt require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
and we don't rely on PolicyChecker's load type until then.
Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
invoking checkNewWindowPolicy which is not the right assumption.
Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadPostRequest):
2019-02-19 Zalan Bujtas <zalan@apple.com>
Fix post-commit feedback.
Unreviewed.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingPair::intersects const):
2019-02-19 Zalan Bujtas <zalan@apple.com>
[LFC][Floats] Remove redundant intersecting logic
https://bugs.webkit.org/show_bug.cgi?id=194804
Reviewed by Antti Koivisto.
floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::intersects const):
2019-02-19 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241722.
https://bugs.webkit.org/show_bug.cgi?id=194801
Causing time outs and EWS failures after expectation file was
added. (Requested by ShawnRoberts on #webkit).
Reverted changeset:
"IndexedDB: leak IDBDatabase and IDBTransacstion in layout
tests"
https://bugs.webkit.org/show_bug.cgi?id=194709
https://trac.webkit.org/changeset/241722
2019-02-16 Darin Adler <darin@apple.com>
Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
https://bugs.webkit.org/show_bug.cgi?id=194752
Reviewed by Daniel Bates.
* Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
got included because of Logger.h, but that no longer pulls in HexNumber.h.
* css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
* css/CSSPrimitiveValue.cpp: Ditto.
* css/CSSUnicodeRangeValue.cpp:
(WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
of String::format and "%x".
* html/HTMLMediaElement.h:
(WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
* html/canvas/WebGLRenderingContextBase.cpp:
(GetErrorString): Use makeString and hex instead of String::format and "%04x".
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
from HTMLMediaElement.h and use makeString instead of String::format. Also use
the word "debug" to make it clear that it's not OK to use this string, with a
pointer value serialized into it, outside of debugging.
* html/track/TextTrackCue.h: Added TextTrackCue::debugString.
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
instead of String::format and "%.1f" etc.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
the old code that did each of the four characters explicitly.
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
* platform/graphics/Color.cpp:
(WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
digit separately.
* platform/graphics/FloatPolygon.cpp:
(WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
from the header and use makeString instead of String::format. Also use
the word "debug" to make it clear that it's not OK to use this string, with a
pointer value serialized into it, outside of debugging.
* platform/graphics/FloatPolygon.h: Updated for the above.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
(WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
* platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
(WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::makeElement): Ditto.
(WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
* platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
and "using namespace WTF".
* platform/win/GDIObjectCounter.cpp:
(WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
* platform/win/KeyEventWin.cpp:
(WebCore::keyIdentifierForWindowsKeyCode): Ditto.
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObject::debugString const): Added. Moved string conversion here
from the header and use makeString instead of String::format. Also use
the word "debug" to make it clear that it's not OK to use this string, with a
pointer value serialized into it, outside of debugging.
* rendering/FloatingObjects.h: Updated for the above.
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::debugString const): Added. Moved string
conversion here from the header and use makeString instead of String::format.
Also use the word "debug" to make it clear that it's not OK to use this string,
with a pointer value serialized into it, outside of debugging.
* rendering/RenderFragmentContainer.h: Updated for the above.
* rendering/RenderFragmentedFlow.h: Ditto.
* testing/Internals.cpp:
(WebCore::Internals::address): Use makeString instead of String::format.
2019-02-18 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
https://bugs.webkit.org/show_bug.cgi?id=194670
<rdar://problem/39066529>
Reviewed by Tim Horton.
Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
special codepath in WebContentReader::readImage.
This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
conforms to "public.content", we take this codepath instead of first attempting the web content reading types
supported by default in WebKit.
See below for more detail.
Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
* editing/Editor.cpp:
(WebCore::Editor::clientReplacementURLForResource): Deleted.
* editing/Editor.h:
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::mimeTypeFromContentType):
(WebCore::contentTypeIsSuitableForInlineImageRepresentation):
(WebCore::createFragmentAndAddResources):
(WebCore::sanitizeMarkupWithArchive):
Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
(WebCore::WebContentReader::readImage):
(WebCore::attachmentForFilePath):
(WebCore::attachmentForData):
Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
of their similarities into helper functions.
(WebCore::WebContentReader::readDataBuffer):
(WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
* loader/EmptyClients.cpp:
* page/EditorClient.h:
* platform/Pasteboard.h:
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
(WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
fidelity order instead.
* platform/PasteboardStrategy.h:
* platform/PlatformPasteboard.h:
* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
informationForItemAtIndex out of the inner loop when reading web content.
(WebCore::Pasteboard::readRespectingUTIFidelities):
Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
PasteboardItemInfo, instead of being sent in a separate message.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
(WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
2019-02-18 Daniel Bates <dabates@apple.com>
Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
https://bugs.webkit.org/show_bug.cgi?id=194785
Reviewed by Simon Fraser.
Change from early return to else-clause to make the states clearer and make it more straightforward
to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
switch to uniform initializer syntax.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::paintCheckboxDecorations):
2019-02-18 Daniel Bates <dabates@apple.com>
[iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
https://bugs.webkit.org/show_bug.cgi?id=193599
<rdar://problem/47399602>
Reviewed by Simon Fraser.
For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
for text fields, textareas, keygens, and selects so as to match the visual appearance of all
the other controls.
Tests: fast/forms/ios/focus-button.html
fast/forms/ios/focus-checkbox.html
fast/forms/ios/focus-checked-checkbox.html
fast/forms/ios/focus-checked-radio.html
fast/forms/ios/focus-radio.html
fast/forms/ios/focus-reset-button.html
fast/forms/ios/focus-search-field.html
fast/forms/ios/focus-submit-button.html
fast/forms/ios/focus-text-field.html
fast/forms/ios/focus-textarea.html
* css/html.css:
(:focus): Use 3px outline width.
(input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
2019-02-18 Oriol Brufau <obrufau@igalia.com>
[css-grid] Handle indefinite percentages in fit-content()
https://bugs.webkit.org/show_bug.cgi?id=194509
Reviewed by Javier Fernandez.
Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html
If the size of the grid container depends on the size of its tracks,
a percentage in fit-content() is indefinite. Without this patch, some
places treated this case as fit-content(0), which prevented the grid
container from growing enough to contain the max-content contribution
of its grid items.
This patch treats such fit-content() as minmax(auto, max-content),
but once the size of the grid container is known and it is laid out
"for real", then the percentage is definite and it's used.
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2019-02-18 John Wilander <wilander@apple.com>
Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
https://bugs.webkit.org/show_bug.cgi?id=194777
<rdar://problem/47731945>
Reviewed by Geoffrey Garen and Chris Dumez.
Test: http/tests/storageAccess/remove-requesting-iframe.html
* dom/Document.cpp:
(WebCore::Document::hasFrameSpecificStorageAccess const):
Now checks for the existence of the frame.
(WebCore::Document::setHasFrameSpecificStorageAccess):
Now checks for the existence of the frame.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
Now checks that the session ID is valid.
2019-02-18 Jer Noble <jer.noble@apple.com>
-[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
https://bugs.webkit.org/show_bug.cgi?id=194790
<rdar://problem/33866742>
Reviewed by Jon Lee.
Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2019-02-18 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Better categorize CPU usage per-thread / worker
https://bugs.webkit.org/show_bug.cgi?id=194564
Reviewed by Devin Rousso.
Test: inspector/cpu-profiler/threads.html
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThreadsMutex):
(WebCore::WorkerThread::workerThreadCount):
(WebCore::WorkerThread::WorkerThread):
(WebCore::WorkerThread::~WorkerThread):
(WebCore::WorkerThread::workerThread):
(WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
* workers/WorkerThread.h:
(WebCore::WorkerThread::identifier const):
Expose the set of all WorkerThreads.
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::collectSample):
Send inspector additional per-thread data.
* page/ResourceUsageData.h:
(WebCore::WorkerCPUInfo::WorkerCPUInfo):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ThreadInfo::ThreadInfo):
(WebCore::threadInfos):
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::threadSendRights): Deleted.
(WebCore::cpuUsage): Deleted.
Compute per-thread values on cocoa ports.
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformCollectCPUData):
Stub per-thread values on linux ports.
2019-02-18 Jer Noble <jer.noble@apple.com>
Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
https://bugs.webkit.org/show_bug.cgi?id=194786
Reviewed by Eric Carlson.
Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
in an exception handler.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
2019-02-18 Daniel Bates <dabates@apple.com>
[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
https://bugs.webkit.org/show_bug.cgi?id=192824
<rdar://problem/47100332>
Reviewed by Wenson Hsieh.
When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
now that hardware key events to non-editable elements use the same code path as for editable elements.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
!USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
(WebCore::isFunctionKey): Ditto.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
2019-02-18 Eric Carlson <eric.carlson@apple.com>
Add MSE logging configuration
https://bugs.webkit.org/show_bug.cgi?id=194719
<rdar://problem/48122151>
Reviewed by Joseph Pecoraro.
No new tests, updated inspector/console/webcore-logging.html.
* dom/Document.cpp:
(WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
2019-02-18 Antoine Quint <graouts@apple.com>
[iOS] Dispatch additional events along with pointerdown and pointerup
https://bugs.webkit.org/show_bug.cgi?id=194776
<rdar://problem/48164284>
Reviewed by Brent Fulgham.
The Pointer Events specification mandates that "pointerover" and "pointerenter" events precede a "pointerdown" event and that "pointerout"
and "pointerleave" events follow a "pointerup" event. We remove the EventHandler::dispatchPointerEventForTouchAtIndex() method and replace
it with a PointerCaptureController::dispatchEventForTouchAtIndex() that can handle the dispatch of such additional events correctly, also
allowing for two PointerCaptureController methods (pointerEventWillBeDispatched and pointerEventWasDispatched) to become private.
Test: pointerevents/ios/over-enter-out-leave.html
* dom/EventNames.h: Add the new "pointerover", "pointerenter", "pointerout" and "pointerleave" event types.
* dom/PointerEvent.h:
* dom/ios/PointerEventIOS.cpp:
(WebCore::PointerEvent::create):
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchPointerEventForTouchAtIndex): Deleted.
* page/EventHandler.h:
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Take the existing code from EventHandler::dispatchPointerEventForTouchAtIndex()
and extend it to dispatch additional events as mandated. Since several events may be dispatched we check whether the dispatch of any of those events
had defaultPrevented() or defaultHanded() return true and return those values as a pair.
(WebCore::PointerCaptureController::pointerEventWasDispatched):
* page/PointerCaptureController.h:
2019-02-18 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak IDBDatabase and IDBTransacstion in layout tests
https://bugs.webkit.org/show_bug.cgi?id=194709
Reviewed by Geoffrey Garen.
When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so
IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle.
Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
between IDBOpenDBRequest and IDBTransaction.
Test: storage/indexeddb/IDBObject-leak.html
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::connectionToServerLost):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
(WebCore::IDBTransaction::~IDBTransaction):
(WebCore::IDBTransaction::finishedDispatchEventForRequest):
(WebCore::IDBTransaction::connectionClosedFromServer):
* Modules/indexeddb/IDBTransaction.h:
* testing/Internals.cpp:
(WebCore::Internals::numberOfIDBTransactions const):
* testing/Internals.h:
* testing/Internals.idl:
2019-02-18 Chris Fleizach <cfleizach@apple.com>
AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
https://bugs.webkit.org/show_bug.cgi?id=194742
Reviewed by Chris Dumez.
With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
receive notifications.
It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
page load.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
2019-02-18 Megan Gardner <megan_gardner@apple.com>
Turn On Smart Delete
https://bugs.webkit.org/show_bug.cgi?id=194320
Reviewed by Ryosuke Niwa.
Updated the following tests to work with iOS:
* editing/deleting/smart-delete-001.html:
* editing/deleting/smart-delete-002.html:
* editing/deleting/smart-delete-003.html:
* editing/deleting/smart-delete-004.html:
* editing/deleting/smart-delete-across-editable-boundaries-2.html:
* editing/selection/delete-word-granularity-text-control.html:
Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other
platforms to turn on smart delete when desired.
* editing/Editor.cpp:
(WebCore::Editor::shouldSmartDelete):
Allow platfroms to determine if smart delete should be on.
On mac, this is via word granularity, on iOS this is just on all the time.
(WebCore::Editor::canSmartCopyOrDelete):
(WebCore::Editor::performCutOrCopy):
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::executeDelete):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::shouldSmartDelete):
* editing/mac/EditorMac.mm:
(WebCore::Editor::shouldSmartDelete):
2019-02-17 David Kilzer <ddkilzer@apple.com>
Unreviewed, rolling out r241620.
"Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
(Requested by ddkilzer on #webkit.)
Reverted changeset:
"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241620
2019-02-16 Zalan Bujtas <zalan@apple.com>
[LFC] RenderImage's default intrinsic size is 0.
https://bugs.webkit.org/show_bug.cgi?id=194745
Reviewed by Antti Koivisto.
While the images are being loaded, their intrinsic size is set to 0 (RenderImage c'tor). Note that this code is temporary.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2019-02-16 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Add support for block replaced intrinsic width.
https://bugs.webkit.org/show_bug.cgi?id=194705
Reviewed by Simon Fraser.
Replaced boxes should report their intrinsic width as preferred widths.
Test: fast/block/block-only/replaced-intrinsic-width-simple.html
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2019-02-16 Zalan Bujtas <zalan@apple.com>
[LFC] Apply min/max width constraints to preferred width computation
https://bugs.webkit.org/show_bug.cgi?id=194739
Reviewed by Simon Fraser.
Ensure that both min-height and max-height are taken into account while computing the preferred width.
Test: fast/block/block-only/min-max-and-preferred-width-simple.html
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2019-02-15 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Make builtin objects more lazily initialized under non-JIT mode
https://bugs.webkit.org/show_bug.cgi?id=194727
Reviewed by Saam Barati.
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController):
(readableByteStreamControllerRespond):
2019-02-15 Dean Jackson <dino@apple.com>
Allow emulation of user gestures from Web Inspector console
https://bugs.webkit.org/show_bug.cgi?id=194725
<rdar://problem/48126604>
Reviewed by Joseph Pecoraro and Devin Rousso.
Test: inspector/runtime/evaluate-userGestureEmulation.html
* inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
a UserGestureIndicator based on the emulateUserGesture option.
(WebCore::PageRuntimeAgent::evaluate):
* inspector/agents/page/PageRuntimeAgent.h:
2019-02-15 Chris Dumez <cdumez@apple.com>
Sample domainsVisited diagnostic logging
https://bugs.webkit.org/show_bug.cgi?id=194657
Reviewed by Ryosuke Niwa.
Sample domainsVisited diagnostic logging, we are getting a lot of data from
this key and this is hurting our other keys.
* page/Page.cpp:
(WebCore::Page::logNavigation):
2019-02-15 Ryosuke Niwa <rniwa@webkit.org>
Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
https://bugs.webkit.org/show_bug.cgi?id=194691
Reviewed by Simon Fraser.
The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
without updating the layout of ancestor documents (i.e. documents in which frame owner
elements appear) even though it hit-tests against the top-level document's RenderView.
Fixed the bug by updating the layout of the top-level document as needed.
Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::isReplacementObscured):
2019-02-15 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
* platform/NotImplemented.h:
* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
* platform/gtk/RenderThemeWidget.cpp:
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::EnvironmentVariableReader::read): Deleted.
(WebCore::EnvironmentVariableReader::defined): Deleted.
(WebCore::EnvironmentVariableReader::readAs): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
* platform/network/playstation/CurlSSLHandlePlayStation.cpp:
(WebCore::getCACertPathEnv):
* platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::topLevelPath):
(WebCore::webkitBuildDirectory):
* platform/unix/LoggingUnix.cpp:
(WebCore::logLevelString):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
Utilize WTF::Environment where possible.
2019-02-15 Antoine Quint <graouts@apple.com>
Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=194702
<rdar://problem/48109355>
Reviewed by Dean Jackson.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
* page/EventHandler.h:
2019-02-15 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Inline WebVTT styles should start with '::cue'
https://bugs.webkit.org/show_bug.cgi?id=194227
Reviewed by Eric Carlson.
The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
all selectors starts with '::cue'.
Test: media/track/track-cue-css.html
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
2019-02-15 Youenn Fablet <youenn@apple.com>
Add binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
https://bugs.webkit.org/show_bug.cgi?id=194713
Reviewed by Eric Carlson.
Binding tests covering mediaDevices and serviceWorker attributes.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
(WebCore::jsTestObjMediaDevices1Getter):
(WebCore::jsTestObjMediaDevices1):
(WebCore::jsTestObjMediaDevices2Getter):
(WebCore::jsTestObjMediaDevices2):
(WebCore::jsTestObjServiceWorkers1Getter):
(WebCore::jsTestObjServiceWorkers1):
(WebCore::jsTestObjServiceWorkers2Getter):
(WebCore::jsTestObjServiceWorkers2):
* bindings/scripts/test/TestObj.idl:
2019-02-15 Beth Dakin <bdakin@apple.com>
Build fix.
* rendering/RenderThemeIOS.mm:
(WebCore::iconForAttachment):
2019-02-15 Youenn Fablet <youenn@apple.com>
Make ServiceWorkerClientFetch closer to WebResourceLoader
https://bugs.webkit.org/show_bug.cgi?id=194651
Reviewed by Alex Christensen.
Check for redirection response and if so call a specific client API.
Ensure ServiceWorkerFetch::Client gets called in the service worker thread proxy
so that its m_connection is only accessed on that thread.
Covered by existing tests.
* platform/network/FormData.h:
* platform/network/ResourceErrorBase.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
* workers/service/context/ServiceWorkerFetch.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::cancelFetch):
(WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
* workers/service/context/ServiceWorkerThreadProxy.h:
2019-02-15 Youenn Fablet <youenn@apple.com>
Make navigator.mediaDevices SecureContext
https://bugs.webkit.org/show_bug.cgi?id=194666
Reviewed by Eric Carlson.
Make navigator.mediaDevices SecureContext.
This can still be enabled for unsecure context using the existing page settings.
To cover that case, introduce ContextHasMediaDevices custom IDL keyword.
Covered by API test.
* Modules/mediastream/NavigatorMediaDevices.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::hasMediaDevices const):
(WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
* dom/ScriptExecutionContext.h:
2019-02-15 Youenn Fablet <youenn@apple.com>
WebSocket should not fire events after being stopped
https://bugs.webkit.org/show_bug.cgi?id=194690
Reviewed by Geoffrey Garen.
dispatchOrQueueErrorEvent is scheduled using RunLoop::main().dispatch or dispatch_async.
This makes it possible to dispatch an event while WebSocket is already stopped.
Instead, use Document::postTask so that the task is only executed if WebSocket is not stopped.
As a refactoring, make use of PendingActivity to keep track of setPendingActivity/unsetPendingActivity more easily.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::stop):
(WebCore::WebSocket::connect):
* Modules/websockets/WebSocket.h:
2019-02-15 Youenn Fablet <youenn@apple.com>
Performance should not fire events when its context is stopped
https://bugs.webkit.org/show_bug.cgi?id=194689
Reviewed by Alex Christensen.
Stop the timer when its context is destroyed.
Add an assertion to ensure the timer does not fire after context is destroyed.
* page/Performance.cpp:
(WebCore::Performance::stop):
2019-02-15 Alex Christensen <achristensen@webkit.org>
REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
https://bugs.webkit.org/show_bug.cgi?id=194523
Reviewed by Geoffrey Garen.
The scope of the FormCreationContext was limited to the scope of createHTTPBodyCFReadStream,
so when it was used in formCreate it was lucky to get the same context if the stack hadn't been overwritten
and if the FormData hadn't been freed. Instead, keep it alive with new/delete like we do the FormStreamFields.
A younger me should've noticed this when reviewing r218517.
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formCreate):
(WebCore::createHTTPBodyCFReadStream):
2019-02-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241559 and r241566.
https://bugs.webkit.org/show_bug.cgi?id=194710
Causes layout test crashes under GuardMalloc (Requested by
ryanhaddad on #webkit).
Reverted changesets:
"[WTF] Add environment variable helpers"
https://bugs.webkit.org/show_bug.cgi?id=192405
https://trac.webkit.org/changeset/241559
"Unreviewed build fix for WinCairo Debug after r241559."
https://trac.webkit.org/changeset/241566
2019-02-15 Youenn Fablet <youenn@apple.com>
Stop the endpoint synchronously in RTCPeerConnection::close
https://bugs.webkit.org/show_bug.cgi?id=194688
Reviewed by Eric Carlson.
In the case where the peer connection is being closed, it was asynchronously stopping the endpoint.
But the endpoint, before being stopped, could try to fire an event.
If the context is gone in between, we end up with a null pointer dereference.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::close):
2019-02-15 Zalan Bujtas <zalan@apple.com>
[LFC] Out-of-flow box is never a float box
https://bugs.webkit.org/show_bug.cgi?id=194704
Reviewed by Antti Koivisto.
We can't have it both ways. Absolute positioning wins.
Test: fast/block/block-only/out-of-flow-is-never-float-box.html
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isFloatingPositioned const):
(WebCore::Layout::Box::isLeftFloatingPositioned const):
(WebCore::Layout::Box::isRightFloatingPositioned const):
2019-02-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] Simplify GObject class name check
https://bugs.webkit.org/show_bug.cgi?id=194537
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
Use G_OBJECT_TYPE_NAME() to filter out uridecodebin child
elements.
2019-02-15 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor EditingStyle::textDirection to return an Optional<WritingDirection> instead of a bool
https://bugs.webkit.org/show_bug.cgi?id=194686
Reviewed by Ryosuke Niwa.
Changes EditingStyle::textDirection to return an Optional<WritingDirection>, instead of taking a reference to
the resulting WritingDirection. No change in behavior.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::applyInlineStyle):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::textDirection const):
(WebCore::EditingStyle::textDirectionForSelection):
* editing/EditingStyle.h:
2019-02-10 Darin Adler <darin@apple.com>
Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
https://bugs.webkit.org/show_bug.cgi?id=194487
Reviewed by Daniel Bates.
* accessibility/win/AccessibilityObjectWrapperWin.cpp:
(WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): Use makeString
instead of String::format.
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::formatByteNumber): Use String::number instead of String::format.
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
Use makeString instead of String::format.
* platform/glib/UserAgentGLib.cpp:
(WebCore::platformVersionForUAString): Ditto.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::simpleBusMessageCallback): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ditto.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline): Ditto.
(WebCore::AppendPipeline::handleStateChangeMessage): Ditto.
(WebCore::AppendPipeline::resetParserState): Ditto.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::load): Ditto.
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Ditto.
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::encodeImage): Use String::number instead of String::format.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Use makeString instead of
String::format.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::addDevice): Ditto.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcAddPad): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::verifySchemaVersion): Ditto.
* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::verifySchemaVersion): Ditto.
2019-02-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] Decoding media-capabilities configuration initial support
https://bugs.webkit.org/show_bug.cgi?id=191191
Reviewed by Xabier Rodriguez-Calvar.
This patch enables basic platform probing for GStreamer decoders,
optionally using Hardware decoding capabilities. The previous code
for decoders/demuxers probing partially duplicated between the MSE
player and its parent class was moved to a new module called
GStreamerRegistryScanner. There is one instance of it for the MSE player
and one for the parent class.
The scanner can check for the presence of the GstElement Hardware
metadata classifier in decoders and thus advise the
MediaEngineConfigurationFactoryGStreamer that hardware decoding is
supported or not. This is only a first step though. The scanner
should also probably attempt a NULL->READY transition on decoders
to validate specific input caps are supported. As this might
require changes in GStreamer, this part of the patch wasn't
included.
This patch is covered by the existing media tests.
* platform/GStreamer.cmake: New files.
* platform/graphics/MediaPlayer.cpp: Add support for converting
SupportsType enum to string.
(WebCore::convertEnumerationToString):
* platform/graphics/MediaPlayer.h: Ditto.
* platform/graphics/MediaPlayerEnums.h: Ditto.
* platform/graphics/gstreamer/GStreamerCommon.cpp: Move
gstRegistryHasElementForMediaType to GStreamerRegistryScanner.
* platform/graphics/gstreamer/GStreamerCommon.h: Ditto.
* platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Added.
(WebCore::GStreamerRegistryScanner::singleton):
(WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Initialize
supported mime-types and codecs from the GStreamer registry.
(WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): Free the element factories.
(WebCore::GStreamerRegistryScanner::gstRegistryHasElementForMediaType):
Check the input caps are supported, optionally using hardware
device.
(WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping):
Moved from MediaPlayerPrivateGStreamer{,MSE}.
(WebCore::GStreamerRegistryScanner::initialize): Ditto.
(WebCore::GStreamerRegistryScanner::supportsCodec const): Ditto.
(WebCore::GStreamerRegistryScanner::supportsAllCodecs const): Ditto.
(WebCore::GStreamerRegistryScanner::isDecodingSupported const): Check
the given configuration is supported. For now hardware support is
checked for video configurations only as it is quite uncommon
anyway to have hardware-enabled audio decoders.
* platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added.
(WebCore::GStreamerRegistryScanner::mimeTypeSet):
(WebCore::GStreamerRegistryScanner::supportsContainerType const):
(WebCore::GStreamerRegistryScanner::RegistryLookupResult::operator bool const):
* platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp: Added.
(WebCore::createMediaPlayerDecodingConfigurationGStreamer):
* platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h: Added.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
Rely on new GStreamerRegistryScanner and add some debugging macros.
(WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp: Ditto. Also
plug qtdemux for AAC containers, this is an explicit consequence
of finer-grained codecs probing.
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.cpp: Added.
(WebCore::GStreamerRegistryScannerMSE::singleton):
(WebCore::GStreamerRegistryScannerMSE::GStreamerRegistryScannerMSE):
* platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.h: Added.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
Rely on new GStreamerRegistryScanner and add some debugging macros.
(WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories): GStreamer support.
2019-02-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector
https://bugs.webkit.org/show_bug.cgi?id=194671
<rdar://problem/47628191>
Reviewed by Devin Rousso.
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::item):
A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of
sync with the m_contents list of rules. In particular if the wrappers
vector is shorter than the rule list. We tried exercising code paths
that modify these lists but were not able to reproduce the crash.
To avoid a crash we can make this access safer and avoid the original
overflow. At the same time we will keep and promote the assertion that
would catch the lists getting out of sync in debug builds.
2019-02-14 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed build fix for WinCairo Debug after r241559.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
2019-02-14 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Add environment variable helpers
https://bugs.webkit.org/show_bug.cgi?id=192405
Reviewed by Michael Catanzaro.
* platform/NotImplemented.h:
* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
(Nicosia::PaintingEngine::create):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::create):
* platform/gtk/RenderThemeWidget.cpp:
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::CurlContext):
(WebCore::EnvironmentVariableReader::read): Deleted.
(WebCore::EnvironmentVariableReader::defined): Deleted.
(WebCore::EnvironmentVariableReader::readAs): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
* platform/network/playstation/CurlSSLHandlePlayStation.cpp:
(WebCore::getCACertPathEnv):
* platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::topLevelPath):
(WebCore::webkitBuildDirectory):
* platform/unix/LoggingUnix.cpp:
(WebCore::logLevelString):
* platform/win/LoggingWin.cpp:
(WebCore::logLevelString):
Utilize WTF::Environment where possible.
2019-02-14 Chris Dumez <cdumez@apple.com>
[PSON] Introduce a WebContent Process cache
https://bugs.webkit.org/show_bug.cgi?id=194594
<rdar://problem/46793397>
Reviewed by Geoff Garen.
Update localizable strings.
* en.lproj/Localizable.strings:
2019-02-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241486.
https://bugs.webkit.org/show_bug.cgi?id=194655
causing API failures in builds (Requested by ShawnRoberts on
#webkit).
Reverted changeset:
"[Cocoa] Media elements will restart network buffering just
before suspending"
https://bugs.webkit.org/show_bug.cgi?id=193691
https://trac.webkit.org/changeset/241486
2019-02-13 Brian Burg <bburg@apple.com>
Web Inspector: don't include accessibility role in DOM.Node object payloads
https://bugs.webkit.org/show_bug.cgi?id=194623
<rdar://problem/36384037>
Reviewed by Devin Rousso.
Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
first place due to a DOM node tree update (i.e., NodeInserted).
It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
necessary to collect this information in a problematic way when initially pushing the node, as
it will be updated anyway.
No new tests, no change in behavior.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForNode):
2019-02-14 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
https://bugs.webkit.org/show_bug.cgi?id=194622
Reviewed by Antti Koivisto.
Ensure that block replaced boxes don't collapse through their vertical margins.
Test: fast/block/block-only/block-replaced-with-vertical-margins.html
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-02-14 Zalan Bujtas <zalan@apple.com>
[LFC] Shrink-to-fit-width should be constrained by min/max width
https://bugs.webkit.org/show_bug.cgi?id=194653
Reviewed by Antti Koivisto.
Use the fixed value of min-width/max-width to constrain the computed preferred width.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2019-02-13 Ryosuke Niwa <rniwa@webkit.org>
Crash in DOMTimer::fired
https://bugs.webkit.org/show_bug.cgi?id=194638
Reviewed by Brent Fulgham.
This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934.
The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer
is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired).
Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit
from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map
we would not leak these DOM timers.
We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the
size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier.
Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code,
and is no longer the preferred approach when dealing with these classes of bugs in WebKit.
Test: fast/dom/timer-destruction-during-firing.html
* page/DOMTimer.cpp:
(WebCore::NestedTimersMap::add):
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
2019-02-13 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Crash when inspecting an element that constantly changes visibility
https://bugs.webkit.org/show_bug.cgi?id=194632
<rdar://problem/48060258>
Reviewed by Matt Baker and Devin Rousso.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::processAccessibilityChildren):
(WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
Don't use rvalue-references as that was taking ownership and deleting
the object we want to keep around. Instead simplify this to just use
references so no ref counting changes happen.
2019-02-13 Chris Fleizach <cfleizach@apple.com>
AX: Crash in handleMenuOpen
https://bugs.webkit.org/show_bug.cgi?id=194627
Reviewed by Zalan Bujtas.
Tests run under libGuardMalloc will cause crashes.
This list of objects is a Node list, not an Element list, so we were
not removing some nodes when they were being deallocated.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
2019-02-13 Jer Noble <jer.noble@apple.com>
[Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
https://bugs.webkit.org/show_bug.cgi?id=194621
<rdar://problem/48002560>
Reviewed by Eric Carlson.
When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation
change events in the media-controller.js on rAF().
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype._returnMediaLayerToInlineIfNeeded):
2019-02-13 John Wilander <wilander@apple.com>
Ignore Ad Click Attribution where source and destination are same-site
https://bugs.webkit.org/show_bug.cgi?id=194620
<rdar://problem/47890018>
Reviewed by Jiewen Tan.
Updated the existing test.
We should not accept Ad Click Attribution requests where the site of the
anchor tag and its addestination attribute are same-site. Such attributions
dont make sense (the site can track intra-site clicks through better means)
and would just lead to increased memory use where are the pending
attributions are stored.
For ports that don't have access to the Public Suffix List, this patch
only checks that the hosts don't match, i.e. not just eTLD+1.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
Now returns WTF::nullopt if the current document and the
addestination are same site. Also fixed a console message
typo.
2019-02-13 Eric Carlson <eric.carlson@apple.com> and Youenn Fablet <youenn@apple.com>
getUserMedia with an ideal deviceId constraint doesn't always select the correct device
https://bugs.webkit.org/show_bug.cgi?id=193614
Reviewed by Eric Carlson.
Compute a fitness score based on constraints.
For each constraint, a fitness score is computed from the distance.
The smaller the distance, the higher the score.
Fitness scores are then summed to give a device fitness score.
Matching devices are then sorted according the fitness score.
For important constraints, deviceId and facingMode, add a more important weight.
This ensures that should any of these ideal constraints are set, they will be respected.
Restrict our automatic setting of default constraints to not add a default ideal facingMode in case of existing deviceId constraint.
Do not set a default ideal frameRate if width and height are already set.
Covered by updated test.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::FlattenedConstraint::set):
(WebCore::MediaConstraints::setDefaultVideoConstraints):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::fitnessDistance):
(WebCore::RealtimeMediaSource::selectSettings):
(WebCore::RealtimeMediaSource::supportsConstraints):
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
2019-02-13 Eric Carlson <eric.carlson@apple.com>
[iOS] Add a hack to work around buggy video control library
https://bugs.webkit.org/show_bug.cgi?id=194615
<rdar://problem/46146946>
Reviewed by Jer Noble.
Test: media/ios/video-volume-ios-quirk.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop.
(WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume.
(WebCore::HTMLMediaElement::closeTaskQueues): Close it.
* html/HTMLMediaElement.h:
2019-02-13 Jer Noble <jer.noble@apple.com>
[Cocoa] Media elements will restart network buffering just before suspending
https://bugs.webkit.org/show_bug.cgi?id=193691
Reviewed by Eric Carlson.
API Test: WebKit.ProcessSuspendMediaBuffering
Allow the Page to suspend all media buffering in its child Documents.
* dom/Document.cpp:
(WebCore::Document::suspendAllMediaBuffering):
(WebCore::Document::resumeAllMediaBuffering):
* dom/Document.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::dataBufferingPermitted const):
(WebCore::MediaElementSession::suspendBuffering):
(WebCore::MediaElementSession::resumeBuffering):
(WebCore::MediaElementSession::bufferingSuspended const):
* html/MediaElementSession.h:
* page/Page.cpp:
(WebCore::Page::suspendAllMediaBuffering):
(WebCore::Page::resumeAllMediaBuffering):
* page/Page.h:
(WebCore::Page::mediaPlaybackIsSuspended const):
(WebCore::Page::mediaBufferingIsSuspended const):
(WebCore::Page::mediaPlaybackIsSuspended): Deleted.
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::suspendBuffering):
(WebCore::PlatformMediaSession::resumeBuffering):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
(WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
* platform/audio/PlatformMediaSessionManager.h:
2019-02-13 Jer Noble <jer.noble@apple.com>
Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root
https://bugs.webkit.org/show_bug.cgi?id=194516
<rdar://problem/44678353>
Reviewed by Antoine Quint.
Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html
When walking up the element ancestor chain, use parentElementInComposedTree() to
walk past the shadow root boundary.
* dom/Element.cpp:
(WebCore::parentCrossingFrameBoundaries):
2019-02-13 Chris Dumez <cdumez@apple.com>
Unreviewed, update localizable strings.
* en.lproj/Localizable.strings:
2019-02-12 Jiewen Tan <jiewen_tan@apple.com>
Further restricting webarchive loads
https://bugs.webkit.org/show_bug.cgi?id=194567
<rdar://problem/47610130>
Reviewed by Youenn Fablet.
This patch futher restricts main frame webarchive loads to the followings:
1) loaded by clients;
2) loaded by drag;
3) reloaded from any of the previous two.
It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document
to FrameLoader such that the option is remembered during redirections.
Covered by API tests.
* dom/Document.h:
(WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted.
(WebCore::Document::alwaysAllowLocalWebarchive const): Deleted.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::disallowWebArchive const):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame):
(WebCore::DocumentLoader::allowsWebArchiveForMainFrame):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput):
(WebCore::FrameLoadRequest::isRequestFromClientOrUserInput):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::reload):
* loader/FrameLoader.h:
(WebCore::FrameLoader::setAlwaysAllowLocalWebarchive):
(WebCore::FrameLoader::alwaysAllowLocalWebarchive const):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* testing/Internals.cpp:
(WebCore::Internals::setAlwaysAllowLocalWebarchive const):
* testing/Internals.h:
* testing/Internals.idl:
2019-02-13 Jer Noble <jer.noble@apple.com>
Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged()
https://bugs.webkit.org/show_bug.cgi?id=194613
<rdar://problem/48023912>
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2019-02-13 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused variable warnings after r241148/r241251
https://bugs.webkit.org/show_bug.cgi?id=194348
<rdar://problem/47566449>
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
(WebCore::SourceBuffer::evictCodedFrames):
(WebCore::SourceBuffer::provideMediaData):
2019-02-13 Sihui Liu <sihui_liu@apple.com>
REGRESSION: [ Mac Debug WK2 ] Layout Test storage/indexeddb/key-type-infinity-private.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=194413
<rdar://problem/47897254>
Reviewed by Brady Eidson.
IDB clients expected transaction operations to be executed in order, but in
UniqueIDBDatabase::immediateCloseForUserDelete, callbacks in callback map were errored out randomly.
This patch added a callback queue to UniqueIDBDatabase to make sure callbacks will be called in the same order
as IDB Server receives the request.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
(WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
(WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
(WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
(WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
(WebCore::IDBServer::UniqueIDBDatabase::performCountCallback):
(WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2019-02-13 John Wilander <wilander@apple.com>
Store Ad Click Attribution requests in the network process
https://bugs.webkit.org/show_bug.cgi?id=194510
<rdar://problem/47650118>
Reviewed by Alex Christensen and Daniel Bates.
Test: http/tests/adClickAttribution/store-ad-click-attribution.html
This patch adds support functions for validation and storage of
WebCore::AdClickAttribution objects. It also adds WTF::HashTraits so that
WebCore::AdClickAttribution::Source and WebCore::AdClickAttribution::Destination
can be used in a HashMap.
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::toString const):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::Source::operator== const):
(WebCore::AdClickAttribution::Source::deletedValue):
(WebCore::AdClickAttribution::Source::constructDeletedValue):
(WebCore::AdClickAttribution::Source::deleteValue):
(WebCore::AdClickAttribution::Source::isDeletedValue const):
(WebCore::AdClickAttribution::SourceHash::hash):
(WebCore::AdClickAttribution::SourceHash::equal):
(WebCore::AdClickAttribution::Destination::operator== const):
(WebCore::AdClickAttribution::Destination::matches const):
This convenience function allows matching of a WTF::URL object.
(WebCore::AdClickAttribution::Destination::deletedValue):
(WebCore::AdClickAttribution::Destination::constructDeletedValue):
(WebCore::AdClickAttribution::Destination::deleteValue):
(WebCore::AdClickAttribution::Destination::isDeletedValue const):
(WebCore::AdClickAttribution::DestinationHash::hash):
(WebCore::AdClickAttribution::DestinationHash::equal):
(WebCore::AdClickAttribution::source const):
(WebCore::AdClickAttribution::destination const):
Getters added to support mapped storage based on source and destination.
(WTF::HashTraits<WebCore::AdClickAttribution::Source>::emptyValue):
(WTF::HashTraits<WebCore::AdClickAttribution::Source>::constructDeletedValue):
(WTF::HashTraits<WebCore::AdClickAttribution::Source>::isDeletedValue):
(WTF::HashTraits<WebCore::AdClickAttribution::Destination>::emptyValue):
(WTF::HashTraits<WebCore::AdClickAttribution::Destination>::constructDeletedValue):
(WTF::HashTraits<WebCore::AdClickAttribution::Destination>::isDeletedValue):
* loader/NavigationAction.h:
(WebCore::NavigationAction::adClickAttribution const):
(WebCore::NavigationAction::adClickAttribution): Deleted.
Corrected the constness of this function.
2019-02-13 Eric Carlson <eric.carlson@apple.com>
Revert r240434
https://bugs.webkit.org/show_bug.cgi?id=194600
<rdar://problem/48044566>
Reviewed by Brent Fulgham.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
(WebCore::HTMLMediaElement::updateVolume):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
2019-02-13 Alex Christensen <achristensen@webkit.org>
Stop using setDefersLoading from WebCore
https://bugs.webkit.org/show_bug.cgi?id=194315
Reviewed by Jer Noble.
That is what CompletionHandlers are for.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::setDefersLoading): Deleted.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::responseReceived):
(WebCore::PlatformMediaResource::stop):
(WebCore::PlatformMediaResource::setDefersLoading): Deleted.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
(-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
2019-02-13 Jer Noble <jer.noble@apple.com>
[Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
https://bugs.webkit.org/show_bug.cgi?id=194580
<rdar://problem/42727739>
Reviewed by Eric Carlson.
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2019-02-13 Antoine Quint <graouts@apple.com>
Support simulated mouse events on iOS based on a PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=194501
<rdar://problem/46910790>
Reviewed by Dean Jackson.
Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within
EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.
Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Event.cpp:
* dom/Event.h:
(WebCore::Event::hasEncounteredListener const):
(WebCore::Event::setHasEncounteredListener):
* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
(WebCore::EventNames::touchRelatedEventNames const):
(WebCore::EventNames::extendedTouchRelatedEventNames const):
(WebCore::EventNames::isTouchEventType const): Deleted.
(WebCore::EventNames::touchAndPointerEventNames const): Deleted.
* dom/EventTarget.cpp:
(WebCore::EventTarget::innerInvokeEventListeners):
* dom/MouseEvent.h:
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
* dom/ios/MouseEventIOS.cpp: Added.
(WebCore::mouseEventType):
(WebCore::MouseEvent::create):
* dom/ios/PointerEventIOS.cpp:
(WebCore::pointerEventType):
(WebCore::PointerEvent::create):
(WebCore::eventType): Deleted.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
* page/EventHandler.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
(WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
(WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
(WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):
2019-02-13 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Unable to render some Hebrew characters
https://bugs.webkit.org/show_bug.cgi?id=194498
Reviewed by Michael Catanzaro.
We are failing to find a font for some of the combining character sequences because normalization is failing due
to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
we should handle that case to resize the output buffer and try again.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
2019-02-13 Ryosuke Niwa <rniwa@webkit.org>
Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
https://bugs.webkit.org/show_bug.cgi?id=194582
Reviewed by Antti Koivisto.
Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
from the non-generated identifier being sent to us as it was the case in this failure.
* loader/PolicyChecker.cpp:
(WebCore::PolicyCheckIdentifier::isValidFor):
2019-02-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241273.
https://bugs.webkit.org/show_bug.cgi?id=194579
This change is causing a flaky assertion failure crash in High
Sierra Debug (Requested by ShawnRoberts on #webkit).
Reverted changeset:
"Stop using setDefersLoading from WebCore"
https://bugs.webkit.org/show_bug.cgi?id=194315
https://trac.webkit.org/changeset/241273
2019-02-12 Mark Lam <mark.lam@apple.com>
Remove unnecessary null check in bindings.
https://bugs.webkit.org/show_bug.cgi?id=194581
Reviewed by Yusuke Suzuki.
It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
It will just return false. Since we don't expect the root pointer to be null in
the common case, having a null check here is also not optimal. We'll remove this
unneeded null check.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2019-02-12 Rob Buis <rbuis@igalia.com>
Align with Fetch on data: URLs
https://bugs.webkit.org/show_bug.cgi?id=182325
Reviewed by Alex Christensen.
The MIME type part of the data url should be serialized as
specified in step 3 under "data" [1].
Test: web-platform-tests/fetch/data-urls/processing.any.js
[1] https://fetch.spec.whatwg.org/#concept-scheme-fetch
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::parseMediaType):
2019-02-12 Alex Christensen <achristensen@webkit.org>
Build fix after r241320
https://bugs.webkit.org/show_bug.cgi?id=194271
* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):
2019-02-12 Justin Fan <justin_fan@apple.com>
[WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
https://bugs.webkit.org/show_bug.cgi?id=194552
Reviewed by Dean Jackson.
WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
Consolidate the two versions of these classes in our implementation.
Affected layout tests updated with new names. No change in behavior.
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
* Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
* Modules/webgpu/WebGPUBufferUsage.h: Removed.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
* platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
2019-02-12 Wenson Hsieh <wenson_hsieh@apple.com>
Unreviewed, try to fix the internal iOS build after r241321
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2019-02-12 Wenson Hsieh <wenson_hsieh@apple.com>
Allow pages to trigger programmatic paste from script on iOS
https://bugs.webkit.org/show_bug.cgi?id=194271
<rdar://problem/47808810>
Reviewed by Tim Horton.
Tests: editing/pasteboard/ios/dom-paste-confirmation.html
editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
editing/pasteboard/ios/dom-paste-rejection.html
editing/pasteboard/ios/dom-paste-requires-user-gesture.html
* dom/UserGestureIndicator.cpp:
(WebCore::UserGestureIndicator::~UserGestureIndicator):
Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::resetDOMPasteAccess):
2019-02-12 Chris Fleizach <cfleizach@apple.com>
AX: IsolatedTree: Implement more attributes
https://bugs.webkit.org/show_bug.cgi?id=193911
<rdar://problem/47599217>
Reviewed by Daniel Bates.
Make use of new HIServices SPI to use a secondary AX thread.
Store root node/focused node status in IsolatedTree rather than on the element.
Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
Implement hit-testing using relative-frames.
Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
* accessibility/AXObjectCache.h:
(WebCore::AXObjectCache::focusedUIElementForPage):
* accessibility/AccessibilityAttachment.cpp:
(WebCore::AccessibilityAttachment::accessibilityText const):
(WebCore::AccessibilityAttachment::accessibilityText): Deleted.
* accessibility/AccessibilityAttachment.h:
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::accessibilityText const):
(WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
* accessibility/AccessibilityImageMapLink.h:
* accessibility/AccessibilityMediaControls.cpp:
(WebCore::AccessibilityMediaControl::accessibilityText const):
(WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
* accessibility/AccessibilityMediaControls.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::accessibilityText const):
(WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::convertFrameToSpace const):
(WebCore::AccessibilityObject::relativeFrame const):
(WebCore::AccessibilityObject::elementAccessibilityHitTest const):
(WebCore::AccessibilityObject::focusedUIElement const):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::accessibilityText const):
(WebCore::AccessibilityObject::isLink const): Deleted.
(WebCore::AccessibilityObject::isImage const): Deleted.
(WebCore::AccessibilityObject::isAttachment const): Deleted.
(WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
(WebCore::AccessibilityObject::isImageMapLink const): Deleted.
(WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
(WebCore::AccessibilityObject::isTree const): Deleted.
(WebCore::AccessibilityObject::isTreeItem const): Deleted.
(WebCore::AccessibilityObject::isScrollbar const): Deleted.
(WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
(WebCore::AccessibilityObject::accessibilityText): Deleted.
(WebCore::AccessibilityObject::roleValue const): Deleted.
(WebCore::AccessibilityObject::wrapper const): Deleted.
* accessibility/AccessibilityObjectInterface.h: Replaced.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::isTabItemSelected const):
(WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
(WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
(WebCore::AccessibilityRenderObject::accessibilityHitTest const):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::accessibilityText const):
(WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
* accessibility/AccessibilitySVGElement.h:
* accessibility/AccessibilityScrollView.cpp:
(WebCore::AccessibilityScrollView::accessibilityHitTest const):
* accessibility/AccessibilityScrollView.h:
* accessibility/ios/AccessibilityObjectIOS.mm:
(WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
* accessibility/isolatedtree: Replaced.
* accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
(WebCore::AXIsolatedTree::treePageCache):
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::nodeInTreeForID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::focusedUIElement):
(WebCore::AXIsolatedTree::setRootNodeID):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::setInitialRequestInProgress):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h: Added.
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
(WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::initializeAttributeData):
(WebCore::AXIsolatedTreeNode::setProperty):
(WebCore::AXIsolatedTreeNode::setParent):
(WebCore::AXIsolatedTreeNode::setTreeIdentifier):
(WebCore::AXIsolatedTreeNode::focusedUIElement const):
(WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
(WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
(WebCore::AXIsolatedTreeNode::tree const):
(WebCore::AXIsolatedTreeNode::rectAttributeValue const):
(WebCore::AXIsolatedTreeNode::stringAttributeValue const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::associateIsolatedTreeNode):
* accessibility/mac/AccessibilityObjectBase.mm: Added.
(WebCore::AccessibilityObject::speechHintAttributeValue const):
(WebCore::AccessibilityObject::descriptionAttributeValue const):
(WebCore::AccessibilityObject::titleAttributeValue const):
(WebCore::AccessibilityObject::helpTextAttributeValue const):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(addChildToArray):
(convertToNSArray):
(-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
(-[WebAccessibilityObjectWrapperBase accessibilityObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
(convertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
(-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
(-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
(-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
(-[WebAccessibilityObjectWrapper childrenVectorSize]):
(-[WebAccessibilityObjectWrapper childrenVectorArray]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
(-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
2019-02-12 Wenson Hsieh <wenson_hsieh@apple.com>
Allow pages to trigger programmatic paste from script on iOS
https://bugs.webkit.org/show_bug.cgi?id=194271
<rdar://problem/47808810>
Reviewed by Ryosuke Niwa.
Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
interaction, since unintended user interaction occasionally happens as well!).
In order to make it possible for web pages to programmatically paste without opening the door to privacy and
security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
instead follow through with the programmatic paste command.
New tests to come in a followup patch.
* WebCore.xcodeproj/project.pbxproj:
* dom/DOMPasteAccessPolicy.h: Added.
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::domPasteAccessPolicy const):
(WebCore::UserGestureToken::didRequestDOMPasteAccess):
Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
"NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
paste access is granted or rejected, make this decision sticky until the end of the current user gesture.
* editing/EditorCommand.cpp:
(WebCore::executePaste):
(WebCore::executePasteAndMatchStyle):
(WebCore::executePasteAsPlainText):
(WebCore::executePasteAsQuotation):
When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
with the paste.
(WebCore::supportedPaste):
* loader/EmptyClients.cpp:
* page/EditorClient.h:
* page/Frame.cpp:
(WebCore::Frame::requestDOMPasteAccess):
Add a helper method that requests access to the clipboard on behalf of script when pasting.
* page/Frame.h:
* page/Settings.yaml:
Introduce a new WebCore setting, used to gate DOM paste access requests.
2019-02-12 Alex Christensen <achristensen@webkit.org>
Remove setDefersLoading infrastructure from WebKit2
https://bugs.webkit.org/show_bug.cgi?id=194506
Reviewed by Brady Eidson.
setDefersLoading is inherently racy from WebCore to the NetworkProcess,
it adds unwanted complexity to the initialization and use of network objects,
and it has led to many unrecoverable hang bugs over the years.
We needed to force it into WebKit2 to transition some existing clients who relied on it,
but we have recently finished transitioning those clients to other solutions, mostly
completion handlers.
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::setJavaScriptPaused):
2019-02-12 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix build warnings after content extensions enablement
https://bugs.webkit.org/show_bug.cgi?id=193622
<rdar://problem/47982850>
* contentextensions/DFABytecode.h:
(WebCore::ContentExtensions::instructionSizeWithArguments):
* contentextensions/DFABytecodeCompiler.h:
* contentextensions/URLFilterParser.cpp:
(WebCore::ContentExtensions::URLFilterParser::statusString):
2019-02-12 Justin Fan <justin_fan@apple.com>
[Web GPU] DepthStencilAttachment implementation
https://bugs.webkit.org/show_bug.cgi?id=194458
<rdar://problem/47932446>
Reviewed by Dean Jackson.
Implement ability to provide a depth attachment to the render pass encoder. Also implement
GPULoad/StoreOp and update color attachments' implementation for full functionality.
Test: webgpu/depth-enabled-triangle-strip.html
Update project files for new symbols:
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
* Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
* Modules/webgpu/GPUStoreOp.idl: Ditto.
* Modules/webpug/WebGPUColor.h: Removed.
* Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
(WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
* Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
* Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
* Modules/webgpu/WebGPUTextureView.h:
* platform/graphics/gpu/GPULoadOp.h: Added.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
* platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
* platform/graphics/gpu/GPUStoreOp.h: Added.
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::loadActionForGPULoadOp): Added.
(WebCore::storeActionForGPUStoreOp): Added.
(WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
(WebCore::populateMtlDepthStencilAttachment): Added.
(WebCore::GPURenderPassEncoder::create):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
(WebCore::GPURenderPipeline::create):
2019-02-12 David Kilzer <ddkilzer@apple.com>
REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
<https://webkit.org/b/194529>
<rdar://problem/47924449>
Reviewed by Eric Carlson.
* SourcesCocoa.txt:
- Do not include DataDetectorsCoreSoftLink.mm in unified
sources.
* WebCore.xcodeproj/project.pbxproj:
- Add DataDetectorsCoreSoftLink.mm to the WebCore target now
that it isn't part of the unifed sources.
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
- Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
DataDetectorsCore.framework. None of the other macros assume
this framework is optional, and it was likely made optional
originally because the framework was new to iOS and thus
didn't exist on older versions.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
- Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
SOFT_LINK_CLASS() since the latter can only be used with
SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation). This broke after
the fix for <wtf/SoftLinking.h> was applied.
2019-02-12 Youenn Fablet <youenn@apple.com>
Make use of is<SubresourceLoader>
https://bugs.webkit.org/show_bug.cgi?id=194541
Reviewed by Alex Christensen.
No change of behavior.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didReceiveResponse):
* loader/SubresourceLoader.h:
(isType):
2019-02-12 Mark Lam <mark.lam@apple.com>
Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
https://bugs.webkit.org/show_bug.cgi?id=194530
<rdar://problem/47973274>
Reviewed by Chris Dumez.
This is needed to fix a null pointer dereference that arises from the following scenario:
1. a Document detaches from its StyleSheetList.
2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
to be scanned and collected by the GC.
3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
discovers a null owner pointer.
This patch fixes this issue by applying the following null checks:
1. Add a null check in JSNodeCustom.h's root().
root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
to root(). However, depending on which class the ownerNode() method belongs to,
it can either return a pointer or a reference. The null check only makes sense
in the pointer case.
To accommodate the 2 forms, root() itself is has an overload that takes a
reference instead of a pointer.
Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
returns, it can't discern when the result is a pointer and apply the null check.
Instead, we just add the null check to the version of root() that takes a
pointer. If the node pointer is null, we'll return a null opaque root.
2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.
* bindings/js/JSNodeCustom.h:
(WebCore::root):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2019-02-12 Andy Estes <aestes@apple.com>
[iOSMac] Enable Parental Controls Content Filtering
https://bugs.webkit.org/show_bug.cgi?id=194521
<rdar://39732376>
Reviewed by Tim Horton.
* Configurations/FeatureDefines.xcconfig:
* platform/ContentFilterUnblockHandler.h:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
* platform/cocoa/ParentalControlsContentFilter.mm:
2019-02-11 Jer Noble <jer.noble@apple.com>
Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
2019-02-12 Antti Koivisto <antti@apple.com>
Crash in WebCore::ScrollingTree::updateTreeFromStateNode
https://bugs.webkit.org/show_bug.cgi?id=194538
<rdar://problem/47841926>
Reviewed by Zalan Bujtas.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::updateTreeFromStateNode):
Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.
2019-02-12 Zalan Bujtas <zalan@apple.com>
[LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
https://bugs.webkit.org/show_bug.cgi?id=194540
Reviewed by Antti Koivisto.
Use FormattingContext::computeBorderAndPadding instead.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-12 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add intrinsic width support for float boxes.
https://bugs.webkit.org/show_bug.cgi?id=194528
Reviewed by Antti Koivisto.
This patch implements a very simple float box support for intrinsic width.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFloatBox const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForInlineBlock const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-12 Rob Buis <rbuis@igalia.com>
Implement serializing in MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=193909
Reviewed by Darin Adler.
Implement serializing in MIME type parser [1], to preserve the parameter
order the Vector m_parameterNames is introduced, since HashMaps do not
guarantee any order.
Test: ParsedContentType.Serialize
[1] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
* platform/network/ParsedContentType.cpp:
(WebCore::skipSpaces):
(WebCore::parseQuotedString):
(WebCore::ParsedContentType::parseContentType):
(WebCore::ParsedContentType::parameterValueForName const):
(WebCore::ParsedContentType::parameterCount const):
(WebCore::ParsedContentType::setContentType):
(WebCore::ParsedContentType::setContentTypeParameter):
(WebCore::ParsedContentType::serialize const):
* platform/network/ParsedContentType.h:
2019-02-08 Chris Fleizach <cfleizach@apple.com>
AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc
https://bugs.webkit.org/show_bug.cgi?id=182280
<rdar://problem/37018386>
Reviewed by Alan Bujtas.
Remove the possibility that changing children calls back into updating layout by
handling children changes in a deferred manner.
This follows the same architecture as many other deferred changes, but also requires us to check deferred changes
in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children.
A few tests had to be modified to no longer change the tree and then check the children immediately.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertToNSArray):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
2019-02-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>
Reviewed by Brent Fulgham.
WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
When trying to style a character with a generic font family, we first look to see if
we have a mapping for the particular script the character is rendered with, and if we
don't find a match, we then check USCRIPT_COMMON.
In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
the only scripts which won't use the API families) is in
SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
for the CJK scripts.
The mappings inside SettingsBase are incorrect and conflict with our policy regarding
user-installed fonts. Instead, we should be consulting with the platform for some of
these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
API still has to work to set the mappings for untagged content. Therefore, we use the
system mappings for language-tagged content, and the API mappings for non-language-tagged
content. This is a good balance that makes sure we always have a good mapping for every
language, but API clients can still set the mappings, too.
Test: fast/text/ja-sans-serif.html
* css/CSSComputedStyleDeclaration.cpp:
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamily):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
(WebCore::osakaMonoIsInstalled): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::computeSpecializedChineseLocale):
(WebCore::cachedSpecializedChineseLocale):
(WebCore::languageChanged):
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::genericFamily):
(WebCore::SystemFontDatabaseCoreText::serifFamily):
(WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
(WebCore::SystemFontDatabaseCoreText::cursiveFamily):
(WebCore::SystemFontDatabaseCoreText::fantasyFamily):
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
2019-02-11 Adrian Perez de Castro <aperez@igalia.com>
[GTK][WPE] Add content extensions support in WKTR and unskip layout tests
https://bugs.webkit.org/show_bug.cgi?id=193622
Reviewed by Michael Catanzaro.
No new tests needed.
* SourcesCocoa.txt: Remove loader/ResourceLoadInfo.cpp, it's not Cocoa-specific anymore.
* Sources.txt: Add loader/ResourceLoadInfo.cpp, all ports use it now.
2019-02-11 Daniel Bates <dabates@apple.com>
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>
Reviewed by Tim Horton.
Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
to be passed to WebKit.
Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
fast/events/touch/ios/pointer-events-with-modifiers.html
fast/events/touch/ios/touch-events-with-modifiers.html
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithMouseEventType:timeStamp:location:]):
(-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
2019-02-11 Jer Noble <jer.noble@apple.com>
[Cocoa] Notify AVSystemController of our presenting PID before registering as a Now Playing app.
https://bugs.webkit.org/show_bug.cgi?id=194504
Reviewed by Eric Carlson.
This allows the MediaRemote framework to associate the WebContent process with its host application.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::prepareToSendUserMediaPermissionRequest):
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::prepareToSendUserMediaPermissionRequest):
(MediaSessionManagerCocoa::providePresentingApplicationPIDIfNecessary):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
2019-02-11 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r241272 and r241276.
https://bugs.webkit.org/show_bug.cgi?id=194514
Broke the Apple Internal build and the fix requires human
intervention :( (Requested by dydz on #webkit).
Reverted changesets:
"[iOS] Mouse/Touch/Pointer events are missing modifier keys"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241272
"Fix internal iOS build after r241272"
https://bugs.webkit.org/show_bug.cgi?id=191446
https://trac.webkit.org/changeset/241276
2019-02-11 Alex Christensen <achristensen@webkit.org>
Stop using setDefersLoading from WebCore
https://bugs.webkit.org/show_bug.cgi?id=194315
Reviewed by Jer Noble.
That is what CompletionHandlers are for.
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::responseReceived):
(WebCore::MediaResource::setDefersLoading): Deleted.
* loader/MediaResourceLoader.h:
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::responseReceived):
(WebCore::PlatformMediaResource::stop):
(WebCore::PlatformMediaResource::setDefersLoading): Deleted.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
(-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
(-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
2019-02-11 Daniel Bates <dabates@apple.com>
[iOS] Mouse/Touch/Pointer events are missing modifier keys
https://bugs.webkit.org/show_bug.cgi?id=191446
<rdar://problem/45929460>
Reviewed by Tim Horton.
Extract the modifier flags from the WebEvent. This code is only used by Legacy WebKit
on iOS and we will need to fix <rdar://problem/47929759> in order for modifier flags
to be passed to WebKit.
Tests: fast/events/touch/ios/mouse-events-with-modifiers.html
fast/events/touch/ios/pointer-events-with-modifiers.html
fast/events/touch/ios/touch-events-with-modifiers.html
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithMouseEventType:timeStamp:location:]):
(-[WebEvent initWithMouseEventType:timeStamp:location:modifiers:]):
2019-02-11 Daniel Bates <dabates@apple.com>
Separate out outline-style: auto user-agent appearance from Mac animated focus ring drawing
https://bugs.webkit.org/show_bug.cgi?id=193591
Reviewed by Simon Fraser.
Untangle the Mac-specific concept of animated focus ring drawing from the concepts of using
the fancy shrink-wrapped focus ring appearance and using the platform focus ring color when
outline-style: auto.
No functionality changed. So, no new tests.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRing):
(WebCore::drawFocusRingToContextAtTime):
Change some macro guards.
* rendering/RenderElement.cpp:
(WebCore::usePlatformFocusRingColorForOutlineStyleAuto): Added.
(WebCore::useShrinkWrappedFocusRingForOutlineStyleAuto): Added.
(WebCore::drawFocusRing): Added.
(WebCore::RenderElement::paintFocusRing): Write in terms of drawFocusRing().
2019-02-11 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r241229.
Revision broke internal builds for watchOS.
Reverted changeset:
"[Cocoa] Ask platform for generic font family mappings"
https://bugs.webkit.org/show_bug.cgi?id=187723
https://trac.webkit.org/changeset/241229
2019-02-11 Youenn Fablet <youenn@apple.com>
Make Request constructor throw if FetchRequestInit.signal is not undefined, null or an AbortSignal object
https://bugs.webkit.org/show_bug.cgi?id=194404
<rdar://problem/47891915>
Reviewed by Geoffrey Garen.
Align with the spec, except for known problematic web sites.
Covered by updated test.
* Modules/fetch/FetchRequest.cpp:
(WebCore::needsSignalQuirk):
(WebCore::processInvalidSignal):
(WebCore::FetchRequest::initializeWith):
2019-02-11 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext::Geometry::floatingHeightAndMargin should take UsedHorizontalValues
https://bugs.webkit.org/show_bug.cgi?id=194490
Reviewed by Antti Koivisto.
This is in preparation for adding floating preferred width computation support. It requires height computaiton
which uses containing block width to resolve vertical margins.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2019-02-11 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext::intrinsicWidthConstraints should compute and save the intrinsic widths consistently.
https://bugs.webkit.org/show_bug.cgi?id=194483
Reviewed by Antti Koivisto.
Rename intrinsicWidthConstraints to computeIntrinsicWidthConstraints (it does not return the width values anymore).
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-10 Zalan Bujtas <zalan@apple.com>
[LFC] Fix spelling error.
https://bugs.webkit.org/show_bug.cgi?id=194489
Reviewed by Simon Fraser.
instrinsic -> intrinsic
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::clearIntrinsicWidthConstraints):
(WebCore::Layout::FormattingState::intrinsicWidthConstraints const):
(WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::clearInstrinsicWidthConstraints): Deleted.
(WebCore::Layout::FormattingState::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraintsNeedChildrenWidth):
(WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraintsNeedChildrenWidth): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::intrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-10 Darin Adler <darin@apple.com>
Switch uses of StringBuilder with String::format for hex numbers to use HexNumber.h instead
https://bugs.webkit.org/show_bug.cgi?id=194485
Reviewed by Daniel Bates.
* Modules/websockets/WebSocket.cpp:
(WebCore::encodeProtocolString): Use appendUnsignedAsHexFixedSize instead of String::format.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize const): Fixed style of many return statements
that called a function returning void; doesn't match WebKit's prevailing style.
Also use break instead of return. Used appendLiteral instead of append in many
cases, and append character instead of single-character literal in others.
Use appendUnsignedAsHex instead of String::format.
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::generateHashedName): Use appendUnsignedAsHex instad of appendUnsigned64AsHex.
Should come back here and use makeString once we make HexNumber.h work with that.
* platform/mac/WebCoreNSURLExtras.mm: Removed unnecessary include of HexNumber.h.
* rendering/RenderTreeAsText.cpp:
(WebCore::quoteAndEscapeNonPrintables): Use appendLiteral instead of multiple calls
to character append. Touched because it was next to a call to appendUnsignedAsHex.
2019-02-10 Pablo Saavedra <psaavedra@igalia.com>
libWPEWebKit-0.1.so: undefined reference to `JSC::JSValue::asCell() const
https://bugs.webkit.org/show_bug.cgi?id=194484
Reviewed by Darin Adler.
* bindings/js/JSUndoItemCustom.cpp:
2019-02-10 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK Debug build fix after r241148.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
SourceBuffer::logClassName and friends are declared for
!RELEASE_LOG_DISABLED builds so adapt calling sites accordingly.
2019-02-10 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add intrinsic width support for inline-block boxes
https://bugs.webkit.org/show_bug.cgi?id=194479
Reviewed by Antti Koivisto.
Compute the intrinsic width for the inline-block (formatting context root) and set it as the content box width while
laying out the content for the min/max width.
<div style="position: absolute">before<span id=inline-block style="display: inline-block">inline_block content<span>after</div>
The "inline-block" formatting root returns "inline_block" width for the minimum and "inline_block width" for
the maximum width. These min/max values are used to figure out the intrinsic width for the parent <div>.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthForFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
* layout/inlineformatting/InlineFormattingContext.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-02-10 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add intrinsic width support for replaced boxes
https://bugs.webkit.org/show_bug.cgi?id=194478
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeMargin const):
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-10 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Add missing return type to lambda
https://bugs.webkit.org/show_bug.cgi?id=194414
Reviewed by Darin Adler.
Since g_signal_connect() is untyped, a compiler error was not
generated when a lambda with a missing GstFlowReturn return type was
provided for a signal that expects it.
This used to work before r240784 because a recent function call had
set GST_FLOW_OK in the return value register and it happened to
survive until the lambda function call ended. Starting on that commit
such return value was removed and it stopped working on debug.
Of course, the actual problem is in the signature of the lambda
function, and this patch fixes that.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
2019-02-09 Darin Adler <darin@apple.com>
Eliminate unnecessary String temporaries by using StringConcatenateNumbers
https://bugs.webkit.org/show_bug.cgi?id=194021
Reviewed by Geoffrey Garen.
For floating point numbers, String::number gives a fixed precision result,
stripping trailing zeroes. When possible, I changed the code to instead use the
equivalent of String::numberToStringECMAScript, which is what makeString does by
default for floating point, gives the same results for many cases, and gives
better results in many others. However, for floats, we do not yet have a good
implementation, so instead I used FormattedNumber::fixedPrecision to match
the old behavior.
* Modules/indexeddb/shared/IDBTransactionInfo.cpp:
(WebCore::IDBTransactionInfo::loggingString const): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* Modules/websockets/ThreadableWebSocketChannel.cpp:
(WebCore::ThreadableWebSocketChannel::create): Ditto.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Ditto. Added a cast to "unsigned" to sidestep the
ambiguity with 16-bit unsigned types that are sometimes used for numbers (uint16_t)
and sometimes used for UTF-16 code units (UChar) and can be the same type.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::didFailSocketStream): Use ASCIILiteral when intializing
a string instead of just a normal C literal. Switched to makeString so we could
remove String::number and do the conversion without allocating/destroying a String.
(WebCore::WebSocketChannel::didFail): Ditto.
(WebCore::WebSocketChannel::processFrame): Ditto.
* Modules/websockets/WebSocketFrame.cpp:
(WebCore::WebSocketFrame::parseFrame): Ditto.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::readServerHandshake): Ditto.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Ditto.
* bindings/js/JSDOMConvertNumbers.cpp:
(WebCore::rangeErrorString): Ditto.
* css/CSSAspectRatioValue.cpp:
(WebCore::CSSAspectRatioValue::customCSSText const): Ditto. Used
FormattedNumber::fixedPrecision since these are floats.
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::toString const): Use
StringBuilder::builder.appendECMAScriptNumber instead of
String::numberToStringECMAScript so we can do it without allocating/destroying
a String.
* css/WebKitCSSMatrix.cpp:
(WebCore::WebKitCSSMatrix::toString const): Ditto.
* dom/MessagePortIdentifier.h:
(WebCore::MessagePortIdentifier::logString const): Remove String::number and let
makeString do the conversion without allocating/destroying a String.
* editing/cocoa/DataDetection.mm:
(WebCore::dataDetectorStringForPath): Remove unnecessary type casts on values
passed to String::number and to StringBuilder::appendNumber. These could do
harm if the values were out of range, and should not be necessary.
* history/BackForwardItemIdentifier.h:
(WebCore::BackForwardItemIdentifier::logString const): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFileDateString): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniformLocation): Ditto.
(WebCore::WebGLRenderingContextBase::checkTextureCompleteness): Ditto.
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didReceiveResponse): Ditto.
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::loadResourceSynchronously): Ditto.
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didFailLoadingManifest): Ditto.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::urlForBlankFrame): Ditto.
* page/PrintContext.cpp:
(WebCore::PrintContext::pageProperty): Ditto.
(WebCore::PrintContext::pageSizeAndMarginsInPixels): Ditto.
* page/WheelEventTestTrigger.cpp:
(WebCore::dumpState): Use StringBuilder::appendNumber instead of
String::number so we can do it without allocating/destroying a String.
Also use StringBuilder::appendLiteral on a literal.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformDraw): Pass explicit
KeepTrailingZeros to FormattedNumber::fixedPrecision to preserve behavior,
since default is now to truncate trailing zeros.
* platform/graphics/Color.cpp:
(WebCore::Color::cssText): Use StringBuilder::appendNumber instead of
calling numberToFixedPrecisionString to do the same thing.
* platform/graphics/ExtendedColor.cpp:
(WebCore::ExtendedColor::cssText): Ditto.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationIdentifier): Remove String::number and let makeString
do the conversion without allocating/destroying a String. Had to add
a typecast to convert the enumeration into an integer.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::setFiltersOnLayer): Ditto.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::description const): Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockMediaSample::MockMediaSample): Use AtomicString::number
instead of String::number to avoid unneccessarily allocating an additional
temporary String when an AtomicString already exists.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::reportErrorToClient): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::setMaximumSize): Ditto.
(WebCore::SQLiteDatabase::setSynchronous): Ditto. Had to add a typecast to
convert the enumeration into an integer.
* svg/SVGAngleValue.cpp:
(WebCore::SVGAngleValue::valueAsString const): Ditto.
* svg/SVGLengthValue.cpp:
(WebCore::SVGLengthValue::valueAsString const): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::configurationForViewport): Ditto. Used
FormattedNumber::fixedPrecision since these are floats.
(WebCore::Internals::getCurrentCursorInfo): Use StringBuilder::appendNumber
instead of calling numberToFixedPrecisionString to do the same thing.
(WebCore::Internals::queueMicroTask): Remove String::number and let makeString
do the conversion without allocating/destroying a String.
(WebCore::appendOffsets): Use StringBuilder::appendNumber instead of
String::number so we can do it without allocating/destroying a String.
* workers/service/ServiceWorkerClientIdentifier.h:
(WebCore::ServiceWorkerClientIdentifier::toString const): Remove String::number
and let makeString do the conversion without allocating/destroying a String.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::databaseFilenameFromVersion): Ditto.
2019-02-09 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add intrinsic width support for basic inline containers
https://bugs.webkit.org/show_bug.cgi?id=194473
Reviewed by Antti Koivisto.
Preferred width computation logic is very similar to normal layout.
One of the main difference is that the preferred width codepath does not provide valid containing block width.
This patch implement basic inline container support by passing nullopt containing block width in UsedHorizontalValues.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-08 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] CTLineGetGlyphRuns() might return nullptr
https://bugs.webkit.org/show_bug.cgi?id=194467
<rdar://problem/42423999>
Reviewed by Simon Fraser.
Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future.
Covered by find/text/find-backwards.html
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2019-02-08 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Ask platform for generic font family mappings
https://bugs.webkit.org/show_bug.cgi?id=187723
<rdar://problem/41892438>
Reviewed by Brent Fulgham.
WebKit API allows setting the generic font families for the USCRIPT_COMMON script.
When trying to style a character with a generic font family, we first look to see if
we have a mapping for the particular script the character is rendered with, and if we
don't find a match, we then check USCRIPT_COMMON.
In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka
the only scripts which won't use the API families) is in
SettingsBase::initializeDefaultFontFamilies(). That function only sets the families
for the CJK scripts.
The mappings inside SettingsBase are incorrect and conflict with our policy regarding
user-installed fonts. Instead, we should be consulting with the platform for some of
these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit
API still has to work to set the mappings for untagged content. Therefore, we use the
system mappings for language-tagged content, and the API mappings for non-language-tagged
content. This is a good balance that makes sure we always have a good mapping for every
language, but API clients can still set the mappings, too.
Test: fast/text/ja-sans-serif.html
* css/CSSComputedStyleDeclaration.cpp:
* css/CSSFontSelector.cpp:
(WebCore::resolveGenericFamily):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFamily):
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::initializeDefaultFontFamilies):
(WebCore::osakaMonoIsInstalled): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/FontDescription.h:
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::computeSpecializedChineseLocale):
(WebCore::cachedSpecializedChineseLocale):
(WebCore::languageChanged):
(WebCore::FontDescription::platformResolveGenericFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::SystemFontDatabaseCoreText::serifFamily):
(WebCore::SystemFontDatabaseCoreText::sansSerifFamily):
(WebCore::SystemFontDatabaseCoreText::cursiveFamily):
(WebCore::SystemFontDatabaseCoreText::fantasyFamily):
(WebCore::SystemFontDatabaseCoreText::monospaceFamily):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h:
2019-02-08 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink sizeof(CodeBlock) more
https://bugs.webkit.org/show_bug.cgi?id=194419
Reviewed by Mark Lam.
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
2019-02-08 Chris Dumez <cdumez@apple.com>
[Cocoa] Optimize ResourceResponse::platformLazyInit()
https://bugs.webkit.org/show_bug.cgi?id=194438
Reviewed by Alex Christensen.
Optimize ResourceResponse::platformLazyInit(). Most of the CPU time currently goes into getting the
HTTP headers from CFNetwork:
"""
Sample Count, Samples %, CPU %, Symbol
46, 0.0%, 0.0%, WebCore::initializeHTTPHeaders(WebCore::OnlyCommonHeaders, NSHTTPURLResponse*, WebCore::HTTPHeaderMap&) (in WebCore)
34, 0.0%, 0.0%, HTTPHeaderDict::copyAsOrdinaryDict(__CFAllocator const*) const (in CFNetwork)
11, 0.0%, 0.0%, CFDictionaryApplyFunction (in CoreFoundation)
"""
We currently have 2 levels of initialization: CommonFieldsOnly & AllFields. With WebKit2, most ResourceResponses get sent over IPC
and thus end up getting initialized twice, once with CommonFieldsOnly and then with AllFields.
This would cause us to call the expensive HTTPHeaderDict::copyAsOrdinaryDict() twice instead of once, simply to initialize the common
HTTP headers first and then the uncommon ones later.
This patch updates ResourceResponse::platformLazyInit() to initialize all HTTP headers at once, as soon as CommonFieldsOnly
initialization is requested, so that we no longer copy all HTTP headers twice.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::initializeHTTPHeaders):
(WebCore::ResourceResponse::platformLazyInit):
2019-02-08 Justin Fan <justin_fan@apple.com>
[Web GPU] Build fix for MTLStorageMode availability on different Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=194443
Unreviewed build fix.
For MTLTextures, MTLStorageModeManaged is only available on macOS. Other platforms,
if not using MTLStorageModePrivate, must use MTLStorageModeShared.
Behavior unchanged.
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::storageModeForPixelFormatAndSampleCount):
2019-02-08 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Inline WebVTT styles should start with '::cue'
https://bugs.webkit.org/show_bug.cgi?id=194227
<rdar://problem/47791087>
Reviewed by Eric Carlson.
Check that the CSS string starts with '::cue' and is successfully parsed before adding it
to the CSS stylesheet list. Also, the caption preferences CSS string should start with
'::cue', since it is added inside the video shadow root element.
Test: media/track/track-cue-css.html
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const):
2019-02-08 Youenn Fablet <youenn@apple.com>
Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8
https://bugs.webkit.org/show_bug.cgi?id=194380
<rdar://problem/47916514>
Reviewed by Eric Carlson.
Set whether VP8 is supported at creation of the page.
This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration.
Add internal API to enable resetting the factory to enable proper testing.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/Page.cpp:
(WebCore::m_applicationManifest):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::clearPeerConnectionFactory):
* testing/Internals.h:
* testing/Internals.idl:
2019-02-08 Andy Estes <aestes@apple.com>
[WebIDL] Support serializing sequences and FrozenArrays of non-interfaces
https://bugs.webkit.org/show_bug.cgi?id=190997
<rdar://problem/35983035>
Reviewed by Brent Fulgham.
Support serializing sequences and FrozenArrays of types that aren't interfaces. This is
needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings.
We should support serializing sequences of interfaces too, but that's slightly more
complicated since it involves iterating the sequence and serializing each of its items. I
left that as a follow-up task, since I don't see any IDLs that currently need this.
We also don't support serializing sequences with the CachedAttribute or CustomGetter
extended attributes, because WebIDL specifies that a new array should be created when
converting an IDL sequence into an ECMAScript value.
Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to
http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html.
* bindings/scripts/CodeGenerator.pm:
(GetInterfaceForType): Renamed from GetInterfaceForAttribute.
(IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types.
(hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an
attribute has the CachedAttribute or CustomGetter extended attributes.
(IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter
extended attributes before calling IsSerializableType.
(GetInterfaceForAttribute): Renamed to GetInterfaceForType.
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/TestSerialization.idl:
2019-02-08 Sihui Liu <sihui_liu@apple.com>
IndexedDB tests leak documents
https://bugs.webkit.org/show_bug.cgi?id=189435
<rdar://problem/44240043>
Reviewed by Geoffrey Garen.
Remove use of JSC::Strong in IndexedDatabase.
* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::continuePrimaryKey):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
(WebCore::IDBCursor::setGetResult):
* Modules/indexeddb/IDBCursor.h:
(WebCore::IDBCursor::key):
(WebCore::IDBCursor::primaryKey):
(WebCore::IDBCursor::value):
(WebCore::IDBCursor::keyWrapper):
(WebCore::IDBCursor::primaryKeyWrapper):
(WebCore::IDBCursor::valueWrapper):
(WebCore::IDBCursor::key const): Deleted.
(WebCore::IDBCursor::primaryKey const): Deleted.
(WebCore::IDBCursor::value const): Deleted.
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putForCursorUpdate):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest):
(WebCore::IDBRequest::~IDBRequest):
(WebCore::IDBRequest::result const):
(WebCore::IDBRequest::setResult):
(WebCore::IDBRequest::setResultToStructuredClone):
(WebCore::IDBRequest::setResultToUndefined):
(WebCore::IDBRequest::resultCursor):
(WebCore::IDBRequest::willIterateCursor):
(WebCore::IDBRequest::didOpenOrIterateCursor):
* Modules/indexeddb/IDBRequest.h:
(WebCore::IDBRequest::resultWrapper):
* Modules/indexeddb/IDBRequest.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSIDBCursorCustom.cpp:
(WebCore::JSIDBCursor::key const):
(WebCore::JSIDBCursor::primaryKey const):
(WebCore::JSIDBCursor::visitAdditionalChildren):
* bindings/js/JSIDBCursorWithValueCustom.cpp:
(WebCore::JSIDBCursorWithValue::value const):
(WebCore::JSIDBCursorWithValue::visitAdditionalChildren):
* bindings/js/JSIDBRequestCustom.cpp: Added.
(WebCore::JSIDBRequest::result const):
(WebCore::JSIDBRequest::visitAdditionalChildren):
* inspector/agents/InspectorIndexedDBAgent.cpp:
2019-02-08 Zalan Bujtas <zalan@apple.com>
[LFC] The used containing block width value is optional
https://bugs.webkit.org/show_bug.cgi?id=194428
Reviewed by Antti Koivisto.
The preferred width codepath cannot provide a valid used containing block width value.
"The percentage is calculated with respect to the width of the generated box's containing block.
If the containing block's width depends on this element's width, then the resulting layout is undefined in CSS 2.2."
Let's use 0 as used value for now.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
* page/FrameViewLayoutContext.cpp:
2019-02-08 Zalan Bujtas <zalan@apple.com>
[LFC] Horizontal geometry compute functions should take the containing block's width as a used value
https://bugs.webkit.org/show_bug.cgi?id=194424
Reviewed by Antti Koivisto.
This is in preparation for passing optional containing block width for the preferred with codepath.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
* layout/LayoutUnits.h:
(WebCore::Layout::UsedHorizontalValues::UsedHorizontalValues):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2019-02-08 Benjamin Poulain <benjamin@webkit.org>
clampTo(): do not convert the input to double when dealing with integers
https://bugs.webkit.org/show_bug.cgi?id=194263
<rdar://problem/47692312>
Reviewed by Darin Adler.
Make the calls to clampTo<float>() unambiguous.
* page/FrameView.cpp:
(WebCore::FrameView::computeUpdatedLayoutViewportRect):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setOpacity):
(WebCore::RenderStyle::setShapeImageThreshold):
2019-02-08 Eric Liang <ericliang@apple.com>
When performing AXPress, check to see if the menu list is disabled.
https://bugs.webkit.org/show_bug.cgi?id=193878
Reviewed by Chris Fleizach.
Test: accessibility/mac/press-not-work-for-disabled-menu-list.html
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::press):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
2019-02-07 Devin Rousso <drousso@apple.com>
PseudoElement created for any ::before/::after selector regardless of whether a content property exists
https://bugs.webkit.org/show_bug.cgi?id=194423
<rdar://problem/46787260>
Reviewed by Antti Koivisto.
Test: inspector/css/pseudo-creation.html
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):
We should only be creating `PseudoElement`s if we actually have a `content` proprety in the
`PseudoElement`'s style. Otherwise, we end up creating `PseudoElement`s for every CSS rule
that has a `::before`/`::after`, only to immediately destroy them as there is nothing to show.
2019-02-07 Chris Dumez <cdumez@apple.com>
Mark more heap-allocated classes as fast allocated
https://bugs.webkit.org/show_bug.cgi?id=194422
Reviewed by Ryosuke Niwa.
* Modules/applepay/PaymentCoordinator.h:
* Modules/beacon/NavigatorBeacon.h:
* Modules/cache/DOMWindowCaches.h:
* Modules/cache/WorkerGlobalScopeCaches.h:
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h:
* Modules/gamepad/NavigatorGamepad.h:
* Modules/indexeddb/IDBGetAllResult.h:
* Modules/indexeddb/IDBGetResult.h:
* Modules/indexeddb/IDBKeyData.h:
* Modules/indexeddb/IDBValue.h:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h:
* Modules/indexeddb/server/IndexValueEntry.h:
* Modules/indexeddb/server/IndexValueStore.h:
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
* Modules/indexeddb/server/MemoryCursor.h:
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.h:
* Modules/indexeddb/server/UniqueIDBDatabase.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
* Modules/indexeddb/shared/IDBTransactionInfo.h:
* Modules/mediacapabilities/NavigatorMediaCapabilities.h:
* Modules/mediasession/WebMediaSessionManager.cpp:
* Modules/mediastream/NavigatorMediaDevices.h:
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
* Modules/navigatorcontentutils/NavigatorContentUtils.h:
* Modules/quota/DOMWindowQuota.h:
* Modules/quota/NavigatorStorageQuota.h:
* Modules/quota/WorkerNavigatorStorageQuota.h:
* Modules/speech/DOMWindowSpeechSynthesis.h:
* Modules/webaudio/BiquadProcessor.h:
* Modules/webaudio/DelayProcessor.h:
* Modules/webauthn/fido/FidoHidPacket.h:
* Modules/webdriver/NavigatorWebDriver.h:
* Modules/webgpu/DOMWindowWebGPU.h:
* Modules/websockets/WebSocketChannel.h:
* Modules/webvr/NavigatorWebVR.h:
* accessibility/AXObjectCache.h:
* bindings/js/DOMGCOutputConstraint.h:
* bindings/js/DOMPromiseProxy.h:
* bridge/c/c_runtime.h:
* contentextensions/CombinedURLFilters.cpp:
* crypto/CryptoAlgorithmParameters.h:
* css/CSSComputedStyleDeclaration.h:
* css/CSSRegisteredCustomProperty.h:
* css/DOMCSSPaintWorklet.h:
* css/DOMCSSRegisterCustomProperty.h:
* css/StyleRule.h:
* dom/ConstantPropertyMap.h:
* dom/CustomElementReactionQueue.h:
* dom/Document.h:
* dom/GenericEventQueue.h:
* dom/RejectedPromiseTracker.h:
* dom/UserGestureIndicator.h:
* editing/ReplaceSelectionCommand.cpp:
* editing/SelectionRectGatherer.h:
* editing/TextIterator.h:
* editing/cocoa/HTMLConverter.mm:
* fileapi/AsyncFileStream.cpp:
* fileapi/AsyncFileStream.h:
* html/forms/FileIconLoader.h:
* html/parser/HTMLTreeBuilder.h:
* html/track/WebVTTParser.h:
* inspector/DOMPatchSupport.cpp:
* loader/FrameLoaderClient.h:
* loader/WorkerThreadableLoader.cpp:
* page/IntersectionObserver.h:
* page/PerformanceMonitor.h:
* page/PerformanceUserTiming.h:
* page/PrintContext.h:
* page/ValidationMessageClient.h:
* platform/ColorChooser.h:
* platform/ControlStates.h:
* platform/DataListSuggestionPicker.h:
* platform/FileStream.h:
* platform/KeyedCoding.h:
* platform/LowPowerModeNotifier.h:
* platform/PlatformSpeechSynthesizer.h:
* platform/WebGLStateTracker.h:
* platform/audio/AudioArray.h:
* platform/audio/AudioDestination.h:
* platform/audio/DownSampler.h:
* platform/audio/DynamicsCompressor.h:
* platform/audio/FFTFrame.h:
* platform/audio/HRTFDatabase.h:
* platform/audio/MultiChannelResampler.h:
* platform/audio/Panner.h:
* platform/audio/Reverb.h:
* platform/audio/ReverbConvolver.h:
* platform/audio/ReverbConvolverStage.h:
* platform/audio/UpSampler.h:
* platform/audio/mac/AudioSessionMac.cpp:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/audio/mac/CARingBuffer.h:
* platform/cocoa/ScrollSnapAnimatorState.h:
* platform/gamepad/PlatformGamepad.h:
* platform/graphics/GraphicsLayer.cpp:
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/PlatformTimeRanges.h:
* platform/graphics/TextTrackRepresentation.h:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/network/cocoa/WebCoreNSURLSession.mm:
* platform/sql/SQLiteDatabase.h:
* platform/text/TextCodecICU.h:
* rendering/GridBaselineAlignment.h:
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderObject.h:
* rendering/style/GridArea.h:
* workers/service/context/SWContextManager.h:
2019-02-07 Justin Fan <justin_fan@apple.com>
[Web GPU] GPUDevice::createTexture implementation prototype
https://bugs.webkit.org/show_bug.cgi?id=194409
<rdar://problem/47894312>
Reviewed by Myles C. Maxfield.
Test: textures-textureviews.html updated to test new functionality.
Implement GPUDevice::createTexture():
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createTexture const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::create): Modified to return non-nullable to match direction of API.
(WebCore::WebGPUTexture::WebGPUTexture):
* Modules/webgpu/WebGPUTexture.h:
Metal backend MTLTextureDescriptor and MTLTexture creation:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateTexture const):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::mtlTextureTypeForGPUTextureDescriptor):
(WebCore::mtlTextureUsageForGPUTextureUsageFlags):
(WebCore::storageModeForPixelFormatAndSampleCount):
(WebCore::tryCreateMtlTextureDescriptor):
(WebCore::GPUTexture::tryCreate):
(WebCore::GPUTexture::createDefaultTextureView): Add ObjC try/catch guards.
Add GPUUtils.h/cpp for shared utility functions:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUUtils.h: Added. Moved platformTextureFormatForGPUTextureFormat here.
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::setFormat):
(WebCore::platformTextureFormatForGPUTextureFormat): Moved to GPUUtils.
* platform/graphics/gpu/cocoa/GPUUtilsMetal.mm: Added.
(WebCore::platformTextureFormatForGPUTextureFormat): Moved here to be referenced by multiple files.
2019-02-07 Sihui Liu <sihui_liu@apple.com>
REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&)
https://bugs.webkit.org/show_bug.cgi?id=194402
<rdar://problem/47858241>
Reviewed by Geoffrey Garen.
r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be
around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it
is valid during access.
* Modules/indexeddb/server/ServerOpenDBRequest.cpp:
(WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked):
(WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase):
* Modules/indexeddb/server/ServerOpenDBRequest.h:
2019-02-07 Timothy Hatcher <timothy@apple.com>
Overflow element scrollbar is light for dark mode content.
https://bugs.webkit.org/show_bug.cgi?id=194407
rdar://problem/45991585
Reviewed by Beth Dakin.
Tested by css-dark-mode/supported-color-schemes-scrollbar.html.
* page/ChromeClient.h:
(WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid
short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1,
that do not implement preferredScrollbarOverlayStyle().
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case
to auto detect overlay style when page() is null.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::useDarkAppearance const): Added.
* rendering/RenderLayer.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollbarOverlayStyle const): Added Node argument.
(WebCore::Internals::scrollbarUsingDarkAppearance const): Added.
* testing/Internals.h:
* testing/Internals.idl:
2019-02-07 Eric Carlson <eric.carlson@apple.com>
[MSE] Convert debug-only logging to runtime logging
https://bugs.webkit.org/show_bug.cgi?id=194348
<rdar://problem/47566449>
Reviewed by Jer Noble.
No new tests, this just changes existing logging.
* Modules/mediasource/MediaSource.cpp:
(WebCore::convertEnumerationToString):
(WebCore::MediaSource::MediaSource):
(WebCore::MediaSource::~MediaSource):
(WebCore::MediaSource::setPrivateAndOpen):
(WebCore::MediaSource::addedToRegistry):
(WebCore::MediaSource::removedFromRegistry):
(WebCore::MediaSource::durationChanged):
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::completeSeek):
(WebCore::MediaSource::setLiveSeekableRange):
(WebCore::MediaSource::clearLiveSeekableRange):
(WebCore::MediaSource::setDuration):
(WebCore::MediaSource::setDurationInternal):
(WebCore::MediaSource::setReadyState):
(WebCore::MediaSource::endOfStream):
(WebCore::MediaSource::streamEndedWithError):
(WebCore::MediaSource::addSourceBuffer):
(WebCore::MediaSource::removeSourceBuffer):
(WebCore::MediaSource::isTypeSupported):
(WebCore::MediaSource::detachFromElement):
(WebCore::MediaSource::attachToElement):
(WebCore::MediaSource::openIfInEndedState):
(WebCore::MediaSource::suspend):
(WebCore::MediaSource::resume):
(WebCore::MediaSource::stop):
(WebCore::MediaSource::onReadyStateChange):
(WebCore::MediaSource::scheduleEvent):
(WebCore::MediaSource::logChannel const):
(WebCore::MediaSourceInternal::toString): Deleted.
* Modules/mediasource/MediaSource.h:
(WTF::LogArgument<WebCore::MediaSource::EndOfStreamError>::toString):
(WTF::LogArgument<WebCore::MediaSource::ReadyState>::toString):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::~SourceBuffer):
(WebCore::SourceBuffer::remove):
(WebCore::SourceBuffer::seekToTime):
(WebCore::SourceBuffer::appendBufferInternal):
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
(WebCore::removeSamplesFromTrackBuffer):
(WebCore::SourceBuffer::removeCodedFrames):
(WebCore::SourceBuffer::evictCodedFrames):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples):
(WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
(WebCore::SourceBuffer::monitorBufferingRate):
(WebCore::SourceBuffer::logChannel const):
* Modules/mediasource/SourceBuffer.h:
* dom/Document.cpp:
(WebCore::messageSourceForWTFLogChannel):
(WebCore::Document::didLogMessage):
* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString):
(WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
(WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
(WebCore::HTMLMediaElement::scheduleUpdatePlayState):
(WebCore::HTMLMediaElement::scheduleUpdateMediaState):
* platform/ContentType.cpp:
(WebCore::ContentType::toJSONString const):
* platform/ContentType.h:
(WTF::LogArgument<WebCore::ContentType>::toString):
* platform/MediaSample.h:
(WebCore::MediaSample::toJSONString const):
(WTF::LogArgument<WebCore::MediaSample>::toString):
* platform/graphics/FloatSize.cpp:
(WebCore::FloatSize::toJSONObject const):
(WebCore::FloatSize::toJSONString const):
* platform/graphics/FloatSize.h:
(WTF::LogArgument<WebCore::FloatSize>::toString):
* platform/graphics/MediaSourcePrivate.h:
(WebCore::MediaSourcePrivate::mediaSourceLogIdentifier):
(WTF::LogArgument<WebCore::MediaSourcePrivate::AddStatus>::toString):
(WTF::LogArgument<WebCore::MediaSourcePrivate::EndOfStreamStatus>::toString):
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::sourceBufferLogger const):
(WebCore::SourceBufferPrivate::sourceBufferLogIdentifier):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setClosedCaptionsVisible):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogIdentifier):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::mediaPlayerLogger):
(WTF::LogArgument<WebCore::MediaPlayerPrivateMediaSourceAVFObjC::SeekState>::toString):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::convertEnumerationToString):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::~MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::playInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pause):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::pauseInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVisible):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekWithTolerance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitForSeekCompleted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekCompleted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateAllRenderersHaveAvailableSamples):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNetworkState):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::logChannel const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::toJSONString const):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::~MediaSourcePrivateAVFObjC):
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::logChannel const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::bufferWasConsumedCallback):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferPrivateAVFObjC::didFailToParseStreamDataWithError):
(WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
(WebCore::SourceBufferPrivateAVFObjC::setReadyState):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::SourceBufferPrivateAVFObjC::flush):
(WebCore::SourceBufferPrivateAVFObjC::flushVideo):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
(WebCore::SourceBufferPrivateAVFObjC::setActive):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
(WebCore::SourceBufferPrivateAVFObjC::logChannel const):
2019-02-07 Youenn Fablet <youenn@apple.com>
Simplify applyConstraints callbacks
https://bugs.webkit.org/show_bug.cgi?id=194297
Reviewed by Eric Carlson.
Make use of one callback for both success and failure cases.
No changed of behavior.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::applyConstraints):
* platform/mediastream/MediaStreamTrackPrivate.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::applyConstraints):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create):
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::MockGStreamerAudioCaptureSource::applyConstraints):
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockGStreamerVideoCaptureSource::applyConstraints):
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
2019-02-07 Youenn Fablet <youenn@apple.com>
Unable to sign in leetcode.
https://bugs.webkit.org/show_bug.cgi?id=194366
rdar://problem/47259025.
Reviewed by Chris Dumez.
In case a signal is passed as part of a FetchRequestInit,
the IDL binding code is throwing an exception in case signal is not an AbortSignal object.
This breaks an AbortSignal shim used in some web sites.
Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest.
Test: http/wpt/fetch/request-abort.html
Also covered by manually signing in to leetcode.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
* Modules/fetch/FetchRequestInit.h:
(WebCore::FetchRequestInit::hasMembers const):
* Modules/fetch/FetchRequestInit.idl:
2019-02-07 Youenn Fablet <youenn@apple.com>
Make to clear sources from UserMediaCaptureManagerProxy and UserMediaCaptureManager when no longer needed
https://bugs.webkit.org/show_bug.cgi?id=194312
Reviewed by Eric Carlson.
Add a way for sources to know when they are ended, i.e. that they will never be started again.
No observable change of behavior.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::requestStop):
* platform/mediastream/RealtimeMediaSource.h:
2019-02-07 Jer Noble <jer.noble@apple.com>
HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class
https://bugs.webkit.org/show_bug.cgi?id=194360
HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should
really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement,
make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor
taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases.
Reviewed by Geoffrey Garen.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::ApplePaySession):
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::UserMediaRequest):
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::PaymentRequest):
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::AudioContext):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::WebAnimation):
* css/FontFaceSet.cpp:
(WebCore::FontFaceSet::FontFaceSet):
* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/Document.h:
(WebCore::ActiveDOMObject::ActiveDOMObject):
* html/HTMLMarqueeElement.cpp:
(WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* html/HTMLSourceElement.cpp:
(WebCore::HTMLSourceElement::HTMLSourceElement):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::IntersectionObserver):
2019-02-07 Zalan Bujtas <zalan@apple.com>
[LFC][Out-of-flow] Use the containing block's padding width when computing min/max width.
https://bugs.webkit.org/show_bug.cgi?id=194391
Reviewed by Antti Koivisto.
The spec is not clear about this but that's what matches the current behaviour.
Test: fast/block/block-only/absolute-positioned-min-max-percentage-with-parent-padding.html
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2019-02-07 Zalan Bujtas <zalan@apple.com>
[LFC] Use dedicated data structures for optional used values (input to geometry functions)
https://bugs.webkit.org/show_bug.cgi?id=194376
Reviewed by Antti Koivisto.
This is in preparation for being able to pass in the containing block's width as an optional used value.
During layout we always have a valid width for the containing block, however it's not the case while computing the preferred width.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): Deleted.
(): Deleted.
(WebCore::Layout::FormattingContext::Geometry::complicatedCases): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Deleted.
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): Deleted.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-02-07 Antti Koivisto <antti@apple.com>
Infinite recursion via CachedResource::~CachedResource
https://bugs.webkit.org/show_bug.cgi?id=194378
<rdar://problem/42023295>
Reviewed by Daniel Bates.
I don't know the exact steps to trigger this but the mechanism seems clear.
1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map.
2) This decrements the handle count of resource and causes it be deleted.
3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with
resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled).
4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created.
This increments the handle count of the resource from 0 back to 1.
5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3).
The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource.
It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles.
Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource
has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything
other than bail out is going to crash.
CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to
support this erranous call so they are removed as well.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):
This is the substantive change. The rest just removes now-dead code.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::setOwningCachedResourceLoader): Deleted.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::~CachedResourceLoader):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::loadResource):
(WebCore::CachedResourceLoader::garbageCollectDocumentResources):
(WebCore::CachedResourceLoader::removeCachedResource): Deleted.
* loader/cache/CachedResourceLoader.h:
2019-02-07 Miguel Gomez <magomez@igalia.com>
[WPE] Implement GStreamer based holepunch
https://bugs.webkit.org/show_bug.cgi?id=193715
Reviewed by Xabier Rodriguez-Calvar.
Implement GStreamer based holepunch functionality. Instead of getting the video frames from the
video sink and drawing then, the player just draws a transparent rectangle on the position where
the video should be. MediaPlayerPrivateGStreamerBase will instantiate a platform dependant video
sink which will be in charge of displaying the video frames in some way (usually on a plane below
the browser), and will push empty frames to the compositor indicating that the rectangle to draw
should overwrite the existent content. TextureMapperPlatformLayerBuffer::HolePunchClient is used
to tell the video sink where to position the video so it's set below the browser transparent hole.
Added ManualTest wpe/video-player-holepunch.html to test the feature.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldIgnoreIntrinsicSize):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::shouldIgnoreIntrinsicSize):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::naturalSize const):
(WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
(WebCore::setRectangleToVideoSink):
(WebCore::GStreamerHolePunchClient::GStreamerHolePunchClient):
(WebCore::MediaPlayerPrivateGStreamerBase::createHolePunchVideoSink):
(WebCore::MediaPlayerPrivateGStreamerBase::pushNextHolePunchBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawSolidColor):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::setHolePunchClient):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::videoBox const):
2019-02-06 Benjamin Poulain <benjamin@webkit.org>
Unreviewed, rolling out r240759 and r240944.
Some timer uses are done off the main thread, WebCore::Timer
cannot be used
Reverted changesets:
"<rdar://problem/47570443> Responsiveness timers are too
expensive for frequent events"
https://bugs.webkit.org/show_bug.cgi?id=194003
https://trac.webkit.org/changeset/240759
"Use deferrable timer to restart the Responsiveness Timer on
each wheel event"
https://bugs.webkit.org/show_bug.cgi?id=194135
https://trac.webkit.org/changeset/240944
2019-02-06 Keith Rollin <krollin@apple.com>
Update .xcfilelist files
Unreviewed build fix.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2019-02-06 Devin Rousso <drousso@apple.com>
Web Inspector: DOM: don't send the entire function string with each event listener
https://bugs.webkit.org/show_bug.cgi?id=194293
<rdar://problem/47822809>
Reviewed by Joseph Pecoraro.
Test: inspector/dom/getEventListenersForNode.html
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
2019-02-06 Andy Estes <aestes@apple.com>
[Payment Request] It should be possible to require a phonetic name for shipping contacts
https://bugs.webkit.org/show_bug.cgi?id=194311
<rdar://46733045>
Reviewed by Alex Christensen.
It should be possible to require that a shipping contact has a phonetic name in Payment Request.
To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to
ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data.
Since required shipping contact fields can now be specified both in
requiredShippingContactFields and PaymentOptions, we merge the required fields from these
two sources such that, e.g., email is required if it is specified in either place.
So that clients can detect this new feature, the API version number is bumped from 5 to 6.
Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html.
* DerivedSources.make:
* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/PaymentCoordinatorClient.cpp: Added.
(WebCore::PaymentCoordinatorClient::supportsVersion):
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::mergePaymentOptions):
(WebCore::ApplePayPaymentHandler::show):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
* testing/MockPaymentContactFields.h: Added.
(WebCore::MockPaymentContactFields::MockPaymentContactFields):
* testing/MockPaymentContactFields.idl: Added.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::supportsVersion): Deleted.
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2019-02-06 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] PrivateName to PublicName hash table is wasteful
https://bugs.webkit.org/show_bug.cgi?id=194277
Reviewed by Michael Saboff.
Use WebCoreBuiltinNames instead of adding WebCore names to JSC CommonIdentifiers.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::addCrossOriginPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::putCommon):
* bindings/js/WebCoreBuiltinNames.h:
2019-02-06 Keith Rollin <krollin@apple.com>
Really enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194357
<rdar://problem/47861231>
Reviewed by Chris Dumez.
Bug 194124 was supposed to enable the automatic checking and
regenerating of .xcfilelist files during the build. While related
changes were included in that patch, the change to actually enable the
operation somehow was omitted. This patch actually enables the
operation. The check-xcfilelist.sh scripts now check
WK_DISABLE_CHECK_XCFILELISTS, and if it's "1", opts-out the developer
from the checking.
No new tests since there should be no observable behavior difference.
* Scripts/check-xcfilelists.sh:
2019-02-06 John Wilander <wilander@apple.com>
Forward Ad Click Attribution data from HTMLAnchorElement::handleClick() to WebKit::NavigationActionData
https://bugs.webkit.org/show_bug.cgi?id=194325
<rdar://problem/47840283>
Reviewed by Chris Dumez.
No new tests. This is just data forwarding. Once the data is stored, I will create
test infrastructure to query it.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::handleClick):
* loader/AdClickAttribution.h:
(WebCore::AdClickAttribution::encode const):
(WebCore::AdClickAttribution::decode):
(WebCore::AdClickAttribution::Conversion::encode const):
(WebCore::AdClickAttribution::Conversion::decode):
Infrastructure for IPC.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
These functions forward the optional WebCore::AdClickAttribution object
FrameLoader::loadURL() creates the NavigationAction object and sets the
WebCore::AdClickAttribution object on there.
* loader/FrameLoader.h:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::adClickAttribution):
(WebCore::NavigationAction::setAdClickAttribution):
2019-02-06 Justin Fan <justin_fan@apple.com>
[Web GPU] Implement supporting dictionaries for GPUTexture
https://bugs.webkit.org/show_bug.cgi?id=194354
Reviewed by Dean Jackson.
Add dictionaries needed to create a GPUTextureDescriptor.
No new tests; no change in behavior.
New interface and dictionaries added:
* Modules/webgpu/GPUExtent3D.idl:
* Modules/webgpu/GPUTextureDescriptor.idl:
* Modules/webgpu/GPUTextureDimension.idl:
* Modules/webgpu/GPUTextureUsage.idl:
* platform/graphics/gpu/GPUExtent3D.h:
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/gpu/GPUTextureDimension.h:
* platform/graphics/gpu/GPUTextureUsage.h:
Update WebGPUTextureFormatEnum to GPUTextureFormat:
* Modules/webgpu/WebGPUTextureFormatEnum.h: Removed.
* Modules/webgpu/GPUTextureFormat.idl: Renamed from WebGPUTextureFormatEnum.idl and updated to hyphen-case.
* platform/graphics/gpu/GPUTextureFormat.h: Renamed from GPUTextureFormatEnum and updated for hyphen-case IDL.
* Modules/webgpu/WebGPUSwapChain.cpp:
* Modules/webgpu/WebGPUSwapChain.h:
* Modules/webgpu/WebGPUSwapChain.idl:
* platform/graphics/gpu/GPUSwapChain.h:
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::platformTextureFormatForGPUTextureFormat):
(WebCore::GPUSwapChain::setFormat):
Update project files with new symbols:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2019-02-12 Dean Jackson <dino@apple.com>
BitmapRenderer should handle existing ImageBuffers
https://bugs.webkit.org/show_bug.cgi?id=194555
<rdar://problem/47857150>
Reviewed by Tim Horton.
Our logic in ImageBitmapRenderingContext assumed that
it had always created the ImageBuffer being used. However, it's
valid to call something like toBlob() or toDataURL() before creating
a context, so we need to handle the case where an ImageBuffer
already exists.
Test: fast/canvas/bitmaprenderer-created-after-toBlob.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createImageBuffer const): Move some logic into setImageBuffer.
(WebCore::HTMLCanvasElement::setImageBuffer const): Make sure to clear the state saver.
2019-02-06 Daniel Bates <dabates@apple.com>
Standardize on ControlKey instead of CtrlKey
https://bugs.webkit.org/show_bug.cgi?id=194317
Reviewed by Tim Horton.
* dom/UIEventWithKeyState.cpp:
(WebCore::UIEventWithKeyState::modifiersFromInitializer):
(WebCore::UIEventWithKeyState::setModifierKeys):
* dom/UIEventWithKeyState.h:
(WebCore::UIEventWithKeyState::ctrlKey const):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::accessKeyModifiers):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::accessKeyModifiers):
* platform/PlatformEvent.h:
(WebCore::PlatformEvent::controlKey const):
(WebCore::PlatformEvent::PlatformEvent):
(WebCore::PlatformEvent::ctrlKey const): Deleted.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::getCurrentModifierState):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::modifiersForGdkKeyEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent):
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::modifiersForEvent):
* testing/Internals.cpp:
(WebCore::Internals::accessKeyModifiers const):
2019-02-06 Alex Christensen <achristensen@webkit.org>
Fix WatchOS build
https://bugs.webkit.org/show_bug.cgi?id=194353
Rubber stamped by Tim Horton and Wenson Hsieh.
* rendering/RenderThemeIOS.mm:
(WebCore::iconForAttachment):
2019-02-06 Olivier Blin <olivier.blin@softathome.com>
[SVG] fix SVGURIReference build by including SVGElement
https://bugs.webkit.org/show_bug.cgi?id=194292
Reviewed by Michael Catanzaro.
* svg/SVGURIReference.h:
SVGURIReference is making use of SVGElement in its constructor, but
it was not declared.
The issue was not seen in unified builds because it was grouped with
other files including SVGElement.
2019-02-06 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Move line layout code to a dedicated file
https://bugs.webkit.org/show_bug.cgi?id=194328
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::isTrimmableContent): Deleted.
(WebCore::Layout::InlineFormattingContext::initializeNewLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): Deleted.
(WebCore::Layout::InlineFormattingContext::createFinalRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): Deleted.
(WebCore::Layout::InlineFormattingContext::closeLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::appendContentToLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const): Deleted.
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const): Deleted.
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::isClosed const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::isFirstLine const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::runs):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::availableWidth const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::lastRunType const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalTop const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalBottom const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::logicalHeight const):
(WebCore::Layout::InlineFormattingContext::Line::hasContent const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::isClosed const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::runs): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::availableWidth const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::lastRunType const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalTop const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): Deleted.
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::adjustedLineLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): Deleted.
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::init):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::adjustLogicalRight):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::LineLayout::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::init): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::appendContent): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::close): Deleted.
2019-02-06 Youenn Fablet <youenn@apple.com>
CoreAudioCaptureSource should not configure its audio unit until it starts producing data
https://bugs.webkit.org/show_bug.cgi?id=194310
Reviewed by Eric Carlson.
Delay the configuration of the audio unit until the source is instructed to start producing data.
This allows the UIProcess to not start changing the audio unit when
checking for constraints during getUserMedia call before the prompt.
Covered by manual testing.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::initializeToStartProducingData):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
2019-02-06 Youenn Fablet <youenn@apple.com>
Disable audio ducking at Audio Unit setup time
https://bugs.webkit.org/show_bug.cgi?id=194303
Reviewed by Eric Carlson.
When creating a CoreAudioCaptureSource, the audio unit might be
reconfigured if a past audio capture was done.
This might trigger audio ducking which is undone in startInternal.
In some cases, startInternal will never call start.
In that case, the audio unit will continue ducking the other processing.
To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal.
In addition to that, once a shared unit is created, it stays alive until the UIProcess exits.
This might affect all applications.
Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened.
This has noticeable effects in the quality of audio being played on bluetooth devices.
Covered by manual tests.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioSharedUnit::unduck):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::captureFailed):
(WebCore::CoreAudioSharedUnit::stopProducingData):
2019-02-06 Antti Koivisto <antti@apple.com>
RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=194333
<rdar://problem/47822929>
Reviewed by Zalan Bujtas.
Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of
the legacy animation code triggering a resource load.
Test: http/tests/contentextensions/css-display-none-keyframe.html
* style/StyleScope.cpp:
(WebCore::Style::Scope::scheduleUpdate):
Avoid clearing the style resolver if we are in the middle of a style resolution.
A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335.
2019-02-06 Pablo Saavedra <psaavedra@igalia.com>
Build failure after r240315
https://bugs.webkit.org/show_bug.cgi?id=194341
Reviewed by Wenson Hsieh.
* bindings/js/JSUndoItemCustom.cpp:
(WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
2019-02-05 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name
https://bugs.webkit.org/show_bug.cgi?id=194329
Reviewed by Geoffrey Garen.
The bug was caused by the code path for when navigating with a specific target frame name that does not exist
never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous
navigation, resulting in this release assertion.
Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix.
Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
2019-02-05 Claudio Saavedra <csaavedra@igalia.com>
[FreeType] Build fix for Debian stable
Unreviewed build fix.
Debian stable currently has a version of fontconfig that doesn't
yet have FC_COLOR. #ifdef its use to fix the build.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
2019-02-05 Alex Christensen <achristensen@webkit.org>
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027
Reviewed by Youenn Fablet.
Also stop using NetworkBlobRegistry::singleton.
Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
We now have to resolve all blob file references while we still have a
NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
using the singleton after we have passed everything to the loading code, but it works the same
as it did before. We must consume the sandbox extension from the BlobRegistryImpl before using
the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
which extensions to revoke.
* platform/network/BlobRegistryImpl.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
(WebCore::FormData::resolveBlobReferences):
* platform/network/FormData.h:
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):
2019-02-05 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240984.
Revision casued two API timeouts
Reverted changeset:
"Stop using blobRegistry in NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=194027
https://trac.webkit.org/changeset/240984
2019-02-05 Keith Rollin <krollin@apple.com>
Enable the automatic checking and regenerations of .xcfilelists during builds
https://bugs.webkit.org/show_bug.cgi?id=194124
<rdar://problem/47721277>
Reviewed by Tim Horton.
Bug 193790 add a facility for checking -- during build time -- that
any needed .xcfilelist files are up-to-date and for updating them if
they are not. This facility was initially opt-in by setting
WK_ENABLE_CHECK_XCFILELISTS until other pieces were in place and until
the process seemed robust. Its now time to enable this facility and
make it opt-out. If there is a need to disable this facility, set and
export WK_DISABLE_CHECK_XCFILELISTS=1 in your environment before
running `make` or `build-webkit`, or before running Xcode from the
command line.
Additionally, remove the step that generates a list of source files
going into the UnifiedSources build step. It's only necessarily to
specify Sources.txt and SourcesCocoa.txt as inputs.
No new tests since there should be no observable behavior difference.
* UnifiedSources-input.xcfilelist: Removed.
* WebCore.xcodeproj/project.pbxproj:
2019-02-05 Keith Rollin <krollin@apple.com>
Update .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=194121
<rdar://problem/47720863>
Reviewed by Tim Horton.
Preparatory to enabling the facility for automatically updating the
.xcfilelist files, check in a freshly-updated set so that not everyone
runs up against having to regenerate them themselves.
No new tests since there should be no observable behavior difference.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2019-02-05 Alex Christensen <achristensen@webkit.org>
Stop using blobRegistry in NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=194027
Reviewed by Youenn Fablet.
Also stop using NetworkBlobRegistry::singleton.
Instead, have the NetworkProcess own a NetworkBlobRegistry which owns a BlobRegistryImpl.
We now have to resolve all blob file references while we still have a
NetworkConnectionToWebProcess/NetworkProcess/NetworkBlobRegistry/BlobRegistryImpl instead of
using the singleton after we have passed everything to the loading code, but it works the same
as it did before. We must consume the sandbox extension from the BlobRegistryImpl before using
the resolved files, so I pass around a Vector<RefPtr<WebCore::BlobDataFileReference>> so we know
which extensions to revoke.
* platform/network/BlobRegistryImpl.h:
* platform/network/FormData.cpp:
(WebCore::appendBlobResolved):
(WebCore::FormData::resolveBlobReferences):
* platform/network/FormData.h:
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::createHTTPBodyCFReadStream):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::CurlFormDataStream):
2019-02-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r240742.
Causes crashes on iOS simulator.
Reverted changeset:
"[iOS] Keyups for non-modifier keys identified as "Dead" when
not focused in a content-editable element"
https://bugs.webkit.org/show_bug.cgi?id=192824
https://trac.webkit.org/changeset/240742
2019-02-05 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] collectInlineContent should use pre-computed margins, paddings and borders
https://bugs.webkit.org/show_bug.cgi?id=194269
Reviewed by Antti Koivisto.
In this patch we pre-compute the margins padding and borders for formatting context roots, replaced boxes and non-replaced containers.
These property values are input to collectInlineContent's inline item detaching logic.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::nextInPreOrder):
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeMarginBorderAndPadding const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/layouttree/LayoutBox.h: ran out bits.
2019-02-05 Antoine Quint <graouts@apple.com>
REGRESSION (r240579): com.apple.WebKit.WebContent at WebCore: WebCore::Document::absoluteEventRegionForNode
https://bugs.webkit.org/show_bug.cgi?id=194284
<rdar://problem/47774298>
Reviewed by Antti Koivisto.
The m_touchActionElements list needs to be HashSet<RefPtr<Element>> instead of HashSet<Element*>. It was initially storing raw pointers based on m_touchEventTargets
which is an EventTargetSet (typedefd to HashCountedSet<Node*>), but that's because these nodes have an event listener registered for them and as such are kept alive,
whereas elements with a touch-action property arent. Elements are removed from this list from Document::nodeWillBeRemoved() and from Document::updateTouchActionElements(),
the latter being called from Style::TreeResolver::resolveElement().
* dom/Document.cpp:
(WebCore::Document::updateTouchActionElements):
* dom/Document.h:
(WebCore::Document::touchActionElements const):
2019-02-05 Benjamin Poulain <benjamin@webkit.org>
Hit testing functions optimizations
https://bugs.webkit.org/show_bug.cgi?id=194073
<rdar://problem/47692312>
Reviewed by Zalan Bujtas.
This patch implements some easy optimizations that speed up
hit testing without changing the algorithms.
* page/FrameViewLayoutContext.h:
The code for:
view().frameView().layoutContext().isPaintOffsetCacheEnabled()
followed by:
view().frameView().layoutContext().layoutState()
was loading all the intermediate values twice and calling layoutState()
twice.
By marking the function as pure, Clang can CSE the whole thing and
remove the duplicated code.
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::isInfinite const):
That one is pretty funny.
Since LayoutRect::isInfinite() was implemented before operator==() is
declared, the compiler was falling back to the implicit convertion to FloatRect()
before doing any comparison.
This explains a bunch of the convertions to float when using LayoutRect.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::mapLocalToContainer const):
Just reoder to make the register nice and clean for the optimization described above.
2019-02-04 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Shrink size of VM by lazily allocating IsoSubspaces for non-common types
https://bugs.webkit.org/show_bug.cgi?id=193993
Reviewed by Keith Miller.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
* bridge/runtime_method.h:
2019-02-04 Simon Fraser <simon.fraser@apple.com>
Move some macOS/iOS scrolling code into the scrolling/cocoa directory
https://bugs.webkit.org/show_bug.cgi?id=194245
Reviewed by Zalan Bujtas.
ScrollingTreeFixedNode and ScrollingTreeStickyNode are used on iOS and macOS, so move them to the cocoa
directory.
Standardize on the ordering of ENABLE(ASYNC_SCROLLING) && PLATFORM(MAC).
Stop building ScrollingThread for iOS (it's never used), and stub out some functions so things build.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::initializeRunLoop):
(WebCore::ScrollingThread::wakeUpRunLoop):
(WebCore::ScrollingThread::threadRunLoopSourceCallback):
* page/scrolling/cocoa/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h.
* page/scrolling/cocoa/ScrollingTreeFixedNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm.
* page/scrolling/cocoa/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h.
* page/scrolling/cocoa/ScrollingTreeStickyNode.mm: Renamed from Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm.
* page/scrolling/mac/ScrollingThreadMac.mm:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h:
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
2019-02-04 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816
Reviewed by Michael Catanzaro.
Tests: enabled fast/url/user-visible/.
* testing/Internals.cpp:
(WebCore::Internals::userVisibleString): Enable method on all platforms.
2019-02-04 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] ASSERTION FAILED: !m_didNotifyResponse || m_multipartHandle
https://bugs.webkit.org/show_bug.cgi?id=190895
Reviewed by Ross Kirsling.
An assertion was failing in CurlRequest::invokeDidReceiveResponse
because DidReceiveResponse was already dispatched. This condition
was met if CurlRequestScheduler::completeTransfer is called while
waiting for the reply for the first DidReceiveResponse.
No new tests, covered by existing tests.
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
Return true if m_didNotifyResponse is false disregard to
m_didReturnFromNotify.
2019-02-04 Said Abou-Hallawa <said@apple.com>
[CG] Enable setAdditionalSupportedImageTypes for WK1
https://bugs.webkit.org/show_bug.cgi?id=194190
Reviewed by Tim Horton.
Move the function webCoreStringVectorFromNSStringArray from WebKit to
WebCore so it can be used by both WebKit and WebKitLegacy.
* platform/mac/StringUtilities.h:
* platform/mac/StringUtilities.mm:
(WebCore::webCoreStringVectorFromNSStringArray):
2019-02-04 Justin Fan <justin_fan@apple.com>
[Web GPU] Code clean-up for RenderPipeline backend
https://bugs.webkit.org/show_bug.cgi?id=194238
Reviewed by Dean Jackson.
Replace dot syntax setters with calls to setter methods, and remove unnecessary setter calls for
the input state's descriptor arrays.
Covered by existing tests; no change in behavior.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::tryCreateMtlDepthStencilState): Refactor to use implicit setters rather than dot syntax.
(WebCore::setInputStateForPipelineDescriptor): Ditto, and remove unnecessary setter calls on array objects.
2019-02-04 Benjamin Poulain <benjamin@webkit.org>
Use deferrable timer to restart the Responsiveness Timer on each wheel event
https://bugs.webkit.org/show_bug.cgi?id=194135
<rdar://problem/47724099>
Reviewed by Simon Fraser.
The original DeferrableOneShotTimer was not really deferrable.
What it allows is to restart the count down from scratch after
firing.
For this optimization, I want to keep the correct timing but avoid
starting a real timer every time.
I renamed DeferrableOneShotTimer to ResettableOneShotTimer and
created a real DeferrableOneShotTimer that support deadlines.
* css/CSSImageGeneratorValue.cpp:
* html/HTMLPlugInImageElement.h:
* loader/cache/CachedResource.h:
* platform/Timer.cpp:
(WebCore::DeferrableOneShotTimer::startOneShot):
(WebCore::DeferrableOneShotTimer::fired):
* platform/Timer.h:
(WebCore::TimerBase::nextFireTime const):
(WebCore::ResettableOneShotTimer::ResettableOneShotTimer):
(WebCore::DeferrableOneShotTimer::DeferrableOneShotTimer):
(WebCore::DeferrableOneShotTimer::stop):
(WebCore::DeferrableOneShotTimer::restart): Deleted.
* platform/graphics/ca/TileController.h:
* platform/graphics/cg/SubimageCacheWithTimer.h:
2019-02-04 Antoine Quint <graouts@apple.com>
Use constants for pointer types
https://bugs.webkit.org/show_bug.cgi?id=194232
Reviewed by Dean Jackson.
We cannot use an enum for the pointer type since a custom pointer type can be created by developers when creating a
pointer event using JavaScript, but we can at least used string constants for the ones created internally.
* dom/PointerEvent.cpp:
(WebCore::PointerEvent::mousePointerType):
(WebCore::PointerEvent::penPointerType):
(WebCore::PointerEvent::touchPointerType):
* dom/PointerEvent.h:
* dom/ios/PointerEventIOS.cpp:
2019-02-04 Zalan Bujtas <zalan@apple.com>
[First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account.
https://bugs.webkit.org/show_bug.cgi?id=194168
Reviewed by Simon Fraser.
First paint should not be blocked by async or deferred scripts.
* page/FrameView.cpp:
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
2019-02-04 Simon Fraser <simon.fraser@apple.com>
Async overflow scroll with border-radius renders incorrectly
https://bugs.webkit.org/show_bug.cgi?id=194205
<rdar://problem/47771668>
Reviewed by Zalan Bujtas.
When an element has composited overflow:scroll and border-radius, we need to make a layer
to clip to the inside of the border radius if necessary.
Existing code simply turned off needsDescendantsClippingLayer for composited scrolling
layers, but now we check to see if the inner border is rounded. If we have both a m_childContainmentLayer
and scrolling layers, we need to adjust the location of the scrolling layers (which are parented
in m_childContainmentLayer).
Also fix offsetFromRenderer for these layers; it's positive for layers inset from the top left
of the border box.
Tests: compositing/clipping/border-radius-async-overflow-clipping-layer.html
compositing/clipping/border-radius-async-overflow-non-stacking.html
compositing/clipping/border-radius-async-overflow-stacking.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateChildClippingStrategy): Layout is always up-to-date now, so remove the comment.
2019-02-04 Simon Fraser <simon.fraser@apple.com>
PageOverlayController's layers should be created lazily
https://bugs.webkit.org/show_bug.cgi?id=194199
Reviewed by Tim Horton.
Expose PageOverlayController::hasDocumentOverlays() and hasViewOverlays()
and use them to only parent the overlay-hosting layers when necessary.
For document overlays, RenderLayerCompositor::appendDocumentOverlayLayers() can
simply do nothing if there are none. Updates are triggered via Page::installedPageOverlaysChanged(),
which calls FrameView::setNeedsCompositingConfigurationUpdate() to trigger the root layer
compositing updates that parents the layerWithDocumentOverlays().
View overlays are added to the layer tree via the DrawingArea. When we go between having
none and some view overlays, Page::installedPageOverlaysChanged() calls attachViewOverlayGraphicsLayer()
on the ChromeClient, and the DrawingArea responds by calling updateRootLayers() and scheduling a
compositing flush (this has to be done manually because view overlay layers are outside the
subtree managed by RenderLayerCompositor).
Now that GraphicsLayers are ref-counted, we can let the DrawingArea simply retain its m_viewOverlayRootLayer;
there is no need for RenderLayerCompositor::attachRootLayer()/detachRootLayer() to do anything with view
overlay layers. This implies that a page can navigate (new FrameView) and view overlays will persist, without
having to be manually removed and re-added. We can also remove the Frame argument to attachViewOverlayGraphicsLayer().
* loader/EmptyClients.h:
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate): These functions need to schedule a compositing flush
because there may be nothing else that does.
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
* page/Page.cpp:
(WebCore::Page::installedPageOverlaysChanged):
* page/Page.h:
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::hasDocumentOverlays const):
(WebCore::PageOverlayController::hasViewOverlays const):
(WebCore::PageOverlayController::attachViewOverlayLayers): PageOverlayController has the Page so it
might as well be the one to call through the ChromeClient.
(WebCore::PageOverlayController::detachViewOverlayLayers):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
* page/PageOverlayController.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers): isFullUpdate is always true; remove it.
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
2019-02-04 Eric Liang <ericliang@apple.com>
When performing Increment or Decrement on sliders, check to see if the slider is disabled.
https://bugs.webkit.org/show_bug.cgi?id=173497
Reviewed by Chris Fleizach.
Test: accessibility/set-value-not-work-for-disabled-sliders.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::alterSliderValue):
2019-02-04 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak WebIDBConnectionToServer in layout tests
https://bugs.webkit.org/show_bug.cgi?id=193688
<rdar://problem/47353263>
Reviewed by Geoffrey Garen.
Let IDBConnectionToServer keep a WeakPtr of IDBConnectionToServerDelegate.
* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::IDBConnectionToServer):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
2019-02-04 Youenn Fablet <youenn@apple.com>
Make sure to remove the device observer in AVVideoCaptureSource
https://bugs.webkit.org/show_bug.cgi?id=194181
<rdar://problem/47739247>
Reviewed by Eric Carlson.
Make sure to remove the device observer when the observer is destroyed.
To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor.
Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource.
Covered by manual test.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::initializeSession):
(WebCore::AVVideoCaptureSource::clearSession):
(WebCore::AVVideoCaptureSource::stopProducingData):
(WebCore::AVVideoCaptureSource::setupSession):
2019-02-04 Antoine Quint <graouts@apple.com>
Use a dedicated type instead of int32_t for pointer identifiers
https://bugs.webkit.org/show_bug.cgi?id=194217
Reviewed by Antti Koivisto.
* WebCore.xcodeproj/project.pbxproj:
* dom/PointerEvent.h:
* dom/PointerID.h: Added.
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::setPointerCapture):
(WebCore::PointerCaptureController::releasePointerCapture):
(WebCore::PointerCaptureController::hasPointerCapture):
(WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
(WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier):
(WebCore::PointerCaptureController::cancelPointer):
* page/PointerCaptureController.h:
2019-02-04 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
Followup to https://bugs.webkit.org/show_bug.cgi?id=193758
Reviewed by Daniel Bates.
Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in
behavior.
* editing/EditingBehavior.h:
(WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
2019-02-04 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Make InlineFormattingContext::collectInlineContent non-recursive.
https://bugs.webkit.org/show_bug.cgi?id=194210
Reviewed by Antti Koivisto.
Use iterative algorithm to collect inline content (and add breaking rules).
This is in preparation for fixing the inline preferred width computation.
* layout/Verification.cpp:
(WebCore::Layout::resolveForRelativePositionIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::addDetachingRules):
(WebCore::Layout::createAndAppendInlineItem):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2019-02-04 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused variable warnings introduced in r240912
https://bugs.webkit.org/show_bug.cgi?id=194198
<rdar://problem/47776051>
* page/FrameView.cpp:
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
2019-02-04 Frederic Wang <fwang@igalia.com>
[css-scroll-snap] scroll-snap-align not honored on child with non-visible overflow
https://bugs.webkit.org/show_bug.cgi?id=191816
Reviewed by Wenson Hsieh.
This patch fixes a bug that prevents children of a scroll container to create snap positions
when they have non-visible overflow. This happens because for such a child, the function
RenderBox::findEnclosingScrollableContainer() will return the child itself rather than the
scroll container. To address that issue, we introduce a new
RenderObject::enclosingScrollableContainerForSnapping() helper function that ensures that
a real RenderBox ancestor is returned.
Test: css3/scroll-snap/scroll-snap-children-with-overflow.html
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::updateSnapOffsetsForScrollableArea): Use enclosingScrollableContainerForSnapping()
so that we don't skip children with non-visible overflow.
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange): Ditto. The new function calls
enclosingBox().
* rendering/RenderObject.cpp:
(WebCore::RenderObject::enclosingScrollableContainerForSnapping const): Return
the scrollable container of the enclosing box. If it is actually the render object itself
then start the search from the parent box instead.
* rendering/RenderObject.h: Declare enclosingScrollableContainerForSnapping().
2019-02-04 Antti Koivisto <antti@apple.com>
Rename GraphicsLayer and PlatformCALayer scrolling layer type enum values to be less ambiguous
https://bugs.webkit.org/show_bug.cgi?id=194215
Reviewed by Frédéric Wang.
GraphicsLayer::Type::Scrolling -> GraphicsLayer::Type::ScrollContainer
PlatformCALayer::LayerTypeScrollingLayer -> PlatformCALayer::LayerTypeScrollContainerLayer
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsLayerType):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::supportsLayerType):
(WebCore::GraphicsLayerCA::initialize):
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
(WebCore::PlatformCALayerCocoa::commonInit):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer):
2019-02-03 Antti Koivisto <antti@apple.com>
[iOS] Tiles not created in large scrollable iframes
https://bugs.webkit.org/show_bug.cgi?id=193665
Reviewed by Simon Fraser.
We are not syncing scroll position back to the graphics layer tree correctly.
Test by Frédéric Wang.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::reconcileScrollPosition):
Factor setting and syncing scrolling layer positions into a function.
Use bounds.origin scrolling mechanic when scrollContainerLayer is present.
(WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
(WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollContainerLayerForFrameView):
(WebCore::ScrollingCoordinator::scrolledContentsLayerForFrameView):
(WebCore::ScrollingCoordinator::scrollLayerForFrameView): Deleted.
* page/scrolling/ScrollingCoordinator.h:
* rendering/RenderLayerCompositor.cpp:
Rename scrollLayer to scrolledContentsLayer according to out preferred naming scheme and use it in that role only.
Add scrollContainerLayer as a separate layer. It is only constructed when using async scrolling on iOS.
(WebCore::RenderLayerCompositor::~RenderLayerCompositor):
(WebCore::RenderLayerCompositor::customPositionForVisibleRectComputation const):
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateScrollLayerPosition):
(WebCore::RenderLayerCompositor::frameViewDidScroll):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::destroyRootLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
* rendering/RenderLayerCompositor.h:
2019-02-03 Simon Fraser <simon.fraser@apple.com>
Make setNeedsLayout on the root more explicitly about triggering its side-effects
https://bugs.webkit.org/show_bug.cgi?id=194198
Reviewed by Antti Koivisto.
Calling setNeedsLayout() on the FrameView or RenderView is an odd concept; the render tree
generally manages its own dirty state.
Most callers of setNeedsLayout() on the root are really trying to trigger the side-effects
of layout, like compositing updates, which are required when view configuration state, like
headers, footers and transparency, change. These dependencies are currently implicit and
poorly defined.
Renaming "setNeedsLayout" on FrameView is a step towards being more explicit about pure
rendering updates, vs updates of downstream data strutures like compositing. It's now called
setNeedsLayoutAfterViewConfigurationChange(). In addition, expose
setNeedsCompositingConfigurationUpdate() and setNeedsCompositingGeometryUpdate() so callers
can trigger the appropriate types of compositing updates on the root layer.
In addition, FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange() schedules a
layout. Withtout this, some callers would dirty the RenderView's layout but rely on some
other trigger to make the layout happen.
This cleanup was prompted by noticing that FrameView::setHeaderHeight() dirtied layout
but never scheduled it, making banner insertion in MiniBrowser unreliable.
This patch also removes the aliasing of headerHeight/footerHeight between Page and
FrameView. Banners are a property of Page, so FrameView fetches the banner heights
from Page.
* page/FrameView.cpp:
(WebCore::FrameView::headerHeight const):
(WebCore::FrameView::footerHeight const):
(WebCore::FrameView::availableContentSizeChanged):
(WebCore::FrameView::setNeedsLayoutAfterViewConfigurationChange):
(WebCore::FrameView::setNeedsCompositingConfigurationUpdate):
(WebCore::FrameView::setNeedsCompositingGeometryUpdate):
(WebCore::FrameView::scheduleSelectionUpdate):
(WebCore::FrameView::setTransparent):
(WebCore::FrameView::setBaseBackgroundColor):
(WebCore::FrameView::setAutoSizeFixedMinimumHeight):
(WebCore::FrameView::enableAutoSizeMode):
(WebCore::FrameView::setHeaderHeight): Deleted.
(WebCore::FrameView::setFooterHeight): Deleted.
(WebCore::FrameView::setNeedsLayout): Deleted.
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange):
(WebCore::FrameViewLayoutContext::setNeedsLayout): Deleted.
* page/FrameViewLayoutContext.h:
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
(WebCore::Page::setHeaderHeight):
(WebCore::Page::setFooterHeight):
(WebCore::Page::addHeaderWithHeight): Deleted.
(WebCore::Page::addFooterWithHeight): Deleted.
* page/Page.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setHeaderHeight):
(WebCore::Internals::setFooterHeight):
2019-02-03 John Wilander <wilander@apple.com>
Parse and handle Ad Click Attribution attributes in HTMLAnchorElement::handleClick()
https://bugs.webkit.org/show_bug.cgi?id=194104
<rdar://problem/47649991>
Reviewed by Chris Dumez, Daniel Bates, and Darin Adler.
Test: http/tests/adClickAttribution/anchor-tag-attributes-validation.html
This patch adds parsing and validation of the two new Ad Click Attribution
attributes in anchor elements: adcampaignid and addestination. The data is
not yet forwarded into the loader.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
(WebCore::HTMLAnchorElement::handleClick):
Now calls HTMLAnchorElement::parseAdClickAttribution().
* html/HTMLAnchorElement.h:
* loader/AdClickAttribution.h:
Made WebCore::AdClickAttribution copyable since it's needed to have it be
WTF::Optional. Also made AdClickAttribution::MaxEntropy public. Changed
numeric types from unsigned short to uint32_t.
(WebCore::AdClickAttribution::Campaign::isValid const):
(WebCore::AdClickAttribution::Conversion::isValid const):
2019-02-03 Ryosuke Niwa <rniwa@webkit.org>
Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy
https://bugs.webkit.org/show_bug.cgi?id=194189
Reviewed by Geoffrey Garen.
Introduced PolicyCheckIdentifier to pair each navigation policy check request with a decision,
and deployed it in PolicyChecker. The identifier is passed from WebContent process to UI process
in WebKit2, and passed it back with the policy decision.
Because PolicyCheckIdentifier embeds the process identifier from which a navigation policy is checked,
we would be able to detect when UI process had sent the decision to a wrong WebContent process.
This patch also adds release assertions to make sure history().provisionalItem() is set whenever
we're requesting a navigation policy check.
These code changes should either:
1. Fix crashes in FrameLoader::continueLoadAfterNavigationPolicy where isBackForwardLoadType would
return true yet history().provisionalItem() is null.
2. Detect a bug that UI process can send a navigation policy decision to a wrong WebContent process.
3. Rule out the possibility that (2) exists.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::responseReceived):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkContentPolicy):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/FrameLoaderTypes.h:
(WebCore::PolicyCheckIdentifier): Added.
(WebCore::PolicyCheckIdentifier::operator== const): Added.
(WebCore::PolicyCheckIdentifier::PolicyCheckIdentifier): Added.
(WebCore::PolicyCheckIdentifier::encode const): Added.
(WebCore::PolicyCheckIdentifier::decode): Added.
* loader/PolicyChecker.cpp:
(WebCore::PolicyCheckIdentifier::generate):
(WebCore::PolicyCheckIdentifier::isValidFor): Returns true if the identifer matches. Also release asserts
that the process ID is same, and that m_check is always not zero (meaning it's a generated value).
The failure of these release assertions would indicate that there is a bug in UI process, which results in
a policy decision response being sent to a wrong Web process.
(WebCore::PolicyChecker::checkNavigationPolicy): Exit early if isValidFor fails.
(WebCore::PolicyChecker::checkNewWindowPolicy):
2019-02-03 Antti Koivisto <antti@apple.com>
Don't include ScrollCoordinator.h from Element.h
https://bugs.webkit.org/show_bug.cgi?id=194206
Reviewed by Daniel Bates.
* dom/Element.h:
2019-02-03 Wenson Hsieh <wenson_hsieh@apple.com>
Unable to move selection into editable roots with 0 height
https://bugs.webkit.org/show_bug.cgi?id=194143
<rdar://problem/47767284>
Reviewed by Ryosuke Niwa.
Currently, positions inside editable elements of height 0 are not considered to be candidates when
canonicalizing a position to its visible counterpart. This prevents us from moving the selection into these
editable roots at all. To fix this, we relax this constraint by allowing positions anchored by root editable
elements to be candidates.
Test: editing/selection/insert-text-in-empty-content-editable.html
* dom/Position.cpp:
(WebCore::Position::isCandidate const):
2019-02-03 Simon Fraser <simon.fraser@apple.com>
Tidyup of Pagination and FrameView m_mediaType initialization
https://bugs.webkit.org/show_bug.cgi?id=194203
Reviewed by Darin Adler.
Fix post-commit feedback on lines around code changed in r240901.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
* page/FrameView.h:
* rendering/Pagination.h:
(WebCore::Pagination::operator!= const):
2019-02-03 Megan Gardner <megan_gardner@apple.com>
Turn on Smart Paste
https://bugs.webkit.org/show_bug.cgi?id=193786
Reviewed by Ryosuke Niwa.
Turned on a modified tests:
LayoutTests/editing/pasteboard/smart-paste-001.html
LayoutTests/editing/pasteboard/smart-paste-002.html
LayoutTests/editing/pasteboard/smart-paste-003.html
LayoutTests/editing/pasteboard/smart-paste-004.html
LayoutTests/editing/pasteboard/smart-paste-005.html
LayoutTests/editing/pasteboard/smart-paste-006.html
LayoutTests/editing/pasteboard/smart-paste-007.html
LayoutTests/editing/pasteboard/smart-paste-008.html
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::canSmartReplace):
Turn on smart replace.
2019-02-02 Simon Fraser <simon.fraser@apple.com>
Tidy up data memebers of FrameView and related classes to shrink class sizes
https://bugs.webkit.org/show_bug.cgi?id=194197
Reviewed by Zalan Bujtas.
Make various enums 8-bit. Re-order data members of FrameView, FrameViewLayoutContext, Widget
and ScrollView to optimize padding.
Use more data member initializers.
This shrinks FrameView from 1168 (144 padding bytes) to 1096 (96 padding bytes).
* dom/Element.h:
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
* page/FrameView.h:
* page/FrameViewLayoutContext.h:
* platform/ScrollTypes.h:
* platform/ScrollView.h: Data members should come after member functions.
* platform/Widget.h:
* rendering/Pagination.h:
(WebCore::Pagination::Pagination): Deleted.
2019-02-02 Simon Fraser <simon.fraser@apple.com>
Rename "scrollingLayer" in RenderLayerBacking to "scrollContainerLayer" for clarity
https://bugs.webkit.org/show_bug.cgi?id=194194
Rubber-stampted by Antti Koivisto.
Our desired terminology is "scrollContainerLayer" for the outer, clipping layer
for scrolling, and "scrolledContentsLayer" for the contents that move when you scroll.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::destroyGraphicsLayers):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::setLocationOfScrolledContents):
(WebCore::RenderLayerBacking::updateAfterDescendants):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
2019-02-02 Justin Fan <justin_fan@apple.com>
[Web GPU] Fix GPURenderPassEncoder::setVertexBuffers and allow overlapping indices with GPUBindGroups
https://bugs.webkit.org/show_bug.cgi?id=194125
Reviewed by Myles C. Maxfield.
GPURenderPassEncoder::setVertexBuffers is now actually written to set all buffers provided. In addition,
shift vertex input buffer indices so that any resource bindings can bind vertex buffer resources to the same indices.
Existing tests cover setVertexBuffers. Updated buffer-resource-triangles to assign bind groups and vertex buffers to the same index.
* Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.cpp: Added.
(WebCore::WHLSL::Metal::calculateVertexBufferIndex): Simple shifting function for vertex input buffer indices.
* Modules/webgpu/WHLSL/Metal/WHLSLVertexBufferIndexCalculator.h: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Limit maximum bind group indices to 0 to 3.
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Limit vertex input indices to 0 to 15.
* Modules/webgpu/WebGPURenderPassEncoder.h: Move IDL/bindings bug note to IDL file.
* Modules/webgpu/WebGPURenderPassEncoder.idl: Ditto.
* platform/graphics/gpu/GPULimits.h: Added. Home for Web GPU limits constants shared between files.
* platform/graphics/gpu/GPURenderPassEncoder.h: Change IDL/bindings bug workaround to unsigned long long to prevent narrowing compared to spec.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers): Now properly calls Metal's setVertexBuffers.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor): Fix validation checks for vertex attribute numbers and vertex buffer indices.
Add symbols to project:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-02-01 Simon Fraser <simon.fraser@apple.com>
Async overflow scroll is jumpy on macOS if the main thread is busy
https://bugs.webkit.org/show_bug.cgi?id=194184
<rdar://problem/47758655>
Reviewed by Antti Koivisto.
This change extends to macOS some existing overflow-scroll functionality for iOS.
When an async scroll is in process in the scroll thread (or UI process), we periodically
message back to the web process main thread with scroll position updates. These
can trigger post-scroll compositing updates, but we need to ensure that this update
doesn't clobber the scroll position of the native layers, which would trigger
stutters.
To do this we have the notion of a scroll position "sync" (ScrollingLayerPositionAction::Sync) which
pokes the new value into the GraphicsLayer (hence making visible rect computations work), but doesn't
propagate it to the platform layer. This patch wires up syncs for macOS during async overflow scrolling,
coming out of AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll().
In RenderLayerBacking, m_scrollingContentsLayer is renamed to m_scrolledContentsLayer, and I added
updateScrollOffset() and setLocationOfScrolledContents() to handle the set vs. sync, and to keep
the iOS vs macOS differences in one function. This allows for more code sharing in RenderLayerBacking::updateGeometry().
There's a confusing bit in the m_childClippingMaskLayer code (trac.webkit.org/178029) where the setOffsetFromRenderer()
just looks wrong; it should match m_scrollingLayer. This code is never hit for Cocoa, which never has m_childClippingMaskLayer.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition): Logging
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition): Logging
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayer.h: Rename m_requiresScrollBoundsOriginUpdate to m_requiresScrollPositionReconciliation
and make it available on all platforms. Just reorder m_adjustForIOSCaretWhenScrolling to reduce #ifdef nesting confusion.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::destroyGraphicsLayers):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::setLocationOfScrolledContents):
(WebCore::RenderLayerBacking::updateScrollOffset):
(WebCore::RenderLayerBacking::updateDrawsContent):
(WebCore::RenderLayerBacking::updateScrollingLayers):
(WebCore::RenderLayerBacking::paintingPhaseForPrimaryLayer const):
(WebCore::RenderLayerBacking::parentForSublayers const):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::paintContents):
(WebCore::RenderLayerBacking::backingStoreMemoryEstimate const):
* rendering/RenderLayerBacking.h:
2019-02-02 Zalan Bujtas <zalan@apple.com>
[LFC] Initialize ICB's style with fixed width/height.
https://bugs.webkit.org/show_bug.cgi?id=194188
Reviewed by Antti Koivisto.
Let's set ICB's logical width/height to Fixed so that it's available when we try to resolve a box's height
in FormattingContext::Geometry::computedHeightValue() by using the containing block's height (ICB in this case).
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutState.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createLayoutTree):
2019-02-02 Zalan Bujtas <zalan@apple.com>
[LFC] Add missing case to out-of-flow non-replaced horizontal used margin value computation
https://bugs.webkit.org/show_bug.cgi?id=194185
Reviewed by Antti Koivisto.
If none of horizontal values (left, right, width, margin-left/right) are auto, then usedHorizontalMarginValues = computedHorizontalMarginValues.
Test: fast/block/block-only/absolute-position-left-right-margin.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2018-12-16 Darin Adler <darin@apple.com>
Convert additional String::format clients to alternative approaches
https://bugs.webkit.org/show_bug.cgi?id=192746
Reviewed by Alexey Proskuryakov.
This round of conversions covers less-trivial cases such as floating
point numerals and hexadecimal. Not yet taking on pointer serialization
("%p") or padding with spaces of zero digits, so call sites using those
have been left untouched.
In some cases these new idioms are a bit clumsy, and we could follow up
with additional convenience functions to make them more elegant.
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString const): Use more ASCIILiteral and
more appendLiteral for efficiency. Use upperNibbleToLowercaseASCIIHexDigit,
lowerNibbleToLowercaseASCIIHexDigit, and also makeString and FormattedNumber.
* css/MediaQueryEvaluator.cpp:
(WebCore::aspectRatioValueAsString): Use makeString and FormattedNumber.
Doing it this way makes it a little clearer that we have an unpleasant
use of fixed 6-digit precision here.
* html/FTPDirectoryDocument.cpp:
(WebCore::processFilesizeString): Use makeString and FormattedNumber.
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties): Ditto.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const): Ditto.
* page/History.cpp:
(WebCore::History::stateObjectAdded): Ditto.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::formatByteNumber): Ditto.
(WebCore::gcTimerString): Use String::number.
(WebCore::ResourceUsageOverlay::platformDraw): Use makeString and FormattedNumber.
* page/scrolling/AxisScrollSnapOffsets.cpp:
(WebCore::snapOffsetsToString): Removed some unnecessary copying in the for loop,
use appendLiteral, and use appendFixedWidthNumber.
(WebCore::snapOffsetRangesToString): Ditto.
(WebCore::snapPortOrAreaToString): Use makeString and FormattedNumber.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const): Use makeString.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::keyIdentifierForCharCode): Use makeString and the ASCIIHexDigit
functions.
* platform/graphics/Color.cpp:
(WebCore::Color::nameForRenderTreeAsText const): Ditto.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Use makeString and FormattedNumber.
* platform/text/PlatformLocale.cpp:
(WebCore::DateTimeStringBuilder::visitField): Use String::numberToStringFixedWidth.
2019-02-01 Simon Fraser <simon.fraser@apple.com>
Remove the unused layerForScrolling()
https://bugs.webkit.org/show_bug.cgi?id=194180
Reviewed by Zalan Bujtas.
Remove ScrollableArea::layerForScrolling() and derivations. This was unused.
* page/FrameView.cpp:
(WebCore::FrameView::layerForScrolling const): Deleted.
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollLayerForScrollableArea): Deleted.
* page/scrolling/ScrollingCoordinator.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::layerForScrolling const): Deleted.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
2019-02-01 Zalan Bujtas <zalan@apple.com>
[LFC] Fix statically positioned replaced out-of-flow horizontal geometry
https://bugs.webkit.org/show_bug.cgi?id=194163
Reviewed by Simon Fraser.
Fix a typo.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2019-02-01 Chris Dumez <cdumez@apple.com>
REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
https://bugs.webkit.org/show_bug.cgi?id=193740
<rdar://problem/47527267>
Reviewed by Alex Christensen.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
* loader/PolicyChecker.h:
2019-02-01 Antoine Quint <graouts@apple.com>
Dispatch pointercancel events when content is panned or zoomed on iOS
https://bugs.webkit.org/show_bug.cgi?id=193962
<rdar://problem/47629134>
Reviewed by Dean Jackson.
Expose two new methods on PointerCaptureController so that, given a pointer id, it can be established whether this pointer
has been cancelled, which is important because a cancelled pointer should no longer dispatch any further pointer events, and
to cancel a pointer.
Tests: pointerevents/ios/touch-action-pointercancel-pan-x.html
pointerevents/ios/touch-action-pointercancel-pan-y.html
pointerevents/ios/touch-action-pointercancel-pinch-zoom.html
* WebCore.xcodeproj/project.pbxproj: Make PointerCaptureController.h Private so that it can be imported from WebKit.
* dom/PointerEvent.h: Remove an unnecessary #if ENABLE(POINTER_EVENTS) since the entire file is already contained in one.
Then we add a new create() method that takes an event type, a pointer id and a pointer type (touch vs. pen) that we use
to create pointercancel events in PointerCaptureController::cancelPointer().
* page/Page.cpp:
(WebCore::Page::Page): Pass the Page as a parameter when creating the PointerCaptureController.
* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::PointerCaptureController): Add a Page reference to the constructor since we'll need
the page to access its main frame's EventHandler to perform hit testing in case we do not have a capture target override
in cancelPointer().
(WebCore::PointerCaptureController::releasePointerCapture): Drive-by, remove the the implicit parameter since on iOS we
don't need to differentiate. We'll bring this back for the macOS work.
(WebCore::PointerCaptureController::hasCancelledPointerEventForIdentifier): New method we'll use when dispatching pointer
events to identify whether a pointer id has already been cancelled which will allow for _not_ dispatching any further
pointer events for this pointer id.
(WebCore::PointerCaptureController::pointerEventWillBeDispatched): Keep track of the pointer type so we can preserve it
when dispatching pointercancel events for a given pointer id.
(WebCore::PointerCaptureController::cancelPointer): Dispatch a pointercancel for the provided pointer id, using the capture
target override as the event's target, if there is one, and otherwise hit-testing at the provided location to figure out
what the target should be.
* page/PointerCaptureController.h: Switch the target overrides from Element* to RefPtr<Element> to ensure it may not be
deleted while we still need them. Existing code already ensures these get set to nullptr.
2019-02-01 Jer Noble <jer.noble@apple.com>
Make the WebKit default for media source based on the WebCore default.
https://bugs.webkit.org/show_bug.cgi?id=194172
Reviewed by Eric Carlson.
* page/SettingsBase.h:
2019-02-01 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Memory timeline starts from zero when both CPU and Memory timeline are enabled
https://bugs.webkit.org/show_bug.cgi?id=194111
<rdar://problem/47714555>
Rubber-stamped by Devin Rousso.
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::waitUntilObservers):
(WebCore::ResourceUsageThread::threadBody):
Wait a short period of time before the first listener registers
and we start sampling. This will allow multiple listeners to
register, each that wants different data.
2019-02-01 Antti Koivisto <antti@apple.com>
Don't use base layer() as the scroll layer in scrolling tree.
https://bugs.webkit.org/show_bug.cgi?id=194160
Reviewed by Simon Fraser.
Maintain scrollContainerLayer() and scrolledContentsLayer() separately in ScrollingTreeScrollingNode.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setNodeLayers):
Turn the long layer parameter list into a struct.
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
(WebCore::ScrollingStateNode::setAllPropertiesChanged):
(WebCore::ScrollingStateNode::setLayer):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateScrollingNode::setScrollContainerLayer):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::scrollContainerLayer const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const):
(WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const):
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeFrameScrollingNodeMac::exposedUnfilledArea const):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
2019-02-01 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r240698): fast/scrolling/sticky-to-fixed.html can cause a crash
https://bugs.webkit.org/show_bug.cgi?id=194134
rdar://problem/47721210
Reviewed by Daniel Bates.
fast/scrolling/sticky-to-fixed.html changes the scrolling node type, which causes
scrollingCoordinator->insertNode() to return a different ScrollingNodeID to the one
passed in. We have to handle this, removing the node for the nodeID and unregistering
the layer with the old nodeID.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachScrollingNode):
2019-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r239915): css3/font-feature-font-face-local.html failing on WPE
https://bugs.webkit.org/show_bug.cgi?id=194008
Reviewed by Žan Doberšek.
We need to replace control characters with zero width space too.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill):
* platform/text/CharacterProperties.h:
(WebCore::isControlCharacter):
2019-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
ComplexText: Test fast/text/word-space-nbsp.html fails when using complex text path
https://bugs.webkit.org/show_bug.cgi?id=193279
Reviewed by Michael Catanzaro.
The fix applied in r135884 to WidthIterator should also be applied to ComplexTextController.
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances):
2019-02-01 Zalan Bujtas <zalan@apple.com>
[LFC] Adjust replaced element's intrinsic ratio
https://bugs.webkit.org/show_bug.cgi?id=194154
Reviewed by Antti Koivisto.
Decouple image and iframe replaced types and set intrinsic ratio accordingly.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isReplaced const):
(WebCore::Layout::Box::isIFrame const):
(WebCore::Layout::Box::isImage const):
* layout/layouttree/LayoutReplaced.cpp:
(WebCore::Layout::Replaced::hasIntrinsicRatio const):
(WebCore::Layout::Replaced::intrinsicRatio const):
(WebCore::Layout::Replaced::hasAspectRatio const):
* layout/layouttree/LayoutReplaced.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2019-02-01 Zalan Bujtas <zalan@apple.com>
[LFC] Set intrinsic size on Layout::Replaced
https://bugs.webkit.org/show_bug.cgi?id=194139
Reviewed by Antti Koivisto.
Eventually Layout::Replaced will track intrinsic size internally until then let's query the RenderReplaced.
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::replaced):
* layout/layouttree/LayoutReplaced.cpp:
(WebCore::Layout::Replaced::hasIntrinsicWidth const):
(WebCore::Layout::Replaced::hasIntrinsicHeight const):
(WebCore::Layout::Replaced::intrinsicWidth const):
(WebCore::Layout::Replaced::intrinsicHeight const):
* layout/layouttree/LayoutReplaced.h:
(WebCore::Layout::Replaced::setIntrinsicSize):
(WebCore::Layout::Replaced::setIntrinsicRatio):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
* rendering/RenderReplaced.h:
2019-02-01 Claudio Saavedra <csaavedra@igalia.com>
Race-condition during scrolling thread creation
https://bugs.webkit.org/show_bug.cgi?id=194016
Reviewed by Saam Barati.
There is a threading issue during the initialization
of the scrolling thread caused by createThreadIfNeeded
locking only on the creation of the thread but not on
the initialization of the main loop, making it possible
for a thread to try to spin the main loop before it's
created.
Fix this by unconditionally waiting on the main loop
being created. This makes it necessary to always hold
the lock, even when the thread is already created.
* page/scrolling/ScrollingThread.cpp:
(WebCore::ScrollingThread::createThreadIfNeeded):
2019-02-01 Simon Fraser <simon.fraser@apple.com>
Use ScrollingNodeID in more places, and improve the name of a ScrollableArea function that returns a ScrollingNodeID
https://bugs.webkit.org/show_bug.cgi?id=194126
Reviewed by Frédéric Wang.
Change uint64_t ScrollableArea::scrollLayerID() to ScrollingNodeID ScrollableArea::scrollingNodeID()
and fix callers.
* page/FrameView.cpp:
(WebCore::FrameView::scrollingNodeID const):
(WebCore::FrameView::scrollLayerID const): Deleted.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::updateExpectsWheelEventTestTriggerWithFrameView):
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
(WebCore::AsyncScrollingCoordinator::frameViewForScrollingNode const):
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::scrollableAreaScrollbarLayerDidChange):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
(WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
(WebCore::AsyncScrollingCoordinator::updateScrollSnapPropertiesWithFrameView):
* page/scrolling/ScrollingCoordinatorTypes.h:
* platform/ScrollTypes.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::scrollingNodeID const):
(WebCore::ScrollableArea::scrollLayerID const): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::detachRootLayer):
2019-01-31 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Expressions can't be copyable
https://bugs.webkit.org/show_bug.cgi?id=194116
Reviewed by Keith Rollin.
Expressions have UniqueRef members, which can't be copied. Describe this constraint explicitly rather than implicitly.
No new tests because there is no behavior change.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2019-01-31 Takashi Komori <Takashi.Komori@sony.com>
[Curl] Remove unnecessary member from NetworkStorageSession.
https://bugs.webkit.org/show_bug.cgi?id=194137
Reviewed by Don Olmstead.
No new tests since there is no behavior change.
* platform/network/NetworkStorageSession.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::context const): Deleted.
2019-01-31 Jer Noble <jer.noble@apple.com>
NSInvalidArgumentException in [WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]
https://bugs.webkit.org/show_bug.cgi?id=194123
<rdar://problem/47721094>
Reviewed by Eric Carlson.
According to crash logs, AVSampleBufferDisplayLayer.error can go from an NSError* to nil; when such a change is KVO'd,
the NSKeyValueChangeNewKey is a NSNull. Detect this state and bail out early.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
2019-01-31 Jer Noble <jer.noble@apple.com>
[Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt
https://bugs.webkit.org/show_bug.cgi?id=194114
Reviewed by Eric Carlson.
The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key
requests to the AVContentKeySession.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2019-01-31 Megan Gardner <megan_gardner@apple.com>
Don't insert spaces at the beginning of a newline when using smart-copy-paste
https://bugs.webkit.org/show_bug.cgi?id=194070
Reviewed by Tim Horton.
If our inserted content end is at the beginning of a paragraph, do not insert a space.
Also, if our inserted content beginning is at the end of a paragraph, do not insert a space.
Test: editing/pasteboard/mac/copy-smartpaste-first-line-in-textarea.html
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::addSpacesForSmartReplace):
2019-01-31 Justin Fan <justin_fan@apple.com>
[WebGPU] Build fix: disable MTLCopyAllDevices call on non-Mac platforms
https://bugs.webkit.org/show_bug.cgi?id=194120
Unreviewed build fix.
No new tests; no change in behavior.
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create): Wrap problem code in #if PLATFORM(MAC).
2019-01-31 Simon Fraser <simon.fraser@apple.com>
Basic scrollability for async overflow scrolling on macOS
https://bugs.webkit.org/show_bug.cgi?id=194093
Reviewed by Antti Koivisto.
Give a ScrollingTreeOverflowScrollingNodeMac a ScrollingTreeScrollingNodeDelegateMac and have it keep track
of its layers so basic scrolling works for async overflow scroll.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollingLayers):
2019-01-31 Simon Fraser <simon.fraser@apple.com>
Generalize ScrollingTreeScrollingNodeDelegate for use in macOS too, add a macOS subclass for frame/overflow scrolling
https://bugs.webkit.org/show_bug.cgi?id=194080
Reviewed by Antti Koivisto.
To share code between ScrollingTreeFrameScrollingNodeMac and ScrollingTreeOverflowScrollingNodeMac, build ScrollingTreeScrollingNodeDelegate
for macOS too, and add some helper functions to ScrollingTreeScrollingNodeDelegate.
Add a macOS subclass, ScrollingTreeScrollingNodeDelegateMac, which takes over the basic scrolling, rubber-banding
and scroll snapping functionality from ScrollingTreeFrameScrollingNodeMac. The delegate owns the ScrollController and
implements ScrollControllerClient.
ScrollingTreeFrameScrollingNodeMac now owns a ScrollingTreeScrollingNodeDelegateMac. A future patch
will add one to ScrollingTreeOverflowScrollingNodeMac.
No behavior change.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::scrollBy): Deleted.
(WebCore::ScrollingTreeFrameScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
(WebCore::ScrollingTreeFrameScrollingNode::frameScaleFactor const):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::isRootNode const):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::scrollBy):
(WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const):
* page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
(WebCore::ScrollingTreeScrollingNodeDelegate::scrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::minimumScrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::maximumScrollPosition const):
(WebCore::ScrollingTreeScrollingNodeDelegate::scrollableAreaSize const):
(WebCore::ScrollingTreeScrollingNodeDelegate::totalContentsSize const):
(WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledHorizontalScrollbar const):
(WebCore::ScrollingTreeScrollingNodeDelegate::hasEnabledVerticalScrollbar const):
(WebCore::ScrollingTreeScrollingNodeDelegate::horizontalScrollElasticity const):
(WebCore::ScrollingTreeScrollingNodeDelegate::verticalScrollElasticity const):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac):
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
(WebCore::ScrollingTreeFrameScrollingNodeMac::minimumScrollPosition const):
(WebCore::ScrollingTreeFrameScrollingNodeMac::maximumScrollPosition const):
(WebCore::newGestureIsStarting): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::isAlreadyPinnedInDirectionOfGesture): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::allowsHorizontalStretching): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::allowsVerticalStretching): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::stretchAmount): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::pinnedInDirection): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollHorizontally): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::canScrollVertically): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::shouldRubberBandInDirection): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollBy): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollByWithoutContentEdgeConstraints): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopSnapRubberbandTimer): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::adjustScrollPositionToBoundsIfNecessary): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollOffset const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::immediateScrollOnAxis): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::pageScaleFactor const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::startScrollSnapTimer): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::stopScrollSnapTimer): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::scrollExtent const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::viewportSize const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::deferTestsForReason const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNodeMac::removeTestDeferralForReason const): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm: Added.
(WebCore::ScrollingTreeScrollingNodeDelegateMac::ScrollingTreeScrollingNodeDelegateMac):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateScrollSnapPoints):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::setActiveScrollSnapIndexForAxis):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexForAxis const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::activeScrollSnapIndexDidChange const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isScrollSnapInProgress const):
(WebCore::newGestureIsStarting):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::isAlreadyPinnedInDirectionOfGesture):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsHorizontalStretching):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::allowsVerticalStretching):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stretchAmount):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pinnedInDirection):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollHorizontally):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::canScrollVertically):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::shouldRubberBandInDirection):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollBy):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopSnapRubberbandTimer):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::adjustScrollPositionToBoundsIfNecessary):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollOffset const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollOnAxis):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::pageScaleFactor const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::startScrollSnapTimer):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::stopScrollSnapTimer):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::scrollExtent const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::viewportSize const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::deferTestsForReason const):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::removeTestDeferralForReason const):
2019-01-31 Jer Noble <jer.noble@apple.com>
[Mac] Requesting PiP from two different WebViews gets PiP window "stuck"
https://bugs.webkit.org/show_bug.cgi?id=194099
<rdar://problem/47271323>
Reviewed by Eric Carlson.
When a different client requests the PiP window, the PiP framework will call -pipDidClose: without
first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where
the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two
WebViews will constantly try to steal PiP from one another, ad infinitum.
When receiving a notification that the PiP window closed when our internal state tells us that the
close was not requested, notify the client that PiP mode was exited, allowing them to set their
expected state to a correct and sane value.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2019-01-31 Keith Rollin <krollin@apple.com>
WebCore::WHLSL::AST::Expression copy constructor needs to be be default, not delete
https://bugs.webkit.org/show_bug.cgi?id=194055
<rdar://problem/47684570>
Reviewed by Myles C. Maxfield.
WebCore::WHLSL::AST::Expression has a deleted copy constructor.
EnumerationMemberLiteral, a subclass, has a default copy constructor.
Some compilers may complain that the latter's c'tor can't access the
former's, because it doesn't exist. Fix this by marking Expression's
c'tor as default.
No new tests since there should be no observable behavior difference.
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
2019-01-31 Alex Christensen <achristensen@webkit.org>
Revert r238819 which is unneeded and caused a performance regression.
https://bugs.webkit.org/show_bug.cgi?id=192272
<rdar://problem/46664625>
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::prepareForLoadStart):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
2019-01-31 Justin Fan <justin_fan@apple.com>
[WebGPU] WebGPUAdapterDescriptor -> GPURequestAdapterOptions and take powerPreference into account
https://bugs.webkit.org/show_bug.cgi?id=194068
<rdar://problem/47680215>
Reviewed by Dean Jackson.
Per the Web GPU IDL, WebGPUAdapterDescriptor is now known as GPURequestAdapterOptions and is optional.
In addition, Web GPU now actually attempts to return an integrated GPU when a low-power adapter is requested.
Test: adapter-options.html
* Modules/webgpu/GPURequestAdapterOptions.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.idl.
* Modules/webgpu/WebGPU.cpp:
(WebCore::WebGPU::requestAdapter const):
* Modules/webgpu/WebGPU.h:
* Modules/webgpu/WebGPU.idl:
* Modules/webgpu/WebGPUAdapter.cpp:
(WebCore::WebGPUAdapter::create):
(WebCore::WebGPUAdapter::WebGPUAdapter):
* Modules/webgpu/WebGPUAdapter.h:
(WebCore::WebGPUAdapter::options const):
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPURequestAdapterOptions.h: Renamed from Source/WebCore/Modules/webgpu/WebGPUAdapterDescriptor.h.
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create):
2019-01-31 Jiewen Tan <jiewen_tan@apple.com>
Formalize WebKitAdditions mechanism of LoadOptimizer
https://bugs.webkit.org/show_bug.cgi?id=193886
<rdar://problem/47696809>
Reviewed by Brent Fulgham.
Covered by existing tests.
* platform/network/ResourceRequestBase.h:
Export isolatedCopy().
2019-01-31 Jer Noble <jer.noble@apple.com>
[Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME
https://bugs.webkit.org/show_bug.cgi?id=193988
Reviewed by Jon Lee.
Modern EME is writing SecureStop data as a file at the same path as the
directory used by Legacy EME; meaning, when Modern EME attempts to write
to that file, it will fail because a directory exists at the same path.
Add a migration step to take care of those instances where Modern EME Secure
Stop data was already written to disk, and move that previously written data
to the correct file path.
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2019-01-31 Antti Koivisto <antti@apple.com>
Call the frame main contents layer "rootContentsLayer" consistently.
https://bugs.webkit.org/show_bug.cgi?id=194089
Reviewed by Simon Fraser.
This is currently called "rootContentLayer" in the compositor and "scrolledContentsLayer" in the scrolling tree.
We want to reserve term "scrolledContentsLayer" to mean the direct child layer of the scroll container layer
without any positioning oddities (which this isn't).
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewRootLayerDidChange):
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
Set the rootContentsLayer for frame. It is only used by the Mac frame scrolling code.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::rootContentsLayerForFrameView):
(WebCore::ScrollingCoordinator::rootContentLayerForFrameView): Deleted.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setNodeLayers):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::setRootContentsLayer):
(WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
Introduce rootContentLayer for frames only.
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
Switch to using rootContentsLayer.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateRootContentLayerClipping):
(WebCore::RenderLayerCompositor::layerTreeAsText):
(WebCore::RenderLayerCompositor::rootGraphicsLayer const):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::destroyRootLayer):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
Pass rootContentsLayer separately for frames only.
Pass null as frame scrolledContentsLayer until these are rearranged (it is not used).
* rendering/RenderLayerCompositor.h:
2019-01-31 Keith Rollin <krollin@apple.com>
GCGamepad is deprecated
https://bugs.webkit.org/show_bug.cgi?id=194056
<rdar://problem/47685010>
Reviewed by Brady Eidson.
GCGamepad is deprecated, resulting in compiler warnings. Address this
for now by employing ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
No new tests since there should be no observable behavior difference.
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsGamepad):
2019-01-31 Darin Adler <darin@apple.com>
Simplify and streamline code that creates an appropriate document based on MIME type
https://bugs.webkit.org/show_bug.cgi?id=193756
Reviewed by Chris Dumez.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument): Use equalLettersIgnoringASCIICase rather
than == for all the MIME type checks. Use MIMETypeRegistry::isSupportedImageMIMEType
instead of Image::supportsType. Rearranged checks so that all the combinations that
that take precedence over plug-ins are checked first, fixing some unimportant edge
cases where the plug-in database is initialized and doesn't need to be. Straightened
out the logic for various special types so that the checks are more independent from
each other and hence easier to understand.
2019-01-31 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Unreviewed debug build fix, obsolete assert
Since m_playerPrivate is now a reference, it no longer has a default
cast to bool. But there is also no longer a need to assert it's non
null, so just remove the assert.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):
2019-01-31 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Use reference instead of pointer in m_playerPrivate
https://bugs.webkit.org/show_bug.cgi?id=194091
Reviewed by Xabier Rodriguez-Calvar.
Since the pointer is initialized with the class, it's never null and
never changes, it's preferrable to use a reference instead of a
pointer.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::MediaSourceClientGStreamerMSE):
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::resetParserState):
(WebCore::MediaSourceClientGStreamerMSE::append):
(WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flush):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
(WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2019-01-31 Alexander Mikhaylenko <exalm7659@gmail.com>
[GTK] Momentum scrolling stops abruptly before websites end
https://bugs.webkit.org/show_bug.cgi?id=193350
Reviewed by Carlos Garcia Campos.
Don't immediately set velocity to 0 when position reaches upper or bottom limit.
Instead, set it to the overshot distance, so that position exactly matches upper
or lower limit on the next frame, and then clamp velocity to 0 using the existing
mechanism.
* platform/ScrollAnimationKinetic.cpp:
(WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):
2019-01-31 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix incorrect string format
https://bugs.webkit.org/show_bug.cgi?id=193907
<rdar://problem/47604080>
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
2019-01-30 Simon Fraser <simon.fraser@apple.com>
[Mac] Implement basic hit testing in the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=172917
<rdar://problem/34215516>
Reviewed by Antti Koivisto.
First steps to getting hit testing of scrolling nodes in the scrolling tree. Based on patch
by Frédéric Wang.
First we pipe the "async scrolling enabled" setting through to the ScrollingTree via
the root node (like the other settings; weird, but that's how it's done). For now,
we hit test in the scrolling tree if either async overflow or frame scrolling are enabled
(it's hard to deal with one without the other).
Nodes in the scrolling tree implement scrollingNodeForPoint() to implement hit testing.
Two helper functions exist to simplify coordinate conversion: parentToLocalPoint()
and localToContentsPoint(). Child nodes are hit-testing in reverse order to find nodes
hightest in Z first. Only scrolling nodes are returned (not sure if we'll ever need
to hit-test non-scrolling nodes). Nodes use parentRelativeScrollableRect and scroll positions
to do these point mappings.
handleWheelEvent() is changed to return a ScrollingEventResult.
Latching is not correct with this change when async frame scrolling is enabled. That needs
to be fixed separately.
No tests yet; for ease of testing, I'd like to add an Internals API to hit-test the
scrolling tree, rather than doing eventSender stuff everywhere.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::asyncFrameOrOverflowScrollingEnabled const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameScrollingNode::setAsyncFrameOrOverflowScrollingEnabled):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::setAsyncFrameOrOverflowScrollingEnabled):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::asyncFrameOrOverflowScrollingEnabled const):
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const):
(WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::scrollingNodeForPoint const):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::children const):
(WebCore::ScrollingTreeNode::parentToLocalPoint const):
(WebCore::ScrollingTreeNode::localToContentsPoint const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const):
(WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const):
(WebCore::ScrollingTreeScrollingNode::localToContentsPoint const):
(WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::handleWheelEvent):
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::handleWheelEvent):
* page/scrolling/ios/ScrollingTreeIOS.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
2019-01-31 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Remove unused GstFlowReturn in AppendPipeline methods
https://bugs.webkit.org/show_bug.cgi?id=194067
Reviewed by Xabier Rodriguez-Calvar.
A couple methods in AppendPipeline were returning GstFlowReturn
despite there being no codepath (sans assertions) where values other
than GST_FLOW_OK are returned.
Therefore, it makes sense to just make these methods return void.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::append):
2019-01-31 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Remove if (m_playerPrivate) from MediaSourceClientGStreamerMSE
https://bugs.webkit.org/show_bug.cgi?id=194069
Reviewed by Xabier Rodriguez-Calvar.
m_playerPrivate is non-NULL since MediaSourceClientGStreamerMSE
creation well until its destruction.
The only case that could make a NULL m_playerPrivate is
clearPlayerPrivate() but that method is not used anymore.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::addSourceBuffer):
(WebCore::MediaSourceClientGStreamerMSE::durationChanged):
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::resetParserState):
(WebCore::MediaSourceClientGStreamerMSE::markEndOfStream):
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
(WebCore::MediaSourceClientGStreamerMSE::flush):
(WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
(WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
(WebCore::MediaSourceClientGStreamerMSE::webKitMediaSrc):
(WebCore::MediaSourceClientGStreamerMSE::clearPlayerPrivate): Deleted.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2019-01-31 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Avoid returning FLUSHING when it is not the case in GStreamerMediaStreamSource
https://bugs.webkit.org/show_bug.cgi?id=194087
Basically GstFlowCombiner was mostly designed for element that have 1 sinkpad and several srcpad
meaning that it makes sense that when any of the downstream pad is returning flushing, you should
return FLUSHING upstream. But in our case we have several sinkpads and FLUSHING should be returned
*only* if the internally linked srcpad is FLUSHING otherwise we might end up setting the upstream
source element task to PAUSED (because downstream returned flushing) on a branch that was not
flushing!
Reviewed by Philippe Normand.
This is a theorical race we can't really cover with tests.
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcChain):
2019-01-31 Zalan Bujtas <zalan@apple.com>
[LFC] Margin before/after/start/end initial value is 0 and not auto.
https://bugs.webkit.org/show_bug.cgi?id=194090
Reviewed by Antti Koivisto.
Don't treat it like auto.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2019-01-31 Zalan Bujtas <zalan@apple.com>
[LFC] Use the used margin values in outOfFlowReplacedHorizontalGeometry consistently
https://bugs.webkit.org/show_bug.cgi?id=194074
Reviewed by Antti Koivisto.
Check the used margin variables whether we already computed start/end values.
Test: fast/block/block-only/absolute-position-with-margin-auto-simple2.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2019-01-31 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Add support for block level replaced box.
https://bugs.webkit.org/show_bug.cgi?id=194071
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
(WebCore::Layout::outputLayoutBox):
2019-01-31 Chris Fleizach <cfleizach@apple.com>
ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification
https://bugs.webkit.org/show_bug.cgi?id=189094
<rdar://problem/43853526>
Reviewed by Zalan Bujtas.
Protect against access to objects and cache's that can be removed while an object is still in memory.
Unskipped flaky tests on mac-wk2.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postTextStateChangePlatformNotification):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(textMarkerForVisiblePosition):
(textMarkerRangeFromVisiblePositions):
2019-01-30 Chris Dumez <cdumez@apple.com>
Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error
https://bugs.webkit.org/show_bug.cgi?id=194023
<rdar://problem/47417981>
Reviewed by Geoffrey Garen.
The issue was caused by the 'isTopSite' flag not getting properly set on the network request
in case of a cross-site history navigation (with process-swap). As a result, twitter.com was
not getting its same-site lax cookies.
The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were
bypassing this method entirely when continuing a load in a new process after a swap. This was
intentional as the network request is normally already fully populated by the previous process
and we do not want the new process to modify the request in any way (e.g. we would not want to
add a Origin header back after it was removed by the previous process). However, in case of a
History navigation, we do not actually pass a request along from one process to another. Instead,
we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process.
In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though
we are technically continuing a load in a new process.
We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're
continuing a load with a request and not when we're continuing a load with a HistoryItem.
Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/FrameLoader.h:
(WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const):
2019-01-30 Justin Fan <justin_fan@apple.com>
[WebGPU] Support GPUDepthStencilStateDescriptor
https://bugs.webkit.org/show_bug.cgi?id=194048
<rdar://problem/46289645>
Reviewed by Dean Jackson.
Implement GPUDepthStencilStateDescriptor to specify a MTLDepthStencilState that is set on the command encoder.
Existing tests cover changes to pipeline. Behavior does not change as DepthStencilState has no effect
without a depth texture attached.
New interface files added:
* Modules/webgpu/GPUCompareFunction.idl:
* Modules/webgpu/GPUDepthStencilStateDescriptor.idl:
* platform/graphics/gpu/GPUCompareFunction.h:
* platform/graphics/gpu/GPUDepthStencilStateDescriptor.h:
Modifications:
* Modules/webgpu/WebGPUDevice.cpp: Include depthStencilState when creating pipeline.
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Add depthStencilState to the descriptor.
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
* platform/graphics/gpu/GPURenderPipeline.h: Ditto.
(WebCore::GPURenderPipeline::depthStencilState const): Getter.
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Update constructor to take depthStencilState.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Setting pipeline also sets the included depthStencilState.
(WebCore::GPURenderPassEncoder::setPipeline):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Convert DepthStencilStateDescriptor to MTLDepthStencilState.
(WebCore::validateAndConvertDepthCompareFunctionToMtl):
(WebCore::tryCreateMtlDepthStencilState):
(WebCore::tryCreateMtlRenderPipelineState): Refactored logic out of GPURenderPipeline::create.
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline):
Added symbols for CompareFunction, DepthStencilStateDescriptor to the project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* Modules/webgpu/WebGPUDevice.idl: Cleaned up IDL to match current version.
2019-01-30 Jer Noble <jer.noble@apple.com>
[Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove()
https://bugs.webkit.org/show_bug.cgi?id=193984
Reviewed by Eric Carlson.
MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The
KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until
after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:]
completion handler is called.
Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID
changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::sessionIdChanged):
* Modules/encryptedmedia/MediaKeySession.h:
* platform/encryptedmedia/CDMInstanceSession.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
2019-01-30 Keith Rollin <krollin@apple.com>
FloatWithRect has invalid and inaccessible default constructor
https://bugs.webkit.org/show_bug.cgi?id=194057
<rdar://problem/47685211>
Reviewed by Zalan Bujtas.
FloatWithRect has a default constructor declared as 'default'. This
constructor is invalid because FloatWithRect has a data member that's
a reference that will not get initialized with this constructor. Since
it's invalid, and since it's private and not accessed by anything,
remove this constructor.
No new tests since there should be no observable behavior difference.
* rendering/line/LineLayoutState.h:
2019-01-30 Daniel Bates <dabates@apple.com>
[iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
https://bugs.webkit.org/show_bug.cgi?id=192824
<rdar://problem/47100332>
Reviewed by Wenson Hsieh.
When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
now that hardware key events to non-editable elements use the same code path as for editable elements.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
!USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
(WebCore::isFunctionKey): Ditto.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
2019-01-30 Jer Noble <jer.noble@apple.com>
Ensure ENABLE_MEDIA_SOURCE is defined inside DerivedSources.make
https://bugs.webkit.org/show_bug.cgi?id=194063
Reviewed by Jon Lee.
* DerivedSources.make:
2019-01-30 Youenn Fablet <youenn@apple.com>
Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe
https://bugs.webkit.org/show_bug.cgi?id=193747
<rdar://problem/47498196>
Reviewed by Chris Dumez.
Make ServiceWorkerJob be no longer ref counted.
Instead its lifetime is fully controlled by ServiceWorkerContainer.
Make sure that a failing load will remove the job from ServiceWorkerContainer job map.
This allows to ensure that these jobs do not stay forever.
Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful.
Before the patch, unsetPendingActivity was only called for successful jobs finishing.
In case of failing loads, ServiceWorkerContainer would leak.
Make sure that setPendingActivity/unsetPendingActivity is balanced by storing
a pending activity in the job map next to the job.
When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess.
This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone.
Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not.
Update type of exception to be SecurityError when load fails due to AccessControl.
Covered by existing tests.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
(WebCore::ServiceWorkerContainer::jobDidFinish):
(WebCore::ServiceWorkerContainer::stop):
(WebCore::ServiceWorkerContainer::job):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::failedWithException):
(WebCore::ServiceWorkerJob::resolvedWithRegistration):
(WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
(WebCore::ServiceWorkerJob::startScriptFetch):
(WebCore::ServiceWorkerJob::didReceiveResponse):
(WebCore::ServiceWorkerJob::notifyFinished):
(WebCore::ServiceWorkerJob::cancelPendingLoad):
* workers/service/ServiceWorkerJob.h:
(WebCore::ServiceWorkerJob::hasPromise const):
(WebCore::ServiceWorkerJob::takePromise):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
2019-01-30 Dean Jackson <dino@apple.com>
PointerEvents - tiltX and tiltY are reversed
https://bugs.webkit.org/show_bug.cgi?id=194032
<rdar://problem/47674184>
Reviewed by Jon Lee.
I got tiltX and tiltY the wrong way around.
* dom/ios/PointerEventIOS.cpp: Flip the values.
2019-01-30 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] nextBreakablePosition returns the same position on hyphen characters
https://bugs.webkit.org/show_bug.cgi?id=194001
Reviewed by Antti Koivisto.
Skip to the next position manually. This is exactly what we do in simple line layout.
* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
2019-01-30 Simon Fraser <simon.fraser@apple.com>
Add some basic geometry information to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194002
rdar://problem/47656294
Reviewed by Antti Koivisto.
To allow hit-testing in the scrolling tree, store a parent-relative scrollable
rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
of the scrollable area, and whose origin is relative to the parent scrolling tree node.
Frame hosting nodes need this rect because they take care of the geometry offset between
an iframe and its scrolling tree ancestor in the parent document.
Based on a patch by Frédéric Wang in bug 172917.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
* page/scrolling/ScrollingStateFrameHostingNode.cpp:
(WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
(WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
(WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
(WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
(WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
* rendering/RenderLayerCompositor.h:
2019-01-30 Zalan Bujtas <zalan@apple.com>
[LFC] Use the used margin values in outOfFlowReplacedVerticalGeometry consistently
https://bugs.webkit.org/show_bug.cgi?id=194020
Reviewed by Antti Koivisto.
Check the used margin variables whether we already computed before/after values.
Test: fast/block/block-only/absolute-position-with-margin-auto-simple.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2019-01-30 Chris Fleizach <cfleizach@apple.com>
AX: Support color well on iOS
https://bugs.webkit.org/show_bug.cgi?id=194010
Reviewed by Joanmarie Diggs.
Test: accessibility/ios-simulator/color-well.html
Add support for color well on iOS.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
(-[WebAccessibilityObjectWrapper accessibilityRoleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityColorStringValue]):
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXColorWellText):
* platform/LocalizedStrings.h:
2019-01-30 Chris Fleizach <cfleizach@apple.com>
AX: Role=switch not returning correct accessibilityValue
https://bugs.webkit.org/show_bug.cgi?id=194006
Reviewed by Joanmarie Diggs.
Return the toggle state of a role=switch element.
Test: accessibility/ios-simulator/role-switch.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityValue]):
2019-01-29 Rob Buis <rbuis@igalia.com>
Align with Fetch on data: URLs
https://bugs.webkit.org/show_bug.cgi?id=182325
Reviewed by Alex Christensen.
Implement most remaining steps for data: URL processing [1].
Serialization is still to be implemented.
To make the code in DataURLDecoder::parseMediaType more efficient,
refactor ParsedContentType so that validation and parsing is done
in one pass.
Test: web-platform-tests/fetch/data-urls/processing.any.js
[1] https://fetch.spec.whatwg.org/#data-urls
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::parseMediaType):
(WebCore::DataURLDecoder::DecodeTask::process):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ParsedContentType.cpp:
(WebCore::containsNewline):
(WebCore::ParsedContentType::parseContentType):
(WebCore::ParsedContentType::create):
(WebCore::isValidContentType):
(WebCore::ParsedContentType::ParsedContentType):
(WebCore::DummyParsedContentType::setContentType const): Deleted.
(WebCore::DummyParsedContentType::setContentTypeParameter const): Deleted.
(WebCore::parseContentType): Deleted.
* platform/network/ParsedContentType.h:
2019-01-29 Eric Carlson <eric.carlson@apple.com>
[MSE] add more source buffer logging
https://bugs.webkit.org/show_bug.cgi?id=193995
<rdar://problem/47650399>
Reviewed by Jon Lee.
No new tests, no functional change.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::resetParserState):
(WebCore::SourceBufferPrivateAVFObjC::setReadyState):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::willSeek):
(WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
2019-01-29 Simon Fraser <simon.fraser@apple.com>
Add nodes to the scrolling tree in z-index order.
https://bugs.webkit.org/show_bug.cgi?id=192529
<rdar://problem/47402708>
Reviewed by Dean Jackson.
We currently add nodes to the scrolling tree via RenderLayerBacking::updateGeometry() and some other places.
This is sub-optimal, because we don't readily know the scrolling ancestor at these times, so have to do RenderLayer
walks to find them.
With this change we update the scrolling tree during the RenderLayerCompositor::updateBackingAndHierarchy()
tree walk, storing state along the way so we always know our scrolling tree ancestor, and the sibling index
(which makes it so that the scrolling tree correctly reflects layer z-order).
The reattachSubframeScrollLayers() code path is removed, since we can now reliably parent frame nodes via FrameHosting
nodes in their parent document.
There is also some minor cleanup around RenderLayerBacking teardown; it used to be the case that cleanup in ~RenderLayerBacking
was hard because the backing was already disconnected from its owning RenderLayer, so I added RenderLayerBacking::willBeDestroyed()
to do work that requires that layer->backing() is still valid. This allows for fewer callsites for detachFromScrollingCoordinator().
updateScrollCoordinatedLayersAfterFlushIncludingSubframes() is now iOS-only because it's only relevant for iOS WK1,
and m_scrollCoordinatedLayers can be moved to LegacyWebKitScrollingLayerCoordinator.
Tests: scrollingcoordinator/scrolling-tree/overflow-in-fixed.html
scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order.html
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::insertNode):
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::~ScrollingTreeNode):
* platform/Logging.cpp:
(WebCore::initializeLogChannelsIfNecessary):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::setParent):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::willBeDestroyed):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateBackgroundLayer):
(WebCore::RenderLayerBacking::coordinatedScrollingRoles const):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::frameHostingNodeForFrame):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::clearBackingForLayerIncludingDescendants):
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForLayer):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addViewportConstrainedLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeViewportConstrainedLayer):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): Deleted.
(WebCore::RenderLayerCompositor::setCompositingParent): Deleted. This was always called with a null parentLayer, so was a no-op.
(WebCore::RenderLayerCompositor::removeCompositedChildren): Deleted.
(WebCore::RenderLayerCompositor::fixedRootBackgroundLayerChanged): Deleted. The work happens via didChangePlatformLayerForLayer() now.
(WebCore::canCoordinateScrollingForLayer): Deleted.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Deleted.
(WebCore::enclosingScrollingNodeID): Deleted.
(WebCore::scrollCoordinatedAncestorInParentOfFrame): Deleted.
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Deleted.
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): Deleted.
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Deleted.
* rendering/RenderLayerCompositor.h:
2019-01-29 Brent Fulgham <bfulgham@apple.com>
Make sure we have a frame before trying to access its loader
https://bugs.webkit.org/show_bug.cgi?id=193985
<rdar://problem/47618239>
Reviewed by Ryosuke Niwa.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2019-01-29 Andy Estes <aestes@apple.com>
Try to fix the watchOS build.
* dom/Element.cpp:
2019-01-29 Simon Fraser <simon.fraser@apple.com>
REGRESSION(r240553): [iOS] Crash in ScrollingTree::updateTreeFromStateNode when attempting to log in to icloud.com
https://bugs.webkit.org/show_bug.cgi?id=193907
rdar://problem/47604080
Reviewed by Frédéric Wang.
Recent scrolling tree changes can trigger unparenting and reparenting of subtrees in the
state tree. If a subframe's state tree nodes are unparented, a scrolling tree commit would
show these as nodes being destroyed, which destroyed the tree nodes. When re-parented, the
commit would re-create the tree node, but the state node would only have a subset of the
change flags set, so the new tree node would fail to get all of the state (for example, it
would be missing layers and scrolling geometry).
Fix by ensuring that when we reparent state node subtrees, we set all the change flags
so that the full set of data is sent to the scrolling tree (the UI process, in the case of iOS WK2).
Annoyingly, virtual setAllPropertiesChanged() functions are needed so each state node subclass can
set the right change flags.
This patch also gets rid of m_nodesRemovedSinceLastCommit in the state tree. We can gain the same
information by using copying all of the nodeIDs in m_nodeMap into a HashSet, and removing nodes
as we encounter them in the tree walk.
Rename m_latchedNode to m_latchedNodeID in ScrollingTree, since it's a nodeID, not a node pointer.
Test: compositing/geometry/composited-frame-contents.html
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateFixedNode.h:
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::setPropertyChanged):
(WebCore::ScrollingStateNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::setPropertyChangedBit):
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateScrollingNode.h:
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::setAllPropertiesChanged):
* page/scrolling/ScrollingStateStickyNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::insertNode): Add a RELEASE_ASSERT on the type of the node created
if parentID == 0, since mistakes here can associate a ScrollingNodeType::MainFrame node with some
other nodeID which can result in type confusion later.
(WebCore::ScrollingStateTree::nodeWasReattachedRecursive):
(WebCore::ScrollingStateTree::commit):
(WebCore::ScrollingStateTree::willRemoveNode):
(WebCore::ScrollingStateTree::setRemovedNodes): Deleted.
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::removedNodes const): Deleted.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNode):
(WebCore::ScrollingTree::latchedNode):
(WebCore::ScrollingTree::setLatchedNode):
(WebCore::ScrollingTree::clearLatchedNode):
(WebCore::ScrollingTree::scrollingTreeAsText):
(WebCore::ScrollingTree::removeDestroyedNodes): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::hasLatchedNode const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::ensureRootLayer): The scroll layer needs a 0,0,0 anchor point so that
setting its position doesn't offset it relative to the center.
2019-01-29 Justin Fan <justin_fan@apple.com>
[WebGPU] Fix and add validation to WebGPURenderPipeline and MTLVertexDescriptor
https://bugs.webkit.org/show_bug.cgi?id=193926
<rdar://problem/47327648>
Reviewed by Myles C. Maxfield.
Update vertex input to properly utilize inputSlot and shaderLocation fields, and add some validation.
Test: webgpu/vertex-buffer-triangle-strip.html
* Modules/webgpu/WebGPUVertexInputDescriptor.idl:
* platform/graphics/gpu/GPUVertexInputDescriptor.h:
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor): Properly retain Metal types.
(WebCore::GPURenderPipeline::create): Provide error logging for MTLRenderPipelineState creation.
2019-01-29 Keith Rollin <krollin@apple.com>
Add .xcfilelists to Run Script build phases
https://bugs.webkit.org/show_bug.cgi?id=193792
<rdar://problem/47201785>
Reviewed by Alex Christensen.
As part of supporting XCBuild, update the necessary Run Script build
phases in their Xcode projects to refer to their associated
.xcfilelist files.
Note that the addition of these files bumps the Xcode project version
number to something that's Xcode 10 compatible. This change means that
older versions of the Xcode IDE can't read these projects. Nor can it
fully load workspaces that refer to these projects (the updated
projects are shown as non-expandable placeholders). `xcodebuild` can
still build these projects; it's just that the IDE can't open them.
Make special accommodations for incorporating .xcfilelists from
WebKitAdditions.
No new tests since there should be no observable behavior difference.
* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
2019-01-29 John Wilander <wilander@apple.com>
Add data abstraction and validation for Ad Click Attribution
https://bugs.webkit.org/show_bug.cgi?id=193916
<rdar://problem/47603481>
Reviewed by Daniel Bates, Brent Fulgham, and Alex Christensen.
New API tests added.
Ad click attribution has two steps. First, the storage of an ad
campaign ID for a click that takes the user to a destination
site. Second, a conversion on the destination site that can be
attributed to the ad click.
This patch adds a class that represents a request for ad click
attribution. Validation makes sure that the bits of entropy
reported through this mechanism is limited.
This feature is experimental and off by default.
* Sources.txt:
Added loader/AdClickAttribution.cpp.
* WebCore.xcodeproj/project.pbxproj:
* loader/AdClickAttribution.cpp: Added.
(WebCore::AdClickAttribution::isValid const):
(WebCore::AdClickAttribution::setConversion):
(WebCore::AdClickAttribution::url const):
(WebCore::AdClickAttribution::referrer const):
* loader/AdClickAttribution.h: Added.
(WebCore::AdClickAttribution::Campaign::Campaign):
(WebCore::AdClickAttribution::Campaign::isValid const):
(WebCore::AdClickAttribution::Source::Source):
(WebCore::AdClickAttribution::Destination::Destination):
(WebCore::AdClickAttribution::Priority::Priority):
(WebCore::AdClickAttribution::Conversion::Conversion):
(WebCore::AdClickAttribution::Conversion::isValid const):
(WebCore::AdClickAttribution::AdClickAttribution):
(WebCore::AdClickAttribution::earliestTimeToSend const):
* loader/DocumentLoader.cpp:
Added missing #include "RuntimeEnabledFeatures.h".
2019-01-29 Zalan Bujtas <zalan@apple.com>
[MathML] Move enum class ScriptType to MathMLScriptsElement.
https://bugs.webkit.org/show_bug.cgi?id=193969
Reviewed by Antti Koivisto.
* mathml/MathMLScriptsElement.cpp:
(WebCore::scriptTypeOf):
* mathml/MathMLScriptsElement.h:
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::scriptType const):
(WebCore::RenderMathMLScripts::validateAndGetReferenceChildren):
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths):
(WebCore::RenderMathMLScripts::verticalMetrics):
(WebCore::RenderMathMLScripts::layoutBlock):
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::isValid const):
(WebCore::RenderMathMLUnderOver::under const):
(WebCore::RenderMathMLUnderOver::over const):
(WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths):
(WebCore::RenderMathMLUnderOver::hasAccent const):
(WebCore::RenderMathMLUnderOver::layoutBlock):
2019-01-29 Chris Dumez <cdumez@apple.com>
Make sure WTF::generateObjectIdentifier() internal counter does not get duplicated
https://bugs.webkit.org/show_bug.cgi?id=193848
Reviewed by Youenn Fablet.
* dom/Document.cpp:
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::contextIdentifier const):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::DOMWindow):
* platform/Process.cpp:
(WebCore::Process::identifier):
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::Connection):
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::generateServiceWorkerRegistrationIdentifier):
* workers/service/server/SWServerToContextConnection.cpp:
(WebCore::generateServerToContextConnectionIdentifier):
2019-01-29 Alex Christensen <achristensen@webkit.org>
Use lambdas instead of member pointer functions for TransactionOperationImpl
https://bugs.webkit.org/show_bug.cgi?id=193933
Reviewed by Tim Horton.
No change in behavior. This just makes it easier to add new parameters to these functions in a straightforward manner.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete):
(WebCore::IDBClient::createTransactionOperation): Deleted.
2019-01-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Remove incorrect downcast<Container>
https://bugs.webkit.org/show_bug.cgi?id=193964
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
2019-01-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Do not ignore next sibling box while laying out BFC.
https://bugs.webkit.org/show_bug.cgi?id=193954
Reviewed by Antti Koivisto.
When a block box has no child (<img style="display: block">), we should not ignore the next sibling (move the container check to the function to keep layout logic simple)
Also inFlowNonReplacedWidthAndMargin() is called through inFlowReplacedWidthAndMargin() to compute margins.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2019-01-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Remove quirk from MarginCollapse::marginsCollapseThrough
https://bugs.webkit.org/show_bug.cgi?id=193948
Reviewed by Antti Koivisto.
This is now implemented in BlockFormattingContext::Quirks::stretchedInFlowHeight().
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2019-01-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Anonymous block container's margin before does not collapse with previous inflow sibling margin after.
https://bugs.webkit.org/show_bug.cgi?id=193952
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
2019-01-29 Frederic Wang <fwang@igalia.com>
Allow scrolling tree nodes to exist in a detached state
https://bugs.webkit.org/show_bug.cgi?id=193754
Unreviewed build warning fix.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode): Remove
unused variable.
2019-01-28 Ryosuke Niwa <rniwa@webkit.org>
User agent string override for navigator.userAgent should be site specific quirks
https://bugs.webkit.org/show_bug.cgi?id=193950
Reviewed by Brent Fulgham.
In order to make it possible to toggle the UA string override just for navigator.userAgent via Web Inspector,
we need to put this override behind the site specific quirks. Because WebInspector overrides Page's setting
without updating WKPreferences, there is no way for WKWebView client's to know whether the site specific quirks
had been disabled or not.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomJavaScriptUserAgentAsSiteSpecificQuirks):
(WebCore::DocumentLoader::customJavaScriptUserAgentAsSiteSpecificQuirks const):
(WebCore::DocumentLoader::setCustomJavaScriptUserAgent): Deleted.
(WebCore::DocumentLoader::customJavaScriptUserAgent const): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgentForJavaScript const):
2019-01-28 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to edit page WebRTC settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193863
<rdar://problem/47572764>
Reviewed by Joseph Pecoraro.
Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
* inspector/agents/InspectorPageAgent.cpp:
* page/Settings.yaml:
* page/SettingsBase.h:
* page/SettingsBase.cpp:
(SettingsBase::iceCandidateFilteringEnabledChanged): Added.
(SettingsBase::mockCaptureDevicesEnabledChanged): Added.
* Scripts/GenerateSettings.rb:
* Scripts/SettingsTemplates/Settings.cpp.erb:
Add page-level settings for WebRTC preferences.
* Modules/mediastream/UserMediaController.cpp:
(WebCore::UserMediaController::canCallGetUserMedia):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
* testing/Internals.h:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::setMockMediaCaptureDevicesEnabled):
(WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
* page/DeprecatedGlobalSettings.h:
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
(WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
2019-01-28 Jer Noble <jer.noble@apple.com>
webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
https://bugs.webkit.org/show_bug.cgi?id=193923
<rdar://problem/45956595>
Reviewed by Eric Carlson.
The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
(WebCore::HTMLMediaElement::dispatchEvent):
* html/HTMLMediaElement.h:
2019-01-28 Ross Kirsling <ross.kirsling@sony.com>
Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
https://bugs.webkit.org/show_bug.cgi?id=193941
Reviewed by Alex Christensen.
* css/CSSBasicShapes.cpp:
* css/CSSPrimitiveValue.cpp:
* css/parser/CSSParser.cpp:
* css/parser/CSSParserSelector.cpp:
* css/parser/CSSPropertyParser.cpp:
* dom/Document.cpp:
* dom/EventListenerMap.cpp:
* dom/EventTarget.cpp:
* editing/Editor.cpp:
* html/HTMLElement.cpp:
* html/HTMLFontElement.cpp:
* html/parser/HTMLTokenizer.cpp:
* html/track/TrackBase.cpp:
* loader/FTPDirectoryParser.cpp:
* loader/TextResourceDecoder.cpp:
* loader/cache/CachedResource.cpp:
* page/ContextMenuController.cpp:
* page/Navigator.cpp:
* platform/Length.cpp:
* platform/cocoa/KeyEventCocoa.mm:
* platform/graphics/FontCascade.cpp:
* platform/graphics/WidthIterator.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/ios/KeyEventIOS.mm:
* platform/mac/KeyEventMac.mm:
* platform/network/HTTPParsers.cpp:
* platform/text/TextCodecUTF8.cpp:
* platform/text/TextEncodingRegistry.cpp:
* platform/win/KeyEventWin.cpp:
* rendering/BidiRun.cpp:
* rendering/FloatingObjects.cpp:
* rendering/RenderBlock.cpp:
* rendering/RenderListMarker.cpp:
* rendering/RenderText.cpp:
2019-01-28 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] WebCore/platform/Process.h is conflicting with process.h
https://bugs.webkit.org/show_bug.cgi?id=193944
Reviewed by Ross Kirsling.
Windows has process.h. Rename Process.h to ProcessIdentifier.h.
No new tests because there is no behavior change.
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
* dom/MessagePortIdentifier.h:
* dom/messageports/MessagePortChannel.h:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelRegistry.h:
* history/BackForwardItemIdentifier.h:
* page/GlobalWindowIdentifier.h:
* platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
(WebCore::Process::setIdentifier):
(WebCore::Process::identifier):
* platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
2019-01-28 Antoine Quint <graouts@apple.com>
Implement capture for Pointer Events on iOS
https://bugs.webkit.org/show_bug.cgi?id=193917
<rdar://problem/47605689>
Reviewed by Dean Jackson.
We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
releasePointerCapture().
Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
pointerevents/ios/pointer-events-implicit-capture-release-exception.html
pointerevents/ios/pointer-events-implicit-capture-release.html
pointerevents/ios/pointer-events-implicit-capture.html
pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::setPointerCapture):
(WebCore::Element::releasePointerCapture):
(WebCore::Element::hasPointerCapture):
* dom/Element.h:
* dom/Element.idl:
* dom/EventNames.h:
* dom/PointerEvent.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::pointerCaptureController const):
* page/PointerCaptureController.cpp: Added.
(WebCore::PointerCaptureController::PointerCaptureController):
(WebCore::PointerCaptureController::setPointerCapture):
(WebCore::PointerCaptureController::releasePointerCapture):
(WebCore::PointerCaptureController::hasPointerCapture):
(WebCore::PointerCaptureController::pointerLockWasApplied):
(WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
(WebCore::PointerCaptureController::pointerEventWillBeDispatched):
(WebCore::PointerCaptureController::pointerEventWasDispatched):
(WebCore::PointerCaptureController::processPendingPointerCapture):
* page/PointerCaptureController.h: Added.
* page/PointerLockController.cpp:
(WebCore::PointerLockController::requestPointerLock):
* page/PointerLockController.h:
2019-01-28 Andy Estes <aestes@apple.com>
[watchOS] Enable Parental Controls content filtering
https://bugs.webkit.org/show_bug.cgi?id=193939
<rdar://problem/46641912>
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
2019-01-28 Dean Jackson <dino@apple.com>
Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
https://bugs.webkit.org/show_bug.cgi?id=193945
<rdar://problem/47618922>
Reviewed by Antoine Quint.
Calculate the pressure, tiltX and tiltY values for incoming
Pointer Events, which have values when the PlatformTouchEvent
originated from a stylus.
Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
* dom/PointerEvent.h: Default to "mouse".
* dom/ios/PointerEventIOS.cpp: Calculate the values.
2019-01-28 Timothy Hatcher <timothy@apple.com>
Make it easier for non-Apple ports to enable dark mode CSS support.
https://bugs.webkit.org/show_bug.cgi?id=193882
Reviewed by Megan Gardner.
* page/FrameView.cpp:
(WebCore::FrameView::updateBackgroundRecursively): Limit use of system
background color to the Mac platform.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
(WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
(WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::colorCache const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
(WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
(WebCore::RenderThemeMac::colorCache const): Deleted.
2019-01-28 Simon Fraser <simon.fraser@apple.com>
svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
https://bugs.webkit.org/show_bug.cgi?id=193930
Reviewed by Tim Horton.
ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
before iterating, since iteration mutates the array.
Tested by ASan tests.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::takeChildren):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
2019-01-28 Simon Fraser <simon.fraser@apple.com>
css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
https://bugs.webkit.org/show_bug.cgi?id=193925
Reviewed by Tim Horton.
Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
node if it's the node being unparented or destroyed.
Tested by existing tests.
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
2019-01-28 Daniel Bates <dabates@apple.com>
[iOS] Make Window virtual key code computation match Mac
https://bugs.webkit.org/show_bug.cgi?id=193452
Reviewed by Ryosuke Niwa.
Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
web compatibility. On Mac, we prefer to compute the Windows virtual key code from the input
strings of the key event and use the key event's keycode as a last resort.
Test: fast/events/ios/key-events-meta-alt-combinations.html
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::isKeypadEvent): Added.
(WebCore::windowsKeyCodeForKeyEvent): Added.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
2019-01-28 Antoine Quint <graouts@apple.com>
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447
Unreviewed build fix.
* dom/Element.cpp:
(WebCore::parentCrossingFrameBoundaries):
2019-01-28 Eric Carlson <eric.carlson@apple.com>
AVStreamSession isn't always available, make a HAVE compile flag for it
https://bugs.webkit.org/show_bug.cgi?id=193889
<rdar://problem/47452863>
Reviewed by Jer Noble.
No new tests, no functional change.
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
* page/SettingsBase.h:
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
-> isEqualToString.
(WebCore::sourceBufferMap):
(WebCore::nextMapID):
(WebCore::bufferWasConsumedCallback):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::append):
(WebCore::SourceBufferPrivateAVFObjC::destroyParser):
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
(WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
(-[WebBufferConsumedContext initWithParent:]): Deleted.
(-[WebBufferConsumedContext parent]): Deleted.
2019-01-28 Rob Buis <rbuis@igalia.com>
Update MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=180526
Reviewed by Frédéric Wang.
I overlooked step 11.9.3 [1], for Mimesniff we should not
bail out on missing subtype, but keep trying. Note
that Rfc2045 does require bailing out, as before.
Test: ParsedContentType unittest
[1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
* platform/network/ParsedContentType.cpp:
(WebCore::parseToken):
(WebCore::parseContentType):
2019-01-28 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed follow-up to r240557, restore a call to makeString
https://bugs.webkit.org/show_bug.cgi?id=192742
<rdar://problem/46757369>
It works if we add this #include that was missing. I got confused by the error messages and
missed that there were two similarly-named headers.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
2019-01-28 Oriol Brufau <obrufau@igalia.com>
[css-logical] Reject unitless length quirk in 'inset' shorthand
https://bugs.webkit.org/show_bug.cgi?id=193773
Reviewed by Manuel Rego Casasnovas.
Even though its longhands ('top', 'right', 'bottom', 'left') accept the
unitless length quirk, the 'inset' shorthand is a new CSS property and
should reject it. This was resolved by the CSS WG in
https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
2019-01-28 Zalan Bujtas <zalan@apple.com>
[LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
https://bugs.webkit.org/show_bug.cgi?id=193896
Reviewed by Antti Koivisto.
This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
1. Collapsed quirk margin values are ignored on quirk containers
<body>
<p> p elements have 1em vertical (top/bottom) quirk margin
</body>
In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
Used vertical margin values on the <body> are top: 8px bottom: 8px.
2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
<body>
<div style="margin-top: 1px">
<p> p elements have 1em vertical (top/bottom) quirk margin
</div>
</body>
When <p>'s vertical margin collapses with the parent <div>,
- the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
- the collapsed after value stays 1qem quirk value.
When <div> collapses with <body>
- the collapsed before value becomes 16px (max(16px, 8px))
- the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
* layout/MarginTypes.h:
(WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
(WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
(WebCore::Layout::computedPositiveAndNegativeMargin):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
2019-01-28 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
https://bugs.webkit.org/show_bug.cgi?id=193872
Reviewed by Antti Koivisto.
This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin().
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2019-01-28 cathie chen <cathiechen@igalia.com>
Add missing #include in ScrollingTreeFrameScrollingNode.cpp
https://bugs.webkit.org/show_bug.cgi?id=193905
Reviewed by Frédéric Wang.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
#include "ScrollingStateFrameScrollingNode.h"
2019-01-28 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
https://bugs.webkit.org/show_bug.cgi?id=193894
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
2019-01-28 Antoine Quint <graouts@apple.com>
Limit user-agent interactions based on the touch-action property on iOS
https://bugs.webkit.org/show_bug.cgi?id=193447
<rdar://problem/47283874>
Reviewed by Antti Koivisto and Simon Fraser.
We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
the bounds of each of those elements to send it up to the UI process along with touch regions. Computing the list of allowed touch
actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
crossing any frame boundary towards the top-level document's root node.
Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
pointerevents/ios/touch-action-none-on-iframe.html
pointerevents/ios/touch-action-none-on-parent.html
pointerevents/ios/touch-action-none.html
pointerevents/ios/touch-action-pan-x-pan-y.html
pointerevents/ios/touch-action-pan-x.html
pointerevents/ios/touch-action-pan-y.html
pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
* WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
* dom/Document.cpp:
(WebCore::Document::invalidateRenderingDependentRegions):
(WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
list of elements with a non-auto touch-action property.
(WebCore::Document::absoluteEventRegionForNode):
(WebCore::Document::absoluteRegionForEventTargets):
(WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
exist yet and update it to add the given element if it contains a non-auto touch-action, or remove it if it doesn't. If the contents
of that list changed as a result, the scrolling coordinator is informed.
* dom/Document.h:
(WebCore::Document:: const):
* dom/Element.cpp:
(WebCore::parentCrossingFrameBoundaries):
(WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
specified on this element and all of its hierarchy, crossing frame boundary.
(WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
touch actions.
* dom/Element.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
throughout the provided frame and all of its subframes.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollableAreaParameters::operator== const): Deleted.
* page/scrolling/ScrollingCoordinatorTypes.h: Added.
(WebCore::ScrollableAreaParameters::operator== const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
account for overlap and nesting.
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeNode.h:
* platform/EventTrackingRegions.cpp:
(WebCore::operator==):
* platform/EventTrackingRegions.h:
(WebCore::operator!=):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
2019-01-27 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix WPE/GTK debug builds after r240557
https://bugs.webkit.org/show_bug.cgi?id=192742
<rdar://problem/46757369>
Also fix an improper format string that was recently added in a different commit.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
2018-12-15 Darin Adler <darin@apple.com>
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742
Reviewed by Mark Lam.
A while back, String::format was more efficient than string concatenation,
but that is no longer true, and we should prefer String::number, makeString,
or concatenation with the "+" operator to String::format for new code.
This is not as good for programmers who are fond of printf formatting
style, and in some cases it's a little harder to read the strings
interspersed with variables rather than a format string, but it's better
in a few ways:
- more efficient (I didn't measure the difference, but it's definitely
slower to use String::Format which calls vsnprintf twice than to use
the WTF code)
- works in a type-safe way without a need to use a format specifier such
as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
subtle differences between platforms
- allows us to use StringView in some cases to sidestep the need to
allocate temporary WTF::String objects
- does not require converting each WTF::String to a C string, allowing
us to remove many cases of ".utf8().data()" and similar expressions,
eliminating the allocation of temporary WTF::CString objects
This patch covers a batch of easiest-to-convert call sites.
Later patches will allow us to deprecate or remove String::format.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const): Ditto.
(WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString const): Ditto.
* Modules/webdatabase/Database.cpp:
(WebCore::formatErrorMessage): Ditto.
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Use makeString.
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated expected results.
:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
and makeString.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setLength): Use makeString.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageUpdated): Ditto.
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init): Ditto.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
(WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
(WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
(WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
(WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
* inspector/agents/InspectorCSSAgent.cpp: Ditto.
* inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
* page/MemoryRelease.cpp:
(WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::formatByteNumber): Use String::number.
(WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::logFootprintComparison): Use makeString.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const): Ditto.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
(WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
(WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
* platform/network/ParsedContentRange.cpp:
(WebCore::ParsedContentRange::headerValue const): Use makeString.
* platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
compiler conditionals and reorganized the start/stop of namespaces.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::unauthorizedSQLFunction): Use makeString.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
(WebCore::RegistrationDatabase::importRecords): Ditto.
2019-01-27 Wenson Hsieh <wenson_hsieh@apple.com>
Remove a couple of PLATFORM defines intended for watchOS
https://bugs.webkit.org/show_bug.cgi?id=193888
Reviewed by Alexey Proskuryakov.
Remove the use of !PLATFORM(WATCH), since this is true on every platform.
* editing/cocoa/DictionaryLookup.mm:
2019-01-27 Jiewen Tan <jiewen_tan@apple.com>
Use a load optimizer for some sites
https://bugs.webkit.org/show_bug.cgi?id=193881
<rdar://problem/46325455>
Reviewed by Brent Fulgham.
Expose FormData::flatten to be used by the load optimizer.
* WebCore.xcodeproj/project.pbxproj:
* platform/network/FormData.h:
2019-01-26 Simon Fraser <simon.fraser@apple.com>
Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
https://bugs.webkit.org/show_bug.cgi?id=193879
Reviewed by Antti Koivisto.
Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
updates of the scrolling tree node in an iframe.
To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
connect GraphicsLayers together.
RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
Tested by existing tests.
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::frameContentsRenderView):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollingStateTreeAsText const):
2019-01-27 Chris Fleizach <cfleizach@apple.com>
AX: Introduce a static accessibility tree
https://bugs.webkit.org/show_bug.cgi?id=193348
<rdar://problem/47203295>
Reviewed by Ryosuke Niwa.
In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which
could be accessed on a different thread by assistive technologies.
That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the
"live" AccessibilityObjects (which interact with both DOM and Render trees).
These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree
representation and able to be read from anywhere.
Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared
with AccessibilityObject.
This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::createIsolatedAccessibilityTree):
(WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h: Added.
* accessibility/isolatedtree: Added.
* accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
(WebCore::AXIsolatedTree::treeCache):
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::treeForID):
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::appendNodeChanges):
(WebCore::AXIsolatedTree::applyPendingChanges):
* accessibility/isolatedtree/AXIsolatedTree.h: Added.
(WebCore::AXIsolatedTree::treeIdentifier const):
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
we may copy an existing node and replace specific values.
(WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
(WebCore::AXIsolatedTreeNode::create):
(WebCore::AXIsolatedTreeNode::initializeAttributeData):
(WebCore::AXIsolatedTreeNode::setProperty):
(WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
(WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
(WebCore::AXIsolatedTreeNode::boolAttributeValue const):
(WebCore::AXIsolatedTreeNode::stringAttributeValue const):
(WebCore::AXIsolatedTreeNode::intAttributeValue const):
* accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::associateIsolatedTreeNode):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
(-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
(-[WebAccessibilityObjectWrapperBase detach]):
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
(-[WebAccessibilityObjectWrapperBase axBackingObject]):
(-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper role]):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* dom/Document.cpp:
(WebCore::Document::pageID const):
* dom/Document.h:
2019-01-26 Simon Fraser <simon.fraser@apple.com>
Allow scrolling tree nodes to exist in a detached state
https://bugs.webkit.org/show_bug.cgi?id=193754
Reviewed by Zalan Bujtas.
One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
in a connected state; attachToStateTree() required a non-zero parent for any node that was not
the root.
This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
can be attached. This is a significant difference from compositing, where a subframe can create
GraphicsLayers which don't have to be parented right away, and actually get parented later via
a compositing update in the parent frame.
We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
connection (anything else is too confusing). So we need to be able to instantiate scrolling
tree nodes in a disconnected state, and attach them later.
To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
by m_stateNodeMap, so it's possible to find them and set state on them.
Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
is really an implementation detail.
This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
in m_orphanedSubframeNodes; now the unparenting is controlled by the client.
Currently no code creates unparented nodes so there is no behavior change.
* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::createNode):
(WebCore::AsyncScrollingCoordinator::insertNode):
(WebCore::AsyncScrollingCoordinator::unparentNode):
(WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
(WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
(WebCore::AsyncScrollingCoordinator::clearAllNodes):
(WebCore::AsyncScrollingCoordinator::parentOfNode const):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
(WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
(WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
(WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::handleWheelEvent):
(WebCore::ScrollingCoordinator::createNode):
(WebCore::ScrollingCoordinator::insertNode):
(WebCore::ScrollingCoordinator::unparentNode):
(WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
(WebCore::ScrollingCoordinator::detachAndDestroySubtree):
(WebCore::ScrollingCoordinator::clearAllNodes):
(WebCore::ScrollingCoordinator::parentOfNode const):
(WebCore::ScrollingCoordinator::childrenOfNode const):
(WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
(WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
(WebCore::ScrollingCoordinator::clearStateTree): Deleted.
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::removeFromParent):
(WebCore::ScrollingStateNode::removeChild):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::ScrollingStateTree):
(WebCore::ScrollingStateTree::createUnparentedNode):
(WebCore::ScrollingStateTree::insertNode):
(WebCore::ScrollingStateTree::unparentNode):
(WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
(WebCore::ScrollingStateTree::detachAndDestroySubtree):
(WebCore::ScrollingStateTree::clear):
(WebCore::ScrollingStateTree::commit):
(WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
(WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
(showScrollingStateTree):
(WebCore::ScrollingStateTree::attachNode): Deleted.
(WebCore::ScrollingStateTree::detachNode): Deleted.
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::nodeCount const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
2019-01-26 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to edit the user agent of a remote target
https://bugs.webkit.org/show_bug.cgi?id=193862
<rdar://problem/47359292>
Reviewed by Joseph Pecoraro.
Test: inspector/page/overrideUserAgent.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgent const):
(WebCore::FrameLoader::userAgentForJavaScript const):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideUserAgent): Added.
(WebCore::InspectorPageAgent::applyUserAgentOverride): Added.
2019-01-26 Zalan Bujtas <zalan@apple.com>
[LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
https://bugs.webkit.org/show_bug.cgi?id=193867
Reviewed by Antti Koivisto.
The initial content top/bottom value is the border top + padding top.
This is only a problem when the box has float children only. While computing the height using the bottom-most float,
we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
has (top)border/padding.
Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
2019-01-26 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
https://bugs.webkit.org/show_bug.cgi?id=193865
Reviewed by Antti Koivisto.
Height computation ->
// 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
// ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
// margin does not collapse with the element's bottom margin
<div style="border: 1px solid green">
<div style="margin-top: 100px;"></div>
</div>
When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored.
Test: fast/block/margin-collapse/collapsed-through-child-simple.html
* layout/MarginTypes.h:
(WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::hasCollapsedThroughMargin const):
2019-01-26 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
https://bugs.webkit.org/show_bug.cgi?id=193864
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
2019-01-26 Zalan Bujtas <zalan@apple.com>
[LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
https://bugs.webkit.org/show_bug.cgi?id=193855
Reviewed by Antti Koivisto.
Use iterative algorithm to find next/previous siblings.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
2019-01-25 Ryosuke Niwa <rniwa@webkit.org>
Need a mechanism to override navigator.userAgent
https://bugs.webkit.org/show_bug.cgi?id=193762
<rdar://problem/47504939>
Reviewed by Brent Fulgham.
Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
(WebCore::DocumentLoader::customJavaScriptUserAgent const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgentForJavaScript const):
* loader/FrameLoader.h:
* page/Navigator.cpp:
(WebCore::Navigator::userAgent const):
2019-01-25 Devin Rousso <drousso@apple.com>
Web Inspector: provide a way to edit page settings on a remote target
https://bugs.webkit.org/show_bug.cgi?id=193813
<rdar://problem/47359510>
Reviewed by Joseph Pecoraro.
Test: inspector/page/overrideSetting.html
* page/Settings.yaml:
* Scripts/GenerateSettings.rb:
* Scripts/SettingsTemplates/Settings.cpp.erb:
* Scripts/SettingsTemplates/Settings.h.erb:
Add support for an `inspectorOverride` boolean value for each setting that will take
precedence over the actual `Setting`'s value when set.
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::disable):
(WebCore::InspectorPageAgent::overrideSetting): Added.
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::isRemote const): Added.
* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::isRemote const): Added.
* inspector/InspectorFrontendClientLocal.h:
(WebCore::InspectorFrontendClientLocal::isRemote const): Added.
2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
https://bugs.webkit.org/show_bug.cgi?id=193843
Reviewed by Zalan Bujtas.
* dom/Document.cpp:
(WebCore::Document::updateMainArticleElementAfterLayout):
This function currently does a bit of wasted work after every layout, on clients that don't listen to the
"significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
don't bother keeping the main article element up to date in this scenario by bailing from
FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
rendered text milestone.
* page/FrameView.cpp:
(WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
2019-01-25 Jer Noble <jer.noble@apple.com>
<video> elements not in the DOM should be allowed to AirPlay
https://bugs.webkit.org/show_bug.cgi?id=193837
<rdar://42559491>
Reviewed by Eric Carlson.
Test: media/airplay-allows-buffering.html
Some websites will switch between <video> elements backed by MSE to one backed by
a media file in order to implement an AirPlay control. But when a <video> element is
removed from the DOM and paused, further buffering is blocked. For some ports (namely
Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
elements who have been asked to play wirelessly, but whose wireless playback has not
started yet.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::dataBufferingPermitted const):
(WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2019-01-25 Keith Rollin <krollin@apple.com>
Update Xcode projects with "Check .xcfilelists" build phase
https://bugs.webkit.org/show_bug.cgi?id=193790
<rdar://problem/47201374>
Reviewed by Alex Christensen.
Support for XCBuild includes specifying inputs and outputs to various
Run Script build phases. These inputs and outputs are specified as
.xcfilelist files. Once created, these .xcfilelist files need to be
kept up-to-date. In order to check that they are up-to-date or not,
add an Xcode build step that invokes an external script that performs
the checking. If the .xcfilelists are found to be out-of-date, update
them, halt the build, and instruct the developer to restart the build
with up-to-date files.
At this time, the checking and regenerating is performed only if the
WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
who want to use this facility can set this variable and test out the
checking/regenerating. Once it seems like there are no egregious
issues that upset a developer's workflow, we'll unconditionally enable
this facility.
No new tests since there should be no observable behavior difference.
* Scripts/check-xcfilelists.sh: Added.
* WebCore.xcodeproj/project.pbxproj:
2019-01-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
https://bugs.webkit.org/show_bug.cgi?id=193796
<rdar://problem/47532910>
Reviewed by Devin Rousso.
* page/ResourceUsageData.h:
* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::collectSample):
Show the CPU usage without debugger threads in the Web Inspector's timeline.
* page/ResourceUsageThread.h:
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
For OS(DARWIN) ports, when starting to observe resource usage,
we grab the mach_port_t of SamplingProfiler on the main thread
in a thread safe way. For our purposes (Web Inspector timelines),
this will be good enough to identify the SamplingProfiler thread
during timeline recording. The SamplingProfiler thread won't change
during a timeline recording and recording start/stops will never
miss the SamplingProfiler changing.
(WebCore::filterThreads):
(WebCore::threadSendRights):
(WebCore::threadSendRightsExcludingDebuggerThreads):
(WebCore::cpuUsage):
(WebCore::ResourceUsageThread::platformCollectCPUData):
Calculate CPU usage twice, the second time excluding some threads.
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
(WebCore::ResourceUsageThread::platformCollectCPUData):
Stubs for linux ports.
2019-01-25 Zalan Bujtas <zalan@apple.com>
Remove FrameView::m_significantRenderedTextMilestonePending
https://bugs.webkit.org/show_bug.cgi?id=193842
Reviewed by Wenson Hsieh.
Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
We can actually stop doing it right when the text content is above the threshold (regardless of whether all the conditions are met for the milestone).
This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
(WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
(WebCore::FrameView::qualifiesAsSignificantRenderedText const):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
* page/FrameView.h:
2019-01-25 Keith Rollin <krollin@apple.com>
Update Xcode projects with "Apply Configuration to XCFileLists" build target
https://bugs.webkit.org/show_bug.cgi?id=193781
<rdar://problem/47201153>
Reviewed by Alex Christensen.
Part of generating the .xcfilelists used as part of adopting XCBuild
includes running `make DerivedSources.make` from a standalone script.
Its important for this invocation to have the same environment as
when the actual build invokes `make DerivedSources.make`. If the
environments are different, then the two invocations will provide
different results. In order to get the same environment in the
standalone script, have the script launch xcodebuild targeting the
"Apply Configuration to XCFileLists" build target, which will then
re-invoke our standalone script. The script is now running again, this
time in an environment with all workspace, project, target, xcconfig
and other environment variables established.
The "Apply Configuration to XCFileLists" build target accomplishes
this task via a small embedded shell script that consists only of:
eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
The process that invokes "Apply Configuration to XCFileLists" first
sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
evaluated and exports it into the shell environment. When xcodebuild
is invoked, it inherits the value of this variable and can `eval` the
contents of that variable. Our external standalone script can then set
WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
of command-line parameters needed to restart itself in the appropriate
state.
No new tests since there should be no observable behavior difference.
* WebCore.xcodeproj/project.pbxproj:
2019-01-25 Keith Rollin <krollin@apple.com>
Update WebKitAdditions.xcconfig with correct order of variable definitions
https://bugs.webkit.org/show_bug.cgi?id=193793
<rdar://problem/47532439>
Reviewed by Alex Christensen.
XCBuild changes the way xcconfig variables are evaluated. In short,
all config file assignments are now considered in part of the
evaluation. When using the new build system and an .xcconfig file
contains multiple assignments of the same build setting:
- Later assignments using $(inherited) will inherit from earlier
assignments in the xcconfig file.
- Later assignments not using $(inherited) will take precedence over
earlier assignments. An assignment to a more general setting will
mask an earlier assignment to a less general setting. For example,
an assignment without a condition ('FOO = bar') will completely mask
an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
This affects some of our .xcconfig files, in that sometimes platform-
or sdk-specific definitions appear before the general definitions.
Under the new evaluations rules, the general definitions alway take
effect because they always overwrite the more-specific definitions. The
solution is to swap the order, so that the general definitions are
established first, and then conditionally overwritten by the
more-specific definitions.
No new tests since there should be no observable behavior difference.
* Configurations/Base.xcconfig:
* Configurations/Version.xcconfig:
2019-01-25 Keith Rollin <krollin@apple.com>
Update existing .xcfilelists
https://bugs.webkit.org/show_bug.cgi?id=193791
<rdar://problem/47201706>
Reviewed by Alex Christensen.
Many .xcfilelist files were added in r238824 in order to support
XCBuild. Update these with recent changes to the set of build files
and with the current generate-xcfilelist script.
No new tests since there should be no observable behavior difference.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* UnifiedSources-input.xcfilelist:
* UnifiedSources-output.xcfilelist:
2019-01-25 Brent Fulgham <bfulgham@apple.com>
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>
Reviewed by Alex Christensen.
Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
(WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
(WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
(WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2019-01-25 Zalan Bujtas <zalan@apple.com>
Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
https://bugs.webkit.org/show_bug.cgi?id=193835
Reviewed by Simon Fraser.
Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
By calling it from incrementVisually*() and setting the m_isVisuallyNonEmpty flag to true early does not have any impact on when the milestone is fired.
The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::loadProgressingStatusChanged):
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
2019-01-25 David Kilzer <ddkilzer@apple.com>
Move soft-linking of Lookup.framework out of LookupSPI.h
<https://webkit.org/b/193815>
Reviewed by Tim Horton.
* editing/cocoa/DictionaryLookup.mm:
- Remove unused header.
* editing/mac/DictionaryLookupLegacy.mm:
(WebCore::tokenRange):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::hidePopup):
- Move soft-linking to LookupSoftLink.{h,mm}.
* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show):
- Update for changes to UIKitSoftLink.{h,mm} now that
UIAccessibilityAnnouncementNotification is using
SOFT_LINK_CONSTANT*().
2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
https://bugs.webkit.org/show_bug.cgi?id=193829
Reviewed by Tim Horton.
No change in behavior.
* page/EventHandler.h:
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::tryToBeginDragAtPoint):
(WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
* platform/ios/WebItemProviderPasteboard.mm:
(linkTemporaryItemProviderFilesToDropStagingDirectory):
2019-01-25 Jon Davis <jond@apple.com>
Updated feature status for several features
https://bugs.webkit.org/show_bug.cgi?id=193794
Reviewed by Joseph Pecoraro.
Updated feature status for the following: CSS Font Display,
CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
File and Directory Entries API, MediaStream Recording API,
Readable Streams, Subresource Integrity, Visual Viewport API,
and Web Audio.
* features.json:
2019-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Need a way for JavaScript (or bundle) code to participate in undo
https://bugs.webkit.org/show_bug.cgi?id=190009
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
editing/undo-manager/undo-manager-add-item.html
editing/undo-manager/undo-manager-delete-stale-undo-items.html
editing/undo-manager/undo-manager-item-labels.html
editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
* editing/CompositeEditCommand.h:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::didRemoveFromUndoManager):
Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
the UndoItem, removing it from its UndoManager.
* editing/CustomUndoStep.h:
* editing/Editor.cpp:
(WebCore::Editor::registerCustomUndoStep):
Add a helper method to register a CustomUndoStep as a platform undoable step.
* editing/Editor.h:
* editing/UndoStep.h:
* page/UndoItem.h:
(WebCore::UndoItem::undoManager const):
* page/UndoManager.cpp:
(WebCore::UndoManager::addItem):
Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
* page/UndoManager.h:
* page/UndoManager.idl:
Mark addItem() as capable of throwing exceptions.
2019-01-25 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
https://bugs.webkit.org/show_bug.cgi?id=193824
Reviewed by Antti Koivisto.
When clear property is set and floats are present, we have to estimate and set the box's vertical position during
static positioning to be able to properly layout its subtree.
<div style="float: left; width: 100px; height: 100px;"></div>
<div style="clear: left;">
<div style="float: left; width: 100px; height: 100px;"></div>
</div>
In the above example since the second float's parent clears the first float, the second float is positioned below
the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
* layout/displaytree/DisplayBox.h:
2019-01-25 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
https://bugs.webkit.org/show_bug.cgi?id=193812
Reviewed by Antti Koivisto.
Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-25 Antoine Quint <graouts@apple.com>
Use ENABLE_POINTER_EVENTS for the touch-action property
https://bugs.webkit.org/show_bug.cgi?id=193819
Reviewed by Antti Koivisto.
Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
Pointer Events specification of which the touch-action property is a part.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture const):
* platform/TouchAction.h:
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
2019-01-24 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
https://bugs.webkit.org/show_bug.cgi?id=193807
Reviewed by Simon Fraser.
Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
2019-01-24 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: CPU Usage Timeline
https://bugs.webkit.org/show_bug.cgi?id=193730
<rdar://problem/46797201>
Reviewed by Devin Rousso.
Test: inspector/cpu-profiler/tracking.html
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
New files.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
* inspector/InstrumentingAgents.cpp:
(WebCore::InstrumentingAgents::reset):
* inspector/InstrumentingAgents.h:
(WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
(WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
Create and track the CPUProfilerAgent.
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::toggleInstruments):
(WebCore::InspectorTimelineAgent::toggleCPUInstrument):
Handle backend auto-start of the CPU instrument / timeline.
* inspector/agents/InspectorCPUProfilerAgent.h:
* inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
(WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
(WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
(WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
(WebCore::InspectorCPUProfilerAgent::startTracking):
(WebCore::InspectorCPUProfilerAgent::stopTracking):
(WebCore::InspectorCPUProfilerAgent::collectSample):
CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::startTracking):
(WebCore::InspectorMemoryAgent::collectSample):
Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
* page/ResourceUsageData.h:
* page/ResourceUsageThread.cpp:
(WebCore::ResourceUsageThread::addObserver):
(WebCore::ResourceUsageThread::removeObserver):
(WebCore::ResourceUsageThread::notifyObservers):
(WebCore::ResourceUsageThread::recomputeCollectionMode):
(WebCore::ResourceUsageThread::threadBody):
* page/ResourceUsageThread.h:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::ResourceUsageOverlay::platformInitialize):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::ResourceUsageThread::platformCollectMemoryData):
(WebCore::ResourceUsageThread::platformThreadBody): Deleted.
* page/linux/ResourceUsageOverlayLinux.cpp:
(WebCore::ResourceUsageOverlay::platformInitialize):
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformCollectCPUData):
(WebCore::ResourceUsageThread::platformCollectMemoryData):
(WebCore::ResourceUsageThread::platformThreadBody):
Give each observer their own collection mode. The ResourceUsageThread
will then collect data that is the union of all of the active observers.
This allows collecting CPU and Memory data separately, reducing the cost
of each when gathered individually.
2019-01-24 Charles Vazac <cvazac@akamai.com>
Implement PerformanceObserver.supportedEntryTypes
https://bugs.webkit.org/show_bug.cgi?id=193428
PerformanceObserver.supportedEntryTypes should return an array of
entryTypes that can be observed per specification
https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
Reviewed by Joseph Pecoraro.
This is covered by web-platform-tests
LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::supportedEntryTypes):
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:
2019-01-24 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240446.
Casued 5 API failures
Reverted changeset:
"Activate the WebResourceLoadStatisticsStore in the
NetworkProcess and deactivate it in the UIProcess."
https://bugs.webkit.org/show_bug.cgi?id=193297
https://trac.webkit.org/changeset/240446
2019-01-24 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
https://bugs.webkit.org/show_bug.cgi?id=193758
<rdar://problem/43614978>
Reviewed by Tim Horton.
CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
(this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
a helper method to select all the text inside of a text form control, called `selectInput`, which normally
invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
1. Roll out this ancient demo hack, in favor of standardized behavior.
2. Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
input, but everywhere else, it selects all the text in the input element.
This causes 6 existing layout tests to begin passing on iOS.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance):
(WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
* html/HTMLInputElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
2019-01-24 Jer Noble <jer.noble@apple.com>
Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
https://bugs.webkit.org/show_bug.cgi?id=193778
Reviewed by Jon Lee.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2019-01-24 Zalan Bujtas <zalan@apple.com>
DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
https://bugs.webkit.org/show_bug.cgi?id=193741
<rdar://problem/47135030>
Reviewed by Antti Koivisto and Simon Fraser.
fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
1. the received data is not "contentful" yet
2. and we are expecting some more (loading is not complete yet)
3. but no layout is initiated anymore
nothing triggers the milestone firing.
This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::loadProgressingStatusChanged):
2019-01-24 Brent Fulgham <bfulgham@apple.com>
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
https://bugs.webkit.org/show_bug.cgi?id=193297
<rdar://problem/47158841>
Reviewed by Alex Christensen.
Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
(WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
(WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
(WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
2019-01-24 John Wilander <wilander@apple.com>
Add Ad Click Attribution as an internal/experimental feature
https://bugs.webkit.org/show_bug.cgi?id=193685
<rdar://problem/47450399>
Reviewed by Brent Fulgham.
Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
* html/HTMLAnchorElement.h:
* html/HTMLAnchorElement.idl:
* html/HTMLAttributeNames.in:
Addeed two new experimental attributes:
- adcampaignid: Ad campaign ID.
- addestination: Ad link destination site.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
(WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
* page/Settings.yaml:
2019-01-24 Youenn Fablet <youenn@apple.com>
Use MonotonicTime in WorkerRunLoop
https://bugs.webkit.org/show_bug.cgi?id=193417
Reviewed by Saam Barati.
Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
Ditto for WorkerRunLoop.
No easy way to test the change which should not be easily observable.
* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
2019-01-24 Ross Kirsling <ross.kirsling@sony.com>
Move FileSystem to WTF
https://bugs.webkit.org/show_bug.cgi?id=193602
Reviewed by Yusuke Suzuki.
* Modules/encryptedmedia/CDM.cpp:
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
* Modules/entriesapi/DOMFileSystem.cpp:
* Modules/entriesapi/FileSystemEntry.cpp:
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
* Modules/indexeddb/shared/InProcessIDBServer.cpp:
* Modules/webdatabase/DatabaseTracker.cpp:
* Modules/webdatabase/OriginLock.cpp:
* Modules/webdatabase/OriginLock.h:
* Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
* PlatformMac.cmake:
* PlatformPlayStation.cmake:
* PlatformWin.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/GCController.cpp:
* dom/DataTransferItem.cpp:
* editing/cocoa/WebContentReaderCocoa.mm:
* fileapi/File.cpp:
* fileapi/FileCocoa.mm:
* html/FileInputType.cpp:
* html/FileListCreator.cpp:
* loader/appcache/ApplicationCacheHost.cpp:
* loader/appcache/ApplicationCacheStorage.cpp:
* page/Page.cpp:
* page/SecurityOrigin.cpp:
* page/SecurityOriginData.cpp:
* platform/FileHandle.h:
* platform/FileStream.cpp:
* platform/FileStream.h:
* platform/SharedBuffer.h:
* platform/SourcesGLib.txt:
* platform/cocoa/FileMonitorCocoa.mm:
* platform/glib/FileMonitorGLib.cpp:
* platform/glib/SharedBufferGlib.cpp:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/ios/QuickLook.mm:
* platform/ios/WebItemProviderPasteboard.mm:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
* platform/network/BlobDataFileReference.cpp:
* platform/network/BlobRegistryImpl.cpp:
* platform/network/BlobResourceHandle.cpp:
* platform/network/FormData.cpp:
* platform/network/cf/FormDataStreamCFNet.cpp:
* platform/network/cocoa/ResourceRequestCocoa.mm:
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/CurlCacheEntry.h:
* platform/network/curl/CurlCacheManager.cpp:
* platform/network/curl/CurlFormDataStream.h:
* platform/network/curl/CurlRequest.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
* platform/network/curl/ResourceHandleCurl.cpp:
* platform/network/mac/BlobDataFileReferenceMac.mm:
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/network/soup/SoupNetworkSession.cpp:
* platform/posix/SharedBufferPOSIX.cpp:
* platform/sql/SQLiteFileSystem.cpp:
* platform/text/hyphen/HyphenationLibHyphen.cpp:
* platform/win/SearchPopupMenuDB.cpp:
* rendering/RenderTheme.cpp:
* rendering/RenderThemeGtk.cpp:
* rendering/RenderThemeWin.cpp:
* workers/service/server/RegistrationDatabase.cpp:
2019-01-24 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
https://bugs.webkit.org/show_bug.cgi?id=193768
Reviewed by Antti Koivisto.
When it comes to the actual used values it does not really matter, only from correctness point of view.
(This patch also moves some checks to their correct place.)
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
2019-01-23 Simon Fraser <simon.fraser@apple.com>
Add "frame hosting" nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=193753
Reviewed by Antti Koivisto.
When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
require the iframe's scrolling node to get reparented in a new ancestor, which requires
a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
to provide a consistent parent node for the subframe's scrolling node.
This patch adds the node types, but does not instantiate them yet.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
(WebCore::ScrollingStateFrameHostingNode::create):
(WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
(WebCore::ScrollingStateFrameHostingNode::clone):
(WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameHostingNode.h: Added.
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isFrameHostingNode const):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode):
* page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
(WebCore::ScrollingTreeFrameHostingNode::create):
(WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
(WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isFrameHostingNode const):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::operator<<):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:
2019-01-24 Eric Carlson <eric.carlson@apple.com>
[iOS] Enable media element volume on iPad
https://bugs.webkit.org/show_bug.cgi?id=193745
<rdar://problem/47452297>
Reviewed by Jer Noble.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
(WebCore::HTMLMediaElement::updateVolume):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
2019-01-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Support JPEG 2000 images
https://bugs.webkit.org/show_bug.cgi?id=186272
Reviewed by Žan Doberšek.
Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
supported.
* platform/ImageDecoders.cmake:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::create):
* platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
(WebCore::syccToRGB):
(WebCore::sycc444ToRGB):
(WebCore::sycc422ToRGB):
(WebCore::sycc420ToRGB):
(WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
(WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
(WebCore::JPEG2000ImageDecoder::decode):
* platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
2019-01-23 Simon Fraser <simon.fraser@apple.com>
Change some RenderLayerCompositor functions to use references
https://bugs.webkit.org/show_bug.cgi?id=193760
Reviewed by Zalan Bujtas.
RenderWidget* -> RenderWidget&
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
* rendering/RenderLayerCompositor.h:
2019-01-23 Benjamin Poulain <benjamin@webkit.org>
<rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
https://bugs.webkit.org/show_bug.cgi?id=193742
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
The original bug was fixed, see radar: rdar://problem/27686430
2019-01-23 Sihui Liu <sihui_liu@apple.com>
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796
<rdar://problem/46824999>
Reviewed by Geoffrey Garen.
We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2019-01-23 Oriol Brufau <obrufau@igalia.com>
Add CSS Logical spec to features.json
https://bugs.webkit.org/show_bug.cgi?id=193717
Reviewed by Manuel Rego Casasnovas.
* features.json:
2019-01-22 Conrad Shultz <conrad_shultz@apple.com>
Clean up USE(WEB_THREAD)
https://bugs.webkit.org/show_bug.cgi?id=193698
Rubber-stamped by Tim Horton.
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::userCaptionPreferencesChangedNotificationCallback):
* platform/cf/MainThreadSharedTimerCF.cpp:
(WebCore::applicationDidBecomeActive):
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::dispatchToMainThread):
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::layoutTiles):
(WebCore::LegacyTileCache::setTilingMode):
* platform/ios/WebCoreMotionManager.mm:
(-[WebCoreMotionManager sendAccelerometerData:]):
(-[WebCoreMotionManager sendMotionData:withHeading:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::willExitFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
(VideoFullscreenControllerContext::didCleanupFullscreen):
(VideoFullscreenControllerContext::fullscreenMayReturnToInline):
(VideoFullscreenControllerContext::requestFullscreenMode):
(VideoFullscreenControllerContext::setVideoLayerFrame):
(VideoFullscreenControllerContext::setVideoLayerGravity):
(VideoFullscreenControllerContext::fullscreenModeChanged):
(VideoFullscreenControllerContext::play):
(VideoFullscreenControllerContext::pause):
(VideoFullscreenControllerContext::togglePlayState):
(VideoFullscreenControllerContext::toggleMuted):
(VideoFullscreenControllerContext::setMuted):
(VideoFullscreenControllerContext::setVolume):
(VideoFullscreenControllerContext::setPlayingOnSecondScreen):
(VideoFullscreenControllerContext::beginScrubbing):
(VideoFullscreenControllerContext::endScrubbing):
(VideoFullscreenControllerContext::seekToTime):
(VideoFullscreenControllerContext::fastSeek):
(VideoFullscreenControllerContext::beginScanningForward):
(VideoFullscreenControllerContext::beginScanningBackward):
(VideoFullscreenControllerContext::endScanning):
(VideoFullscreenControllerContext::selectAudioMediaOption):
(VideoFullscreenControllerContext::selectLegibleMediaOption):
(VideoFullscreenControllerContext::duration const):
(VideoFullscreenControllerContext::currentTime const):
(VideoFullscreenControllerContext::bufferedTime const):
(VideoFullscreenControllerContext::isPlaying const):
(VideoFullscreenControllerContext::playbackRate const):
(VideoFullscreenControllerContext::seekableRanges const):
(VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
(VideoFullscreenControllerContext::liveUpdateInterval const):
(VideoFullscreenControllerContext::canPlayFastReverse const):
(VideoFullscreenControllerContext::audioMediaSelectionOptions const):
(VideoFullscreenControllerContext::audioMediaSelectedIndex const):
(VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
(VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
(VideoFullscreenControllerContext::externalPlaybackEnabled const):
(VideoFullscreenControllerContext::externalPlaybackTargetType const):
(VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
(VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
(VideoFullscreenControllerContext::setUpFullscreen):
(VideoFullscreenControllerContext::exitFullscreen):
(VideoFullscreenControllerContext::requestHideAndExitFullscreen):
(-[WebVideoFullscreenController enterFullscreen:mode:]):
(-[WebVideoFullscreenController exitFullscreen]):
(-[WebVideoFullscreenController requestHideAndExitFullscreen]):
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow setVisible:]):
(-[WAKWindow setScreenScale:]):
(-[WAKWindow sendEvent:]):
(-[WAKWindow sendMouseMoveEvent:contentChange:]):
* platform/network/ios/NetworkStateNotifierIOS.mm:
(WebCore::NetworkStateNotifier::startObserving):
* rendering/RenderThemeIOS.mm:
(WebCore::contentSizeCategoryDidChange):
2019-01-23 David Kilzer <ddkilzer@apple.com>
REGRESSION (r240292): Attempt to fix WinCairo build
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::handleCookieHeaders): Remove argument to
NetworkingContext::storageSession().
2019-01-23 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
https://bugs.webkit.org/show_bug.cgi?id=193706
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
label simultaneously. There should be no change in behavior.
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::label const):
* editing/CompositeEditCommand.h:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::label const):
* editing/CustomUndoStep.h:
* editing/EditAction.cpp:
(WebCore::undoRedoLabel):
(WebCore::nameForUndoRedo): Deleted.
* editing/EditAction.h:
Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
WebKitLegacy.
* editing/UndoStep.h:
Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
2019-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Clean up NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=193707
Reviewed by Carlos Garcia Campos.
A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
know the session has always already been created. The soupNetworkSession getter can now
return a reference rather than a pointer, because it will never be NULL except after it has
been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
before process termination after nothing else is using it. Cookie jar syncing can also go
away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
use its cookie jar.
* platform/network/NetworkStorageSession.h:
(WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
* platform/network/soup/DNSResolveQueueSoup.cpp:
(WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
(WebCore::DNSResolveQueueSoup::platformResolve):
(WebCore::DNSResolveQueueSoup::resolve):
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession):
(WebCore::NetworkStorageSession::~NetworkStorageSession):
(WebCore::NetworkStorageSession::soupNetworkSession const):
(WebCore::NetworkStorageSession::clearSoupNetworkSession):
(WebCore::NetworkStorageSession::cookieStorage const):
(WebCore::NetworkStorageSession::setCookieStorage):
(WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
(WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):
2019-01-23 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] computeStaticPosition should include estimated computation as well.
https://bugs.webkit.org/show_bug.cgi?id=193719
Reviewed by Antti Koivisto.
Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
the containing block's width).
This is also in preparation for moving 'clear' positioning to computeStaticPosition.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2019-01-22 Simon Fraser <simon.fraser@apple.com>
Compositing updates need to reparent scrolling tree nodes with a changed ancestor
https://bugs.webkit.org/show_bug.cgi?id=193699
Reviewed by Frédéric Wang.
Now that compositing updates are incremental and may not do a full layer walk,
we need to ensure that when a scrolling tree node is removed, we traverse to all
descendant layers whose scrolling tree nodes refer to the removed node as their parent.
To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
ensures that the updateBackingAndHierarchy part of the compositing update traverses
layers with the bit set.
Adjust the compositing logging to make the legend easier to read.
Tests: scrollingcoordinator/reparent-across-compositing-layers.html
scrollingcoordinator/reparent-with-layer-removal.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::childrenOfNode const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::childrenOfNode const):
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2019-01-23 Oriol Brufau <obrufau@igalia.com>
[css-logical] Implement flow-relative inset properties
https://bugs.webkit.org/show_bug.cgi?id=189441
Reviewed by Dean Jackson.
Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
behind the CSSLogicalEnabled runtime flag.
Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
webexposed/css-properties-behind-flags.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::isLayoutDependent):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::resolveDirectionAwareProperty):
(WebCore::CSSProperty::isDirectionAwareProperty):
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isSimpleLengthPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseShorthand):
2019-01-23 Oriol Brufau <obrufau@igalia.com>
[css-grid] Properly handle static positions of abspos inside grid items
https://bugs.webkit.org/show_bug.cgi?id=193657
Reviewed by Javier Fernandez.
Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
and only if it's needed (not for abspos descentants in their static position).
Add logicalOffsetForChild that finds the value to be set by the functions above.
Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutGridItems):
(WebCore::RenderGrid::layoutPositionedObject):
(WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
(WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
(WebCore::RenderGrid::setLogicalPositionForChild const):
(WebCore::RenderGrid::setLogicalOffsetForChild const):
(WebCore::RenderGrid::logicalOffsetForChild const):
* rendering/RenderGrid.h:
2019-01-23 Rob Buis <rbuis@igalia.com>
Update MIME type parser
https://bugs.webkit.org/show_bug.cgi?id=180526
Reviewed by Frédéric Wang.
Add an enum to allow two modes of MIME type parsing, one mode
to keep supporting RFC2045 as before, and one mode to support
the updated MIME parser from mimesniff [1]. Mimesniff support
brings the following changes:
- allows parameter names without matching =value.
- skips whitespace after subtype, parameter value and before
parameter name.
- lower cases MIME type and parameter name.
- parameter names parsed before are discarded.
The old mode is still used by CDM.cpp and MIMEHeader.cpp.
[1] https://mimesniff.spec.whatwg.org/
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* platform/network/MIMEHeader.cpp:
(WebCore::MIMEHeader::parseHeader):
* platform/network/ParsedContentType.cpp:
(WebCore::DummyParsedContentType::setContentType const):
(WebCore::DummyParsedContentType::setContentTypeParameter const):
(WebCore::isQuotedStringTokenCharacter):
(WebCore::isTokenCharacter):
(WebCore::parseToken):
(WebCore::containsNonTokenCharacters):
(WebCore::parseQuotedString):
(WebCore::isNotForwardSlash):
(WebCore::isNotSemicolon):
(WebCore::isNotSemicolonOrEqualSign):
(WebCore::parseContentType):
(WebCore::isValidContentType):
(WebCore::ParsedContentType::ParsedContentType):
(WebCore::ParsedContentType::setContentType):
(WebCore::isNonTokenCharacter):
(WebCore::isNonQuotedStringTokenCharacter):
(WebCore::ParsedContentType::setContentTypeParameter):
* platform/network/ParsedContentType.h:
Test: web-platform-tests/xhr/overridemimetype-blob.html
2019-01-22 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce CustomUndoStep.h and CustomUndoStep.cpp
https://bugs.webkit.org/show_bug.cgi?id=193704
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
No change in behavior.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/CustomUndoStep.cpp:
(WebCore::CustomUndoStep::CustomUndoStep):
Subclass UndoStep.
(WebCore::CustomUndoStep::unapply):
(WebCore::CustomUndoStep::reapply):
If possible, invoke the UndoItem's undo and redo handlers.
(WebCore::CustomUndoStep::isValid const):
* editing/CustomUndoStep.h:
* editing/EditingStyle.cpp:
* editing/InsertEditableImageCommand.cpp:
(WebCore::InsertEditableImageCommand::doApply):
Unified build fixes.
* page/UndoItem.h:
2019-01-22 Simon Fraser <simon.fraser@apple.com>
Adding a child to a ScrollingStateNode needs to trigger a tree state commit
https://bugs.webkit.org/show_bug.cgi?id=193682
Reviewed by Zalan Bujtas.
Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
need to trigger scrolling tree updates, and currently do not.
Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
this flag when committing the scrolling tree because we always eagerly traverse children, but
we could use it to optimize later. The important part is that we use it to trigger a tree update.
Can't test via z-reordering until webkit.org/b/192529 is fixed.
Tests: scrollingcoordinator/gain-scrolling-node-parent.html
scrollingcoordinator/lose-scrolling-node-parent.html
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::appendChild):
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::removeChildAtIndex):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
2019-01-22 Devin Rousso <drousso@apple.com>
Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
https://bugs.webkit.org/show_bug.cgi?id=116191
<rdar://problem/13905910>
Reviewed by Joseph Pecoraro.
Test inspector/timeline/line-column.html
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):
* bindings/js/JSExecStateInstrumentation.h:
(WebCore::JSExecState::instrumentFunctionInternal):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willCallFunction):
(WebCore::InspectorInstrumentation::willEvaluateScript):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willCallFunctionImpl):
(WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
* inspector/agents/InspectorTimelineAgent.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willCallFunction):
(WebCore::InspectorTimelineAgent::willEvaluateScript):
* inspector/TimelineRecordFactory.h:
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createFunctionCallData):
(WebCore::TimelineRecordFactory::createEvaluateScriptData):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::startColumn const): Added.
2019-01-22 Devin Rousso <drousso@apple.com>
Web Inspector: expose Audit and Recording versions to the frontend
https://bugs.webkit.org/show_bug.cgi?id=193262
<rdar://problem/47130684>
Reviewed by Joseph Pecoraro.
Tests: inspector/audit/version.html
inspector/recording/version.html
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2019-01-22 Wenson Hsieh <wenson_hsieh@apple.com>
Add some bindings-related bookkeeping to UndoManager and UndoItem
https://bugs.webkit.org/show_bug.cgi?id=193111
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).
No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
will write a test to verify that the undo and redo JavaScript functions survive garbage collection.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSUndoItemCustom.cpp:
(WebCore::JSUndoItem::visitAdditionalChildren):
Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
for these functions are not garbage collected underneath the item.
(WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
`UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
Invalidate all undo items when the document is about to go away.
* page/UndoItem.cpp:
(WebCore::UndoItem::setUndoManager):
(WebCore::UndoItem::invalidate):
(WebCore::UndoItem::isValid const):
Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
UndoManager, and is thus associated with a document.
(WebCore::UndoItem::document const):
* page/UndoItem.h:
* page/UndoItem.idl:
* page/UndoManager.cpp:
(WebCore::UndoManager::UndoManager):
(WebCore::UndoManager::addItem):
Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
(this latter behavior is yet to be implemented).
(WebCore::UndoManager::removeItem):
(WebCore::UndoManager::removeAllItems):
* page/UndoManager.h:
(WebCore::UndoManager::UndoManager): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
Unified build fix.
2019-01-22 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
https://bugs.webkit.org/show_bug.cgi?id=193664
Reviewed by Brent Fulgham.
WinCairo WebKitTestRunner always crash on openning test cases of
HTMLMeterElement.
If GraphicsContext::getWindowsContext retruned null HDC,
LocalWindowsContext shouldn't release the null HDC.
Covered by existing tests.
* platform/graphics/win/LocalWindowsContext.h:
(WebCore::LocalWindowsContext::~LocalWindowsContext):
Release m_hdc only if it isn't null.
2019-01-22 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix -Wsign-compare warning
https://bugs.webkit.org/show_bug.cgi?id=188697
<rdar://problem/46105624>
* css/StyleProperties.cpp:
(WebCore::StyleProperties::asText const):
2019-01-22 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
https://bugs.webkit.org/show_bug.cgi?id=193227
<rdar://problem/46787862>
Reviewed by Joseph Pecoraro.
Test: inspector/audit/run-accessibility.html
* inspector/InspectorAuditAccessibilityObject.idl:
* inspector/InspectorAuditAccessibilityObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
2019-01-22 Simon Fraser <simon.fraser@apple.com>
Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
https://bugs.webkit.org/show_bug.cgi?id=193692
Reviewed by Zalan Bujtas.
Remove the iOS-specific renderName() implementation.
* rendering/RenderIFrame.h:
2019-01-22 Said Abou-Hallawa <sabouhallawa@apple.com>
Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
https://bugs.webkit.org/show_bug.cgi?id=193647
Reviewed by Simon Fraser.
Changing a style attribute of an SVGELement needs to call invalidateInstances().
Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
* svg/SVGElement.cpp:
(WebCore::SVGElement::attributeChanged):
2019-01-22 Alex Christensen <achristensen@webkit.org>
Fix more builds.
* platform/network/curl/CurlResourceHandleDelegate.cpp:
(WebCore::handleCookieHeaders):
(WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
2019-01-22 Alex Christensen <achristensen@webkit.org>
Fix some builds after r240292
https://bugs.webkit.org/show_bug.cgi?id=193580
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
2019-01-22 Alex Christensen <achristensen@webkit.org>
Move NetworkStorageSession ownership to NetworkProcess
https://bugs.webkit.org/show_bug.cgi?id=193580
Reviewed by Geoff Garen.
NetworkStorageSessions used to be owned by a process-global map living in WebCore.
This patch moves the ownership to the WebKit/WebKitLegacy layer.
In WebKitLegacy they are still owned by a process-global map for compatibility.
In WebKit they are owned by a map owned by the NetworkProcess object.
There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
1. The WebProcess used to clear credentials from a NetworkStorageSession. Since this was the only use
of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
so this code was removed with no change in behavior.
2. The WebProcess used NetworkStorageSessions to get persistent credentials. This was turned
into a static method that does the same thing. We should audit these calls and decide if we really want them.
3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
storage on Cocoa platforms. This has been replaced by functions that do the same thing directly.
* platform/network/CredentialStorage.h:
* platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::processMayUseCookieAPI):
(WebCore::NetworkStorageSession::globalSessionMap): Deleted.
(WebCore::NetworkStorageSession::storageSession): Deleted.
(WebCore::NetworkStorageSession::destroySession): Deleted.
(WebCore::NetworkStorageSession::forEach): Deleted.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
(WebCore::createCFStorageSessionForIdentifier): Deleted.
(WebCore::defaultNetworkStorageSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
(WebCore::NetworkStorageSession::ensureSession): Deleted.
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
* platform/network/cocoa/CookieStorageObserver.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
(WebCore::NetworkStorageSession::ensureSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
(WebCore::defaultSession): Deleted.
(WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
(WebCore::NetworkStorageSession::ensureSession): Deleted.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2019-01-22 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
https://bugs.webkit.org/show_bug.cgi?id=193225
<rdar://problem/46799956>
Reviewed by Joseph Pecoraro.
Test: inspector/audit/run-accessibility.html
* inspector/InspectorAuditAccessibilityObject.idl:
* inspector/InspectorAuditAccessibilityObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
(WebCore::addChildren): Added.
(WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
(WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
(WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
(WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
2019-01-22 David Kilzer <ddkilzer@apple.com>
Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
<https://webkit.org/b/193654>
<rdar://problem/47430290>
Reviewed by Alex Christensen.
- Moves QuickLookSoftLink.{h,mm} to PAL.
- Adds soft-link to 3 classes to consolidate QuickLook.framework
soft-linking.
- Updates existing source to work with above changes.
* SourcesCocoa.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
- Remove QuickLookSoftLink.{h,mm} due to move to PAL.
* platform/ios/QuickLook.mm:
(WebCore::QLPreviewGetSupportedMIMETypesSet):
(WebCore::registerQLPreviewConverterIfNeeded):
- Update for QuickLookSoftLink.{h,mm} move to PAL.
* platform/network/ios/PreviewConverter.mm:
(WebCore::optionsWithPassword):
(WebCore::PreviewConverter::PreviewConverter):
- Switch to using QuickLookSoftLink.{h,mm} in PAL.
* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
- Update for QuickLookSoftLink.{h,mm} move to PAL.
2019-01-22 Simon Fraser <simon.fraser@apple.com>
Fix the position of layers nested inside of composited overflow-scroll
https://bugs.webkit.org/show_bug.cgi?id=193642
Reviewed by Antti Koivisto and Sam Weinig.
Remove an iOS #ifdef so that layers inside composited overflow gets the correct
positions on macOS too.
Test: compositing/geometry/fixed-inside-overflow-scroll.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
2019-01-22 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Build fix for Ubuntu LTS 16.04
https://bugs.webkit.org/show_bug.cgi?id=193672
Unreviewed build fix.
* html/canvas/CanvasStyle.h: Add default copy constructor for
CMYKAColor struct.
2019-01-22 David Kilzer <ddkilzer@apple.com>
Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193673>
<rdar://problem/47448241>
Reviewed by Dean Jackson.
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
2019-01-22 Zalan Bujtas <zalan@apple.com>
[LFC][Floats] Decouple clearance computation and margin collapsing reset.
https://bugs.webkit.org/show_bug.cgi?id=193670
Reviewed by Antti Koivisto.
Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
This is also in preparation for adding clear to static position.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapTopToAncestor):
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingContext.h:
2019-01-22 Frederic Wang <fwang@igalia.com>
Minor refactoring of the scrolling code
https://bugs.webkit.org/show_bug.cgi?id=192398
Unreviewed build fix.
* page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
2019-01-22 Oriol Brufau <obrufau@igalia.com>
[css-logical] Implement flow-relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697
Reviewed by Simon Fraser and Antti Koivisto.
Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
webexposed/css-properties-behind-flags.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
Allow the new properties to serialize their computed value.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
* css/CSSComputedStyleDeclaration.h:
Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
shorthands.
* css/CSSProperties.json:
Add the new properties behind the CSSLogicalEnabled runtime flag.
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
Prevent CSS properties disabled behind a runtime flag from being exposed in
style declarations.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
Allow the new properties to serialize their specified value.
(WebCore::StyleProperties::get2Values const):
Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
(WebCore::StyleProperties::borderPropertyValue const):
Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
corresponding to width, style and color.
(WebCore::MutableStyleProperties::setProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.
(WebCore::StyleProperties::asText const):
Allow the new properties to be serialized in cssText.
Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
and serialize the longhands instead. Note that there could be another shorthand
available which is enabled, but a proper solution would require bug 190496.
* css/StyleProperties.h:
Update declarations of borderPropertyValue and get2Values.
* css/makeprop.pl:
(addProperty):
Add isEnabledCSSProperty function for checking that a CSS property is not
disabled behind a runtime flag.
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
Prevent CSS properties disabled behind a runtime flag from being exposed in
computed styles.
(WebCore::CSSPropertyParser::addProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.
(WebCore::CSSPropertyParser::consumeBorder):
Change consumeBorder to provide the caller with the parsed values instead of
setting properties. Then the caller can decide to which properties the values
should be set, and whether border-image should be reset or not.
(WebCore::CSSPropertyParser::consume2ValueShorthand):
(WebCore::CSSPropertyParser::consume4ValueShorthand):
Rename consume4Values to consume4ValueShorthand, and add analogous
consume2ValueShorthand for parsing shorthands with two longhands.
(WebCore::CSSPropertyParser::parseShorthand):
Allow the new properties to be parsed.
* css/parser/CSSPropertyParser.h:
Update declarations of consumeBorder, consume2ValueShorthand and
consume4ValueShorthand.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Prevent CSS properties disabled behind a runtime flag from being exposed in
the CSS inspector tool.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
(WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
Add the CSSLogicalEnabled runtime flag.
2019-01-21 Antti Koivisto <antti@apple.com>
[iOS] Handle hit testing for subframes
https://bugs.webkit.org/show_bug.cgi?id=192303
Reviewed by Frédéric Wang.
Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
Test by Frederic Wang.
Test: fast/scrolling/ios/hit-testing-iframe.html
* platform/ScrollView.cpp:
(WebCore::ScrollView::managesScrollbars const):
Add a function that tells if the scrollview should deal with scrollbars at all
This is always false on iOS and not connected to delegatesScrolling bit.
(WebCore::ScrollView::updateScrollbars):
* platform/ScrollView.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2019-01-21 Brent Fulgham <bfulgham@apple.com>
Implement message handlers for NetworkProcess-based ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=193556
<rdar://problem/47368501>
Reviewed by Alex Christensen.
This patch adds a new observer callback used to message the NetworkProcess when
user interaction events are received. This is needed when the ResourceLoadStatistics
data is not being managed by the UIProcess.
Tested by existing ResourceLoadStatistics and storageAccess tests.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* loader/ResourceLoadObserver.h:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookiesFromDOM):
2019-01-21 Zalan Bujtas <zalan@apple.com>
[LFC][Floats] Take float top position into account when computing containing block height.
https://bugs.webkit.org/show_bug.cgi?id=193655
Reviewed by Antti Koivisto.
When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
computing the containing block's height. Let's take the relevant floats into account as well.
Test: fast/block/float/float-first-child-and-clear-sibling.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::top const):
* layout/floats/FloatingState.h:
2019-01-21 David Kilzer <ddkilzer@apple.com>
REGRESSION (r240237): Revert changes to WebCore Xcode project
* WebCore.xcodeproj/project.pbxproj: Revert changes that were
fixed in r240135. Darin's patch must have been made prior to
r240135.
2019-01-21 David Kilzer <ddkilzer@apple.com>
REGRESSION (r240201): Add a POINTER_EVENTS feature flag
https://bugs.webkit.org/show_bug.cgi?id=193577
<rdar://problem/47408511>
* dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
to fix tvOS & watchOS builds.
2019-01-15 Darin Adler <darin@apple.com>
Use references rather than pointers for register/unregister functions, and more
https://bugs.webkit.org/show_bug.cgi?id=175028
Reviewed by Daniel Bates.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::begin): Pass a reference.
(WebCore::ApplePaySession::completePayment): Ditto.
(WebCore::ApplePaySession::didReachFinalState): Ditto.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords): Ditto.
(WebCore::DOMCache::batchDeleteOperation): Ditto.
(WebCore::DOMCache::batchPutOperation): Ditto.
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::match): Ditto.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::loadBlob): Ditto.
(WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
* Modules/fetch/FetchBodySource.cpp:
(WebCore::FetchBodySource::setActive): Ditto.
(WebCore::FetchBodySource::setInactive): Ditto.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
(WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::addedToRegistry): Ditto.
(WebCore::MediaSource::removedFromRegistry): Ditto.
* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::~MediaStream): Ditto.
(WebCore::MediaStream::startProducingData): Ditto.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
(WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::create): Ditto.
(WebCore::RTCDataChannel::close): Ditto.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create): Use auto.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::show): Pass a reference.
(WebCore::Notification::finalize): Ditto.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::constructCommon): Ditto.
(WebCore::AudioContext::lazyInitialize): Ditto.
(WebCore::AudioContext::clear): Ditto.
(WebCore::AudioContext::uninitialize): Ditto.
(WebCore::AudioContext::markForDeletion): Take a reference.
(WebCore::AudioContext::addAutomaticPullNode): Ditto.
(WebCore::AudioContext::removeAutomaticPullNode): Ditto.
(WebCore::AudioContext::willBeginPlayback): Pass a reference.
(WebCore::AudioContext::willPausePlayback): Ditto.
* Modules/webaudio/AudioContext.h: Update above functions to take
references rather than pointers.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::finishDeref): Pass a reference.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Ditto.
(WebCore::WebSocket::stop): Ditto.
(WebCore::WebSocket::didClose): Ditto.
* WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
moduleLoader is now a reference.
(WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
(WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
(WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
(WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
* dom/ActiveDOMObject.h:
(WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
(WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
* dom/CharacterData.cpp:
(WebCore::CharacterData::setData): Pass a reference.
(WebCore::CharacterData::insertData): Ditto.
(WebCore::CharacterData::deleteData): Ditto.
(WebCore::CharacterData::replaceData): Ditto.
* dom/Document.cpp:
(WebCore::Document::getElementByAccessKey): Pass a reference.
(WebCore::Document::buildAccessKeyMap): Take a reference.
(WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
(WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
(WebCore::Document::addAudioProducer): Ditto.
(WebCore::Document::removeAudioProducer): Ditto.
(WebCore::Document::hoveredElementDidDetach): Ditto.
(WebCore::Document::elementInActiveChainDidDetach): Ditto.
(WebCore::Document::attachNodeIterator): Ditto.
(WebCore::Document::detachNodeIterator): Ditto.
(WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
a reference.
(WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
(WebCore::Document::nodeWillBeRemoved): Ditto.
(WebCore::Document::textInserted): Take a reference.
(WebCore::Document::textRemoved): Ditto.
(WebCore::Document::textNodesMerged): Ditto.
(WebCore::Document::textNodeSplit): Ditto.
(WebCore::Document::takeDOMWindowFrom): Ditto.
(WebCore::Document::registerForDocumentSuspensionCallbacks): Ditto.
(WebCore::Document::unregisterForDocumentSuspensionCallbacks): Ditto.
(WebCore::Document::registerForMediaVolumeCallbacks): Ditto.
(WebCore::Document::unregisterForMediaVolumeCallbacks): Ditto.
(WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Ditto.
(WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Ditto.
(WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Ditto.
(WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
(WebCore::Document::registerForPageScaleFactorChangedCallbacks): Ditto.
(WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Ditto.
(WebCore::Document::finishedParsing): Use a reference.
(WebCore::Document::attachRange): Take a reference.
(WebCore::Document::detachRange): Ditto.
(WebCore::Document::suspendScheduledTasks): Use a reference.
(WebCore::Document::resumeScheduledTasks): Ditto.
(WebCore::Document::addMediaCanStartListener): Take a reference.
(WebCore::Document::removeMediaCanStartListener): Ditto.
(WebCore::Document::deviceMotionController const): Return a reference.
(WebCore::Document::deviceOrientationController const): Ditto.
(WebCore::Document::simulateDeviceOrientationChange): Use a reference.
(WebCore::Document::fullScreenIsAllowedForElement const): Take a reference.
(WebCore::Document::requestFullScreenForElement): Pass a reference.
(WebCore::Document::webkitExitFullscreen): Ditto.
(WebCore::Document::webkitWillEnterFullScreen): Renamed to remove the
"ForElement" from the function name. Take a reference rather than a pointer.
(WebCore::Document::webkitDidEnterFullScreen): Renamed to remove the
"ForElement" from the function name and removed the unused element argument.
(WebCore::Document::webkitWillExitFullScreen): Ditto.
(WebCore::Document::webkitDidExitFullScreen): Ditto.
(WebCore::Document::pushFullscreenElementStack): Take a reference.
(WebCore::Document::addDocumentToFullScreenChangeEventQueue): Ditto.
(WebCore::DocumentParserYieldToken::DocumentParserYieldToken): Use a reference.
(WebCore::DocumentParserYieldToken::~DocumentParserYieldToken): Ditto.
(WebCore::Document::updateHoverActiveState): Updated name of isInActiveChain.
* dom/Document.h: Updated argument types as described above. Changed a couple
of inline functions to return references.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker): Take a reference.
(WebCore::DocumentMarkerController::addMarkerToNode): Ditto.
(WebCore::DocumentMarkerController::addTextMatchMarker): Ditto.
(WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker): Ditto.
(WebCore::DocumentMarkerController::addDictationResultMarker): Ditto.
(WebCore::DocumentMarkerController::addDraggedContentMarker): Ditto.
(WebCore::DocumentMarkerController::removeMarkers): Ditto.
(WebCore::DocumentMarkerController::copyMarkers): Ditto.
(WebCore::DocumentMarkerController::shiftMarkers): Ditto.
(WebCore::DocumentMarkerController::setMarkersActive): DItto.
* dom/DocumentMarkerController.h: Updated argument types as described above.
* dom/Element.cpp:
(WebCore::Element::~Element): Pass a reference.
(WebCore::Element::isUserActionElementInActiveChain const): Updated name of
isInActiveChain.
(WebCore::Element::hasEquivalentAttributes const): Take a reference.
(WebCore::Element::removedFromAncestor): Pass a reference.
(WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
Pass a reference and updated name of isInActiveChain.
* dom/Element.h: Renamed inActiveChain to isInActiveChain, updated argument
types to be references, and removed unneeded friend declaration and made
SynchronizationOfLazyAttribute private.
* dom/Node.cpp:
(WebCore::Node::normalize): Pass a reference.
(WebCore::Node::isEqualNode const): Ditto.
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::NodeIterator): Ditto.
(WebCore::NodeIterator::~NodeIterator): Ditto.
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroup::add): Take a reference.
(WebCore::RadioButtonGroup::updateCheckedState): Ditto.
(WebCore::RadioButtonGroup::remove): Ditto.
(WebCore::RadioButtonGroup::contains const): Ditto.
(WebCore::RadioButtonGroups::addButton): Ditto.
(WebCore::RadioButtonGroups::updateCheckedState): Ditto.
(WebCore::RadioButtonGroups::hasCheckedButton const): Ditto.
(WebCore::RadioButtonGroups::isInRequiredGroup const): Ditto.
(WebCore::RadioButtonGroups::removeButton): Ditto.
* dom/RadioButtonGroups.h: Updated argument types.
* dom/Range.cpp:
(WebCore::Range::Range): Pass a reference.
(WebCore::Range::~Range): Ditto.
(WebCore::Range::setDocument): Ditto.
(WebCore::Range::createContextualFragment): Ditto.
(WebCore::boundaryTextInserted): Ditto.
(WebCore::Range::textInserted): Ditto.
(WebCore::boundaryTextRemoved): Ditto.
(WebCore::Range::textRemoved): Ditto.
(WebCore::boundaryTextNodesSplit): Ditto.
(WebCore::Range::textNodeSplit): Ditto.
* dom/Range.h: Take references instead of pointers.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript): Use reference.
* dom/Text.cpp:
(WebCore::Text::splitText): Pass reference.
* dom/UserActionElementSet.h: Renamed inActiveChain to isInActiveChain to
match the naming scheme of the other similar functions, like isActive.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
Pass a reference.
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Ditto.
(WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto.
(WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
(WebCore::AlternativeTextController::markReversed): Ditto.
(WebCore::AlternativeTextController::markCorrection): Ditto.
(WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto.
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto.
* editing/DictationCommand.cpp: Ditto.
* editing/Editing.cpp:
(WebCore::areIdenticalElements): Ditto.
* editing/Editor.cpp:
(WebCore::Editor::ignoreSpelling): Ditto.
(WebCore::Editor::learnSpelling): Ditto.
(WebCore::Editor::advanceToNextMisspelling): Ditto.
(WebCore::Editor::clearMisspellingsAndBadGrammar): Ditto.
(WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
(WebCore::Editor::markAndReplaceFor): Ditto.
(WebCore::Editor::changeBackToReplacedString): Ditto.
(WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
(WebCore::Editor::countMatchesForText): Ditto.
(WebCore::Editor::scanRangeForTelephoneNumbers): Ditto.
(WebCore::Editor::editorUIUpdateTimerFired): Ditto.
(WebCore::Editor::handleAcceptedCandidate): Ditto.
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply): Pass a reference.
* editing/InsertTextCommand.h: Take a reference.
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::didCheckSucceed): Pass a reference.
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doApply): Ditto.
(WebCore::SplitTextNodeCommand::doUnapply): Ditto.
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findFirstMisspelling): Pass a reference.
(WebCore::TextCheckingHelper::findFirstGrammarDetail const): Ditto.
* editing/ios/DictationCommandIOS.cpp:
(WebCore::DictationCommandIOS::doApply): Ditto.
Also added a comment about a possible missing null check; behavior should
be no different than before, but using a reference helps make clear there
was never any null check.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
* fileapi/FileReader.cpp:
(WebCore::FileReader::readInternal): Ditto.
(WebCore::FileReader::abort): Ditto.
(WebCore::FileReader::didFinishLoading): Ditto.
(WebCore::FileReader::didFail): Ditto.
* html/HTMLAppletElement.cpp: Removed unneeded include of HTMLDocument.h.
There's very little left that is truly specific to HTMLDocument vs. Document.
* html/HTMLDocument.h:
(WebCore::HTMLDocument::create): Take a reference.
(WebCore::HTMLDocument::createSynthesizedDocument): Ditto.
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::~HTMLFormElement): Pass a reference.
(WebCore::HTMLFormElement::parseAttribute): Ditto.
(WebCore::HTMLFormElement::didMoveToNewDocument): Ditto.
* html/HTMLIFrameElement.cpp: Removed unneeded include of HTMLDocument.h.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::~HTMLInputElement): Pass a reference.
(WebCore::HTMLInputElement::setChecked): Ditto.
(WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): Ditto.
(WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): Ditto.
(WebCore::HTMLInputElement::didMoveToNewDocument): Ditto.
(WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Ditto.
(WebCore::HTMLInputElement::addToRadioButtonGroup): Ditto.
(WebCore::HTMLInputElement::removeFromRadioButtonGroup): Ditto.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument): Ditto.
(WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
(WebCore::HTMLMediaElement::selectMediaResource): Ditto.
(WebCore::HTMLMediaElement::addTextTrack): Ditto.
(WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
(WebCore::HTMLMediaElement::resume): Ditto.
(WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Ditto.
* html/HTMLNameCollection.cpp: Removed unneeded include of HTMLDocument.h.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Pass a reference.
(WebCore::HTMLPlugInImageElement::createElementRenderer): Ditto.
(WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Ditto.
* html/HTMLSourceElement.cpp: Removed unneeded include of HTMLDocument.h.
* html/HTMLTemplateElement.cpp: Ditto.
* html/RadioInputType.cpp:
(WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
Pass a reference.
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::begin): Ditto.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener): Ditto.
(WebCore::DOMWindow::removeEventListener): Ditto.
(WebCore::DOMWindow::removeAllEventListeners): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::didStartDrag): Use a reference.
* page/EventSource.cpp:
(WebCore::EventSource::create): Pass reference.
(WebCore::EventSource::networkRequestEnded): Ditto.
(WebCore::EventSource::close): Ditto.
(WebCore::EventSource::abortConnectionAttempt): Ditto.
* page/Frame.cpp: Removed unneeded include of HTMLDocument.h.
* page/FrameView.cpp: Ditto.
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Use reference.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine): Pass reference.
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle): Take reference.
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle): Ditto.
(WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): Ditto.
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): Ditto.
(WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): Ditto.
* page/animation/CSSAnimationControllerPrivate.h: Ditto.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::clearElement): Pass reference.
(WebCore::CompositeAnimation::updateTransitions): Ditto.
(WebCore::CompositeAnimation::updateKeyframeAnimations): Ditto.
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::layerContentsFormat): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END so
I can continue to compile with latest headers.
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::buildReferenceFilter): Pass reference, small coding style
tweaks as well.
* rendering/svg/RenderSVGResource.cpp:
(WebCore::removeFromCacheAndInvalidateDependencies): Pass reference.
* rendering/svg/RenderSVGResourceContainer.cpp:
(WebCore::RenderSVGResourceContainer::registerResource): Ditto.
* rendering/svg/SVGResources.cpp:
(WebCore::registerPendingResource): Ditto.
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::resourceDestroyed): Ditto.
* svg/SVGDocumentExtensions.cpp:
(WebCore::SVGDocumentExtensions::addTimeContainer): Take reference.
(WebCore::SVGDocumentExtensions::removeTimeContainer): Ditto.
(WebCore::SVGDocumentExtensions::addResource): Ditto.
(WebCore::SVGDocumentExtensions::addPendingResource): Ditto.
(WebCore::SVGDocumentExtensions::isElementWithPendingResources const): Ditto.
(WebCore::SVGDocumentExtensions::isPendingResource const): Ditto.
(WebCore::SVGDocumentExtensions::clearHasPendingResourcesIfPossible): Ditto.
(WebCore::SVGDocumentExtensions::removeElementFromPendingResources): Ditto.
(WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): Ditto.
(WebCore::SVGDocumentExtensions::addElementReferencingTarget): Ditto.
(WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Ditto.
(WebCore::SVGDocumentExtensions::clearTargetDependencies): Ditto.
(WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Ditto.
(WebCore::SVGDocumentExtensions::registerSVGFontFaceElement): Ditto.
(WebCore::SVGDocumentExtensions::unregisterSVGFontFaceElement): Ditto.
* svg/SVGDocumentExtensions.h: Ditto.
* svg/SVGElement.cpp:
(WebCore::SVGElement::~SVGElement): Pass reference.
(WebCore::SVGElement::removedFromAncestor): Ditto.
(WebCore::SVGElement::buildPendingResourcesIfNeeded): Ditto.
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::clearResourceReferences): Ditto.
(WebCore::SVGFEImageElement::buildPendingResource): Ditto.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::insertedIntoAncestor): Ditto.
(WebCore::SVGFontFaceElement::removedFromAncestor): Ditto.
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource): Ditto.
(WebCore::SVGMPathElement::clearResourceReferences): Ditto.
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::SVGSVGElement): Ditto.
(WebCore::SVGSVGElement::~SVGSVGElement): Ditto.
(WebCore::SVGSVGElement::didMoveToNewDocument): Ditto.
(WebCore::SVGSVGElement::insertedIntoAncestor): Ditto.
(WebCore::SVGSVGElement::removedFromAncestor): Ditto.
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget): Ditto.
(WebCore::SVGTRefElement::buildPendingResource): Ditto.
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::clearResourceReferences): Ditto.
(WebCore::SVGTextPathElement::buildPendingResource): Ditto.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree): Ditto.
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::clearResourceReferences): Ditto.
(WebCore::SVGSMILElement::buildPendingResource): Ditto.
* testing/Internals.cpp:
(WebCore::Internals::addTextMatchMarker): Ditto.
(WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
(WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
(WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
(WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
* workers/Worker.cpp:
(WebCore::Worker::create): Ditto.
(WebCore::Worker::notifyFinished): Ditto.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob): Ditto.
(WebCore::ServiceWorkerContainer::jobDidFinish): Ditto.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::prepareToSend): Ditto.
(WebCore::XMLHttpRequest::createRequest): Ditto.
(WebCore::XMLHttpRequest::internalAbort): Ditto.
(WebCore::XMLHttpRequest::networkErrorTimerFired): Ditto.
(WebCore::XMLHttpRequest::didFail): Ditto.
(WebCore::XMLHttpRequest::didFinishLoading): Ditto.
* xml/XPathStep.cpp: Removed unneeded include of HTMLDocument.h.
(WebCore::XPath::nodeMatchesBasicTest): Changed code to call isHTMLDocument
rather than is<HTMLDocument> since this is not a type check for a downcast,
but rather a behavioral difference that does not depend on any of the data
stored in an HTMLDocument or the use of a distinct C++ class for it.
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource): Pass a reference.
2019-01-21 David Kilzer <ddkilzer@apple.com>
Switch remaining VideoToolbox soft-linking in WebCore over to VideoToolboxSoftLink.{cpp,h}
<https://webkit.org/b/193645>
<rdar://problem/47421574>
Reviewed by Alex Christensen.
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
- Move soft-linking of VTPixelBufferConformer* functions from
PixelBufferConformerCV.cpp to here.
* platform/graphics/cv/PixelBufferConformerCV.cpp:
- Remove local soft-linking of VideoToolbox.framework and switch
to VideoToolboxSoftLink.h.
2019-01-21 Antti Koivisto <antti@apple.com>
Move delegatesScrolling() tests to lower level conversion function in ScrollView
https://bugs.webkit.org/show_bug.cgi?id=193649
Reviewed by Frédéric Wang.
This reduces places where these tests are needed and helps avoid mistakes.
* dom/Document.cpp:
(WebCore::computeIntersectionState):
* page/FrameView.cpp:
(WebCore::FrameView::convertFromRendererToContainingView const):
(WebCore::FrameView::convertFromContainingViewToRenderer const):
* platform/ScrollView.cpp:
(WebCore::ScrollView::viewToContents const):
(WebCore::ScrollView::contentsToView const):
(WebCore::ScrollView::contentsToContainingViewContents const):
(WebCore::ScrollView::rootViewToContents const):
(WebCore::ScrollView::contentsToRootView const):
(WebCore::ScrollView::windowToContents const):
(WebCore::ScrollView::contentsToWindow const):
2019-01-21 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r239915): about 130 test failures on WPE
https://bugs.webkit.org/show_bug.cgi?id=193395
Reviewed by Žan Doberšek.
Since r239915 we are only overriding the characters with Default_Ignorable unicode property when the font
doesn't support the code point. If the font happens to provide a glyph for the character, it's later ignored by
harfbuzz when shaping, but the simple text code path doesn't ignore them unless there isn't a glyph.
* platform/graphics/WidthIterator.cpp:
(WebCore::WidthIterator::advanceInternal): Always ignore characters with Default_Ignorable unicode property.
(WebCore::characterMustDrawSomething): Moved to CharacterProperties.h and renamed as isDefaultIgnorableCodePoint().
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill): Use isDefaultIgnorableCodePoint().
* platform/text/CharacterProperties.h:
(WebCore::isDefaultIgnorableCodePoint): Return whether the character has Default_Ignorable unicode property.
2019-01-20 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement Metal code generation
https://bugs.webkit.org/show_bug.cgi?id=193531
Reviewed by Dean Jackson.
This implements the majority of the metal code generation piece. There are still a few pieces missing,
that I'll add in follow up patches. There's still enough complexity here that this is worth reviewing
on its own, though.
This patch includes a few pieces:
- Metal typedefs for every WHLSL type. This analysis is actually pretty interesting, because complex
types depend on their inner types, and the inner types need to be emitted first. Therefore,
this patch implements a topological sort when emitting types. Also, WHLSL types need to be de-
duped because array references are implemented in MSL as structs, and if you have two structs
in MSL with the same contents, those two structs are not equal and cannot be assigned to each
other. So, this patch creates a trie to de-dup all the UnnamedTypes, and implements a
dependency graph which includes both nodes in the trie as well as NamedTypes which don't appear
in the trie.
- WHLSL enumeration code generation
- A name mangler, which ensures that no text from the source program is contained within the result
program
- Full support for expressions. An expression like "y = *x + 7;" would be converted to something like
Type1 variable1 = *x;
Type2 variable2 = 7;
Type3 variable3 = variable1 + variable2;
y = variable3;
- Mostly complete support for control flow. This is tricky because of how we transform WHLSL
expressions into C++ statements. Therefore, things like "for ( ; *x + 7; )" is difficult to
compile, because we can't put the "*x + 7" generated statements into the for loop itself.
Instead, we have to emit this code inside the loop, in all the places that would implicitly run
it. This patch doesn't fully handle this, see below. (If MSL supported lambdas, we could put
the statements into a lambda and do something like "for ( ; theLambda(); )" but MSL doesn't
support lambdas.)
Missing pieces:
- Entry point pack / unpack code
- Support for "continue" (See above regarding control flow)
- Knowing whether or not a switch case should end with break or fallthrough
- Trapping
- Zero filling variables
- Code generation for compiler-generated native functions (this patch supports native functions in the
standard library), texture functions, and HLSL's half <-> int functions.
No new tests because it isn't hooked up yet. As soon as we can do entry point packing and unpacking,
I'll start porting the test suite.
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
(WebCore::WHLSL::AST::BuiltInSemantic::targetIndex):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::resolvedType):
(WebCore::WHLSL::AST::Expression::type): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::name):
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
(WebCore::WHLSL::AST::StructureDefinition::find):
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Added.
(WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
(WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes):
(WebCore::WHLSL::Metal::EntryPointScaffolding::signature):
(WebCore::WHLSL::Metal::EntryPointScaffolding::unpack):
(WebCore::WHLSL::Metal::EntryPointScaffolding::pack):
* Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Added.
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
(WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
(WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
(WebCore::WHLSL::Metal::metalFunctions):
* Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h.
(WebCore::WHLSL::Metal::generateMetalCode):
* Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Added.
(WebCore::WHLSL::Metal::getNativeName):
(WebCore::WHLSL::Metal::mapFunctionName):
(WebCore::WHLSL::Metal::convertAddressSpace):
(WebCore::WHLSL::Metal::writeNativeFunction):
* Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Added.
(WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
(WebCore::WHLSL::Metal::BaseTypeNameNode::children):
(WebCore::WHLSL::Metal::BaseTypeNameNode::append):
(WebCore::WHLSL::Metal::BaseTypeNameNode::parent):
(WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
(WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
(WebCore::WHLSL::Metal::ArrayTypeNameNode::numElements const):
(WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
(WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::addressSpace const):
(WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
(WebCore::WHLSL::Metal::PointerTypeNameNode::addressSpace const):
(WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
(WebCore::WHLSL::Metal::ReferenceTypeNameNode::namedType):
(WebCore::WHLSL::Metal::TypeNamer::TypeNamer):
(WebCore::WHLSL::Metal::TypeNamer::visit):
(WebCore::WHLSL::Metal::findInVector):
(WebCore::WHLSL::Metal::find):
(WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
(WebCore::WHLSL::Metal::TypeNamer::createNameNode):
(WebCore::WHLSL::Metal::TypeNamer::insert):
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString):
(WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
(WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
(WebCore::WHLSL::Metal::toString):
(WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
(WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
(WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
(WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
(WebCore::WHLSL::Metal::TypeNamer::metalTypes):
* Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Added.
(WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
(WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
(WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::checkSemantics):
(WebCore::WHLSL::Checker::visit):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
(WebCore::WHLSL::Gatherer::visit):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
(WebCore::WHLSL::EntryPointItem::EntryPointItem):
* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed.
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
(WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
(WebCore::WHLSL::checkStatementBehavior):
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-20 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add the statement behavior checker
https://bugs.webkit.org/show_bug.cgi?id=193487
Reviewed by Dean Jackson.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
does.
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
(WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
(WebCore::WHLSL::checkStatementBehavior):
* Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-20 Michael Catanzaro <mcatanzaro@igalia.com>
REGRESSION(r240174): Wrong preprocessor guards in RenderImage::paintAreaElementFocusRing
https://bugs.webkit.org/show_bug.cgi?id=193630
Reviewed by Daniel Bates.
r240174 inadvertently disabled this function on non-Apple platforms.
This fixes layout test fast/images/image-map-outline-in-positioned-container.html.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
2019-01-20 chris fleizach <cfleizach@apple.com>
AX: Support returning relative frames for accessibility
https://bugs.webkit.org/show_bug.cgi?id=193414
<rdar://problem/47268501>
Reviewed by Zalan Bujtas.
Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
Consolidate rect/point conversion methods for macOS and iOS.
This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
Tests: accessibility/mac/relative-frame.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
(-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
(-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
(-[WebAccessibilityObjectWrapper accessibilityFrame]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
(-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
(-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2019-01-20 Simon Fraser <simon.fraser@apple.com>
On RenderBox, make client sizing be derived from padding box sizing
https://bugs.webkit.org/show_bug.cgi?id=193621
Reviewed by Daniel Bates.
I never liked how clientWidth/Height, an IE-originated term, was used as the basis
for various RenderBox geometry functions.
Fix by adding some functions which return the dimensions of the padding box (which
is the inside of the border and any scrollbar), and define clientWidth/Height in
terms of them.
Also add paddingBoxRectIncludingScrollbar() function that is used by compositing code.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::clientWidth const):
(WebCore::RenderBox::clientHeight const):
* rendering/RenderBox.h:
(WebCore::RenderBox::borderBoxRect const):
(WebCore::RenderBox::computedCSSContentBoxRect const):
(WebCore::RenderBox::contentWidth const):
(WebCore::RenderBox::contentHeight const):
(WebCore::RenderBox::paddingBoxWidth const):
(WebCore::RenderBox::paddingBoxHeight const):
(WebCore::RenderBox::paddingBoxRect const):
(WebCore::RenderBox::paddingBoxRectIncludingScrollbar const):
(WebCore::RenderBox::hasHorizontalOverflow const):
(WebCore::RenderBox::hasVerticalOverflow const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
2019-01-20 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r238275.
Regressed css3/shapes/shape-outside/shape-image/shape-
image-025.html
Reverted changeset:
"ScalableImageDecoder: don't forcefully decode image data when
querying frame completeness, duration"
https://bugs.webkit.org/show_bug.cgi?id=191354
https://trac.webkit.org/changeset/238275
2019-01-19 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] <body>'s overflow property value is propagated to viewport
https://bugs.webkit.org/show_bug.cgi?id=193617
Reviewed by Antti Koivisto.
When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element
or an XHTML "body" element as a child, user agents must instead apply the 'overflow' property from the first such child element to the viewport,
if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'.
The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
This also has impact on layout since <body style="overflow: hidden"> would establish a block formatting context.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::isOverflowVisible const):
2019-01-20 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r240209.
Broke GTK/WPE injected bundle
Reverted changeset:
"AX: Support returning relative frames for accessibility"
https://bugs.webkit.org/show_bug.cgi?id=193414
https://trac.webkit.org/changeset/240209
2019-01-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Avoid importing directly from subumbrella frameworks
https://bugs.webkit.org/show_bug.cgi?id=186016
<rdar://problem/40591038>
Reviewed by Sam Weinig.
* Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS.
* editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
* platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
* platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2019-01-20 chris fleizach <cfleizach@apple.com>
AX: Support returning relative frames for accessibility
https://bugs.webkit.org/show_bug.cgi?id=193414
<rdar://problem/47268501>
Reviewed by Zalan Bujtas.
Create a way for assistive technologies to retrieve a frame in page space that can be transformed to its final screen space by having the AT message the UI process separately.
Consolidate rect/point conversion methods for macOS and iOS.
This is only needed on WebKit2, where we have to reach back across to the hosting process to get the final frame, so we can skip this test on WK1.
Tests: accessibility/mac/relative-frame.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
(-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
(-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
(-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
(-[WebAccessibilityObjectWrapper accessibilityFrame]):
(-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
(-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
(-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertPathToScreenSpaceFunction):
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
(-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
(-[WebAccessibilityObjectWrapper position]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
2019-01-20 Antoine Quint <graouts@apple.com>
Add a POINTER_EVENTS feature flag
https://bugs.webkit.org/show_bug.cgi?id=193577
<rdar://problem/47408511>
Unreviewed. Also enable Pointer Events for iosmac.
* Configurations/FeatureDefines.xcconfig:
2019-01-19 Zalan Bujtas <zalan@apple.com>
[LFC][Floats] Ensure that floats in FloatingContext::m_floats are always horizontally ordered.
https://bugs.webkit.org/show_bug.cgi?id=193613
Reviewed by Antti Koivisto.
Float items in m_floats list should stay in horizontal position order (left/right edge).
When adding a new float item to floating state list, we have to ensure that it is definitely the left(right)-most item.
Normally it is, but negative horizontal margins can push the float box beyond another float box.
<div style="float: left; height: 10px; width: 10px;"></div>
<div style="float: left; height: 10px; width: 10px; margin-left: -80px;"></div>
The second float's right edge beyond the first float' left edge. THe second float is not the right(inner)-most float anymore.
Test: fast/block/float/floats-with-negative-horizontal-margin.html
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::areFloatsHorizontallySorted):
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::append):
2019-01-19 Youenn Fablet <youenn@apple.com>
getUserMedia with a deviceId exact constraint with an empty string value should succeed
https://bugs.webkit.org/show_bug.cgi?id=193541
<rdar://problem/47357218>
Reviewed by Eric Carlson.
If there is a deviceId constraint, remove any empty string from ideal/exact string list.
This will make the device selection be solely based on other constraints.
An improvement might be for 'exact' constraint to pick the default device.
There is currently no such notion of a default device.
Picking the best fitting device seems a good tradeoff.
Covered by updated test.
* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaTrackConstraintSetMap::set):
* platform/mediastream/MediaConstraints.h:
(WebCore::StringConstraint::removeEmptyStringConstraint):
2019-01-19 Eric Liang <ericliang@apple.com>
AXSelected attribute on RadioButton should not be settable.
https://bugs.webkit.org/show_bug.cgi?id=193371
Reviewed by Chris Fleizach.
Test: accessibility/set-selected-editable.html
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
2019-01-19 Antoine Quint <graouts@apple.com>
Add a POINTER_EVENTS feature flag
https://bugs.webkit.org/show_bug.cgi?id=193577
Reviewed by Dean Jackson.
Only expose the PointerEvent interface if the POINTER_EVENTS feature is enabled.
* Configurations/FeatureDefines.xcconfig:
* dom/EventNames.in:
* dom/PointerEvent.cpp:
* dom/PointerEvent.h:
* dom/PointerEvent.idl:
2019-01-18 Ryosuke Niwa <rniwa@webkit.org>
iOS: Updating input mode should update the software keyboard
https://bugs.webkit.org/show_bug.cgi?id=193565
<rdar://problem/47376334>
Reviewed by Wenson Hsieh.
Let the chrome client know that the focused element's inputmode had changed.
Test: fast/forms/ios/inputmode-none-removed.html
* html/HTMLElement.cpp:
(WebCore::HTMLElement::parseAttribute):
* page/ChromeClient.h:
2019-01-18 Brian Burg <bburg@apple.com>
Automation.computeElementLayout should return visual viewport-aware coordinates
https://bugs.webkit.org/show_bug.cgi?id=193598
<rdar://problem/35325644>
Reviewed by Simon Fraser.
* page/FrameView.h: export symbol to be usable from WebKit.
* page/FrameView.cpp:
(WebCore::FrameView::clientToLayoutViewportRect const): Added.
Do the same thing as clientToLayoutViewportPoint with a rect instead.
2019-01-18 Eric Carlson <eric.carlson@apple.com>
Revert r238815, it broke WK1 video fullscreen on Mac
https://bugs.webkit.org/show_bug.cgi?id=193586
<rdar://problem/47358941>
Reviewed by Jer Noble.
* PlatformMac.cmake:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
2019-01-18 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: don't keep the injected sub-objects alive between runs
https://bugs.webkit.org/show_bug.cgi?id=193594
<rdar://problem/47398091>
Reviewed by Joseph Pecoraro.
Rather than save the `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject`
between individual `Audit.setup` invocations, we should only keep them alive so long as the
injected `WebInspectorAudit` object is alive (e.g. from `Audit.setup` to `Audit.teardown`).
This change fixes inspector/audit/run-accessibility.html.
* inspector/agents/page/PageAuditAgent.h:
* inspector/agents/page/PageAuditAgent.cpp:
(WebCore::PageAuditAgent::populateAuditObject):
2019-01-18 Daniel Bates <dabates@apple.com>
Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
(https://bugs.webkit.org/show_bug.cgi?id=193583)
Substitute ENABLE(FULL_KEYBOARD_ACCESS) for PLATFORM(MAC). On Mac, we always build with
ENABLE(FULL_KEYBOARD_ACCESS) enabled.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
2019-01-18 Daniel Bates <dabates@apple.com>
Fix some build issues.
Including UIKitSoftLinking.h is not compatible with unified builds.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-18 Justin Fan <justin_fan@apple.com>
(WIP) [WebGPU] WebGPUProgrammablePassEncoder::setBindGroup prototype
https://bugs.webkit.org/show_bug.cgi?id=193457
<rdar://problem/47296678>
Reviewed by Dean Jackson.
Enable WebGPU developers to assign buffer bind groups and access them via render pipeline.
Test: webgpu/buffer-resource-triangles.html
* Modules/webgpu/WebGPUBindGroup.h:
(WebCore::WebGPUBindGroup::bindGroup const): Added getter.
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::setBindGroup const): Added. Delegates call to GPUProgrammablePassEncoder.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Enable setBindGroup.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl: ditto.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBindGroup.h:
(WebCore::GPUBindGroup::layout const): Added getter.
(WebCore::GPUBindGroup::bindings const): ditto.
* platform/graphics/gpu/GPUBindGroupLayout.h: Added ArgumentEncoderBuffer struct to retain ptr to both MTLArgumentEncoders and their argument MTLBuffers.
(WebCore::GPUBindGroupLayout::ArgumentEncoderBuffer::operator! const):
(WebCore::GPUBindGroupLayout::vertexArguments const): Added. Getter.
(WebCore::GPUBindGroupLayout::fragmentArguments const): ditto.
(WebCore::GPUBindGroupLayout::computeArguments const): ditto.
* platform/graphics/gpu/GPUDevice.cpp: Refactored unnecessary header include.
* platform/graphics/gpu/GPUDevice.h: ditto.
* platform/graphics/gpu/GPUProgrammablePassEncoder.h:
(WebCore::GPUProgrammablePassEncoder::setVertexBuffer): Added. Delegates to MTLCommandEncoder call.
(WebCore::GPUProgrammablePassEncoder::setFragmentBuffer): ditto.
* platform/graphics/gpu/GPURenderPassEncoder.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::tryCreateArgumentEncoderAndBuffer): Replace newEncoder(). Now create an ArgumentEncoderBuffer object from an array of MTLArgumentDescriptors, if able.
(WebCore::GPUBindGroupLayout::tryCreate): Refactor to support ArgumentEncoderBuffers, and allocate MTLBuffers for argument encoders.
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout): Support ArgumentEncoderBuffers.
(WebCore::newEncoder): Deleted.
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Set a buffer resource on the MTLArgumentEncoder, and call useResource on the command encoder.
(WebCore::GPUProgrammablePassEncoder::setBindGroup): Parses the bind group to assign each resource on its matching MTLArgumentEncoder.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::useResource): Resolves call from GPUProgrammablePassEncoder to call on MTLRenderCommandEncoder.
(WebCore::GPURenderPassEncoder::setVertexBuffer): ditto.
(WebCore::GPURenderPassEncoder::setFragmentBuffer): ditto.
2019-01-18 Daniel Bates <dabates@apple.com>
Another attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
(https://bugs.webkit.org/show_bug.cgi?id=193583)
Only override RenderTheme::platformFocusRingColor() when building with ENABLE(FULL_KEYBOARD_ACCESS)
enabled.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
2019-01-18 Daniel Bates <dabates@apple.com>
Attempt to fix the iOS build following <https://trac.webkit.org/changeset/240174>
(https://bugs.webkit.org/show_bug.cgi?id=193583)
Namespace qualify call to getUIColorClass().
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformFocusRingColor const):
2019-01-18 Jer Noble <jer.noble@apple.com>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WebCore.xcconfig:
2019-01-18 Daniel Bates <dabates@apple.com>
CSS auto focus-ring outlines don't render on iOS
https://bugs.webkit.org/show_bug.cgi?id=193583
<rdar://problem/6508697>
Reviewed by Simon Fraser.
Implement support for drawing focus rings on iOS when built with ENABLE(FULL_KEYBOARD_ACCESS)
enabled.
For now the focus ring drawing for iOS is tangled up into the Mac-specific code to draw
animated focus rings. I will fix this in <https://bugs.webkit.org/show_bug.cgi?id=193591>.
* SourcesCocoa.txt: Add file ColorIOS.mm.
* WebCore.xcodeproj/project.pbxproj: Add files ColorIOS.{h, mm}.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime):
(WebCore::GraphicsContext::drawFocusRing):
Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
This is always enabled on Mac.
* platform/ios/ColorIOS.h: Added.
* platform/ios/ColorIOS.mm: Added.
(WebCore::colorFromUIColor): Convert a UIColor to a WebCore::Color.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
Compile focus ring drawing code when building with ENABLE(FULL_KEYBOARD_ACCESS) enabled.
This is always enabled on Mac.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::platformFocusRingColor const): Implement this override for iOS.
(WebCore::RenderThemeIOS::supportsFocusRing const): Implement this override for iOS to always
return false - the iOS theme code does not support painting focus rings. By returning false we
will use the platform-independent, non-theme code path to draw focus rings.
2019-01-18 David Kilzer <ddkilzer@apple.com>
Follow-up: Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
<https://webkit.org/b/193568>
<rdar://problem/47381130>
* editing/cocoa/DictionaryLookup.mm:
(-[WebRevealHighlight drawHighlightContentForItem:context:]):
Fix the build by changing getUIApplicationClass() to
PAL::getUIApplicationClass().
2019-01-18 David Kilzer <ddkilzer@apple.com>
Switch remaining UIKit soft-linking in WebCore, WebKitLegacy over to UIKitSoftLink.{cpp,h}
<https://webkit.org/b/193568>
<rdar://problem/47381130>
Reviewed by Alex Christensen.
This does the following:
- Removes local soft-linking of UIKit.
- Switches to using PAL functions for soft-linking.
* SourcesCocoa.txt: Add 4 source files to UnifiedSources.
* WebCore.xcodeproj/project.pbxproj: Remove 4 sources files
from WebCore target now that they are in UnifiedSources.
* editing/cocoa/DictionaryLookup.mm:
* editing/cocoa/HTMLConverter.mm: Move SPI to UIKitSPI.h. Remove
declarations in public headers.
(_fontForNameAndSize): Change use of getUIFontClass() to
PlatformFontClass.
(HTMLConverter::_processElement): Add cast here since compiler
finds the wrong selector for +clearColor and thinks it returns a
`CIColor *` object. The same cast already exists in
VideoFullscreenInterfaceAVKit.mm.
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::SettingsBase::defaultTextAutosizingEnabled):
* platform/audio/ios/MediaSessionManagerIOS.mm:
(-[WebMediaSessionHelper initWithCallback:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::showLetterpressedGlyphsWithAdvances):
* platform/ios/DragImageIOS.mm:
(WebCore::scaleDragImage):
(WebCore::createDragImageFromImage):
(WebCore::cascadeForSystemFont):
(WebCore::createDragImageForLink):
(WebCore::createDragImageForSelection):
(WebCore::createDragImageForRange):
(WebCore::createDragImageForColor):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::PlatformPasteboard):
(WebCore::PlatformPasteboard::color):
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::setColor):
* platform/ios/ThemeIOS.mm:
(WebCore::ThemeIOS::userPrefersReducedMotion const):
* platform/ios/UserAgentIOS.mm:
(WebCore::isClassic):
(WebCore::isClassicPad):
(WebCore::isClassicPhone):
* platform/ios/ValidationBubbleIOS.mm:
(-[WebValidationBubbleTapRecognizer initWithPopoverController:]):
(WebCore::ValidationBubble::ValidationBubble):
(WebCore::ValidationBubble::show):
(WebCore::fallbackViewController):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(clearUIColor):
(allocWebAVPictureInPicturePlayerLayerViewInstance):
(WebAVPlayerLayerView_videoView):
(fallbackViewController):
(VideoFullscreenInterfaceAVKit::doSetup):
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]):
* platform/ios/WebItemProviderPasteboard.mm:
(allLoadableClasses):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::setUpFullscreen):
* platform/network/mac/WebCoreURLResponse.mm: Add missing header
after unified sources were updated.
* rendering/RenderThemeIOS.mm:
(WebCore::contentSizeCategoryDidChange):
(WebCore::RenderThemeIOS::RenderThemeIOS):
(WebCore::RenderThemeIOS::contentSizeCategory):
(WebCore::RenderThemeIOS::systemColor const):
(WebCore::attachmentActionColor):
(WebCore::attachmentTitleColor):
(WebCore::attachmentSubtitleColor):
(WebCore::iconForAttachment):
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion const):
2019-01-18 Antti Koivisto <antti@apple.com>
Implement asynchronous frame scrolling for iOS
https://bugs.webkit.org/show_bug.cgi?id=193539
<rdar://problem/47379873>
Reviewed by Simon Fraser.
This patch implements UIScrollView based frame scrolling on iOS, enabled by the "Async Frame Scrolling"
internal setting (still off by default).
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::scrollLayer const): Deleted.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
Export ScrollingTreeFrameScrollingNodeIOS.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
(WebCore::RenderLayerCompositor::updateScrollLayerClipping):
If we don't have a separate clip layer, just resize and position the scroll layer.
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
Use GraphicsLayer::Type::Scrolling as the scroll layer type when async frame scrolling is enabled.
Don't create a separate clip layer since the scroll layer will handle clipping.
* rendering/RenderLayerCompositor.h:
2019-01-18 Ali Juma <ajuma@chromium.org>
FetchResponse::url should return the empty string for tainted responses
https://bugs.webkit.org/show_bug.cgi?id=193553
Reviewed by Youenn Fablet.
Check whether the response is tainted in FetchResponse::url, to match
the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::url const):
2019-01-18 Youenn Fablet <youenn@apple.com>
A track source should be unmuted whenever reenabled after setDirection changes
https://bugs.webkit.org/show_bug.cgi?id=193554
<rdar://problem/47366196>
Reviewed by Eric Carlson.
Ensure that track gets unmuted after being fired as part of track event.
Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC.
Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track,
some enqueued samples might not be from the right active video track or there might be no active video track.
Test: webrtc/video-setDirection.html
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::fireTrackEvent):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
2019-01-18 Charlie Turner <cturner@igalia.com>
[GStreamer][EME][ClearKey] Request keys from CDMInstance rather than passing via bus messages
https://bugs.webkit.org/show_bug.cgi?id=192229
Reviewed by Xabier Rodriguez-Calvar.
Covered by existing tests.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat): There is a defect in some C++11
compiles where they will copy this return value since the type
doesn't exactly match. Force a move with WTFMove.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
Deleted. No longer used by anything.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: Ditto.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
Rename these methods to avoid "namespacing names".
(webkit_media_clear_key_decrypt_class_init):
(finalize):
(handleKeyResponse): This is a temporary fix, we need some more
reorganisation to be full driven by CDMInstance APIs for decryption.
(findAndSetKey):
(decrypt):
(webKitMediaClearKeyDecryptorFinalize): Deleted.
(webKitMediaClearKeyDecryptorHandleKeyResponse): Deleted.
(webKitMediaClearKeyDecryptorFindAndSetKey): Deleted.
(webKitMediaClearKeyDecryptorDecrypt): Deleted.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: Ditto.
(webkit_media_common_encryption_decrypt_class_init):
(finalize):
(transformCaps):
(transformInPlace):
(isCDMInstanceAvailable):
(sinkEventHandler):
(queryHandler):
(changeState):
(setContext):
(webKitMediaCommonEncryptionDecryptorFinalize): Deleted.
(webkitMediaCommonEncryptionDecryptTransformCaps): Deleted.
(webkitMediaCommonEncryptionDecryptTransformInPlace): Deleted.
(webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): Deleted.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): Deleted.
(webkitMediaCommonEncryptionDecryptorQueryHandler): Deleted.
(webKitMediaCommonEncryptionDecryptorChangeState): Deleted.
(webKitMediaCommonEncryptionDecryptorSetContext): Deleted.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
Deleted. No longer passing key information over bus messages.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2019-01-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Collapsing through should not ignore floats.
https://bugs.webkit.org/show_bug.cgi?id=193564
Reviewed by Antti Koivisto.
Float boxes prevent collapsing through.
Test: fast/block/float/float-in-descendant-formatting-context.html
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2019-01-18 Zalan Bujtas <zalan@apple.com>
[LFC] Do not skip float boxes that are not part of the current formatting context when computing bottom.
https://bugs.webkit.org/show_bug.cgi?id=193562
Reviewed by Antti Koivisto.
The current floating context's (float) boxes could belong to descendant formatting contexts.
We need to include them as well when computing height (bottom) (we essentially need to skip ancestor floats only).
<div id=container style="overflow: hidden"><div>foo<div style="float: left">bar</div></div></div>
While computing the height for "container", the float box needs to be taken into account even though
it is part of another (descendant) formatting context (the inline formatting context established by its parent div).
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::isDescendantOfFormattingRoot const):
(WebCore::Layout::FloatingState::FloatItem::inFormattingContext const): Deleted.
2019-01-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Check for inflow children while computing height for block formatting context roots.
https://bugs.webkit.org/show_bug.cgi?id=193555
Reviewed by Antti Koivisto.
This patch also extends areEssentiallyEqual to 0.125px to be able to match (essentially equal) inline runs.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-18 Yacine Bandou <yacine.bandou@softathome.com>
[WebAudio] Release the AudioDestination when uninitializing DefaultAudioDestinationNode
https://bugs.webkit.org/show_bug.cgi?id=192590
Reviewed by Philippe Normand.
When we uninitialize DefaultAudioDestinationNode, the AudioDestination is stopped but not destroyed.
On some platforms the resources are allocated and released with the AudioDestination, thus when we uninitialize
DefaultAudioDestinationNode we don't release resources because the AudioDestination is not destroyed.
* Modules/webaudio/DefaultAudioDestinationNode.cpp:
(WebCore::DefaultAudioDestinationNode::uninitialize):
2019-01-18 Yacine Bandou <yacine.bandou@softathome.com>
[WebAudio] Call AudioContext::uninitialize() immediately when the AudioContext is stopped
https://bugs.webkit.org/show_bug.cgi?id=192586
Reviewed by Philippe Normand.
When WebProcess is killed, AudioContext::uninitialize() is not called immediately in the stop so
the AudioDestinationNode is not destroyed.
In my case, I have a resource device manager, the output audio device is reserved when AudioDestinationNode
is instantiated and it is released when AudioDestinationNode is destroyed, thus when the webprocess is killed,
the resources leak.
AudioContext::uninitialize() is not called immediately since r94608.
This modification can now be reverted without regression in WebAudio tests.
Test: webaudio/mediaelementaudiosourcenode-gc.html
* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::stop):
2019-01-18 Simon Fraser <simon.fraser@apple.com>
ScrollingCoordinator::scrollableAreaScrollLayerDidChange() can be removed
https://bugs.webkit.org/show_bug.cgi?id=193559
Reviewed by Antti Koivisto.
ScrollingCoordinator::scrollableAreaScrollLayerDidChange() existed for CoordinatedGraphics,
but the code that used it was removed in webkit.org/r229318 so we can remove it and
code that calls it.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::willDestroyScrollableArea):
(WebCore::ScrollingCoordinator::scrollableAreaScrollLayerDidChange): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::RenderLayerCompositor::scrollingLayerDidChange): Deleted.
* rendering/RenderLayerCompositor.h:
2019-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Content offset jumps erratically when autoscrolling near scroll view content inset areas
https://bugs.webkit.org/show_bug.cgi?id=193494
<rdar://problem/46859627>
Reviewed by Simon Fraser and Tim Horton.
When computing the content offset to scroll to when revealing a given rect in content coordinates, we currently
just use the unobscured content rect. As a result, when scrolling to reveal a rect, we'll clamp the final scroll
position such that only content is visible. For example, when asked to reveal the rect `(0, 0, 1, 1)`, we adjust
the scroll position to be the origin.
However, consider the case where a client (e.g. Mail on iOS) has added a content inset to the web view's scroll
view. If we're asked to reveal a rect that is outside the content area but within a content inset, we will still
end up clamping the scroll position to the unobscured rect. This manifests in a bug where selecting text and
autoscrolling in iOS Mail compose while the scroll view is scrolled all the way to the top to reveal the To/Cc/
Subject fields causes the content offset to jump to the origin, rather than staying at (0, -topContentInset).
To fix this, we teach `RenderLayer::scrollRectToVisible` about content insets that are visible. Rather than use
the content rects as-is, expand to encompass visible content insets as well. This ensures that revealing a
position which is already visible won't cause us to scroll away the content inset area and only show the
unobscured rect.
Tests: editing/selection/ios/autoscroll-with-top-content-inset.html
fast/scrolling/ios/scroll-into-view-with-top-content-inset.html
* page/FrameView.cpp:
(WebCore::FrameView::unobscuredContentRectExpandedByContentInsets const):
Introduce a helper method that expands the unobscured content rect to include surrounding content insets.
* page/FrameView.h:
* page/Page.h:
(WebCore::Page::contentInsets const):
(WebCore::Page::setContentInsets):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::getRectToExpose const):
2019-01-17 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r240124.
This commit broke an internal build.
Reverted changeset:
"SDK_VARIANT build destinations should be separate from non-
SDK_VARIANT builds"
https://bugs.webkit.org/show_bug.cgi?id=189553
https://trac.webkit.org/changeset/240124
2019-01-17 Devin Rousso <drousso@apple.com>
Web Inspector: fix Xcode project file list after r239976
https://bugs.webkit.org/show_bug.cgi?id=193474
Reviewed by Timothy Hatcher.
* WebCore.xcodeproj/project.pbxproj:
2019-01-17 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed WinCairo fix -- hundreds of tests crash after r240031.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
2019-01-17 John Wilander <wilander@apple.com>
Add infrastructure to enable/disable ITP Debug Mode through Preferences
https://bugs.webkit.org/show_bug.cgi?id=193510
<rdar://problem/47330969>
Reviewed by Dean Jackson.
No new tests. These changes are purely for settings/preferences.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setItpDebugModeEnabled):
(WebCore::RuntimeEnabledFeatures::itpDebugModeEnabled const):
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode): Deleted.
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const): Deleted.
Renamed.
* page/Settings.yaml:
Removed since this particular setting should not be persisted for privacy
reasons.
2019-01-17 Jer Noble <jer.noble@apple.com>
SDK_VARIANT build destinations should be separate from non-SDK_VARIANT builds
https://bugs.webkit.org/show_bug.cgi?id=189553
Reviewed by Tim Horton.
* Configurations/Base.xcconfig:
* Configurations/SDKVariant.xcconfig: Added.
* Configurations/WebCore.xcconfig:
2019-01-17 Jer Noble <jer.noble@apple.com>
MediaPlayerPrivateAVFoundationObjC can return incorrect paused information
https://bugs.webkit.org/show_bug.cgi?id=193499
Reviewed by Eric Carlson.
MediaPlayerPrivateAVFoundation uses rate() as an indicator of whether the player
is paused or not. This is incorrect when playback is stalled waiting for more data.
For MPPAVFObjC, use the timeControlStatus as a more accurate indicator of whether
the player is playing.
Now that we have correct play state information, we can remove the handlePlaybackCommand()
path when playing remotely for a more direct approach of notifying the HTMLMediaElement
that the play state has changed.
Drive-by fix: Before throwing away the AVPlayer, clear its output context. This keeps
remote devices from keeping the AVPlayer alive.
Drive-by fix #2: The NullMediaPlayer should always return "true" for paused(), not "false",
since it can't possibly play anything.
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::paused const):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::platformPaused const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPaused const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
2019-01-17 Jiewen Tan <jiewen_tan@apple.com>
[Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable
https://bugs.webkit.org/show_bug.cgi?id=193478
<rdar://problem/34368591>
Reviewed by Brent Fulgham.
By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention
as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This
is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only
website that assumes submit buttons are focusable, and will prohibit users from completing immigration
forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to
HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable.
This quirk is for ceac.state.gov specifically, and therefore no tests.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isMouseFocusable const):
(WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const):
* html/HTMLFormControlElement.h:
2019-01-17 Alex Christensen <achristensen@webkit.org>
Fix WinCairo build after r240117
https://bugs.webkit.org/show_bug.cgi?id=193529
* PlatformWin.cmake:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
2019-01-17 Youenn Fablet <youenn@apple.com>
Add release logging for incoming and outgoing webrtc audio tracks
https://bugs.webkit.org/show_bug.cgi?id=185545
Reviewed by Eric Carlson.
Add logging of audio tracks. When doing a WebRTC call,
one log line is added each second for each audio track.
Validated that logging is done through manual testing.
Refactored code to use LogHelper and apply it to video sources as well.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addTrack):
(WebCore::LibWebRTCMediaEndpoint::sourceFromNewReceiver):
(WebCore::sourceFromNewReceiver): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
(WebCore::RealtimeIncomingAudioSource::logChannel const):
(WebCore::RealtimeIncomingAudioSource::logger const):
* platform/mediastream/RealtimeIncomingAudioSource.h:
(WebCore::RealtimeIncomingAudioSource::setLogger):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::logChannel const):
(WebCore::RealtimeIncomingVideoSource::logger const):
* platform/mediastream/RealtimeIncomingVideoSource.h:
(WebCore::RealtimeIncomingVideoSource::setLogger):
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
(WebCore::RealtimeOutgoingAudioSource::logChannel const):
(WebCore::RealtimeOutgoingAudioSource::logger const):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
(WebCore::RealtimeOutgoingAudioSource::setLogger):
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
(WebCore::RealtimeOutgoingVideoSource::sendOneBlackFrame):
(WebCore::RealtimeOutgoingVideoSource::logChannel const):
(WebCore::RealtimeOutgoingVideoSource::logger const):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
(WebCore::RealtimeOutgoingVideoSource::setLogger):
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
(WebCore::RealtimeIncomingAudioSourceCocoa::OnData):
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):
2019-01-17 Alex Christensen <achristensen@webkit.org>
Stop using NetworkStorageSession::storageSession in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193529
Reviewed by Tim Horton.
Ownership of the map that NetworkStorageSession::storageSession searches needs to move to the WebKit/WebKitLegacy layer,
so when WebCore used to look in this map it needs to call a client function to ask the layer above it for the storage object.
I've called this client StorageSessionProvider::storageSession. Right now it just looks in NetworkStorageSession::storageSession,
but this added abstraction makes it possible to move the currently process-global map to be a member of the NetworkProcess object.
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::connect):
* WebCore.xcodeproj/project.pbxproj:
* loader/CookieJar.cpp:
(WebCore::CookieJar::create):
(WebCore::CookieJar::CookieJar):
(WebCore::CookieJar::cookies const):
(WebCore::CookieJar::setCookies):
(WebCore::CookieJar::cookiesEnabled const):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
(WebCore::CookieJar::getRawCookies const):
(WebCore::CookieJar::deleteCookie):
* loader/CookieJar.h:
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* page/Page.h:
* page/SocketProvider.cpp:
(WebCore::SocketProvider::createSocketStreamHandle):
* page/SocketProvider.h:
* platform/network/NetworkingContext.h:
* platform/network/SocketStreamHandleImpl.cpp:
(WebCore::cookieDataForHandshake):
(WebCore::SocketStreamHandleImpl::platformSendHandshake):
* platform/network/StorageSessionProvider.h: Added.
(WebCore::StorageSessionProvider::~StorageSessionProvider):
* platform/network/cf/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
(WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
* platform/network/curl/SocketStreamHandleImpl.h:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):
2019-01-17 Jon Lee <jonlee@apple.com>
[EME] Remove Amazon Prime Video from quirks list
https://bugs.webkit.org/show_bug.cgi?id=193514
rdar://problem/47295330
Reviewed by Jer Noble.
* page/Quirks.cpp:
(WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const):
2019-01-17 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] An element with transform is a containing block for positioned descendants.
https://bugs.webkit.org/show_bug.cgi?id=193534
Reviewed by Antti Koivisto.
"For elements whose layout is governed by the CSS box model, any value other than none for the transform
property also causes the element to establish a containing block for all descendants."
https://www.w3.org/TR/css-transforms-1/
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::containingBlock const):
2019-01-17 Simon Fraser <simon.fraser@apple.com>
ScrollingCoordinator: separate updating node geometry from node layers
https://bugs.webkit.org/show_bug.cgi?id=193527
Reviewed by Antti Koivisto.
Updating scrolling tree node layers happens in a different code path from updating geometry;
the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.
We can also clean up the ScrollingCoordinator API and have a single function that updates
node layers (handling different node types), and separate functions for pushing viewport-constrained
and scrolling node geometry.
No observable behavior change.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setNodeLayers):
(WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
(WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
(WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
(WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
(WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:
2019-01-17 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][Quirk] Take body padding and border into account when stretching height.
https://bugs.webkit.org/show_bug.cgi?id=193528
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::verticalBorder const):
(WebCore::Display::Box::horizontalBorder const):
(WebCore::Display::Box::verticalPadding const):
(WebCore::Display::Box::horizontalPadding const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-17 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] For height computation, the bottom edge of the last line box value should not include top border/padding
https://bugs.webkit.org/show_bug.cgi?id=193520
Reviewed by Antti Koivisto.
This is similar to the other "10.6.3" cases. The bottom edge of the last inline box is in the coordinate systyem
of the containing block's border box (and for content height computation it needs to be mapped to the containing block's content box instead).
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2019-01-16 Simon Fraser <simon.fraser@apple.com>
Stub out scrolling tree classes for overflow scrolling nodes on macOS
https://bugs.webkit.org/show_bug.cgi?id=193524
Reviewed by Antti Koivisto.
Add an empty implementation of ScrollingTreeOverflowScrollingNodeMac for macOS. Change
ScrollingTreeMac::createScrollingTreeNode() to create these nodes.
Minor refactor of RenderLayerCompositor::useCoordinatedScrollingForLayer() code to ask
the scrolling coordinator if it can coordinate scrolling for this layer; no behavior
change for existing code paths.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::coordinatesScrollingForOverflowLayer const):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h: Copied from Source/WebCore/page/scrolling/mac/ScrollingStateFrameScrollingNodeMac.mm.
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm: Added.
(WebCore::ScrollingTreeOverflowScrollingNodeMac::create):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::ScrollingTreeOverflowScrollingNodeMac):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::~ScrollingTreeOverflowScrollingNodeMac):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateBeforeChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::commitStateAfterChildren):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::scrollPosition const):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
(WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterDelegatedScroll):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::usesAsyncScrolling const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
* rendering/RenderLayerCompositor.h:
2019-01-16 Justin Fan <justin_fan@apple.com>
[WebGPU] Update vertex-buffer-triangle-strip.html to actually use vertex buffer
https://bugs.webkit.org/show_bug.cgi?id=193473
Reviewed by Dean Jackson and Myles Maxfield.
Also, switch to using the inputSlot instead of the shaderLocation field, as this seems more correct.
As of now I cannot determine an analog for WebGPU's shaderLocation in Metal.
Test: Covered by vertex-buffer-triangle-strip.html. No change in behavior.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor): Use the inputSlot instead of shaderLocation as bufferIndex.
2019-01-16 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add the function stage checker
https://bugs.webkit.org/show_bug.cgi?id=193479
Reviewed by Dean Jackson and Robin Morisset.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/CheckNativeFuncStages.mjs into C++.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
(WebCore::WHLSL::AST::CallExpression::function):
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.cpp: Added.
(WebCore::WHLSL::FunctionStageChecker::FunctionStageChecker):
(WebCore::WHLSL::checkFunctionStages):
* Modules/webgpu/WHLSL/WHLSLFunctionStageChecker.h: Added.
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
(WebCore::WHLSL::Intrinsics::add):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
(WebCore::WHLSL::Intrinsics::ddx const):
(WebCore::WHLSL::Intrinsics::ddy const):
(WebCore::WHLSL::Intrinsics::allMemoryBarrier const):
(WebCore::WHLSL::Intrinsics::deviceMemoryBarrier const):
(WebCore::WHLSL::Intrinsics::groupMemoryBarrier const):
(WebCore::WHLSL::Intrinsics::WTF_ARRAY_LENGTH):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-16 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Delete the 'restricted' keyword
https://bugs.webkit.org/show_bug.cgi?id=193469
Reviewed by Dean Jackson and Robin Morisset.
This change mirrors https://github.com/gpuweb/WHLSL/pull/304 in the reference implementation.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h:
(WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
(WebCore::WHLSL::AST::FunctionDefinition::block):
(WebCore::WHLSL::AST::FunctionDefinition::restricted const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h:
(WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
(WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const): Deleted.
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
(WebCore::WHLSL::resolveFunctionOverloadImpl):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):
2019-01-16 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement the recursion checker
https://bugs.webkit.org/show_bug.cgi?id=193436
Reviewed by Saam Barati.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/RecursionChecker.mjs into C++.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h:
(WebCore::WHLSL::AST::CallExpression::function):
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp.
(WebCore::WHLSL::checkRecursion):
* Modules/webgpu/WHLSL/WHLSLRecursionChecker.h: Added.
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-16 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add the literal type checker
https://bugs.webkit.org/show_bug.cgi?id=193430
Reviewed by Dean Jackson.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LiteralTypeChecker.mjs into C++.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
(WebCore::WHLSL::AST::FloatLiteralType::value const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
(WebCore::WHLSL::AST::IntegerLiteralType::value const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const):
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.cpp: Added.
(WebCore::WHLSL::getNativeTypeDeclaration):
(WebCore::WHLSL::LiteralTypeChecker::visit):
(WebCore::WHLSL::checkLiteralTypes):
* Modules/webgpu/WHLSL/WHLSLLiteralTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-16 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Inflow non-replaced used width should not be negative.
https://bugs.webkit.org/show_bug.cgi?id=193495
Reviewed by Antti Koivisto.
min-width (initial value 0) enforces non-negative used width.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2019-01-16 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add a handwritten parser
https://bugs.webkit.org/show_bug.cgi?id=192355
Reviewed by Dean Jackson.
The parser is a mechanical representation of WHLSL's ANTLR grammar at
https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. The parser
uses Expected<> to return an appropriate Error string when parsing fails.
This patch doesn't include the AST nodes themselves - those are in
https://bugs.webkit.org/show_bug.cgi?id=192991. I split up the patch to
aid easier reviewing.
No new tests because the parser isn't hooked up yet.
* Modules/webgpu/WHLSL/WHLSLParser.cpp:
(WebCore::WHLSL::Parser::Parser):
(WebCore::WHLSL::Parser::parse):
(WebCore::WHLSL::Parser::fail):
(WebCore::WHLSL::Parser::peek):
(WebCore::WHLSL::Parser::tryType):
(WebCore::WHLSL::Parser::tryTypes):
(WebCore::WHLSL::Parser::consumeType):
(WebCore::WHLSL::Parser::consumeTypes):
(WebCore::WHLSL::digitValue):
(WebCore::WHLSL::intLiteralToInt):
(WebCore::WHLSL::uintLiteralToUint):
(WebCore::WHLSL::floatLiteralToFloat):
(WebCore::WHLSL::Parser::consumeIntegralLiteral):
(WebCore::WHLSL::Parser::consumeNonNegativeIntegralLiteral):
(WebCore::WHLSL::recognizeSimpleUnsignedInteger):
(WebCore::WHLSL::Parser::parseConstantExpression):
(WebCore::WHLSL::Parser::parseTypeArgument):
(WebCore::WHLSL::Parser::parseTypeArguments):
(WebCore::WHLSL::Parser::parseTypeSuffixAbbreviated):
(WebCore::WHLSL::Parser::parseTypeSuffixNonAbbreviated):
(WebCore::WHLSL::Parser::parseAddressSpaceType):
(WebCore::WHLSL::Parser::parseNonAddressSpaceType):
(WebCore::WHLSL::Parser::parseType):
(WebCore::WHLSL::Parser::parseTypeDefinition):
(WebCore::WHLSL::Parser::parseBuiltInSemantic):
(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::parseEntryPointFunctionDeclaration):
(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::parseEffectfulPrefix):
(WebCore::WHLSL::Parser::parseEffectfulSuffix):
(WebCore::WHLSL::Parser::parseLimitedSuffixOperator):
(WebCore::WHLSL::Parser::parseSuffixOperator):
(WebCore::WHLSL::Parser::parseExpression):
(WebCore::WHLSL::Parser::parseTernaryConditional):
(WebCore::WHLSL::Parser::parseAssignment):
(WebCore::WHLSL::Parser::parsePossibleTernaryConditional):
(WebCore::WHLSL::Parser::parsePossibleLogicalBinaryOperation):
(WebCore::WHLSL::Parser::parsePossibleRelationalBinaryOperation):
(WebCore::WHLSL::Parser::parsePossibleShift):
(WebCore::WHLSL::Parser::parsePossibleAdd):
(WebCore::WHLSL::Parser::parsePossibleMultiply):
(WebCore::WHLSL::Parser::parsePossiblePrefix):
(WebCore::WHLSL::Parser::parsePossibleSuffix):
(WebCore::WHLSL::Parser::parseCallExpression):
(WebCore::WHLSL::Parser::parseTerm):
* Modules/webgpu/WHLSL/WHLSLParser.h:
(WebCore::WHLSL::Parser::Error::Error):
(WebCore::WHLSL::Parser::backtrackingScope):
(WebCore::WHLSL::Parser::SuffixExpression::SuffixExpression):
(WebCore::WHLSL::Parser::SuffixExpression::operator bool const):
2019-01-16 Sihui Liu <sihui_liu@apple.com>
IndexedDB: UniqueIDBDatabase should not be freed if the database task queue is not empty.
https://bugs.webkit.org/show_bug.cgi?id=193093
Reviewed by Brady Eidson.
performUnconditionalDeleteBackingStore killed the database task queue immediately, but performPrefetchCursor
task may be scheduled behind performUnconditionalDeleteBackingStore on database thread.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
(WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
2019-01-16 Alex Christensen <achristensen@webkit.org>
Internal build fix.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::layerContentsFormat):
2019-01-16 Youenn Fablet <youenn@apple.com>
ServiceWorkerContainer is leaking due to a ref cycle
https://bugs.webkit.org/show_bug.cgi?id=193462
<rdar://problem/47026303>
Reviewed by Brady Eidson.
ServiceWorkerContainer keeps a reference to its ready promise.
The ready promise keeps a ref to its value which is a ServiceWorkerRegistration.
ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer.
To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped.
Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::stop):
2019-01-15 Simon Fraser <simon.fraser@apple.com>
Make didCommitChangesForLayer() explicitly about the platform layer changing because of tile/non-tile swapping
https://bugs.webkit.org/show_bug.cgi?id=193290
Reviewed by Tim Horton.
RenderLayerCompositor::didFlushChangesForLayer() triggers updates scrolling tree nodes for
the flushed layer, but it's not clear what has changed at this point.
didCommitChangesForLayer()/didFlushChangesForLayer() were added to explicitly handle the
case where the underlying platform layer for a GraphicsLayer changes because the layer swaps
between tiled and non-tiled, and structural layer changes; we need to push the new layer to
the scrolling tree because it operates on platform layers. So the only work that
didFlushChangesForLayer() should do is to update layers on scrolling tree nodes; it doesn't
need to do any geometry updating. Move towards that goal by renaming this callback to
didChangePlatformLayerForLayer() to make its function more explicit.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::didChangePlatformLayerForLayer):
(WebCore::GraphicsLayerClient::didCommitChangesForLayer const): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingStateForThisLayerOnly):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::didChangePlatformLayerForLayer):
(WebCore::RenderLayerBacking::didCommitChangesForLayer const): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::didChangePlatformLayerForLayer):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer): Deleted.
(WebCore::RenderLayerCompositor::didCommitChangesForLayer const): Deleted.
(WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): Deleted.
* rendering/RenderLayerCompositor.h:
2019-01-16 Chris Dumez <cdumez@apple.com>
Regression(PSON) View becomes blank after click a cross-site download link
https://bugs.webkit.org/show_bug.cgi?id=193361
<rdar://problem/47099573>
Reviewed by Geoffrey Garen.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
When restoring from PageCache, make sure we notify the client that the load was committed
*before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
logic in the UIProcess.
2019-01-16 Devin Rousso <drousso@apple.com>
Web Inspector: extend overlay element bounds lines to the right/below as well
https://bugs.webkit.org/show_bug.cgi?id=193336
Reviewed by Matt Baker.
This patch is purely a visual change for WebInspector, and doesn't affect anything else.
* inspector/InspectorOverlayPage.js:
(_drawBounds):
2019-01-16 Youenn Fablet <youenn@apple.com>
Prevent WorkerRunLoop::runInMode from spinning in nested cases
https://bugs.webkit.org/show_bug.cgi?id=193359
<rdar://problem/46345353>
Reviewed by Joseph Pecoraro.
Speculative fix for some cases where service worker is spinning and consuming a lot of CPU.
The hypothesis is that:
- Service Worker is checking for its script freshness through WorkerScriptLoader.
This triggers the worker run loop to be nested.
- The run loop timer is active and needs to fire immediately.
The hypothesis is that this happens in some cases like restarting a device after sleep mode.
WorkerRunLoop::runInMode will then compute a 0 timeout value for getting a message.
This will trigger a timeout while waiting for the message queue.
Since the run loop is nested, the run loop timer will not be able to fire,
and it will keep ask to fire immediately.
runInMode will return timeout as a result and WorkerRunLoop::run will call it immediately.
The fix is to prevent the shared timer to fire only when the run loop is being debugged through the web inspector.
We compute this by checking the run loop mode as debuggerMode().
Did some refactoring by introducing helper routines for running the loop and posting task in debugger mode.
* inspector/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
* workers/WorkerInspectorProxy.cpp:
(WebCore::WorkerInspectorProxy::resumeWorkerIfPaused):
(WebCore::WorkerInspectorProxy::connectToWorkerInspectorController):
(WebCore::WorkerInspectorProxy::disconnectFromWorkerInspectorController):
(WebCore::WorkerInspectorProxy::sendMessageToWorkerInspectorController):
* workers/WorkerRunLoop.cpp:
(WebCore::ModePredicate::ModePredicate):
(WebCore::WorkerRunLoop::WorkerRunLoop):
(WebCore::debuggerMode):
(WebCore::RunLoopSetup::RunLoopSetup):
(WebCore::RunLoopSetup::~RunLoopSetup):
(WebCore::WorkerRunLoop::run):
(WebCore::WorkerRunLoop::runInDebuggerMode):
(WebCore::WorkerRunLoop::runInMode):
(WebCore::WorkerRunLoop::Task::performTask):
* workers/WorkerRunLoop.h:
(WebCore::WorkerRunLoop::isBeingDebugged const):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::startRunningDebuggerTasks):
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
(WebCore::ServiceWorkerInspectorProxy::connectToWorker):
(WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
(WebCore::ServiceWorkerInspectorProxy::sendMessageToWorker):
2019-01-16 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak WebIDBConnectionToClient for retain cycle
https://bugs.webkit.org/show_bug.cgi?id=193097
<rdar://problem/46899601>
Reviewed by David Kilzer.
Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live
forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself.
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
2019-01-16 Antti Koivisto <antti@apple.com>
Add more assertions to find root cause for release assert hit in StyleResolver
https://bugs.webkit.org/show_bug.cgi?id=193488
<rdar://problem/30983040>
Reviewed by Zalan Bujtas.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::~StyleResolver):
Release assert we are not resolving tree style.
* dom/Document.cpp:
(WebCore::Document::setIsResolvingTreeStyle):
* dom/Document.h:
(WebCore::Document::isResolvingTreeStyle const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Scope::Scope):
(WebCore::Style::TreeResolver::Scope::~Scope):
Set isResolvingTreeStyle bit when we have a tree resolver scope.
2019-01-16 Zalan Bujtas <zalan@apple.com>
[LFC][Out-of-flow] Set used vertical margin values when top/height/bottom are non-auto.
https://bugs.webkit.org/show_bug.cgi?id=193470
Reviewed by Antti Koivisto.
Non-auto vertical margin values (which is mostly the case) should be set as used values.
Test: fast/block/block-only/non-auto-top-bottom-height-with-margins.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2019-01-16 Alan Kinsley <zalan@apple.com>
[LFC] Adjust margin box verification.
https://bugs.webkit.org/show_bug.cgi?id=193482
Reviewed by Antti Koivisto.
In certain cases, like out-of-flow boxes with margin auto, marginBoxRect() returns 0. It's clearly incorrect,
so let's check the individual margin values instead (and at this point we know that all other boxes match).
Test: fast/block/block-only/non-auto-top-bottom-height-with-auto-margins.html
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2019-01-16 Zan Dobersek <zdobersek@igalia.com>
[FreeType] Cache the zero-width space glyph in GlyphPage::fill()
https://bugs.webkit.org/show_bug.cgi?id=193485
Reviewed by Carlos Garcia Campos.
In FreeType's implementation of GlyphPage::fill(), we can cache the
zero-width space glyph upon first retrieval through the
FcFreeTypeCharIndex() entrypoint, avoiding any subsequent calls
for other ignorable characters.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill):
2019-01-16 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add the high zombie finder
https://bugs.webkit.org/show_bug.cgi?id=193432
Reviewed by Robin Morisset and Saam Barati.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/HighZombieFinder.mjs into C++.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.cpp: Added.
(WebCore::WHLSL::findHighZombies):
* Modules/webgpu/WHLSL/WHLSLHighZombieFinder.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-15 Fujii Hironori <Hironori.Fujii@sony.com>
Unreviewed WinCairo build fix.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
2019-01-15 Alex Christensen <achristensen@webkit.org>
Reduce use of NetworkStorageSession::defaultStorageSession in WebCore
https://bugs.webkit.org/show_bug.cgi?id=193368
Reviewed by Geoff Garen.
The NetworkStorageSession ownership needs to move to the WebKit/WebKitLegacy layer instead of being a process-global static map.
* loader/EmptyClients.cpp:
* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::defaultCredentialStorage): Deleted.
* platform/network/CredentialStorage.h:
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::ensureSession):
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
(WebCore::createPrivateStorageSession):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
2019-01-15 Ryosuke Niwa <rniwa@webkit.org>
VisualViewport API should be updated upon opening of keyboard
https://bugs.webkit.org/show_bug.cgi?id=193475
Reviewed by Simon Fraser.
Added a function to update the visual viewport API and schedule a resize event to FrameView.
Test: fast/visual-viewport/ios/resize-event-for-keyboard.html
* page/FrameView.cpp:
(WebCore::FrameView::didUpdateViewportOverrideRects):
* page/FrameView.h:
2019-01-15 Myles C. Maxfield <mmaxfield@apple.com>
Fix build after r240018
https://bugs.webkit.org/show_bug.cgi?id=193434
Unreviewed.
* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
(WebCore::WHLSL::checkLoops):
(WebCore::WHLSL::findHighZombies): Deleted.
* Modules/webgpu/WHLSL/WHLSLLoopChecker.h:
2019-01-15 Megan Gardner <megan_gardner@apple.com>
Add Reveal support in iOSMac
https://bugs.webkit.org/show_bug.cgi?id=193408
<rdar://problem/47300699>
Reviewed by Tim Horton.
iOSMac and Reveal are currently not testable.
Add support for the reveal SPI specifically for iOSMac.
Show the controller when called, and implement the delegate to
correctly re-paint the content with the auto-generated highlight from
the reveal framework.
* Configurations/WebCore.xcconfig:
* editing/cocoa/DictionaryLookup.mm:
(-[WebRevealHighlight initWithHighlightRect:view:]):
(-[WebRevealHighlight setImage:]):
(-[WebRevealHighlight highlightRectsForItem:]):
(-[WebRevealHighlight startHighlightingItem:]):
(-[WebRevealHighlight highlightItem:withProgress:]):
(-[WebRevealHighlight completeHighlightingItem:]):
(-[WebRevealHighlight stopHighlightingItem:]):
(-[WebRevealHighlight highlightRangeChangedForItem:]):
(-[WebRevealHighlight highlighting]):
(-[WebRevealHighlight drawHighlightContentForItem:context:]):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
* editing/mac/DictionaryLookup.h:
2019-01-15 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add ending namespace comments to make namespace boundaries more clear
https://bugs.webkit.org/show_bug.cgi?id=193471
Reviewed by Saam Barati.
This patch only adds the comments to the files that are too long to fit on a single screen in my editor.
No new tests because there is no behavior change.
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp:
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h:
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
* Modules/webgpu/WHLSL/WHLSLLexer.h:
* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp:
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLProgram.h:
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp:
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
* Modules/webgpu/WHLSL/WHLSLVisitor.h:
2019-01-15 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement the loop checker
https://bugs.webkit.org/show_bug.cgi?id=193434
Reviewed by Saam Barati.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/LoopChecker.mjs into C++.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Added.
(WebCore::WHLSL::findHighZombies):
* Modules/webgpu/WHLSL/WHLSLLoopChecker.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-15 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r239993, r239995, r239997, and
r239999.
Caused assertions under
ViewGestureController::disconnectFromProcess()
Reverted changesets:
"Regression(PSON) View becomes blank after click a cross-site
download link"
https://bugs.webkit.org/show_bug.cgi?id=193361
https://trac.webkit.org/changeset/239993
"Unreviewed iOS build fix after r239993."
https://trac.webkit.org/changeset/239995
"Fix iOS build after r239993"
https://bugs.webkit.org/show_bug.cgi?id=193361
https://trac.webkit.org/changeset/239997
"Unreviewed, revert part of r239997 as it is not needed to fix
the build."
https://trac.webkit.org/changeset/239999
2019-01-15 Alex Christensen <achristensen@webkit.org>
Stop using CookiesStrategy
https://bugs.webkit.org/show_bug.cgi?id=161106
Reviewed by Don Olmstead and Antti Koivisto.
CookiesStrategy is process-global and makes it difficult to switch NetworkStorageSession from having a process-global map.
Instead, use a CookieJar object in the WebProcess. This has the additional benefit of making it more clear which code
is used in the WebProcess and which code is used in the NetworkProcess.
* Modules/beacon/NavigatorBeacon.cpp:
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::processBuffer):
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::WebSocketHandshake::clientHandshakeRequest const):
(WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
* WebCore.xcodeproj/project.pbxproj:
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/Document.cpp:
(WebCore::Document::cookie):
(WebCore::Document::setCookie):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerGetRawCookies const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
* loader/CookieJar.cpp:
(WebCore::CookieJar::shouldIncludeSecureCookies):
(WebCore::CookieJar::sameSiteInfo):
(WebCore::CookieJar::create):
(WebCore::CookieJar::cookies const):
(WebCore::CookieJar::cookieRequestHeaderFieldProxy):
(WebCore::CookieJar::setCookies):
(WebCore::CookieJar::cookiesEnabled const):
(WebCore::CookieJar::cookieRequestHeaderFieldValue const):
(WebCore::CookieJar::getRawCookies const):
(WebCore::CookieJar::deleteCookie):
(WebCore::shouldIncludeSecureCookies): Deleted.
(WebCore::sameSiteInfo): Deleted.
(WebCore::cookies): Deleted.
(WebCore::cookieRequestHeaderFieldProxy): Deleted.
(WebCore::setCookies): Deleted.
(WebCore::cookiesEnabled): Deleted.
(WebCore::cookieRequestHeaderFieldValue): Deleted.
(WebCore::getRawCookies): Deleted.
(WebCore::deleteCookie): Deleted.
* loader/CookieJar.h:
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/cache/CachedApplicationManifest.cpp:
(WebCore::CachedApplicationManifest::CachedApplicationManifest):
* loader/cache/CachedApplicationManifest.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
* loader/cache/CachedCSSStyleSheet.h:
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::CachedFont):
* loader/cache/CachedFont.h:
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::CachedRawResource):
* loader/cache/CachedRawResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::cookieJar const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::revalidateResource):
(WebCore::CachedResourceLoader::loadResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocument.cpp:
(WebCore::CachedSVGDocument::CachedSVGDocument):
* loader/cache/CachedSVGDocument.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::CachedSVGFont):
* loader/cache/CachedSVGFont.h:
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::CachedScript):
* loader/cache/CachedScript.h:
* loader/cache/CachedTextTrack.cpp:
(WebCore::CachedTextTrack::CachedTextTrack):
* loader/cache/CachedTextTrack.h:
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
* loader/cache/CachedXSLStyleSheet.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
* loader/cache/MemoryCache.h:
* page/Navigator.cpp:
(WebCore::Navigator::cookieEnabled const):
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::cookieJar):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* platform/CookiesStrategy.h: Removed.
* platform/PlatformStrategies.h:
(WebCore::PlatformStrategies::cookiesStrategy): Deleted.
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
* platform/network/CookieRequestHeaderFieldProxy.h:
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
* platform/network/curl/ResourceHandleCurl.cpp:
* rendering/RenderSnapshottedPlugIn.cpp:
(WebCore::RenderSnapshottedPlugIn::updateSnapshot):
* testing/Internals.cpp:
(WebCore::Internals::getCookies const):
2019-01-15 Simon Fraser <simon.fraser@apple.com>
Animations should only trigger layer recomposite when necessary
https://bugs.webkit.org/show_bug.cgi?id=193450
Reviewed by Antoine Quint.
Animations only need to trigger compositing updates when their states change in a way
that affects compositing. RenderLayerCompositor::requiresCompositingForAnimation() checks for
running animations of properties that can be accelerated, so this patch fixes the legacy
animation logic to only set 'shouldRecompositeLayer' in TreeResolver::createAnimatedElementUpdate()
when the running state of such an animation changes.
ImplicitAnimation::animate() and KeyframeAnimation::animate() now return OptionSet<AnimateChange>.
This contains information about whether the running state changed, so CompositeAnimation::animate()
asks about whether the running state of an accelerated property changed, and returns this in
the AnimationUpdate result.
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::isPausedState):
(WebCore::AnimationBase::isRunningState):
(WebCore::AnimationBase::inPausedState const):
(WebCore::AnimationBase::inRunningState const):
(WebCore::AnimationBase::isAnimatingProperty const):
* page/animation/CSSAnimationController.h:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::animate):
* page/animation/ImplicitAnimation.cpp:
(WebCore::ImplicitAnimation::animate):
(WebCore::ImplicitAnimation::affectsAcceleratedProperty const):
* page/animation/ImplicitAnimation.h:
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::KeyframeAnimation):
(WebCore::KeyframeAnimation::animate):
(WebCore::KeyframeAnimation::computeStackingContextImpact): Deleted.
* page/animation/KeyframeAnimation.h:
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2019-01-15 Simon Fraser <simon.fraser@apple.com>
Clean up code related to the updating of Dashboard and touch event regions
https://bugs.webkit.org/show_bug.cgi?id=193460
Reviewed by Zalan Bujtas.
In preparation for layout testing that can count the number of event region
updates, move the code related to updating "annotated" (Dashboard) regions, and
touch event regions into bottleneck functions in Document.
Updating these two kinds of regions is generally similar, but there are some code paths
that eagerly update annotated regions.
No behavior change.
* dom/Document.cpp:
(WebCore::Document::updateAnnotatedRegions): Moved from FrameView.
(WebCore::Document::invalidateRenderingDependentRegions):
(WebCore::Document::invalidateScrollbarDependentRegions):
(WebCore::Document::updateZOrderDependentRegions):
* dom/Document.h:
(WebCore::Document::setAnnotatedRegionsDirty):
(WebCore::Document::annotatedRegionsDirty const):
(WebCore::Document::hasAnnotatedRegions const):
* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
(WebCore::FrameView::didPaintContents):
(WebCore::FrameView::updateAnnotatedRegions): Deleted.
* page/FrameView.h:
* rendering/RenderElement.cpp: Drive-by header cleanup.
(WebCore::RenderElement::styleWillChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::setHasHorizontalScrollbar):
(WebCore::RenderLayer::setHasVerticalScrollbar):
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::setHasVerticalScrollbar):
2019-01-15 David Kilzer <ddkilzer@apple.com>
Let Xcode have its way with the WebCore project
* WebCore.xcodeproj/project.pbxproj:
- Change the lastKnownFileType for *.gperf and *.idl files from
"file" to "text".
- Resort source files into UUID order.
2019-01-15 Youenn Fablet <youenn@apple.com>
Correctly handle rotation for local video playback
https://bugs.webkit.org/show_bug.cgi?id=193412
Reviewed by Eric Carlson.
Update AVVideoCaptureSource to compute the size given to settings after rotating the sample.
This ensures computing the size of video elements appropriately.
Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size.
Covered by manual testing as we do not have yet emulation of local capture with rotation.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setIntrinsicSize):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settings):
(WebCore::AVVideoCaptureSource::computeSampleRotation):
2019-01-15 Chris Dumez <cdumez@apple.com>
Regression(PSON) View becomes blank after click a cross-site download link
https://bugs.webkit.org/show_bug.cgi?id=193361
<rdar://problem/47099573>
Reviewed by Geoff Garen.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
When restoring from PageCache, make sure we notify the client that the load was committed
*before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy
logic in the UIProcess.
2019-01-15 Zalan Bujtas <zalan@apple.com>
[LFC][Out-of-flow] Ignore bottom when the vertical values are over-constrained
https://bugs.webkit.org/show_bug.cgi?id=193448
Reviewed by Antti Koivisto.
Add missing check. We should only resolve auto values.
Test: fast/block/block-only/non-auto-top-bottom-left-right-widht-height-out-of-flow.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2019-01-15 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: provide a way to determine whether a give node has event listeners
https://bugs.webkit.org/show_bug.cgi?id=193226
<rdar://problem/46800005>
Reviewed by Joseph Pecoraro.
Test: inspector/audit/run-dom.html
* inspector/InspectorAuditDOMObject.idl:
* inspector/InspectorAuditDOMObject.h:
* inspector/InspectorAuditDOMObject.cpp:
(WebCore::InspectorAuditDOMObject::hasEventListeners): Added.
2019-01-15 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: provide a way to query for all nodes with a given computed Accessibility role
https://bugs.webkit.org/show_bug.cgi?id=193228
<rdar://problem/46787787>
Reviewed by Joseph Pecoraro.
Test: inspector/audit/run-accessibility.html
* inspector/InspectorAuditAccessibilityObject.idl:
* inspector/InspectorAuditAccessibilityObject.h:
* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::accessiblityObjectForNode): Added.
(WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole): Added.
2019-01-15 Simon Fraser <simon.fraser@apple.com>
Simplify isRunningAnimationOnRenderer()
https://bugs.webkit.org/show_bug.cgi?id=193435
Reviewed by Darin Adler.
All callers of CSSAnimationController::isRunningAnimationOnRenderer() pass AnimationBase::Running | AnimationBase::Paused,
so we can remove the parameter and just hardcode this behavior.
This will simplify a later patch that needs to consider state changes between running and not running.
No behavior change.
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::isAnimatingProperty const):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::isRunningAnimationOnRenderer const):
(WebCore::CSSAnimationControllerPrivate::isRunningAcceleratedAnimationOnRenderer const):
(WebCore::CSSAnimationControllerPrivate::computeExtentOfAnimation const):
(WebCore::CSSAnimationController::isRunningAnimationOnRenderer const):
(WebCore::CSSAnimationController::isRunningAcceleratedAnimationOnRenderer const):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::isAnimatingProperty const):
* page/animation/CompositeAnimation.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
2019-01-15 Antti Koivisto <antti@apple.com>
Remove unused fields from Scrollbar
https://bugs.webkit.org/show_bug.cgi?id=193442
Reviewed by Zalan Bujtas.
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
* platform/Scrollbar.h:
(WebCore::Scrollbar::isCustomScrollbar const):
Make virtual so it doesn't need a bit.
(WebCore::Scrollbar::isAlphaLocked const): Deleted.
(WebCore::Scrollbar::setIsAlphaLocked): Deleted.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
* rendering/RenderScrollbar.cpp:
(WebCore::RenderScrollbar::RenderScrollbar):
* rendering/RenderScrollbar.h:
2019-01-15 Zalan Bujtas <zalan@apple.com>
[LFC] Use the containing block's padding box to position out-of-flow elements.
https://bugs.webkit.org/show_bug.cgi?id=193431
Reviewed by Antti Koivisto.
If the element has 'position: absolute', the containing block is established by the nearest ancestor
with a 'position' of 'absolute', 'relative' or 'fixed', in the following way:
1. In the case that the ancestor is an inline element, the containing block is the bounding box around the padding
boxes of the first and the last inline boxes generated for that element. In CSS 2.2, if the inline element is split
across multiple lines, the containing block is undefined.
2. Otherwise, the containing block is formed by the padding edge of the ancestor.
This patch covers #2.
Test: fast/block/block-only/out-of-flow-with-containing-block-border-padding.html
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::contentBoxTop const):
(WebCore::Display::Box::contentBoxLeft const):
(WebCore::Display::Box::paddingBoxTop const):
(WebCore::Display::Box::paddingBoxLeft const):
(WebCore::Display::Box::paddingBoxBottom const):
(WebCore::Display::Box::paddingBoxRight const):
(WebCore::Display::Box::paddingBoxHeight const):
(WebCore::Display::Box::paddingBoxWidth const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-11 Antoine Quint <graouts@apple.com>
Support parsing of additional values for the touch-action property
https://bugs.webkit.org/show_bug.cgi?id=193314
<rdar://problem/47176519>
Reviewed by Dean Jackson.
We add parsing support for the "none", "pan-x", "pan-y" and "pinch-zoom" values of the CSS "touch-action" property.
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::touchActionFlagsToCSSValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator OptionSet<TouchAction> const):
(WebCore::CSSPrimitiveValue::operator TouchAction const): Deleted.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTouchAction):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTouchAction):
* dom/Element.cpp:
(WebCore::Element::allowsDoubleTapGesture const):
* platform/TouchAction.h: Added.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::touchActions const):
(WebCore::RenderStyle::setTouchActions):
(WebCore::RenderStyle::initialTouchActions):
(WebCore::RenderStyle::touchAction const): Deleted.
(WebCore::RenderStyle::setTouchAction): Deleted.
(WebCore::RenderStyle::initialTouchAction): Deleted.
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
2019-01-15 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: create new IDL type for exposing special functionality in test context
https://bugs.webkit.org/show_bug.cgi?id=193149
<rdar://problem/46801218>
Reviewed by Joseph Pecoraro.
Tests: inspector/audit/run.html
inspector/audit/setup.html
inspector/audit/teardown.html
Create a new `AuditAgent` (and various subclasses for different inspection targets), as well
as `InspectorAuditAccessibilityObject` and `InspectorAuditDOMObject` objects that will
be injected into the test function to allow for more advanced testing.
* inspector/InspectorAuditAccessibilityObject.idl: Added.
* inspector/InspectorAuditAccessibilityObject.h: Added.
(WebCore::InspectorAuditAccessibilityObject::create):
* inspector/InspectorAuditAccessibilityObject.cpp: Added.
(WebCore::InspectorAuditAccessibilityObject::InspectorAuditAccessibilityObject):
* inspector/InspectorAuditDOMObject.idl: Added.
* inspector/InspectorAuditDOMObject.h: Added.
(WebCore::InspectorAuditDOMObject::create):
* inspector/InspectorAuditDOMObject.cpp: Added.
(WebCore::InspectorAuditDOMObject::InspectorAuditDOMObject):
* inspector/agents/page/PageAuditAgent.h: Added.
* inspector/agents/page/PageAuditAgent.cpp: Added.
(WebCore::PageAuditAgent::PageAuditAgent):
(WebCore::PageAuditAgent::injectedScriptForEval):
(WebCore::PageAuditAgent::populateAuditObject):
(WebCore::PageAuditAgent::muteConsole):
(WebCore::PageAuditAgent::unmuteConsole):
* inspector/agents/worker/WorkerAuditAgent.h: Added.
* inspector/agents/worker/WorkerAuditAgent.cpp: Added.
(WebCore::WorkerAuditAgent::WorkerAuditAgent):
(WebCore::WorkerAuditAgent::injectedScriptForEval):
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::createLazyAgents):
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
2019-01-14 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement the Type Checker
https://bugs.webkit.org/show_bug.cgi?id=193080
Reviewed by Dean Jackson.
This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Source/Checker.mjs into C++.
The Checker passes types between nested expressions. An inner expression figures out what type it is, and
passes that information up to an outer expression. This is done via reading/writing into a HashMap,
because all the type information needs to be saved so that the Metal codegen can emit the correct types.
These types can have two forms: A regular type (like "int[]") or a ResolvableType. ResolvableTypes
represent literals, since a literal needs to know its context before it knows what type it should be. So,
if you have a function like "void foo(int x)" and you have a call like "foo(3)", the 3's ResolvableType
gets passed to the CallExpression, which then unifies it with the function's parameter type, thereby
resolving the 3 to be an int.
There are a few examples where multiple expressions will have the same type: "return (foo, 3)." If those
types are regular types, then it's no problem; we can just clone() the type and stick both in the HashMap.
However, if the type is a ResolvableType, an outer expression will only resolve that type once, so the two
ResolvableTypes can't be distinct. The Checker solves this problem by making a reference-counted wrapper
around ResolvableTypes and using that in the HashMap instead.
Once all the ResolvableTypes have been resolved, a second pass runs through the entire HashMap and assigns
the known types to all the expressions. LValues and their associated address spaces are held in a parallel
HashMap, and are assigned to the expression at the same time. The type is an Optional<AddressSpace> because
address spaces are only relevant if the value is an lvalue; if it's nullopt then that means the expression
is an rvalue.
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/WHLSLChecker.cpp: Added.
(WebCore::WHLSL::resolveWithOperatorAnderIndexer):
(WebCore::WHLSL::resolveWithOperatorLength):
(WebCore::WHLSL::resolveWithReferenceComparator):
(WebCore::WHLSL::resolveByInstantiation):
(WebCore::WHLSL::checkSemantics):
(WebCore::WHLSL::checkOperatorOverload):
(WebCore::WHLSL::Checker::Checker):
(WebCore::WHLSL::Checker::visit):
(WebCore::WHLSL::Checker::assignTypes):
(WebCore::WHLSL::Checker::checkShaderType):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::Checker::recurseAndGetInfo):
(WebCore::WHLSL::Checker::getInfo):
(WebCore::WHLSL::Checker::assignType):
(WebCore::WHLSL::Checker::forwardType):
(WebCore::WHLSL::getUnnamedType):
(WebCore::WHLSL::Checker::finishVisitingPropertyAccess):
(WebCore::WHLSL::Checker::recurseAndWrapBaseType):
(WebCore::WHLSL::Checker::isBoolType):
(WebCore::WHLSL::Checker::recurseAndRequireBoolType):
(WebCore::WHLSL::check):
* Modules/webgpu/WHLSL/WHLSLChecker.h: Added.
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp: Added.
(WebCore::WHLSL::Gatherer::Gatherer):
(WebCore::WHLSL::Gatherer::reset):
(WebCore::WHLSL::Gatherer::takeEntryPointItems):
(WebCore::WHLSL::Gatherer::visit):
(WebCore::WHLSL::gatherEntryPointItems):
* Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h: Added.
(WebCore::WHLSL::EntryPointItem::EntryPointItem):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-14 Alex Christensen <achristensen@webkit.org>
Split headerValueForVary into specialized functions for NetworkProcess and WebProcess/WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=193429
Reviewed by Joseph Pecoraro.
headerValueForVary is a strange function that is causing trouble with my NetworkProcess global state removal project.
It currently accesses the cookie storage to see if there's a match in two different ways currently written as fallbacks.
In the WebProcess or in WebKitLegacy, it uses cookiesStrategy to access cookies via IPC or directly, respectively,
depending on the PlatformStrategies implementation of cookiesStrategy for that process.
In the NetworkProcess, it uses WebCore::NetworkStorageSession to access cookies directly.
Both of these cookie accessing methods use global state in the process, and I must split them to refactor them separately.
This patch does the split by passing in the method of cookie access: a CookiesStrategy& or a NetworkStorageSession&.
Further refactoring will be done in bug 193368 and bug 161106 to build on this and replace the global state with
member variables of the correct containing objects.
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setResponse):
(WebCore::CachedResource::varyHeaderValuesMatch):
* platform/network/CacheValidation.cpp:
(WebCore::cookieRequestHeaderFieldValue):
(WebCore::headerValueForVary):
(WebCore::collectVaryingRequestHeaders):
(WebCore::verifyVaryingRequestHeaders):
* platform/network/CacheValidation.h:
2019-01-14 Simon Fraser <simon.fraser@apple.com>
Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections
https://bugs.webkit.org/show_bug.cgi?id=193416
Reviewed by Wenson Hsieh.
The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and
it shows up on Speedometer profiles so optimize to only run this code if we have a selection range.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification):
2019-01-14 Simon Fraser <simon.fraser@apple.com>
Animation and other code is too aggressive about invalidating layer composition
https://bugs.webkit.org/show_bug.cgi?id=193343
Reviewed by Antoine Quint.
We used to have the concept of a "SyntheticStyleChange", which was used to trigger
style updates for animation, and also to get compositing updated.
That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes
a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work,
and dirties DOM touch event regions (which can be expensive to update).
However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger
compositing, and doing so from animations caused excessive touch event regions on yahoo.com,
which has several visibility:hidden elements with background-position animation.
So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead
call just invalidateStyle().
Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to
do so, because fireAnimationEventsIfNeeded() can run the state machine and change state.
* animation/KeyframeEffect.cpp:
(WebCore::invalidateElement):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::setNeedsStyleRecalc):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimations):
(WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle):
(WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime):
(WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime):
(WebCore::CSSAnimationController::cancelAnimations):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::animate):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::imageChanged):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/svg/SVGResourcesCache.cpp:
(WebCore::SVGResourcesCache::clientStyleChanged):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* svg/SVGAnimateElementBase.cpp:
(WebCore::applyCSSPropertyToTarget):
(WebCore::removeCSSPropertyFromTarget):
2019-01-14 Sihui Liu <sihui_liu@apple.com>
IndexedDB: When deleting databases, some open databases might be missed
https://bugs.webkit.org/show_bug.cgi?id=193090
Reviewed by Brady Eidson.
We should close all databases with an open backing store instead of looking at which ones have an open database
connection. This is because a database might be in the process of getting a backing store before its connection
has been created.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
2019-01-14 Ryosuke Niwa <rniwa@webkit.org>
Remove redundant check for alignAttr and hiddenAttr in various isPresentationAttribute overrides
https://bugs.webkit.org/show_bug.cgi?id=193410
Reviewed by Simon Fraser.
Removed redundant checks for check for alignAttr and hiddenAttr in isPresentationAttribute overrides
in HTMLElement subclasses since HTMLElement::isPresentationAttribute already checks for those attributes.
* html/HTMLDivElement.cpp:
(WebCore::HTMLDivElement::isPresentationAttribute const): Deleted.
* html/HTMLDivElement.h:
* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::isPresentationAttribute const): Deleted.
* html/HTMLEmbedElement.h:
* html/HTMLHRElement.cpp:
(WebCore::HTMLHRElement::isPresentationAttribute const):
* html/HTMLIFrameElement.cpp:
(WebCore::HTMLIFrameElement::isPresentationAttribute const):
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::isPresentationAttribute const):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::isPresentationAttribute const):
* html/HTMLParagraphElement.cpp:
(WebCore::HTMLParagraphElement::isPresentationAttribute const): Deleted.
* html/HTMLParagraphElement.h:
* html/HTMLTableCaptionElement.cpp:
(WebCore::HTMLTableCaptionElement::isPresentationAttribute const): Deleted.
* html/HTMLTableCaptionElement.h:
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::isPresentationAttribute const):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::isPresentationAttribute const):
2019-01-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239901, r239909, r239910, r239912,
r239913, and r239914.
https://bugs.webkit.org/show_bug.cgi?id=193407
These revisions caused an internal failure (Requested by
Truitt on #webkit).
Reverted changesets:
"[Cocoa] Avoid importing directly from subumbrella frameworks"
https://bugs.webkit.org/show_bug.cgi?id=186016
https://trac.webkit.org/changeset/239901
"Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901."
https://trac.webkit.org/changeset/239909
"Tried to fix the build."
https://trac.webkit.org/changeset/239910
"Fixed iOS builds after r239910."
https://trac.webkit.org/changeset/239912
"More build fixing."
https://trac.webkit.org/changeset/239913
"Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds."
https://trac.webkit.org/changeset/239914
2019-01-14 Mark Lam <mark.lam@apple.com>
Re-enable ability to build --cloop builds.
https://bugs.webkit.org/show_bug.cgi?id=192955
Reviewed by Saam barati and Keith Miller.
* Configurations/FeatureDefines.xcconfig:
2019-01-14 Jer Noble <jer.noble@apple.com>
https://bugs.webkit.org/show_bug.cgi?id=193403
<rdar://problem/46750743>
Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC.
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
2019-01-14 Justin Fan <justin_fan@apple.com>
[WebGPU] Map WebGPUBindGroupLayoutBindings from the BindGroupLayoutDescriptor for error checking and later referencing
https://bugs.webkit.org/show_bug.cgi?id=193405
Reviewed by Dean Jackson.
When creating a WebGPUBindGroupLayout, cache the WebGPUBindGroupLayoutDescriptor's list of BindGroupLayoutBindings
in a HashMap, keyed by binding number, for quick reference during the WebGPUProgrammablePassEncoder::setBindGroups
implementation to follow. Also add error-checking e.g. detecting duplicate binding numbers in the same WebGPUBindGroupLayout
and non-existent binding numbers when creating the WebGPUBindGroup.
No new tests. BindGroups and BindGroupLayouts reflect the (canonical?) strategy of returning empty
objects upon creation failure and reporting errors elswhere. Since error reporting is not yet implemented,
the error checks aren't testable from LayoutTests right now. Expected behavior unchanged and covered by existing tests.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroup const):
Number of bindings must be consistent between bindings and layout bindings.
BindGroupBindings should only refer to existing BindGroupLayoutBindings.
* platform/graphics/gpu/GPUBindGroup.h:
* platform/graphics/gpu/GPUBindGroupLayout.h:
(WebCore::GPUBindGroupLayout::bindingsMap const): Added. Cache map of BindGroupLayoutBindings.
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Disallow duplicate binding numbers in BindGroupLayoutBindings.
(WebCore::GPUBindGroupLayout::tryCreate):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
2019-01-14 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Assorted cleanup
https://bugs.webkit.org/show_bug.cgi?id=193389
Reviewed by Dean Jackson.
This is a bunch of non-behavior-changing cleanup.
- The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore,
we don't need to static_cast<T&> everywhere.
- ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so
this patch deletes the longer-named class in favor of the shorter-named class.
- Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be
used by files that FunctionDeclaration depends on. Same thing for AddressSpace.
- EnumTypes have to have non-null base types. The parser will make sure this is always true.
No new tests because there is no behavior change.
* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::type const):
(WebCore::WHLSL::AST::ArrayType::type):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
(WebCore::WHLSL::AST::AssignmentExpression::left):
(WebCore::WHLSL::AST::AssignmentExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
(WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
(WebCore::WHLSL::AST::ConstantExpression::clone const):
(WebCore::WHLSL::AST::ConstantExpression::matches const):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
(WebCore::WHLSL::AST::DereferenceExpression::pointer):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
(WebCore::WHLSL::AST::DoWhileLoop::body):
(WebCore::WHLSL::AST::DoWhileLoop::conditional):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
(WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
(WebCore::WHLSL::AST::EnumerationDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::left const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::right const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::type):
(WebCore::WHLSL::AST::Expression::setType):
(WebCore::WHLSL::AST::Expression::addressSpace const):
(WebCore::WHLSL::AST::Expression::setAddressSpace):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
(WebCore::WHLSL::AST::FloatLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
(WebCore::WHLSL::AST::ForLoop::condition):
(WebCore::WHLSL::AST::ForLoop::increment):
(WebCore::WHLSL::AST::ForLoop::body):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::type const):
(WebCore::WHLSL::AST::FunctionDeclaration::type):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
(WebCore::WHLSL::AST::IfStatement::conditional):
(WebCore::WHLSL::AST::IfStatement::body):
(WebCore::WHLSL::AST::IfStatement::elseBody):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
(WebCore::WHLSL::AST::IndexExpression::indexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
(WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
(WebCore::WHLSL::AST::LogicalExpression::left):
(WebCore::WHLSL::AST::LogicalExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
(WebCore::WHLSL::AST::LogicalNotExpression::operand):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
(WebCore::WHLSL::AST::MakePointerExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
(WebCore::WHLSL::AST::PropertyAccessExpression::base):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
(WebCore::WHLSL::AST::ReferenceType::elementType const):
(WebCore::WHLSL::AST::ReferenceType::elementType):
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
(WebCore::WHLSL::AST::ResolvableType::resolvedType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
(WebCore::WHLSL::AST::Return::value):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::type):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
(WebCore::WHLSL::AST::SwitchStatement::value):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
(WebCore::WHLSL::AST::TernaryExpression::predicate):
(WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
(WebCore::WHLSL::AST::TernaryExpression::elseExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
(WebCore::WHLSL::AST::TypeDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
(WebCore::WHLSL::AST::VariableDeclaration::type):
(WebCore::WHLSL::AST::VariableDeclaration::initializer):
(WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
(WebCore::WHLSL::AST::WhileLoop::conditional):
(WebCore::WHLSL::AST::WhileLoop::body):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::commit):
(WebCore::WHLSL::inferTypesForTypeArguments):
(WebCore::WHLSL::inferTypesForCall):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append):
* 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:
* WebCore.xcodeproj/project.pbxproj:
2019-01-14 Zan Dobersek <zdobersek@igalia.com>
DOMCacheStorage: use-after-move in doSequentialMatch()
https://bugs.webkit.org/show_bug.cgi?id=193396
Reviewed by Youenn Fablet.
Depending on the platform- and compiler-specific calling conventions,
the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
object into the callback lambda before the DOMCache object at the
specified index is retrieved for the DOMCache::doMatch() invocation.
This problem is now avoided by retrieving reference to the target
DOMCache object in an earlier expression.
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::doSequentialMatch):
2019-01-14 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Add basic box-sizing support.
https://bugs.webkit.org/show_bug.cgi?id=193392
Reviewed by Antti Koivisto.
No min/max support yet.
Test: fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-14 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
https://bugs.webkit.org/show_bug.cgi?id=193397
This was necessary but wasn't done.
Reviewed by Philippe Normand.
No test required as this fixes a regression in all WebRTC tests when built in debug mode.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
2019-01-14 Zan Dobersek <zdobersek@igalia.com>
Unreviewed WPE debug build fix after r239921.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fix the assert that checks the
size of the mapped buffer containing IV data.
2019-01-14 Charlie Turner <cturner@igalia.com>
[GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
https://bugs.webkit.org/show_bug.cgi?id=192977
Reviewed by Carlos Garcia Campos.
Add a utility method on GstMappedBuffer to return a SharedBuffer
view over the mapped data with no copies.
This patch also introduces a new gstreamer port API test
directory, and includes some tests for GstMappedBuffer.
New tests in the API section.
* platform/SharedBuffer.cpp: Add a new overload for
GstMappedBuffer that allows sharing the mapped GStreamer buffers
with zero copies.
(WebCore::SharedBuffer::create):
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::size const):
* platform/SharedBuffer.h:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcAllocateBuffersAndRenderAudio): Update to new
API.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::GstMappedBuffer::createSharedBuffer): Return a shared
buffer sharing this mapped buffer. The buffer must be shareable to
use this method.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): Make GstMappedBuffer RefCounted
(WebCore::GstMappedBuffer::~GstMappedBuffer):
(WebCore::GstMappedBuffer::data):
(WebCore::GstMappedBuffer::data const):
(WebCore::GstMappedBuffer::size const):
(WebCore::GstMappedBuffer::isSharable const): New predicate to
check whether this buffer can be shared (i.e., is not writable)
(WebCore::GstMappedBuffer::GstMappedBuffer):
(WebCore::GstMappedBuffer::operator bool const): Deleted.
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
Update to use new API.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::InitData::InitData): Ditto.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorFindAndSetKey): Ditto.
(webKitMediaClearKeyDecryptorDecrypt): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::render): Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): Ditto.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::Fragmentize): Ditto.
2019-01-14 Karl Leplat <karl.leplat_ext@softathome.com>
[GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
https://bugs.webkit.org/show_bug.cgi?id=193239
Reviewed by Žan Doberšek.
Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
when invalidating the CoordinatedBackingStore areas.
2019-01-13 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Support emoji modifiers
https://bugs.webkit.org/show_bug.cgi?id=177040
Reviewed by Myles C. Maxfield.
The problem only happens with emojis having the zero with joiner (U+200D) in the sequence. The sequence is
broken because createAndFillGlyphPage() in Font.cpp overwrites zero with joiner with zero width space (U+200B),
but the emoji font actually supports zero with joiner. This patch moves the control characters override from
createAndFillGlyphPage() to GlyphPage::fill() only for FreeType based ports. This way we can do the override
only for the cases where the code point is not supported by the font.
* platform/graphics/Font.cpp:
(WebCore::overrideControlCharacters): Helper function to override the control characters.
(WebCore::createAndFillGlyphPage): Call overrideControlCharacters() only when not using FreeType.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill): Use zero width space as fallback when the font doesn't support characters with
Default_Ignorable Unicode property.
2019-01-13 Dan Bernstein <mitz@apple.com>
More build fixing.
* editing/cocoa/DictionaryLookup.mm:
2019-01-13 Simon Fraser <simon.fraser@apple.com>
Minor optimization to RenderText::setRenderedText()
https://bugs.webkit.org/show_bug.cgi?id=193388
Reviewed by Ryosuke Niwa.
Avoid the call to applyTextTransform() if TextTransform is None, so that we don't
have to call previousCharacter() and reassign m_text.
Similar optimization in RenderText::textWithoutConvertingBackslashToYenSymbol().
Speedometer profiles show a few samples here, but this isn't going to win any prizes.
* rendering/RenderText.cpp:
(WebCore::RenderText::setRenderedText):
(WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):
2019-01-13 Dan Bernstein <mitz@apple.com>
Tried to fix the build.
* editing/cocoa/DictionaryLookup.mm:
2019-01-13 Dan Bernstein <mitz@apple.com>
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
Patch by Keith Rollin.
* accessibility/mac/AXObjectCacheMac.mm:
2019-01-13 Zalan Bujtas <zalan@apple.com>
[LFC] Adjust assert for statically positioned fixed elements
https://bugs.webkit.org/show_bug.cgi?id=193385
Reviewed by Antti Koivisto.
While computing the static position and traversing the ancestor chain, we can surely hit a positioned container
(since we need to go all the way up to the initial containing block).
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2019-01-13 Antti Koivisto <antti@apple.com>
Release assert with <img usemap> in shadow tree
https://bugs.webkit.org/show_bug.cgi?id=193378
Reviewed by Ryosuke Niwa.
When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try
to remove the map from the scope of the host.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::removedFromAncestor):
Tree scope changes are relevant, not the connection to the document.
2019-01-12 Timothy Hatcher <timothy@apple.com>
Have prefers-color-scheme: light always match on macOS versions before Mojave.
https://bugs.webkit.org/show_bug.cgi?id=191655
rdar://problem/46074680
Reviewed by Megan Gardner.
Tests: css-dark-mode/older-systems/prefers-color-scheme.html
css-dark-mode/older-systems/supported-color-schemes-css.html
css-dark-mode/older-systems/supported-color-schemes.html
Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.
* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::useDarkAppearance const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::enable):
* page/Page.cpp:
(WebCore::Page::setUseDarkAppearance):
(WebCore::Page::useDarkAppearance const):
(WebCore::Page::setUseDarkAppearanceOverride):
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ScrollAnimatorMac.mm:
* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
(-[WebListButtonCell drawWithFrame:inView:]):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::systemColor const):
2019-01-12 Zalan Bujtas <zalan@apple.com>
[LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
https://bugs.webkit.org/show_bug.cgi?id=193383
Reviewed by Antti Koivisto.
This is just a downcast really.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::formattingState const): Deleted.
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::createFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::formattingState const):
(WebCore::Layout::BlockFormattingContext::blockFormattingState const): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::formattingState const):
(WebCore::Layout::InlineFormattingContext::inlineFormattingState const): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-12 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add native function synthesis passes
https://bugs.webkit.org/show_bug.cgi?id=193360
Reviewed by Dean Jackson.
This patch includes all the passes in prepare() that are between the name resolver and the
type checker. It involves a few small pieces:
- CheckDuplicateFunctions which makes sure the same function isn't defined twice
- Intrinsics, which remembers all of the native types so they can be referred to by the
rest of the compiler
- RecursiveTypeChecker which makes sure types don't refer to themselves
- SynthesizeArrayOperatorLength which creates operator.length() functions for arrays
- SynthesizeConstructors which creates copy constructors and default constructors for all
types
- SynthesizeEnumerationFunctions which provides cast operators between enum types and their
base types
- SynthesizeStructureAccessors which provides getters, setters, and anders for each member
of a struct
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Added.
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Added.
(WebCore::WHLSL::Intrinsics::Intrinsics):
(WebCore::WHLSL::Intrinsics::add):
(WebCore::WHLSL::Intrinsics::addPrimitive):
(WebCore::WHLSL::Intrinsics::addVector):
(WebCore::WHLSL::Intrinsics::addMatrix):
(WebCore::WHLSL::Intrinsics::addFullTexture):
(WebCore::WHLSL::Intrinsics::addDepthTexture):
(WebCore::WHLSL::Intrinsics::addTexture):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Added.
(WebCore::WHLSL::Intrinsics::voidType const):
(WebCore::WHLSL::Intrinsics::boolType const):
(WebCore::WHLSL::Intrinsics::intType const):
(WebCore::WHLSL::Intrinsics::uintType const):
(WebCore::WHLSL::Intrinsics::samplerType const):
(WebCore::WHLSL::Intrinsics::floatType const):
(WebCore::WHLSL::Intrinsics::float3Type const):
(WebCore::WHLSL::Intrinsics::float4Type const):
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append):
(WebCore::WHLSL::Program::intrinsics):
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Added.
(WebCore::WHLSL::checkRecursiveTypes):
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Added.
(WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Added.
(WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
(WebCore::WHLSL::FindAllTypes::takeNamedTypes):
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Added.
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Added.
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Avoid importing directly from subumbrella frameworks
https://bugs.webkit.org/show_bug.cgi?id=186016
<rdar://problem/40591038>
Reviewed by Sam Weinig.
* Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
OTHER_CPLUSPLUSFLAGS.
* editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
* platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
* platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
2019-01-12 Zalan Bujtas <zalan@apple.com>
[LFC] Move formatting context creation from FormattingState to LayoutState
https://bugs.webkit.org/show_bug.cgi?id=193381
Reviewed by Antti Koivisto.
layoutState().createFormattingStateForFormattingRootIfNeeded(root).createFormattingContext(root) is not only mouthful
but also feels unintuitive. Use layoutState().createFormattingContext(root) instead.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::~FormattingContext):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/FormattingState.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::createFormattingContext):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::deregisterFormattingContext):
(WebCore::Layout::LayoutState::registerFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::createFormattingContext): Deleted.
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::createFormattingContext): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
2019-01-12 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Move estimatedMarginBefore flag from state/display box to BlockFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=193375
Reviewed by Antti Koivisto.
The estimated marginBefore is a pre-computed, temporary value. We need to keep it around until the final vertical margin value is computed.
Neither BlockFormattingState nor Display should hold temporary values.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
(WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const):
(WebCore::Layout::hasPrecomputedMarginBefore): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::estimatedMarginBefore const):
* layout/blockformatting/BlockFormattingState.h:
(WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasEstimatedMarginBefore):
(WebCore::Display::Box::invalidateEstimatedMarginBefore):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::setEstimatedMarginBefore): Deleted.
(WebCore::Display::Box::estimatedMarginBefore const): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement the NameResolver
https://bugs.webkit.org/show_bug.cgi?id=193007
Reviewed by Dean Jackson.
This is the base implementation for WHLSL's name resolver. The name resolver matches three kinds of things:
1. It matches VariableRefs to VariableDecls
2. It matches TypeRefs to NamedTypes
3. It matches CallExpressions to FunctionDeclarations
No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Now that InferTypes.h exists, we can implement these
functions.
(WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Remove unnecessary function.
(WebCore::WHLSL::AST::FloatLiteralType::value const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement these
functions.
(WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Remove unnecessary function.
(WebCore::WHLSL::AST::IntegerLiteralType::value const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Modifying Sources.txt caused the sources
to get shuffled around, so the #includes need to be fixed.
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement
these functions.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Remove unnecessary function.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const): Deleted.
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Added. This is the replacement for UnificationContext in the
reference compiler. It's much simpler (and we should remove UnificationContext in the reference compiler in
favor of this design). It has three sets of functions: Tell if two types are the same, tell if two types are
the same and commit the resolvable type, and run the above functions on type references or function arguments.
(WebCore::WHLSL::matches):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::commit):
(WebCore::WHLSL::inferTypesForTypeArguments):
(WebCore::WHLSL::inferTypesForCall):
* Modules/webgpu/WHLSL/WHLSLInferTypes.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Added. This is the data structure that remembers NamedTypes,
FunctionDeclarations, and VariableDeclarations so NameResolver can work.
(WebCore::WHLSL::NameContext::NameContext):
(WebCore::WHLSL::NameContext::add):
(WebCore::WHLSL::NameContext::getTypes):
(WebCore::WHLSL::NameContext::getFunctions):
(WebCore::WHLSL::NameContext::getVariable):
(WebCore::WHLSL::NameContext::exists):
* Modules/webgpu/WHLSL/WHLSLNameContext.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Added. Use the NameContext to match up the three types of names.
(WebCore::WHLSL::NameResolver::NameResolver):
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
(WebCore::WHLSL::NameResolver::setCurrentFunctionDefinition):
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append): The parser needs to add all global declarations to the name context so the
name resolver is ready to go as soon as parsing is finished.
(WebCore::WHLSL::Program::nameContext):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Added. Pick the appropriate FunctionDeclaration or
NamedType for a particular CallExpression or TypeReference.
(WebCore::WHLSL::conversionCost):
(WebCore::WHLSL::resolveFunctionOverloadImpl):
(WebCore::WHLSL::resolveTypeOverloadImpl):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
* Modules/webgpu/WHLSL/WHLSLResolvingType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp. This describes the two states that a type in the type resolver can be in: either an owned
UnnamedType, or a reference to a ResolvableType. This is because every expression needs to have a type
associated with it, but those types might be the type of a literal (aka a ResolvableType). Multiple
expressions might need to reference the same ResolvableType so when it gets resolved, all the expressions
get the result.
(WebCore::WHLSL::ResolvableTypeReference::ResolvableTypeReference):
(WebCore::WHLSL::ResolvableTypeReference::resolvableType):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add a Visitor class
https://bugs.webkit.org/show_bug.cgi?id=192826
Reviewed by Dean Jackson.
This patch exposes a bunch of the private members of WHLSL's AST nodes so that Visitor can recurse on constituent nodes.
It also writes the recursion in Visitor.h. This is a virtual base class that gets subclassed for compiler passes.
I've split this part into its own patch to aid reviewing of the compiler.
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Added.
(WebCore::WHLSL::Visitor::visit):
(WebCore::WHLSL::Visitor::checkErrorAndVisit):
* Modules/webgpu/WHLSL/WHLSLVisitor.h: Added.
(WebCore::WHLSL::Visitor::setError):
(WebCore::WHLSL::Visitor::error const):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-11 Jer Noble <jer.noble@apple.com>
REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
https://bugs.webkit.org/show_bug.cgi?id=193342
<rdar://problem/47119836>
Reviewed by Eric Carlson.
Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::initCallback):
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
2019-01-11 John Wilander <wilander@apple.com>
Compile out Web API Statistics Collection
https://bugs.webkit.org/show_bug.cgi?id=193370
<rdar://problem/45388584>
Reviewed by Brent Fulgham.
No new tests. This patch disables functionality. The associated tests
are skipped.
These functions are now no-ops unless web API statistics is enabled.
* Configurations/FeatureDefines.xcconfig:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
The associated struct members are skipped unless web API
statistics is enabled.
2019-01-11 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak WebIDBConnectionToClient for retain cycle
https://bugs.webkit.org/show_bug.cgi?id=193097
<rdar://problem/46899601>
Reviewed by Brady Eidson.
Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate.
* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
(WebCore::IDBServer::IDBConnectionToClient::identifier const):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
(WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
(WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
(WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
(WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
(WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd):
(WebCore::IDBServer::IDBConnectionToClient::didGetRecord):
(WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
(WebCore::IDBServer::IDBConnectionToClient::didGetCount):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord):
(WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
(WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
(WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction):
(WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent):
(WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
(WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer):
(WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:
2019-01-11 Myles C. Maxfield <mmaxfield@apple.com>
Fix the build after r239844
https://bugs.webkit.org/show_bug.cgi?id=192991
Unreviewed.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
2019-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Precision drop state thrashes when dragging near the top edge of an editable element
https://bugs.webkit.org/show_bug.cgi?id=193364
<rdar://problem/47214117>
Reviewed by Tim Horton.
Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop
caret position. This is either the enclosing form control (in the case of text fields and text areas), or the
highest editable root. See WebKit ChangeLog for more details.
Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea
* editing/FrameSelection.cpp:
(WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
* editing/FrameSelection.h:
2019-01-11 Tim Horton <timothy_horton@apple.com>
REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
https://bugs.webkit.org/show_bug.cgi?id=193366
<rdar://problem/46097212>
Reviewed by Simon Fraser.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isFirefox):
Add a Firefox Mobile bundle check.
2019-01-11 Antti Koivisto <antti@apple.com>
Release assert when removing element with a map element in the shadow tree
https://bugs.webkit.org/show_bug.cgi?id=193351
<rdar://problem/47208807>
Reviewed by Ryosuke Niwa.
When a shadow host that has a map element in the shadow tree is removed from the document, we try
to remove the map from the scope of the host.
Test: fast/shadow-dom/image-map-tree-scope.html
* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::insertedIntoAncestor):
(WebCore::HTMLMapElement::removedFromAncestor):
Add and remove image maps when the scope changes, not when the document changes.
This matches how id/name/etc updates work in the HTMLElement.
2019-01-11 Sihui Liu <sihui_liu@apple.com>
Fix an assertion in UniqueIDBDatabase
https://bugs.webkit.org/show_bug.cgi?id=193096
Reviewed by Brady Eidson.
m_objectStoreTransactionCounts.count(objectStore) == 1 in UniqueIDBDatabase::operationAndTransactionTimerFired()
is not necessarily true because m_objectStoreTransactionCounts may be cleared in immediateCloseForUserDelete.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2019-01-11 Miguel Gomez <magomez@igalia.com>
[GTK] Garbled rendering on Youtube while scrolling under X11.
https://bugs.webkit.org/show_bug.cgi?id=192982
Reviewed by Carlos Garcia Campos.
When creating a GLX window context, try to get a GLXFBConfig that has depth and stencil buffers for
the default framebuffer.
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::compatibleVisuals):
(WebCore::GLContextGLX::createWindowContext):
2019-01-11 Sihui Liu <sihui_liu@apple.com>
IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
https://bugs.webkit.org/show_bug.cgi?id=193167
<rdar://problem/46891688>
Reviewed by Geoffrey Garen.
Do some cleanup to break retain cycle when context is stopped.
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::cancelForStop):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::stop):
(WebCore::IDBTransaction::removeRequest):
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete):
2019-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=193109
<rdar://problem/44807048>
Reviewed by Ryosuke Niwa.
Adds new IDL files and stubs for UndoManager and UndoItem. This is an experimental DOM API that (in the near
future) is intended only for use in internal WebKit text editing clients. This API allows the page to
participate in the processes of undoing and redoing by defining custom undo and redo handlers, to be executed
when undo or redo is triggered.
Tests: editing/undo-manager/undo-manager-interfaces.html
editing/undo-manager/undo-manager-keeps-wrapper-alive.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
Add new source files.
* bindings/js/WebCoreBuiltinNames.h:
Add "UndoManager" and "UndoItem" names.
* dom/Document.cpp:
(WebCore::m_undoManager):
Have the document own a UndoManager.
* dom/Document.h:
(WebCore::Document::undoManager const):
* dom/Document.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled):
(WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const):
Guard the new bindings behind a runtime-enabled feature flag.
* page/UndoItem.h: Added.
(WebCore::UndoItem::create):
(WebCore::UndoItem::label const):
(WebCore::UndoItem::undoHandler const):
(WebCore::UndoItem::redoHandler const):
(WebCore::UndoItem::UndoItem):
* page/UndoItem.idl: Added.
* page/UndoManager.cpp: Added.
(WebCore::UndoManager::addItem):
* page/UndoManager.h: Added.
(WebCore::UndoManager::create):
(WebCore::UndoManager::document):
(WebCore::UndoManager::UndoManager):
* page/UndoManager.idl: Added.
* page/mac/WheelEventDeltaFilterMac.h:
Necessary (albeit unrelated) build fix to appease unified sources.
2019-01-11 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
https://bugs.webkit.org/show_bug.cgi?id=193346
Reviewed by Antti Koivisto.
If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.
1. If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
2. Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved.
The position of the element's top border edge is the same as it would have been if the element had a non-zero bottom border.
Test: fast/block/block-only/collapsed-through-with-parent.html
* layout/MarginTypes.h:
(WebCore::Layout::EstimatedMarginBefore::usedValue const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):
2019-01-10 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Include the standard library
https://bugs.webkit.org/show_bug.cgi?id=192994
Reviewed by Jon Lee.
A small section of the standard library is present in WHLSLStandardLibrary.txt. This gets turned into a header file containing
its raw data at build time by invoking our xxd.pl script (which WebCore already uses for other purposes). The standard
library is generated by running a JavaScript script, but currently there is no way to invoke JavaScript from our build
process, so this patch includes in the standard library's raw text instead. Once the parser is faster, we can include the
entire standard library.
No new tests because it isn't hooked up yet.
* DerivedSources.make:
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Added.
* WebCore.xcodeproj/project.pbxproj:
2019-01-10 Jer Noble <jer.noble@apple.com>
<video> elements do not enter 'paused' state when playing to end over AirPlay
https://bugs.webkit.org/show_bug.cgi?id=193295
<rdar://problem/46708670>
Reviewed by Eric Carlson.
Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting
for more data before playing. AirPlay devices report this state back from the remote device, and this allows the
MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling.
Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the
readyState > HAVE_ENOUGH as an intentional pause.
Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay()
until the first frame became available. But this code was entirely undermined by the previous
behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was
actually requested started making this code work for the first time, and broke some API tests.
Thus, we're removing this previously dead code.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
(WebCore::MediaPlayerPrivateAVFoundation::play):
(WebCore::MediaPlayerPrivateAVFoundation::pause):
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate):
(WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2019-01-10 Myles C. Maxfield <mmaxfield@apple.com>
Fix the build after r239844
https://bugs.webkit.org/show_bug.cgi?id=192991
Unreviewed.
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
2019-01-10 Justin Fan <justin_fan@apple.com>
[WebGPU] WebGPUBindGroup and device::createBindGroup prototype
https://bugs.webkit.org/show_bug.cgi?id=193341
Reviewed by Myles C. Maxfield.
Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.
Test: bind-groups.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* Modules/webgpu/WebGPUBindGroup.cpp:
(WebCore::WebGPUBindGroup::create):
(WebCore::WebGPUBindGroup::WebGPUBindGroup):
* Modules/webgpu/WebGPUBindGroup.h:
* Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
(WebCore::WebGPUDevice::createBindGroup const): Added.
* Modules/webgpu/WebGPUDevice.h:
* platform/graphics/gpu/GPUBindGroup.cpp:
(WebCore::GPUBindGroup::create):
(WebCore::GPUBindGroup::GPUBindGroup):
* platform/graphics/gpu/GPUBindGroup.h:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.
2019-01-10 Simon Fraser <simon.fraser@apple.com>
Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
https://bugs.webkit.org/show_bug.cgi?id=193337
rdar://problem/47179993
Reviewed by Zalan Bujtas.
Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
which tried to get at the platform context, and then crashed.
So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
that other scrollbar-related painting code paths were already protected.
Hard to test because it depends on async image decoding timing.
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
(WebCore::ScrollbarThemeMac::paintScrollCorner):
2019-01-10 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Implement parser AST nodes
https://bugs.webkit.org/show_bug.cgi?id=192991
Reviewed by Alex Christensen.
This patch creates all the AST nodes which will be the result of running the parser.
This patch used to be a part of the "create a WHLSL parser" patch but I split them
out in order to aid reviewing.
The classes were mechanically created to match the result of the parser. There are
nodes for things like ForLoops, LogicalNotExpressions, DereferenceExpressions,
StructureDefinitions, and things like that. The classes don't actually have any logic
in them - they are currently just containers to hold the structure of the parsed
program. Some of these nodes (like constexprs) are just Variants of the various things
they can in the form of.
No new tests because the parser doesn't exist to create the new AST nodes yet.
* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Added.
(WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Added.
(WebCore::WHLSL::AST::ArrayType::ArrayType):
(WebCore::WHLSL::AST::ArrayType::type const):
(WebCore::WHLSL::AST::ArrayType::type):
(WebCore::WHLSL::AST::ArrayType::numElements const):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Added.
(WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
(WebCore::WHLSL::AST::AssignmentExpression::left):
(WebCore::WHLSL::AST::AssignmentExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Added.
(WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Added.
(WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Added.
(WebCore::WHLSL::AST::Block::Block):
(WebCore::WHLSL::AST::Block::statements):
* Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Added.
(WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
(WebCore::WHLSL::AST::BooleanLiteral::value const):
(WebCore::WHLSL::AST::BooleanLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Added.
(WebCore::WHLSL::AST::Break::Break):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Added.
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Added.
(WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
(WebCore::WHLSL::AST::BuiltInSemantic::variable const):
(WebCore::WHLSL::AST::BuiltInSemantic::operator== const):
(WebCore::WHLSL::AST::BuiltInSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Added.
(WebCore::WHLSL::AST::CallExpression::CallExpression):
(WebCore::WHLSL::AST::CallExpression::arguments):
(WebCore::WHLSL::AST::CallExpression::name):
(WebCore::WHLSL::AST::CallExpression::setCastData):
(WebCore::WHLSL::AST::CallExpression::isCast):
(WebCore::WHLSL::AST::CallExpression::castReturnType):
(WebCore::WHLSL::AST::CallExpression::hasOverloads const):
(WebCore::WHLSL::AST::CallExpression::overloads):
(WebCore::WHLSL::AST::CallExpression::setOverloads):
(WebCore::WHLSL::AST::CallExpression::setFunction):
* Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Added.
(WebCore::WHLSL::AST::CommaExpression::CommaExpression):
(WebCore::WHLSL::AST::CommaExpression::list):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Added.
(WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
(WebCore::WHLSL::AST::ConstantExpression::integerLiteral):
(WebCore::WHLSL::AST::ConstantExpression::visit):
(WebCore::WHLSL::AST::ConstantExpression::visit const):
(WebCore::WHLSL::AST::ConstantExpression::clone const):
(WebCore::WHLSL::AST::ConstantExpression::matches const):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Added.
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::ConstantExpressionEnumerationMemberReference):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::left const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::right const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::clone const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::setEnumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Added.
(WebCore::WHLSL::AST::Continue::Continue):
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Added.
(WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
(WebCore::WHLSL::AST::DereferenceExpression::pointer):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Added.
(WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
(WebCore::WHLSL::AST::DoWhileLoop::body):
(WebCore::WHLSL::AST::DoWhileLoop::conditional):
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Added.
(WebCore::WHLSL::AST::DotExpression::DotExpression):
(WebCore::WHLSL::AST::DotExpression::fieldName):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Added.
(WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
(WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Added.
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
(WebCore::WHLSL::AST::EnumerationDefinition::type):
(WebCore::WHLSL::AST::EnumerationDefinition::add):
(WebCore::WHLSL::AST::EnumerationDefinition::memberByName):
(WebCore::WHLSL::AST::EnumerationDefinition::enumerationMembers):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Added.
(WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
(WebCore::WHLSL::AST::EnumerationMember::origin const):
(WebCore::WHLSL::AST::EnumerationMember::name):
(WebCore::WHLSL::AST::EnumerationMember::value):
(WebCore::WHLSL::AST::EnumerationMember::setValue):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Added.
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Added.
(WebCore::WHLSL::AST::Expression::Expression):
(WebCore::WHLSL::AST::Expression::origin const):
(WebCore::WHLSL::AST::Expression::isAssignmentExpression const):
(WebCore::WHLSL::AST::Expression::isBooleanLiteral const):
(WebCore::WHLSL::AST::Expression::isCallExpression const):
(WebCore::WHLSL::AST::Expression::isCommaExpression const):
(WebCore::WHLSL::AST::Expression::isDereferenceExpression const):
(WebCore::WHLSL::AST::Expression::isDotExpression const):
(WebCore::WHLSL::AST::Expression::isFloatLiteral const):
(WebCore::WHLSL::AST::Expression::isIndexExpression const):
(WebCore::WHLSL::AST::Expression::isIntegerLiteral const):
(WebCore::WHLSL::AST::Expression::isLogicalExpression const):
(WebCore::WHLSL::AST::Expression::isLogicalNotExpression const):
(WebCore::WHLSL::AST::Expression::isMakeArrayReferenceExpression const):
(WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
(WebCore::WHLSL::AST::Expression::isNullLiteral const):
(WebCore::WHLSL::AST::Expression::isPropertyAccessExpression const):
(WebCore::WHLSL::AST::Expression::isReadModifyWriteExpression const):
(WebCore::WHLSL::AST::Expression::isTernaryExpression const):
(WebCore::WHLSL::AST::Expression::isUnsignedIntegerLiteral const):
(WebCore::WHLSL::AST::Expression::isVariableReference const):
(WebCore::WHLSL::AST::Expression::isEnumerationMemberLiteral const):
* Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Added.
(WebCore::WHLSL::AST::Fallthrough::Fallthrough):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Added.
(WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
(WebCore::WHLSL::AST::FloatLiteral::type):
(WebCore::WHLSL::AST::FloatLiteral::value const):
(WebCore::WHLSL::AST::FloatLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Added.
(WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
(WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Added.
(WebCore::WHLSL::AST::FloatLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Added.
(WebCore::WHLSL::AST::ForLoop::ForLoop):
(WebCore::WHLSL::AST::ForLoop::~ForLoop):
(WebCore::WHLSL::AST::ForLoop::initialization):
(WebCore::WHLSL::AST::ForLoop::condition):
(WebCore::WHLSL::AST::ForLoop::increment):
(WebCore::WHLSL::AST::ForLoop::body):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Added.
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
(WebCore::WHLSL::AST::FunctionDeclaration::isFunctionDefinition const):
(WebCore::WHLSL::AST::FunctionDeclaration::isNativeFunctionDeclaration const):
(WebCore::WHLSL::AST::FunctionDeclaration::attributeBlock):
(WebCore::WHLSL::AST::FunctionDeclaration::entryPointType const):
(WebCore::WHLSL::AST::FunctionDeclaration::type const):
(WebCore::WHLSL::AST::FunctionDeclaration::type):
(WebCore::WHLSL::AST::FunctionDeclaration::name const):
(WebCore::WHLSL::AST::FunctionDeclaration::isCast const):
(WebCore::WHLSL::AST::FunctionDeclaration::parameters const):
(WebCore::WHLSL::AST::FunctionDeclaration::parameters):
(WebCore::WHLSL::AST::FunctionDeclaration::semantic):
(WebCore::WHLSL::AST::FunctionDeclaration::isOperator const):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Added.
(WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
(WebCore::WHLSL::AST::FunctionDefinition::block):
(WebCore::WHLSL::AST::FunctionDefinition::restricted const):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Added.
(WebCore::WHLSL::AST::IfStatement::IfStatement):
(WebCore::WHLSL::AST::IfStatement::conditional):
(WebCore::WHLSL::AST::IfStatement::body):
(WebCore::WHLSL::AST::IfStatement::elseBody):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Added.
(WebCore::WHLSL::AST::IndexExpression::IndexExpression):
(WebCore::WHLSL::AST::IndexExpression::indexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Added.
(WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Added.
(WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
(WebCore::WHLSL::AST::IntegerLiteral::type):
(WebCore::WHLSL::AST::IntegerLiteral::value const):
(WebCore::WHLSL::AST::IntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Added.
(WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
(WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Added.
(WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Added.
(WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
(WebCore::WHLSL::AST::LogicalExpression::type const):
(WebCore::WHLSL::AST::LogicalExpression::left):
(WebCore::WHLSL::AST::LogicalExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Added.
(WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
(WebCore::WHLSL::AST::LogicalNotExpression::operand):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Added.
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Added.
(WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
(WebCore::WHLSL::AST::MakePointerExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Added.
(WebCore::WHLSL::AST::NamedType::NamedType):
(WebCore::WHLSL::AST::NamedType::origin const):
(WebCore::WHLSL::AST::NamedType::name):
(WebCore::WHLSL::AST::NamedType::isTypeDefinition const):
(WebCore::WHLSL::AST::NamedType::isStructureDefinition const):
(WebCore::WHLSL::AST::NamedType::isEnumerationDefinition const):
(WebCore::WHLSL::AST::NamedType::isNativeTypeDeclaration const):
(WebCore::WHLSL::AST::NamedType::unifyNode const):
(WebCore::WHLSL::AST::NamedType::unifyNode):
* Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Added.
(WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
(WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const):
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Added.
(WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
(WebCore::WHLSL::AST::NativeTypeDeclaration::name const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::name):
(WebCore::WHLSL::AST::NativeTypeDeclaration::typeArguments):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isInt const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isNumber const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isFloating const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isVector const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isMatrix const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isTexture const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isSigned const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<bool const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<int64_t const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::iterateAllValues):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsInt):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsNumber):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsFloating):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsVector):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsMatrix):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTexture):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsSigned):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentUnsignedInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentFloat):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setSuccessor):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromUnsignedInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIterateAllValues):
* Modules/webgpu/WHLSL/AST/WHLSLNode.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Added.
(WebCore::WHLSL::AST::NullLiteral::NullLiteral):
(WebCore::WHLSL::AST::NullLiteral::type):
(WebCore::WHLSL::AST::NullLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Added.
(WebCore::WHLSL::AST::NullLiteralType::canResolve const):
(WebCore::WHLSL::AST::NullLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Added.
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::width const):
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::height const):
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::depth const):
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Added.
(WebCore::WHLSL::AST::PointerType::PointerType):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Added.
(WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
(WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::base):
* Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Added.
(WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::setNewValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::setResultExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::oldValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Added.
(WebCore::WHLSL::AST::ReferenceType::ReferenceType):
(WebCore::WHLSL::AST::ReferenceType::addressSpace const):
(WebCore::WHLSL::AST::ReferenceType::elementType const):
(WebCore::WHLSL::AST::ReferenceType::elementType):
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Added.
(WebCore::WHLSL::AST::ResolvableType::isFloatLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::isIntegerLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::isNullLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::isUnsignedIntegerLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType):
(WebCore::WHLSL::AST::ResolvableType::resolve):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Added.
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Added.
(WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
(WebCore::WHLSL::AST::ResourceSemantic::mode const):
(WebCore::WHLSL::AST::ResourceSemantic::index const):
(WebCore::WHLSL::AST::ResourceSemantic::space const):
(WebCore::WHLSL::AST::ResourceSemantic::operator== const):
(WebCore::WHLSL::AST::ResourceSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Added.
(WebCore::WHLSL::AST::Return::Return):
(WebCore::WHLSL::AST::Return::value):
(WebCore::WHLSL::AST::Return::function):
(WebCore::WHLSL::AST::Return::setFunction):
* Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Added.
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Added.
(WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::operator== const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Added.
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Added.
(WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
(WebCore::WHLSL::AST::StageInOutSemantic::index const):
(WebCore::WHLSL::AST::StageInOutSemantic::operator== const):
(WebCore::WHLSL::AST::StageInOutSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Added.
(WebCore::WHLSL::AST::Statement::Statement):
(WebCore::WHLSL::AST::Statement::isBlock const):
(WebCore::WHLSL::AST::Statement::isBreak const):
(WebCore::WHLSL::AST::Statement::isContinue const):
(WebCore::WHLSL::AST::Statement::isDoWhileLoop const):
(WebCore::WHLSL::AST::Statement::isEffectfulExpressionStatement const):
(WebCore::WHLSL::AST::Statement::isFallthrough const):
(WebCore::WHLSL::AST::Statement::isForLoop const):
(WebCore::WHLSL::AST::Statement::isIfStatement const):
(WebCore::WHLSL::AST::Statement::isReturn const):
(WebCore::WHLSL::AST::Statement::isSwitchCase const):
(WebCore::WHLSL::AST::Statement::isSwitchStatement const):
(WebCore::WHLSL::AST::Statement::isTrap const):
(WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
(WebCore::WHLSL::AST::Statement::isWhileLoop const):
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Added.
(WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
(WebCore::WHLSL::AST::StructureDefinition::structureElements):
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Added.
(WebCore::WHLSL::AST::StructureElement::StructureElement):
(WebCore::WHLSL::AST::StructureElement::origin const):
(WebCore::WHLSL::AST::StructureElement::type):
(WebCore::WHLSL::AST::StructureElement::name):
(WebCore::WHLSL::AST::StructureElement::semantic):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Added.
(WebCore::WHLSL::AST::SwitchCase::SwitchCase):
(WebCore::WHLSL::AST::SwitchCase::value):
(WebCore::WHLSL::AST::SwitchCase::block):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Added.
(WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
(WebCore::WHLSL::AST::SwitchStatement::value):
(WebCore::WHLSL::AST::SwitchStatement::switchCases):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Added.
(WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
(WebCore::WHLSL::AST::TernaryExpression::predicate):
(WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
(WebCore::WHLSL::AST::TernaryExpression::elseExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Added.
(WebCore::WHLSL::AST::Trap::Trap):
* Modules/webgpu/WHLSL/AST/WHLSLType.h: Added.
(WebCore::WHLSL::AST::Type::isNamedType const):
(WebCore::WHLSL::AST::Type::isUnnamedType const):
(WebCore::WHLSL::AST::Type::isResolvableType const):
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Added.
(WebCore::WHLSL::AST::clone):
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Added.
(WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
(WebCore::WHLSL::AST::TypeDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Added.
(WebCore::WHLSL::AST::TypeReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Added.
(WebCore::WHLSL::AST::TypeReference::TypeReference):
(WebCore::WHLSL::AST::TypeReference::name):
(WebCore::WHLSL::AST::TypeReference::typeArguments):
(WebCore::WHLSL::AST::TypeReference::resolvedType const):
(WebCore::WHLSL::AST::TypeReference::setResolvedType):
(WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Added.
(WebCore::WHLSL::AST::UnnamedType::UnnamedType):
(WebCore::WHLSL::AST::UnnamedType::isTypeReference const):
(WebCore::WHLSL::AST::UnnamedType::isPointerType const):
(WebCore::WHLSL::AST::UnnamedType::isArrayReferenceType const):
(WebCore::WHLSL::AST::UnnamedType::isArrayType const):
(WebCore::WHLSL::AST::UnnamedType::isReferenceType const):
(WebCore::WHLSL::AST::UnnamedType::unifyNode const):
(WebCore::WHLSL::AST::UnnamedType::unifyNode):
(WebCore::WHLSL::AST::UnnamedType::origin const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::type):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::value const):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLValue.h: Added.
(WebCore::WHLSL::AST::Value::Value):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Added.
(WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
(WebCore::WHLSL::AST::VariableDeclaration::origin const):
(WebCore::WHLSL::AST::VariableDeclaration::name):
(WebCore::WHLSL::AST::VariableDeclaration::type const):
(WebCore::WHLSL::AST::VariableDeclaration::type):
(WebCore::WHLSL::AST::VariableDeclaration::semantic):
(WebCore::WHLSL::AST::VariableDeclaration::initializer):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Added.
(WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
(WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Added.
(WebCore::WHLSL::AST::VariableReference::VariableReference):
(WebCore::WHLSL::AST::VariableReference::wrap):
(WebCore::WHLSL::AST::VariableReference::name):
(WebCore::WHLSL::AST::VariableReference::variable):
(WebCore::WHLSL::AST::VariableReference::setVariable):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Added.
(WebCore::WHLSL::AST::WhileLoop::WhileLoop):
(WebCore::WHLSL::AST::WhileLoop::conditional):
(WebCore::WHLSL::AST::WhileLoop::body):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
* Modules/webgpu/WHLSL/WHLSLParser.cpp: Added.
* Modules/webgpu/WHLSL/WHLSLParser.h: Added.
* Modules/webgpu/WHLSL/WHLSLProgram.h: Added.
(WebCore::WHLSL::Program::append):
(WebCore::WHLSL::Program::nameContext):
(WebCore::WHLSL::Program::intrinsics):
(WebCore::WHLSL::Program::typeDefinitions):
(WebCore::WHLSL::Program::structureDefinitions):
(WebCore::WHLSL::Program::enumerationDefinitions):
(WebCore::WHLSL::Program::functionDefinitions const):
(WebCore::WHLSL::Program::functionDefinitions):
(WebCore::WHLSL::Program::nativeFunctionDeclarations const):
(WebCore::WHLSL::Program::nativeFunctionDeclarations):
(WebCore::WHLSL::Program::nativeTypeDeclarations):
2019-01-10 Wenson Hsieh <wenson_hsieh@apple.com>
Bindings generator emits incorrect code when using VoidCallback as an IDL dictionary attribute
https://bugs.webkit.org/show_bug.cgi?id=193328
Reviewed by Chris Dumez.
Currently, when generating the function body of `convertDictionary`, our bindings generator does not pass in an
argument to use as the `$globalObjectReference` in `JSValueToNative`, when generating code to convert a wrapped
attribute value to the native value. As a result, if the generated IDL type returns `true` from
`JSValueToNativeDOMConvertNeedsGlobalObject` (i.e. for callback function types), we will end up using the empty
string as the generated expression for the global object. This emits syntactically incorrect code:
`convert<IDLCallbackFunction<JSVoidCallback>>(state, someValue, );`
To fix this, we pass in a string to use as the global object, which uses the given ExecState to grab the global
object. Tested by augmenting TestStandaloneDictionary.idl and its generated expectation.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/TestStandaloneDictionary.idl:
2019-01-10 Eric Carlson <eric.carlson@apple.com>
Define page media state flags for display capture.
https://bugs.webkit.org/show_bug.cgi?id=193230
<rdar://problem/47095142>
Reviewed by Youenn Fablet.
Test: fast/mediastream/get-display-media-muted.html
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::mediaState const):
* page/MediaProducer.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeVideoSource.h:
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState):
2019-01-10 Justin Fan <justin_fan@apple.com>
[WebGPU] Add BindGroupBinding, BindGroupDescriptor, and BufferBinding dictionaries from API
https://bugs.webkit.org/show_bug.cgi?id=193298
Reviewed by Dean Jackson.
No new tests. No change in behavior.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPUBindGroupBinding.h: Added.
* Modules/webgpu/WebGPUBindGroupBinding.idl: Added.
* Modules/webgpu/WebGPUBindGroupDescriptor.h: Added.
* Modules/webgpu/WebGPUBindGroupDescriptor.idl: Added.
* Modules/webgpu/WebGPUBufferBinding.h: Added.
* Modules/webgpu/WebGPUBufferBinding.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBindGroupBinding.h: Added.
* platform/graphics/gpu/GPUBindGroupDescriptor.h: Added.
* platform/graphics/gpu/GPUBufferBinding.h: Added.
2019-01-09 Justin Fan <justin_fan@apple.com>
[WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
https://bugs.webkit.org/show_bug.cgi?id=193289
Reviewed by Dean Jackson.
Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
retaining its descriptor after creation.
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::primitiveTopology const):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::GPURenderPipeline):
2019-01-09 Dean Jackson <dino@apple.com>
Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters
https://bugs.webkit.org/show_bug.cgi?id=193309
<rdar://problem/45279224>
Reviewed by Antoine Quint.
A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters.
The crash log indicates we crash in a Checked<> class that is not recording
overflow i.e. it is crashing due to an overflow. The only place in this function
where that could happen is when we convert the FloatRect for the backdrop
region into a Checked<unsigned> for width and height. This suggests that either
the width or height are negative, or the float values are too large for integers,
or the product of the two overflows.
Avoid this by using RecordOverflow, but also changing the code a little to
bail if the rectangle is incorrect.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateBackdropFilters):
2019-01-10 Oriol Brufau <obrufau@igalia.com>
[css-grid] Let abspos items reference implicit grid lines
https://bugs.webkit.org/show_bug.cgi?id=193313
Reviewed by Manuel Rego Casasnovas.
While they can't create new implicit grid lines, abspos items
can reference existing ones as clarified in
https://github.com/w3c/csswg-drafts/commit/511bb63
This patch makes WebKit match Blink, Firefox and Edge.
Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html
web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
Don't treat implicit grid lines as 'auto'.
* rendering/RenderGrid.h:
Remove unused gridPositionIsAutoForOutOfFlow.
* rendering/style/GridPositionsResolver.cpp:
(WebCore::adjustGridPositionsFromStyle):
Don't treat implicit grid lines as 'auto'.
Remove unused gridContainerStyle parameter.
(WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
Remove argument from adjustGridPositionsFromStyle call.
Remove unused gridContainerStyle parameter.
(WebCore::resolveGridPositionFromStyle):
Remove unnecessary assert that uses isValidNamedLineOrArea.
(WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
Remove argument from adjustGridPositionsFromStyle call.
* rendering/style/GridPositionsResolver.h:
Remove unused isValidNamedLineOrArea.
Remove unused parameter from spanSizeForAutoPlacedItem.
2019-01-09 Matt Rajca <mrajca@apple.com>
Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
https://bugs.webkit.org/show_bug.cgi?id=193301
Reviewed by Jer Noble.
Instead of unconditionally enabling this with a compile-time flag, let clients
enable the quirk on a per-load basis.
Tests: added API tests in favor of the current layout test as this behavior is no
longer on by default unless a client opts in.
* html/MediaElementSession.cpp:
(WebCore::needsPerDocumentAutoplayBehaviorQuirk):
(WebCore::MediaElementSession::playbackPermitted const):
* loader/DocumentLoader.h:
2019-01-10 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
https://bugs.webkit.org/show_bug.cgi?id=193310
Reviewed by Antti Koivisto.
If the block inflow element has previous siblings with collapsed through vertical margins,
then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings
to check for margin collapsing.
Test: fast/block/block-only/collapsed-through-siblings.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2019-01-10 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
https://bugs.webkit.org/show_bug.cgi?id=192934
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::pushNewBuffer):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):
2019-01-10 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Color emoji not properly supported
https://bugs.webkit.org/show_bug.cgi?id=191976
Reviewed by Michael Catanzaro.
Always try to fallback to a colored font for emojis.
Test: platform/gtk/fonts/font-emoji-system-fallback.html
* platform/graphics/ComplexTextController.cpp:
(WebCore::advanceByCombiningCharacterSequence): Group regional indicators in pairs.
* platform/graphics/Font.cpp:
(WebCore::CharacterFallbackMapKey::CharacterFallbackMapKey):
(WebCore::Font::systemFallbackFontForCharacter const): Pass PreferColoredFont::No to FontCache::systemFallbackForCharacters.
* platform/graphics/Font.h: Add IsForPlatformFont enum to replace the bool parameter in systemFallbackFontForCharacter().
* platform/graphics/FontCache.h:
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::FontCascadeFonts::glyphDataForSystemFallback):
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::characterSequenceIsEmoji): Check whether the character sequence is an emoji.
(WebCore::FontCascade::fontForCombiningCharacterSequence const): In case of emojis try to fallback to a colored
font even if base font can render the emoji in black and white.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::FontPlatformData): Initialize m_isColorBitmapFont.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::variantCapsSupportsCharacterForSynthesis const): Moved from cross-platform file.
(WebCore::Font::platformSupportsCodePoint const): Add freetype implementation.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::systemFallbackForCharacters): Add PreferColoredFont parameter that is ignored.
* platform/text/CharacterProperties.h:
(WebCore::isEmojiKeycapBase):
(WebCore::isEmojiRegionalIndicator):
(WebCore::isEmojiWithPresentationByDefault):
(WebCore::isEmojiModifierBase):
2019-01-09 Antoine Quint <graouts@apple.com>
[Web Animations] Audit Web Animations classes for memory reduction
https://bugs.webkit.org/show_bug.cgi?id=193195
Reviewed by Simon Fraser and Yusuke Suzuki.
The classes, enums and structs added to support Web Animations were not as memory-efficient as they could be. We now order
members in a way that reduces padding, use Markable<T, Traits> instead of Optional<T> where applicable, declare enums as uint8_t
and removed unnecessary members.
As a result, classes and structs have shrunk as follows:
WebAnimation: 256 > 216
DeclarativeAnimation: 392 > 344
CSSAnimation: 416 > 368
CSSTransition: 440 > 392
AnimationEffect: 88 > 72
KeyframeEffect: 208 > 184
AnimationPlaybackEvent: 104 > 88
EffectTiming: 72 > 64
ComputedEffectTiming: 136 > 112
AnimationTimeline: 264 > 248
DocumentTimeline: 496 > 464
OptionalEffectTiming: 112 > 80
BaseKeyframe: 32 > 24
ParsedKeyframe: 80 > 72
BaseComputedKeyframe: 40 > 32
* animation/AnimationEffect.h: Order members in decreasing size, except for m_fill and m_direction, which we put at the top to
save 8 bytes (2 bytes of padding instead of 4 before m_animation and saving 6 bytes of padding at the end).
* animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
* animation/AnimationPlaybackEvent.h:
* animation/AnimationPlaybackEventInit.h:
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::AnimationTimeline):
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/AnimationTimeline.h: We remove the m_classType member and instead make isDocumentTimeline() virtual.
(WebCore::AnimationTimeline::isDocumentTimeline const):
(): Deleted.
(WebCore::AnimationTimeline::classType const): Deleted.
* animation/CompositeOperation.h:
* animation/CompositeOperationOrAuto.h:
* animation/ComputedEffectTiming.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::DeclarativeAnimation):
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DeclarativeAnimation.h: We keep m_wasPending and m_previousPhase at the top to save some padding at the end.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
* animation/DocumentTimeline.h:
* animation/EffectTiming.h:
* animation/FillMode.h:
* animation/IterationCompositeOperation.h:
* animation/KeyframeEffect.cpp:
(WebCore::computeMissingKeyframeOffsets):
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
* animation/KeyframeEffect.h:
* animation/OptionalEffectTiming.h:
* animation/PlaybackDirection.h:
* animation/WebAnimation.h:
* animation/WebAnimationUtilities.h:
(WebCore::WebAnimationsMarkableDoubleTraits::isEmptyValue):
(WebCore::WebAnimationsMarkableDoubleTraits::emptyValue):
2019-01-09 Ryosuke Niwa <rniwa@webkit.org>
ThreadTimers should not store a raw pointer in its heap
https://bugs.webkit.org/show_bug.cgi?id=192975
<rdar://problem/46893946>
Reviewed by Geoffrey Garen.
Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code,
this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like
WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears
the raw pointer back to TimerBase*.
This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node
in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its
"priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and
insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this
hardening is to make it work even in the precense of such a bug).
This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector
in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton.
The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in
TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that
layout tests run successfully without hitting any debug assertions.
No new tests since there should be no observable behavior difference.
* WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h
* platform/ThreadTimers.cpp:
(WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had
already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap,
which should never happen.
(WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer
from the heap since setNextFireTime does the removal already.
* platform/ThreadTimers.h: Outdented the whole file.
(WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~>
doesn't have a copy constructor which is used by std::push_heap.
(WebCore::ThreadTimerHeapItem): Added.
(WebCore::ThreadTimerHeapItem::hasTimer const): Added.
(WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which
signifies the item not being in the heap instead of all negative values as in the old code in TimerBase.
(WebCore::ThreadTimerHeapItem::isInHeap const): Added.
(WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added.
(WebCore::ThreadTimerHeapItem::timer): Added.
(WebCore::ThreadTimerHeapItem::clearTimer): Added.
(WebCore::ThreadTimerHeapItem::heapIndex const): Added.
(WebCore::ThreadTimerHeapItem::setHeapIndex): Added.
(WebCore::ThreadTimerHeapItem::timerHeap const): Added.
* platform/Timer.cpp:
(WebCore::threadGlobalTimerHeap): This function is now only used in assertions.
(WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added.
(WebCore::ThreadTimerHeapItem::create): Added.
(WebCore::TimerHeapPointer::TimerHeapPointer):
(WebCore::TimerHeapPointer::operator-> const):
(WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor.
(WebCore::TimerHeapReference::copyRef const): Added.
(WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const):
(WebCore::TimerHeapPointer::operator* const):
(WebCore::TimerHeapReference::operator=): Use move assignment operator.
(WebCore::TimerHeapReference::swapWith):
(WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=.
(WebCore::swap):
(WebCore::TimerHeapIterator::TimerHeapIterator):
(WebCore::TimerHeapIterator::operator-> const):
(WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>.
(WebCore::TimerHeapLessThanFunction::operator() const):
(WebCore::TimerBase::TimerBase):
(WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem.
(WebCore::TimerBase::stop):
(WebCore::TimerBase::nextFireInterval const):
(WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap.
(WebCore::TimerBase::checkConsistency const):
(WebCore::TimerBase::heapDecreaseKey):
(WebCore::TimerBase::heapDelete):
(WebCore::TimerBase::heapDeleteMin):
(WebCore::TimerBase::heapIncreaseKey):
(WebCore::TimerBase::heapInsert):
(WebCore::TimerBase::heapPop):
(WebCore::TimerBase::heapPopMin):
(WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase.
(WebCore::parentHeapPropertyHolds):
(WebCore::childHeapPropertyHolds):
(WebCore::TimerBase::hasValidHeapPosition const):
(WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called
on an item with an invalid (-1) heap index.
(WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase
is deleted.
(WebCore::TimerHeapReference::operator TimerBase* const): Deleted.
* platform/Timer.h:
(WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap
by m_heapItem, RefPtr to an ThreadTimerHeapItem.
(WebCore::TimerBase::augmentFireInterval):
(WebCore::TimerBase::inHeap const):
(WebCore::TimerBase::nextFireTime const):
(WebCore::TimerBase::isActive const):
(WebCore::TimerBase:: const): Deleted.
2019-01-09 Alex Christensen <achristensen@webkit.org>
REGRESSION(239737) iOS quicklook tests should not dereference null
https://bugs.webkit.org/show_bug.cgi?id=193307
Reviewed by Brent Fulgham.
The quicklook tests rely on ResourceHandle on iOS for some reason.
This is a problem we'll fix later, but for now keep them working by not crashing.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
2019-01-09 Zalan Bujtas <zalan@apple.com>
[Datalist] Crash when input with datalist is dynamically added.
https://bugs.webkit.org/show_bug.cgi?id=193012
<rdar://problem/45923457>
Reviewed by Brent Fulgham.
In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree
to see whether the input needs datalist related items. The list attribute is simply not set yet.
This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032).
Test: fast/forms/datalist/datalist-crash-when-dynamic.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::createShadowSubtree):
(WebCore::TextFieldInputType::attributeChanged):
(WebCore::TextFieldInputType::createDataListDropdownIndicator):
* html/TextFieldInputType.h:
2019-01-09 Justin Fan <justin_fan@apple.com>
[WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
https://bugs.webkit.org/show_bug.cgi?id=193289
Reviewed by Dean Jackson.
Fix broken test after pipeline layouts were added, and a small refactoring to GPURenderPipeline to avoid
retaining its descriptor after creation.
* platform/graphics/gpu/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::primitiveTopology const):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::GPURenderPipeline):
2019-01-09 Devin Rousso <drousso@apple.com>
Web Inspector: Protocol Logging: log messages as objects if inspector^2 is open
https://bugs.webkit.org/show_bug.cgi?id=193284
Reviewed by Joseph Pecoraro.
No newe tests, as this is simply exposes a value.
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::isBeingInspected): Added.
2019-01-09 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Add support for peculiar cases.
https://bugs.webkit.org/show_bug.cgi?id=192625
Reviewed by Antti Koivisto.
Implement some of the more peculiar cases like margin collpasing through multiple boxes etc.
Add ~100 new passing cases.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::hasFormattingState const):
* layout/MarginTypes.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
(WebCore::Layout::hasPrecomputedMarginBefore):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::blockFormattingState const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): Deleted.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter):
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): Deleted.
* layout/blockformatting/BlockFormattingState.h:
(WebCore::Layout::BlockFormattingState::setPositiveAndNegativeVerticalMargin):
(WebCore::Layout::BlockFormattingState::hasPositiveAndNegativeVerticalMargin const):
(WebCore::Layout::BlockFormattingState::positiveAndNegativeVerticalMargin const):
(WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore):
(WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore):
(WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::hasClearance):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSiblingMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::computedPositiveAndNegativeMargin):
(WebCore::Layout::marginValue):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::hasClearance const):
(WebCore::Display::Box::setEstimatedMarginBefore):
(WebCore::Display::Box::estimatedMarginBefore const):
(WebCore::Display::Box::setHasClearance):
(WebCore::Display::Box::invalidateEstimatedMarginBefore):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::rectWithMargin const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2019-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r239156): [FreeType] fixed width, and synthetic bold/italic not correctly applied since r239156
https://bugs.webkit.org/show_bug.cgi?id=193276
Reviewed by Žan Doberšek.
FontCache::createFontPlatformData() is calling getFontPropertiesFromPattern() with the configure pattern instead
of the result one after the match.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::createFontPlatformData):
2019-01-08 Dean Jackson <dino@apple.com>
Blob references for System Previews don't get a correct file extension
https://bugs.webkit.org/show_bug.cgi?id=193268
<rdar://problem/47133037>
Reviewed by Tim Horton.
Apple platforms don't yet have a mapping from the USD MIME type to
file extensions (and we support some non-standard MIME types), which
means that downloads from Blob references don't get correctly named.
Fix this by adding an explicit mapping between System Preview types
and ".usdz".
WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since
this applies to macOS and iOS now.
* platform/MIMETypeRegistry.h:
* platform/cocoa/MIMETypeRegistryCocoa.mm:
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping
for USDZ.
2019-01-08 Tim Horton <timothy_horton@apple.com>
Editable images sometimes don't become focused when tapped
https://bugs.webkit.org/show_bug.cgi?id=193259
<rdar://problem/47038424>
Reviewed by Wenson Hsieh.
Often when tapping an editable image inside an editable text area, the
text area's selection will change instead of focusing the editable image.
No new tests; I have had no luck writing a test that reliably failed
beforehand (the "sometimes" is a problem).
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::defaultEventHandler):
* html/HTMLImageElement.h:
Override mousedown on editable images, focus the image, and prevent
the default behavior.
2019-01-08 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Support U2F HID Authenticators on macOS
https://bugs.webkit.org/show_bug.cgi?id=191535
<rdar://problem/47102027>
Reviewed by Brent Fulgham.
This patch changes U2fCommandConstructor to produce register commands with
enforcing test of user presence. Otherwise, authenticators would silently
generate credentials. It also renames readFromU2fSignResponse to
readU2fSignResponse.
Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html
http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html
http/wpt/webauthn/public-key-credential-create-success-u2f.https.html
http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html
http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html
http/wpt/webauthn/public-key-credential-get-success-u2f.https.html
* Modules/webauthn/fido/U2fCommandConstructor.cpp:
(fido::WebCore::constructU2fRegisterCommand):
* Modules/webauthn/fido/U2fResponseConverter.cpp:
(fido::readU2fSignResponse):
(fido::readFromU2fSignResponse): Deleted.
* Modules/webauthn/fido/U2fResponseConverter.h:
2019-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Dispatch a synthetic mousedown event prior to starting drags
https://bugs.webkit.org/show_bug.cgi?id=193229
<rdar://problem/46717097>
Reviewed by Tim Horton.
Tweaks some drag initiation logic on iOS to actually send a "mousedown" event to the page prior to drag start.
This improves drag and drop compatibility with web pages that expect a mousedown to always precede dragging.
Additionally, ensure that preventing the "mousedown" event also prevents "dragstart", which matches macOS
behavior.
Test: DragAndDropTests.PreventingMouseDownShouldPreventDragStart
* page/EventHandler.cpp:
Make the text drag delay 0 on iOS. This was introduced on iOS when originally bringing up drag and drop, and was
made to simply match macOS. However, it doesn't make sense to respect the delay here, since the purpose of this
delay is to disambiguate between making a text selection and starting a drag when pressing on text that is
already selected; on iOS (including iOSMac), this gesture conflict is already resolved by platform gesture
recognizers in the client layer, so there is always no delay between mouse down and drag here.
* page/ios/EventHandlerIOS.mm:
Dispatch a mousedown and inspect the value of `m_mouseDownMayStartDrag` when starting a drag on iOS. This brings
our behavior closer in line with macOS.
(WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
2019-01-08 Youenn Fablet <youenn@apple.com>
service worker fetch handler results in bad referrer
https://bugs.webkit.org/show_bug.cgi?id=188248
<rdar://problem/47050478>
Reviewed by Alex Christensen.
Response sanitization was removing the ReferrerPolicy header from opaque redirect responses.
Reduce sanitization of opaque redirect responses to opaque responses and allow Location header.
Make sure referrer policy is updated for all load redirections, not only CORS loads.
Test: http/tests/security/referrer-policy-redirect-link-downgrade.html
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
* platform/network/ResourceResponseBase.cpp:
(WebCore::isSafeCrossOriginResponseHeader):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2019-01-08 Youenn Fablet <youenn@apple.com>
IDB storage of Crypto keys does not work in private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=193219
Reviewed by Brady Eidson.
https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization.
This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object.
To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject.
If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject.
Covered by updated test.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWrapper.cpp:
(WebCore::JSDOMObject::JSDOMObject):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpArrayBufferView):
(WebCore::CloneSerializer::toJSArrayBuffer):
2019-01-08 Justin Fan <justin_fan@apple.com>
[WebGPU] Update createRenderPipeline for WebGPUPipelineLayout
https://bugs.webkit.org/show_bug.cgi?id=193247
Reviewed by Dean Jackson.
Add WebGPUPipelineLayout to WebGPURenderPipeline via WebGPUPipelineDescriptorBase.
Test: Updated render-pipelines.html to test new functionality.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const): Convert WebGPUPipelineLayout to GPUPipelineLayout.
* Modules/webgpu/WebGPUPipelineDescriptorBase.h:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl: Add layout field.
* Modules/webgpu/WebGPUPipelineLayout.h:
(WebCore::WebGPUPipelineLayout::pipelineLayout): Added. Getter.
* platform/graphics/gpu/GPUPipelineDescriptorBase.h: Updated from out-of-date version.
* platform/graphics/gpu/GPUPipelineLayout.cpp:
(WebCore::GPUPipelineLayout::GPUPipelineLayout): Now retains bindGroupLayouts from descriptor.
* platform/graphics/gpu/GPUPipelineLayout.h:
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Now inherits from GPUPipelineDescriptorBase.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Custom constructor for non-aggregate struct.
2019-01-08 Chris Dumez <cdumez@apple.com>
Prevent cross-site top-level navigations from third-party iframes
https://bugs.webkit.org/show_bug.cgi?id=193076
<rdar://problem/36074736>
Reviewed by Alex Christensen.
Prevent cross-site top-level navigations from third-party iframes if the following conditions are met:
1. Its tries to navigate the top-level page cross-site (different eTDL+1)
2. The user has never interacted with the third-party iframe or any of its subframes
This experiment's intent is to block suspicious main-frame navigations by third-party content. The feature
is behind a runtime experimental feature flag, on by default.
Tests: http/tests/security/allow-top-level-navigations-by-third-party-iframes-to-same-origin.html
http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-previous-user-activation.html
http/tests/security/allow-top-level-navigations-by-third-party-iframes-with-user-activation.html
http/tests/security/block-top-level-navigations-by-third-party-iframes.html
* dom/Document.cpp:
(WebCore::printNavigationErrorMessage):
(WebCore::Document::canNavigate):
(WebCore::Document::canNavigateInternal):
(WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
* dom/Document.h:
* dom/UserGestureIndicator.cpp:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setLocation):
* page/DOMWindow.h:
* page/Frame.h:
* page/Location.cpp:
(WebCore::Location::replace):
(WebCore::Location::setLocation):
* page/Settings.yaml:
2019-01-08 Alex Christensen <achristensen@webkit.org>
Stop using NetworkStorageSession in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193236
Reviewed by Don Olmstead.
No change in behavior. Some code was only used for ResourceHandle, which isn't used in modern WebKit,
and for cookies, which are handled in the NetworkProcess in modern WebKit.
* loader/CookieJar.cpp:
(WebCore::storageSession):
* loader/EmptyClients.cpp:
* platform/network/NetworkingContext.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r239727.
Broke API tests
Reverted changeset:
"Stop using NetworkStorageSession in WebProcess"
https://bugs.webkit.org/show_bug.cgi?id=193236
https://trac.webkit.org/changeset/239727
2019-01-08 Alex Christensen <achristensen@webkit.org>
Stop using NetworkStorageSession in WebProcess
https://bugs.webkit.org/show_bug.cgi?id=193236
Reviewed by Don Olmstead.
No change in behavior. Some code was only used for ResourceHandle, which isn't used in modern WebKit,
and for cookies, which are handled in the NetworkProcess in modern WebKit.
* loader/CookieJar.cpp:
(WebCore::storageSession):
* loader/EmptyClients.cpp:
* platform/network/NetworkingContext.h:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
2019-01-08 Chris Dumez <cdumez@apple.com>
Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow
https://bugs.webkit.org/show_bug.cgi?id=193224
<rdar://problem/47097726>
Reviewed by Alex Christensen.
Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation.
When we return to a suspended page, we load the current history item again and it normally properly restores
the page from PageCache, even though we load the same history item and the current one and even though the
page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache).
The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would
return true because both the source and destination URLs (which are the same) contains a fragment. To address
the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is
suspended.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldPerformFragmentNavigation):
2019-01-08 Alex Christensen <achristensen@webkit.org>
Move Windows-specific code from NetworkStorageSessionCFNet.cpp to its own file
https://bugs.webkit.org/show_bug.cgi?id=192958
Reviewed by Yusuke Suzuki.
This makes it easier to reason about what code is used where.
* PlatformAppleWin.cmake:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createPrivateStorageSession): Deleted.
(WebCore::cookieDomain): Deleted.
(WebCore::canonicalCookieTime): Deleted.
(WebCore::cookieCreatedTime): Deleted.
(WebCore::cookieExpirationTime): Deleted.
(WebCore::cookieName): Deleted.
(WebCore::cookiePath): Deleted.
(WebCore::cookieValue): Deleted.
(WebCore::filterCookies): Deleted.
(WebCore::copyCookiesForURLWithFirstPartyURL): Deleted.
(WebCore::createCookies): Deleted.
(WebCore::NetworkStorageSession::setCookiesFromDOM const): Deleted.
(WebCore::containsSecureCookies): Deleted.
(WebCore::NetworkStorageSession::cookiesForDOM const): Deleted.
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Deleted.
(WebCore::NetworkStorageSession::cookiesEnabled const): Deleted.
(WebCore::NetworkStorageSession::getRawCookies const): Deleted.
(WebCore::NetworkStorageSession::deleteCookie const): Deleted.
(WebCore::NetworkStorageSession::getHostnamesWithCookies): Deleted.
(WebCore::NetworkStorageSession::deleteAllCookies): Deleted.
(WebCore::NetworkStorageSession::deleteCookiesForHostnames): Deleted.
(WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince): Deleted.
* platform/network/cf/NetworkStorageSessionCFNetWin.cpp: Added.
(WebCore::createPrivateStorageSession):
(WebCore::NetworkStorageSession::setCookies):
(WebCore::cookieDomain):
(WebCore::canonicalCookieTime):
(WebCore::cookieCreatedTime):
(WebCore::cookieExpirationTime):
(WebCore::cookieName):
(WebCore::cookiePath):
(WebCore::cookieValue):
(WebCore::filterCookies):
(WebCore::copyCookiesForURLWithFirstPartyURL):
(WebCore::createCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::containsSecureCookies):
(WebCore::NetworkStorageSession::cookiesForDOM const):
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
(WebCore::NetworkStorageSession::cookiesEnabled const):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::NetworkStorageSession::deleteCookie const):
(WebCore::NetworkStorageSession::getHostnamesWithCookies):
(WebCore::NetworkStorageSession::deleteAllCookies):
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
(WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
2018-12-19 Antoine Quint <graouts@apple.com>
[Web Animations] Compute animation effect timing properties in batch
https://bugs.webkit.org/show_bug.cgi?id=192850
Reviewed by Dean Jackson.
We remove a host of functions from AnimationEffect that would allow the computation of various timing properties
defined by the Web Animations specification: phase, progress, current iteration, etc. Indeed, a lot of these functions
would call each other in a chain, and we would re-compute a lot of the earlier properties in those chains several times
when doing something like querying the animation progress. Additionally, some functions, such as WebAnimation::computeRelevance()
and WebAnimation::timeToNextTick() would yield the computation of several such properties numerous times. All of those
functions are called during each animation frame and are ripe for optimizations.
We now compute all timing properties across two functions:
1. the new AnimationEffect::getBasicTiming() which computes the local time, end time, active duration, active time and phase,
2. the existing AnimationEffect::getComputedTiming() which now also exposes the phase and simple iteration progress.
To support this we introduce a new BasicEffectTiming struct to contain the values computed in AnimationEffect::getBasicTiming()
and spun the AnimationEffect::Phase struct as AnimationEffectPhase so that it may be used across BasicEffectTiming and
ComputedEffectTiming.
No new test since there is no user-observable change.
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getTiming const):
(WebCore::AnimationEffect::getBasicTiming const):
(WebCore::AnimationEffect::getComputedTiming const):
(WebCore::AnimationEffect::localTime const): Deleted.
(WebCore::AnimationEffect::phase const): Deleted.
(WebCore::AnimationEffect::activeTime const): Deleted.
(WebCore::AnimationEffect::overallProgress const): Deleted.
(WebCore::AnimationEffect::simpleIterationProgress const): Deleted.
(WebCore::AnimationEffect::currentIteration const): Deleted.
(WebCore::AnimationEffect::currentDirection const): Deleted.
(WebCore::AnimationEffect::directedProgress const): Deleted.
(WebCore::AnimationEffect::transformedProgress const): Deleted.
(WebCore::AnimationEffect::iterationProgress const): Deleted.
(WebCore::AnimationEffect::getTiming): Deleted.
(WebCore::AnimationEffect::getComputedTiming): Deleted.
(WebCore::AnimationEffect::endTime const): Deleted.
(WebCore::AnimationEffect::activeDuration const): Deleted.
* animation/AnimationEffect.h:
* animation/AnimationEffectPhase.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/AnimationTimeline.h:
* animation/BasicEffectTiming.h: Copied from Source/WebCore/animation/ComputedEffectTiming.h.
* animation/ComputedEffectTiming.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::cancel):
(WebCore::DeclarativeAnimation::phaseWithoutEffect const):
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DeclarativeAnimation.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::apply):
(WebCore::KeyframeEffect::getAnimatedStyle):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectEndTime const):
(WebCore::WebAnimation::computeRelevance):
(WebCore::WebAnimation::timeToNextTick const):
2019-01-07 Youenn Fablet <youenn@apple.com>
Crash in SWServer::Connection::resolveRegistrationReadyRequests
https://bugs.webkit.org/show_bug.cgi?id=193217
Reviewed by Chris Dumez.
As can be seen from the traces, SWServer might clear its connections HashMap in its destructor.
This might then trigger calling SWServer::resolveRegistrationReadyRequests.
This method is iterating on the connections HashMap which is being cleared.
To remove this problem, move the HashMap in a temporary variable and clear the temporary variable.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
2019-01-07 Jer Noble <jer.noble@apple.com>
REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53
https://bugs.webkit.org/show_bug.cgi?id=193211
<rdar://problem/46937412>
Reviewed by Eric Carlson.
Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in
std::unique_ptrs, and not in Ref or RefPtr.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2019-01-07 David Kilzer <ddkilzer@apple.com>
Prefer RetainPtr<NSObject> to RetainPtr<NSObject *>
<https://webkit.org/b/193056>
Reviewed by Alex Christensen.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:]):
(-[WebAVStreamDataParserListener streamDataParser:didParseStreamDataAsAsset:withDiscontinuity:]):
* platform/network/cf/AuthenticationChallenge.h:
- Remove '*' from RetainPtr<> type.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::cookiesForURL):
- Once retainPtr() was changed to return RetainPtr<NSArray>
instead of RetainPtr<NSArray *> here, that forced the type of
`cookiesPtr` to change as well since
Optional<RetainPtr<NSArray>> is not assignable to
Optional<RetainPtr<NSArray *>> without further template
specialization, which didn't seem useful since
Optional<RetainPtr<>> variable types are rarely used.
2019-01-07 Devin Rousso <drousso@apple.com>
Web Inspector: extend XHR breakpoints to work with fetch
https://bugs.webkit.org/show_bug.cgi?id=185843
<rdar://problem/40431027>
Reviewed by Matt Baker.
Test: inspector/dom-debugger/url-breakpoints.html
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willFetch): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willFetchImpl): Added.
* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::disable):
(WebCore::InspectorDOMDebuggerAgent::discardBindings):
(WebCore::InspectorDOMDebuggerAgent::setURLBreakpoint): Added.
(WebCore::InspectorDOMDebuggerAgent::removeURLBreakpoint): Added.
(WebCore::InspectorDOMDebuggerAgent::breakOnURLIfNeeded): Added.
(WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
(WebCore::InspectorDOMDebuggerAgent::willFetch): Added.
(WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint): Deleted.
(WebCore::InspectorDOMDebuggerAgent::removeXHRBreakpoint): Deleted.
2019-01-07 Eric Carlson <eric.carlson@apple.com>
Cleanup AudioTrackPrivateMediaStreamCocoa
https://bugs.webkit.org/show_bug.cgi?id=193208
<rdar://problem/42225870>
Reviewed by Youenn Fablet.
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and
output format descriptions after stopping the audio unit.
2019-01-07 Devin Rousso <drousso@apple.com>
Web Inspector: Network: show secure connection details per-request
https://bugs.webkit.org/show_bug.cgi?id=191539
<rdar://problem/45979891>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/network/resource-security-connection.html
* platform/network/NetworkLoadMetrics.h:
(WebCore::NetworkLoadMetrics:isolatedCopy):
(WebCore::NetworkLoadMetrics:clearNonTimingData):
(WebCore::NetworkLoadMetrics:operator==):
(WebCore::NetworkLoadMetrics:encode):
(WebCore::NetworkLoadMetrics:decode):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForMetrics):
2019-01-07 Eric Carlson <eric.carlson@apple.com>
Deactivate audio session whenever possible
https://bugs.webkit.org/show_bug.cgi?id=193188
<rdar://problem/42678977>
Reviewed by Jer Noble.
Test: media/deactivate-audio-session.html
* platform/audio/AudioSession.cpp:
(WebCore::AudioSession::tryToSetActive):
(WebCore::AudioSession::tryToSetActiveInternal):
* platform/audio/AudioSession.h:
(WebCore::AudioSession::isActive const):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::deactivateAudioSession):
(WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession):
(WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession):
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::tryToSetActiveInternal):
(WebCore::AudioSession::tryToSetActive): Deleted.
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSession::tryToSetActiveInternal):
(WebCore::AudioSession::tryToSetActive): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::audioSessionActive const):
* testing/Internals.h:
* testing/Internals.idl:
2019-01-07 David Kilzer <ddkilzer@apple.com>
PlatformECKey should use a std::unique_ptr
<https://webkit.org/b/193170>
Reviewed by Brent Fulgham.
Broadly:
- Switch from using raw pointers to using std::unique_ptr<> to
hold PlatformECKey.
- Introduce PlatformECKeyContainer type to handle different
std::unique_ptr<> types on each platform.
- Get rid of custom CryptoKeyEC destructors since the
std::unique_ptr<> handles that with a Deleter.
- Initialize stack variables to nullptr.
* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
(WebCore::CryptoKeyEC::keySizeInBits const):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportRaw const):
(WebCore::CryptoKeyEC::platformAddFieldElements const):
(WebCore::CryptoKeyEC::platformExportSpki const):
(WebCore::CryptoKeyEC::platformExportPkcs8 const):
(WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
* crypto/keys/CryptoKeyEC.cpp:
(WebCore::CryptoKeyEC::CryptoKeyEC):
* crypto/keys/CryptoKeyEC.h:
(WebCore::CCECCryptorRefDeleter::operator() const):
* crypto/mac/CryptoKeyECMac.cpp:
(WebCore::CryptoKeyEC::keySizeInBits const):
(WebCore::CryptoKeyEC::platformGeneratePair):
(WebCore::CryptoKeyEC::platformImportRaw):
(WebCore::CryptoKeyEC::platformExportRaw const):
(WebCore::CryptoKeyEC::platformImportJWKPublic):
(WebCore::CryptoKeyEC::platformImportJWKPrivate):
(WebCore::CryptoKeyEC::platformAddFieldElements const):
(WebCore::CryptoKeyEC::platformImportSpki):
(WebCore::CryptoKeyEC::platformExportSpki const):
(WebCore::CryptoKeyEC::platformImportPkcs8):
(WebCore::CryptoKeyEC::platformExportPkcs8 const):
(WebCore::CryptoKeyEC::~CryptoKeyEC): Deleted.
2019-01-07 Antti Koivisto <antti@apple.com>
UI process side scrollbars for UI side compositing on Mac
https://bugs.webkit.org/show_bug.cgi?id=193106
Reviewed by Tim Horton.
* page/FrameView.cpp:
(WebCore::FrameView::paintScrollCorner):
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
Pass scrollbar host layers and the dark appearance bit to the scrolling tree.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::verticalScrollbarLayerForFrameView):
(WebCore::ScrollingCoordinator::horizontalScrollbarLayerForFrameView):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollableAreaParameters::ScrollableAreaParameters):
(WebCore::ScrollableAreaParameters::operator== const):
* page/scrolling/ScrollingStateFrameScrollingNode.cpp:
(WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
(WebCore::ScrollingStateFrameScrollingNode::setScrollbarLayers):
* page/scrolling/ScrollingStateFrameScrollingNode.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const):
(WebCore::ScrollingTreeScrollingNode::totalContentsSize const):
(WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const):
(WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const):
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::useDarkAppearanceForScrollbars const):
Factor into a function as this is used in several places.
* platform/ScrollableArea.h:
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]):
* platform/mac/ScrollbarThemeMac.h:
2019-01-07 Wenson Hsieh <wenson_hsieh@apple.com>
Native caret shows up alongside the page's caret when requesting desktop site on jsfiddle.net
https://bugs.webkit.org/show_bug.cgi?id=193180
<rdar://problem/45971041>
Reviewed by Tim Horton.
Adjust a method on RenderObject to additionally detect when the RenderObject is inside of an `overflow: hidden`
container that is also empty. See WebKit ChangeLog for more details.
Test: editing/selection/ios/hide-selection-in-empty-overflow-hidden-container.html
editing/selection/ios/show-selection-in-empty-overflow-hidden-document.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isTransparentOrFullyClippedRespectingParentFrames const):
(WebCore::RenderObject::isTransparentRespectingParentFrames const): Deleted.
* rendering/RenderObject.h:
2019-01-07 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes.
https://bugs.webkit.org/show_bug.cgi?id=193183
Reviewed by Antti Koivisto.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2019-01-07 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=193181
Reviewed by Antti Koivisto.
This is in preparation to share margin collapsing across all boxes in block formatting context.
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted.
2019-01-07 Zan Dobersek <zdobersek@igalia.com>
[WPE] Use Widget bounds for PlatformScreen rectangle information
https://bugs.webkit.org/show_bug.cgi?id=193190
Reviewed by Philippe Normand.
Provide a better screen area estimate in screenRect() and
screenAvailableRect() return values than the current 1240x640 value by
using the Widget's bounds rectangle.
This approach is only factually correct when the Widget-associated view
is displayed in fullscreen, but it provides a better estimate even when
displayed in any other case as well. WPE doesn't provide specific API
that could enable the embedding environment to provide this information.
* platform/wpe/PlatformScreenWPE.cpp:
(WebCore::screenRect): Return bounds of the Widget object.
(WebCore::screenAvailableRect): Relay the call to screenRect().
2019-01-07 Zan Dobersek <zdobersek@igalia.com>
Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const
https://bugs.webkit.org/show_bug.cgi?id=193189
Reviewed by Philippe Normand.
The transform getter methods on the Gradient and Pattern classes both
return const references to the transform objects, and don't modify any
internal state. They should be marked const accordingly, allowing
invocations of these two methods through const references to Gradient
and Pattern objects.
* platform/graphics/Gradient.h:
(WebCore::Gradient::gradientSpaceTransform): Now const.
* platform/graphics/Pattern.h:
(WebCore::Pattern::patternSpaceTransform): Now const.
2019-01-07 Zan Dobersek <zdobersek@igalia.com>
REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder
https://bugs.webkit.org/show_bug.cgi?id=193187
Reviewed by Philippe Normand.
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the
setEncodedDataStatusChangeCallback() method when the returned
ImageDecoder object is null.
2019-01-06 Zan Dobersek <zdobersek@igalia.com>
[Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes
https://bugs.webkit.org/show_bug.cgi?id=193133
Reviewed by Michael Catanzaro.
Move the CoordinatedGraphics-specific files under
page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along
with renaming the files and classes accordingly. Implementation will
only depend on the Nicosia-specific layer structure and is not specific
to the CoordinatedGraphics system.
* PlatformPlayStation.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp.
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h.
* page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp.
* page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp.
* page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h.
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp.
* page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h.
* page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp.
* page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h.
* page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp.
* page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h.
* platform/TextureMapper.cmake:
2019-01-06 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import U2F command/response converters from Chromium
https://bugs.webkit.org/show_bug.cgi?id=193150
<rdar://problem/47054028>
Reviewed by Brent Fulgham.
This patch imports Chromium's U2F command/response converters:
https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability
1. It directly imports the following files and suit them to WebKit's coding style:
https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0
https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0
https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0
2. It gathers the following methods into U2fResponseConverter:
AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse()
AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse()
3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly.
Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h
and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7).
Covered by API tests.
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
* Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h.
* Modules/webauthn/WebAuthenticationUtils.cpp: Added.
(WebCore::convertBytesToVector):
(WebCore::produceRpIdHash):
(WebCore::encodeES256PublicKeyAsCBOR):
(WebCore::buildAttestedCredentialData):
(WebCore::buildAuthData):
(WebCore::buildAttestationObject):
* Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h.
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::getCredentialId):
(fido::readCTAPGetInfoResponse):
* Modules/webauthn/fido/FidoConstants.h:
* Modules/webauthn/fido/U2fCommandConstructor.cpp: Added.
(fido::WebCore::constructU2fRegisterCommand):
(fido::WebCore::constructU2fSignCommand):
(fido::isConvertibleToU2fRegisterCommand):
(fido::isConvertibleToU2fSignCommand):
(fido::convertToU2fRegisterCommand):
(fido::convertToU2fCheckOnlySignCommand):
(fido::convertToU2fSignCommand):
(fido::constructBogusU2fRegistrationCommand):
* Modules/webauthn/fido/U2fCommandConstructor.h: Added.
* Modules/webauthn/fido/U2fResponseConverter.cpp: Added.
(fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse):
(fido::WebCore::extractCredentialIdFromU2fRegistrationResponse):
(fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse):
(fido::WebCore::parseX509Length):
(fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse):
(fido::readU2fRegisterResponse):
(fido::readFromU2fSignResponse):
* Modules/webauthn/fido/U2fResponseConverter.h: Added.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2019-01-06 David Kilzer <ddkilzer@apple.com>
Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193177>
<rdar://problem/47072196>
Reviewed by Saam Barati.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing
raw pointers to heap-allocated __block variables to hold the
WTF::Function objects until they are consumed within the block
passed to dispatch_async(). The __block variables act like
captured variables in a C++ lambda and have the same lifetime as
the block that they are captured in. Note that we would have to
convert the source file from C++ to Objective-C++ to use a C++
lambda functor with dispatch_async(), which creates its own
issue because the comipiler requires a copy constructor to
convert the C++ lambda to a block functor, but the copy
constructor for the C++ lambda is implicitly deleted because the
WTF::Function copy constructor is explicitly deleted. Whew!
2019-01-06 Pablo Saavedra <psaavedra@igalia.com>
[WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions.
https://bugs.webkit.org/show_bug.cgi?id=193174
Reviewed by Michael Catanzaro.
* page/Page.cpp:
(WebCore::Page::stopAllMediaPlayback):
(WebCore::Page::suspendAllMediaPlayback):
(WebCore::Page::resumeAllMediaPlayback):
2019-01-05 David Kilzer <ddkilzer@apple.com>
Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193154>
<rdar://problem/47052993>
Reviewed by Brent Fulgham.
Broadly:
- Fix leaks by switching from using raw pointers to using
std::unique_ptr<>.
- Introduce PlatformRSAKeyContainer type to handle different
std::unique_ptr<> on each platform.
- Get rid of custom CryptoKeyRSA destructors since the
std::unique_ptr<> handles that with a Deleter.
- Initialize stack variables to nullptr.
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::CryptoKeyRSA):
(WebCore::CryptoKeyRSA::keySizeInBits const):
(WebCore::CryptoKeyRSA::generatePair):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::exportSpki const):
(WebCore::CryptoKeyRSA::exportPkcs8 const):
(WebCore::CryptoKeyRSA::algorithm const):
(WebCore::CryptoKeyRSA::exportData const):
(WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
* crypto/keys/CryptoKeyRSA.h:
(WebCore::CCRSACryptorRefDeleter::operator() const):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents):
(WebCore::getPrivateKeyComponents):
(WebCore::CryptoKeyRSA::CryptoKeyRSA):
(WebCore::CryptoKeyRSA::create):
(WebCore::CryptoKeyRSA::exportData const):
(WebCore::CryptoKeyRSA::generatePair):
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
(WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted.
2019-01-05 Zalan Bujtas <zalan@apple.com>
Incorrect clipping across compositing boundary.
https://bugs.webkit.org/show_bug.cgi?id=193172
<rdar://problem/44693008>
Reviewed by Simon Fraser.
Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching.
The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers
clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match.
For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions)
but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct.
It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root.
Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
2019-01-05 Youenn Fablet <youenn@apple.com>
Service Worker fetch should obey its referrer policy
https://bugs.webkit.org/show_bug.cgi?id=193152
Reviewed by Chris Dumez.
Pass referrer policy retrieved when fetching the service worker script to the SWServer.
The SWServer then stores it persistently and sends it to the manager creating service workers.
This manager will then set the referrer policy on the dummy Document of the corresponding service worker.
Covered by rebased test.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::referrerPolicy const):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::failedFetchingScript):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::createPageForServiceWorker):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::recordsTableSchema):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:
2019-01-04 Simon Fraser <simon.fraser@apple.com>
Factor legacy WK1 code for fixed and scrolling layers into their own helper class
https://bugs.webkit.org/show_bug.cgi?id=193165
Reviewed by Frédéric Wang.
RenderLayerCompositor has some code to handle registration of viewport-constrained
and scrolling layers which is specific to iOS WK1. To reduce pollution, move this
into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only
allocated for iOS WK1.
iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(),
we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget
(i.e. WK1).
* page/ChromeClient.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we
destroy the render tree of pages in the page cache, so we should never hit this code path.
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers):
(WebCore::scrollbarHasDisplayNone):
(WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate):
(WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers):
(WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer):
(WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer):
(WebCore::updateScrollingLayerWithClient): Deleted.
(WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted.
(WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted.
(WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted.
(WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted.
* rendering/RenderLayerCompositor.h:
(WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::~ServiceWorkerContainer):
2019-01-05 Zalan Bujtas <zalan@apple.com>
[LFC] VerticalMargin should only have the used values.
https://bugs.webkit.org/show_bug.cgi?id=193168
Reviewed by Antti Koivisto.
Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin.
ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the
collapsed (optional) and the non-collapsed values.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted.
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/LayoutUnits.h:
* layout/MarginTypes.h:
(WebCore::Layout::UsedVerticalMargin::before const):
(WebCore::Layout::UsedVerticalMargin::after const):
(WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const):
(WebCore::Layout::UsedVerticalMargin::collapsedValues const):
(WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const):
(WebCore::Layout::UsedVerticalMargin::setCollapsedValues):
(WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin):
(WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted.
(WebCore::Layout::VerticalMargin::collapsedValues const): Deleted.
(WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted.
(WebCore::Layout::VerticalMargin::VerticalMargin): Deleted.
(WebCore::Layout::VerticalMargin::usedValues const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::verticalMargin const):
(WebCore::Display::Box::marginBefore const):
(WebCore::Display::Box::marginAfter const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2019-01-04 Daniel Bates <dabates@apple.com>
REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com
https://bugs.webkit.org/show_bug.cgi?id=192996
<rdar://problem/46573552>
Reviewed by Simon Fraser.
Only scroll a text field if its inner text size changes and it is the currently active and
focused element on the page.
Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
2019-01-04 Alex Christensen <achristensen@webkit.org>
Progress towards fixing Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=193105
Reviewed by Don Olmstead.
* PlatformMac.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPURenderPassEncoder.h:
2019-01-04 Zalan Bujtas <zalan@apple.com>
[iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker()
https://bugs.webkit.org/show_bug.cgi?id=189608
<rdar://problem/44473299>
Reviewed by Simon Fraser.
When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well.
Covered by fast/frames/invalid-frameset.html.
* rendering/RenderFrameSet.cpp:
(WebCore::clearSiblingSubtrees):
(WebCore::RenderFrameSet::positionFrames):
(WebCore::RenderFrameSet::positionFramesWithFlattening):
2019-01-04 Youenn Fablet <youenn@apple.com>
[Fetch API] Implement abortable fetch
https://bugs.webkit.org/show_bug.cgi?id=174980
<rdar://problem/46861402>
Reviewed by Chris Dumez.
Add an AbortSignal to FetchRequest.
Add support for AbortSignal algorithm.
The fetch request signal is added an algorithm to abort the fetch.
Update clone algorithm to let signal of the cloned request be following the origin request.
Update ReadableStream error handling to return an exception instead of a string.
This allows passing an AbortError instead of a TypeError as previously done.
Update FetchBodyOwner to store a loading error either as an exception or as a resource error.
The latter is used for passing the error from service worker back to the page.
The former is used to pass it to ReadableStream or body accessors.
Covered by enabled tests.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::consumeAsStream):
(WebCore::FetchBody::loadingFailed):
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::loadingFailed):
* Modules/fetch/FetchBodyConsumer.h:
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::arrayBuffer):
(WebCore::FetchBodyOwner::blob):
(WebCore::FetchBodyOwner::cloneBody):
(WebCore::FetchBodyOwner::formData):
(WebCore::FetchBodyOwner::json):
(WebCore::FetchBodyOwner::text):
(WebCore::FetchBodyOwner::loadBlob):
(WebCore::FetchBodyOwner::blobLoadingFailed):
(WebCore::FetchBodyOwner::consumeBodyAsStream):
(WebCore::FetchBodyOwner::setLoadingError):
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::loadingError const):
(WebCore::FetchBodyOwner::loadingException const):
* Modules/fetch/FetchBodySource.cpp:
(WebCore::FetchBodySource::error):
* Modules/fetch/FetchBodySource.h:
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith):
(WebCore::FetchRequest::clone):
* Modules/fetch/FetchRequest.h:
(WebCore::FetchRequest::FetchRequest):
* Modules/fetch/FetchRequest.idl:
* Modules/fetch/FetchRequestInit.h:
(WebCore::FetchRequestInit::hasMembers const):
* Modules/fetch/FetchRequestInit.idl:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone):
(WebCore::FetchResponse::fetch):
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::error):
* dom/AbortSignal.cpp:
(WebCore::AbortSignal::abort):
(WebCore::AbortSignal::follow):
* dom/AbortSignal.h:
2019-01-04 Brent Fulgham <bfulgham@apple.com>
Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox
https://bugs.webkit.org/show_bug.cgi?id=193155
<rdar://problem/40230982>
Reviewed by Chris Dumez.
Test: fast/loader/comment-only-javascript-url.html
Make a special case for URLs beginning with 'javascript:'. We should always
treat these as JS URLs, even if the content contained within the URL
string might match other parts of the URL parsing spec.
* html/URLUtils.h:
(WebCore::URLUtils<T>::protocol const):
2019-01-04 Jer Noble <jer.noble@apple.com>
[WebKitLegacy] Media playback pauses on scroll
https://bugs.webkit.org/show_bug.cgi?id=192829
Reviewed by Eric Carlson.
New API tests:
WebKitLegacy.ScrollingDoesNotPauseMedia
WKWebView.StopAllMediaPlayback
WKWebView.SuspendResumeAllMediaPlayback
Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause
video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls
suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior.
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::stopAllMediaPlayback):
(WebCore::Document::suspendAllMediaPlayback):
(WebCore::Document::resumeAllMediaPlayback):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::didFinishInsertingNode):
(WebCore::HTMLMediaElement::setSrcObject):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const):
* page/Page.cpp:
(WebCore::Page::stopAllMediaPlayback):
(WebCore::Page::suspendAllMediaPlayback):
(WebCore::Page::resumeAllMediaPlayback):
* page/Page.h:
(WebCore::Page::mediaPlaybackIsSuspended):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument):
(WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument):
* platform/audio/PlatformMediaSessionManager.h:
2019-01-04 Chris Dumez <cdumez@apple.com>
Add support for toggling device orientation API support per site
https://bugs.webkit.org/show_bug.cgi?id=193143
<rdar://problem/46605724>
Reviewed by Alex Christensen.
Add support for toggling device orientation API support per site via _WKWebsitePolicies.
* dom/Document.cpp:
(WebCore::Document::simulateDeviceOrientationChange):
* dom/Document.h:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::deviceOrientationEventEnabled const):
(WebCore::DocumentLoader::setDeviceOrientationEventEnabled):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
2019-01-04 Jer Noble <jer.noble@apple.com>
Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com
https://bugs.webkit.org/show_bug.cgi?id=191806
<rdar://problem/46151477>
Reviewed by Dean Jackson.
Test: http/tests/images/mp4-partial-load.html
Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data
synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads
sample metadata, including the byte offset and byte length of the sample data. By waiting until the
AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without
blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset
attachements in the sample with actual data, and mark the sample as "complete".
Because the existing ImageSource assumes that image data parsing will occur synchronously, and that
synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which
allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the
CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the
renderer's animation loop.
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged):
(WebCore::CachedImage::encodedDataStatusChanged):
* loader/cache/CachedImage.h:
* platform/graphics/ImageDecoder.h:
(WebCore::ImageDecoder::setEncodedDataStatusChangeCallback):
* platform/graphics/ImageObserver.h:
(WebCore::ImageObserver::encodedDataStatusChanged):
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::ensureDecoderAvailable):
(WebCore::ImageSource::encodedDataStatusChanged):
(WebCore::ImageSource::frameDecodingStatusAtIndex):
* platform/graphics/ImageSource.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(-[WebCoreSharedBufferResourceLoaderDelegate data]):
(WebCore::ImageDecoderAVFObjCSample::byteRange const):
(WebCore::ImageDecoderAVFObjC::readSamples):
(WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback):
(WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
(WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
(WebCore::ImageDecoderAVFObjC::sampleIsComplete const):
2019-01-04 Youenn Fablet <youenn@apple.com>
CSP violation reports should bypass CSP checks
https://bugs.webkit.org/show_bug.cgi?id=192857
<rdar://problem/46887236>
Reviewed by Chris Dumez.
For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy.
This new option is unused by WebKit Legacy.
It is used by WebKit loader strategy to only send any CSP response header to network process
in case CSP checks should be done.
This option is used to disable CSP checks for Ping Loads that report CSP violations.
Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html
* loader/LoaderStrategy.h:
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):
(WebCore::PingLoader::startPingLoad):
* loader/PingLoader.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
2019-01-04 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function
https://bugs.webkit.org/show_bug.cgi?id=193129
Reviewed by Tim Horton.
Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp.
(WebCore::nameForUndoRedo):
* editing/EditAction.h:
* editing/Editor.cpp:
2019-01-03 Matt Rajca <mrajca@apple.com>
Make DidPlayMediaPreventedFromPlaying autoplay event more generic.
https://bugs.webkit.org/show_bug.cgi?id=193128
rdar://34554231
Reviewed by Jer Noble.
Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for
media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture"
event along with a flag that indicates whether or not autoplay was actually prevented.
Moreover, we can include a flag that indicates whether the media element in question
is main content. Clients will then know in more cases when media was played with a user
gesture, whether or not it has audio, as well as its main content status. While the main
content heuristics may not be perfect, they covered the top 20 video-centric websites that
this was tested with and are meant to be used by clients for data evaluation purposes.
As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState
since it now also applies to cases where there is a user gesture. The
`m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of
`playbackStartedTime` which also covers all the cases we care about.
Tests: existing API tests were updated to reflect the new names. New API tests
were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent.
* html/HTMLMediaElement.cpp:
(WebCore::convertEnumerationToString): Update to new enum cases.
(WebCore::HTMLMediaElement::setReadyState): Ditto.
(WebCore::HTMLMediaElement::play): Ditto.
(WebCore::HTMLMediaElement::playInternal): Also cover the case where
playback was not prevented but there was a user gesture.
(WebCore::HTMLMediaElement::pauseInternal): Use new name.
(WebCore::HTMLMediaElement::setVolume): Use new name.
(WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the
DidPlayMediaWithUserGesture event when playback was started with a user
gesture as well.
(WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name.
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
(WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
(WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state.
(WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name.
(WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting
m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime.
(WebCore::HTMLMediaElement::updateShouldPlay): Use new name.
(WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed.
* html/HTMLMediaElement.h:
(WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from...
(WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't
do the hit testing check for the purposes of autoplay events. It seems to fail on the
basic Vimeo player due to overlapping divs.
(WebCore::isElementMainContentForPurposesOfAutoplay):
(WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior
here of hit testing.
(WebCore::isMainContentForPurposesOfAutoplay): Renamed.
* html/MediaElementSession.h:
* page/AutoplayEvent.h:
2019-01-04 Youenn Fablet <youenn@apple.com>
Crash in WebCore::ServiceWorkerGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=192513
<rdar://problem/46563880>
Reviewed by Alex Christensen.
Store the identifier in its own variable to make sure we do not use workerThread after being moved.
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::skipWaiting):
2019-01-04 Chris Fleizach <cfleizach@apple.com>
AX: String check: "Rule" does not reflect the meaning of the <hr> html tag
https://bugs.webkit.org/show_bug.cgi?id=193041
<rdar://problem/46954090>
Reviewed by Zalan Bujtas.
* en.lproj/Localizable.strings:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::AXHorizontalRuleDescriptionText):
2019-01-04 Zalan Bujtas <zalan@apple.com>
[LFC] ComputedHorizontalMargin should have optional members
https://bugs.webkit.org/show_bug.cgi?id=193131
Reviewed by Antti Koivisto.
Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional.
(see computed vs used values)
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted.
* layout/LayoutUnits.h:
* layout/MarginTypes.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setHorizontalComputedMargin):
(WebCore::Display::Box::computedMarginStart const):
(WebCore::Display::Box::computedMarginEnd const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2019-01-04 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Use computedValue and usedValue consistently
https://bugs.webkit.org/show_bug.cgi?id=193059
Reviewed by Antti Koivisto.
https://www.w3.org/TR/CSS22/cascade.html#value-stages
6.1.2 Computed values
Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units
are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document...
6.1.3 Used values
Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document
is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined
until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining
dependencies into an absolute value.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutUnits.h:
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasValidHorizontalComputedMargin):
(WebCore::Display::Box::setHorizontalComputedMargin):
(WebCore::Display::Box::computedMarginStart const):
(WebCore::Display::Box::computedMarginEnd const):
(WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted.
(WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted.
(WebCore::Display::Box::nonComputedMarginStart const): Deleted.
(WebCore::Display::Box::nonComputedMarginEnd const): Deleted.
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
2019-01-03 Zalan Bujtas <zalan@apple.com>
REGRESSION: -webkit-appearance test case crashes
https://bugs.webkit.org/show_bug.cgi?id=189302
<rdar://problem/44143049>
Reviewed by Wenson Hsieh.
The painting and the layout positions of the cancel button need to match in order to be able to interact with it.
This patch removes the previous position inlining attempts.
Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2019-01-03 David Kilzer <ddkilzer@apple.com>
Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193122>
<rdar://problem/47022987>
Reviewed by Youenn Fablet.
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const):
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const):
- Remove `final` keyword so that
`new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
can be called.
(WebCore::LibWebRTCCertificateGenerator::generateCertificate):
- To fix the leak call
`new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()`
to create the object.
2019-01-03 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset)
https://bugs.webkit.org/show_bug.cgi?id=193124
rdar://problem/46755409
Reviewed by Tim Horton.
Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger
an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry().
So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code
path that runs when top content inset changes.
Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::frameViewDidChangeSize):
2019-01-03 Chris Dumez <cdumez@apple.com>
Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&)
https://bugs.webkit.org/show_bug.cgi?id=192997
<rdar://problem/46217271>
Reviewed by Antti Koivisto.
isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers.
The issue is that a Frame can be its opener. There could also be a cycle in the opener chain.
To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now
only check if the frames belong to the same pages or if their openers do. We no longer check
openers' opener and up.
Note that this function is used to check if a frame is allowed to target another. In practice,
it is unlikely to be useful to navigate an opener's opener and an openee's openee.
Tests: fast/dom/Window/window-open-opener-cycle.html
fast/dom/Window/window-open-self-as-opener.html
* page/FrameTree.cpp:
(WebCore::isFrameFamiliarWith):
2019-01-02 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later
https://bugs.webkit.org/show_bug.cgi?id=193095
<rdar://problem/47014944>
Reviewed by Zalan Bujtas.
In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave
and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)),
which continues to affect the appearance of text.
Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing.
Test: compositing/contents-format/subpixel-antialiased-text.html
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayer::drawLayerContents):
2019-01-02 David Kilzer <ddkilzer@apple.com>
Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
<https://webkit.org/b/193016>
<rdar://problem/46925703>
Reviewed by Simon Fraser.
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::copySampleBufferWithCurrentTimeStamp):
- Change to return RetainPtr<CMSampleBufferRef>.
- Check return value of CMSampleBufferCreateCopyWithNewTiming().
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
- Check return value of copySampleBufferWithCurrentTimeStamp().
- Fix leak by using RetainPtr<CMSampleBufferRef> returned from
copySampleBufferWithCurrentTimeStamp() instead of leaking
`bufferWithCurrentTime` by using retainPtr().
(WebCore::createAudioFormatDescription):
- Extract method from appendAudioSampleBuffer() to return
RetainPtr<CMFormatDescriptionRef> after calling
CMAudioFormatDescriptionCreate().
- Check return value of CMAudioFormatDescriptionCreate().
(WebCore::createAudioSampleBufferWithPacketDescriptions):
- Extract method from appendAudioSampleBuffer() to return
RetainPtr<CMSampleBufferRef> after calling
CMAudioSampleBufferCreateWithPacketDescriptions().
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
- Check return values of createAudioFormatDescription() and
createAudioSampleBufferWithPacketDescriptions().
- Fix leaks by extracting code into helper methods that return
RetainPtr<> objects instead of leaking CMFormatDescriptionRef
directly or leaking `sampleBuffer` by using retainPtr().
2019-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
Add support for using the current text selection as the find string on iOS
https://bugs.webkit.org/show_bug.cgi?id=193034
<rdar://problem/45138739>
Reviewed by Tim Horton.
Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find
pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI
process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are
able to trigger find-in-page with this string.
Test: WebKit.UseSelectionAsFindString
* editing/Editor.cpp:
(WebCore::Editor::canCopyExcludingStandaloneImages const):
Make this helper function cross-platform.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::createCommandMap):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::takeFindStringFromSelection):
Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the
find string (see WebKit/ChangeLog for more details).
* editing/mac/EditorMac.mm:
(WebCore::Editor::canCopyExcludingStandaloneImages): Deleted.
(WebCore::Editor::takeFindStringFromSelection): Deleted.
* loader/EmptyClients.cpp:
* page/EditorClient.h:
Add a new editor client method to send the string for find-in-page to the UI process.
2019-01-02 Devin Rousso <webkit@devinrousso.com>
Web Inspector: Implement `queryObjects` Command Line API
https://bugs.webkit.org/show_bug.cgi?id=176766
<rdar://problem/34890689>
Reviewed by Joseph Pecoraro.
Test: inspector/console/queryObjects.html
* inspector/CommandLineAPIModuleSource.js:
(CommandLineAPI):
(CommandLineAPIImpl.prototype.queryObjects): Added.
2019-01-02 Charles Vazac <cvazac@gmail.com>
Fix resourcetimingbufferfull bubbles attribute
https://bugs.webkit.org/show_bug.cgi?id=193087
Reviewed by Chris Dumez.
This change is covered by web-platform-tests [1].
[1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20
* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired):
2019-01-02 Simon Fraser <simon.fraser@apple.com>
Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class
https://bugs.webkit.org/show_bug.cgi?id=193010
Reviewed by Zalan Bujtas.
Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h,
and make it an enum class.
* page/FrameView.cpp:
(WebCore::FrameView::scrollLayerID const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::~RenderLayerBacking):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
(WebCore::operator<<):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
* rendering/RenderLayerCompositor.h:
2019-01-02 Simon Fraser <simon.fraser@apple.com>
Don't spin up a CalcParser if the current token is not a function token
https://bugs.webkit.org/show_bug.cgi?id=193067
Reviewed by Zalan Bujtas.
Various functions in CSSPropertyParserHelpers fall back to trying to parse
a calc expression if the normal parsing fails. Don't do this unless the
current token is a function token, which should be slightly more efficient.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeInteger):
(WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
(WebCore::CSSPropertyParserHelpers::consumeNumber):
(WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
(WebCore::CSSPropertyParserHelpers::consumeLength):
(WebCore::CSSPropertyParserHelpers::consumePercent):
(WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeAngle):
(WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeTime):
2019-01-02 Simon Fraser <simon.fraser@apple.com>
Support css-color-4 rgb functions
https://bugs.webkit.org/show_bug.cgi?id=192321
Reviewed by Zalan Bujtas.
Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions.
The differences are:
1. There is a new comma-free syntax, where the optional alpha is separated by a slash:
rgb(128 34 56)
rgb(128 34 56 / 50%)
2. Floating point values are allowed, and rounded:
rgb(128.5 34.2 56.5) becomes rgb(129 34 57)
3. rgba() is a pure alias for rgb(), so these are equivalent:
rgb(128 34 56 / 50%)
rgba(128 34 56 / 50%)
hsl()/hsla() parsing was already updated to this new syntax in r230861.
Tested by tests in imported/w3c/web-platform-tests/css/css-color/
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::clampRGBComponent):
(WebCore::CSSPropertyParserHelpers::parseRGBParameters):
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
2019-01-02 Simon Fraser <simon.fraser@apple.com>
Handle calc() expressions in gradient color stops
https://bugs.webkit.org/show_bug.cgi?id=193066
rdar://problem/46961985
Reviewed by Sam Weinig.
Fix two issues that prevented calc() expressions from working in conic-gradient color stops,
for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent
calc values as well as angle ones.
Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account),
just as isPx() etc do.
Test: fast/gradients/conic-calc-stop-position.html
* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isAngle const):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2018-12-31 Keith Miller <keith_miller@apple.com>
SourceProviders should use an actual URL instead of a string
https://bugs.webkit.org/show_bug.cgi?id=192734
Reviewed by Yusuke Suzuki.
Remove ScriptSourceCode's URL member and make the url() method
reference the URL on the SourceProvider. Also, avoid some
ref count churn.
Additionally, this patch fixes an existing bug in
WorkletGlobalScope() that would use a ScriptSourceCode after
WTFMoving it.
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::execute):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeScriptInWorld):
(WebCore::ScriptController::executeScript):
* bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
(WebCore::ScriptSourceCode::m_code):
(WebCore::ScriptSourceCode::url const):
(WebCore::ScriptSourceCode::m_url): Deleted.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::prepareScript):
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executePendingScript):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* page/Frame.cpp:
(WebCore::Frame::injectUserScriptImmediately):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::endElementNs):
2019-01-01 Jeff Miller <jeffm@apple.com>
Update user-visible copyright strings to include 2019
https://bugs.webkit.org/show_bug.cgi?id=192811
Reviewed by Mark Lam.
* Info.plist:
2018-12-30 David Kilzer <ddkilzer@apple.com>
clang-tidy: Save 8 padding bytes on WebCore::BorderEdge
<https://webkit.org/b/193058>
<rdar://problem/46979275>
Reviewed by Yusuke Suzuki.
* rendering/BorderEdge.cpp:
(WebCore::BorderEdge::BorderEdge): Reorder initialization to
match new instance variable order.
* rendering/BorderEdge.h: Reorder instance variables to save
8 padding bytes.
2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Remove one indirection in JSObject::toStringName
https://bugs.webkit.org/show_bug.cgi?id=193037
Reviewed by Keith Miller.
Use old JSObject::toStringName function here.
* bindings/js/JSDOMConstructorBase.cpp:
(WebCore::JSDOMConstructorBase::className):
(WebCore::JSDOMConstructorBase::toStringName):
* bindings/js/JSDOMConstructorBase.h:
(WebCore::JSDOMConstructorBase::className): Deleted.
2018-12-27 Alex Christensen <achristensen@webkit.org>
Resurrect Mac CMake build
https://bugs.webkit.org/show_bug.cgi?id=192658
Reviewed by Yusuke Suzuki.
This makes it so JSC and most of WebCore builds.
WebCore's use of ARC seems inconsistent, so I'll fix that later.
* PlatformMac.cmake:
* config.h:
2018-12-26 Jim Mason <jmason@ibinx.com>
[FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring
https://bugs.webkit.org/show_bug.cgi?id=193036
Reviewed by Michael Catanzaro.
* platform/graphics/FontPlatformData.h:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com>
Remove "using namespace std;"
https://bugs.webkit.org/show_bug.cgi?id=192973
<rdar://problem/46937309>
Unreviewed Windows port Debug builds fix.
No new tests since no behavior changes.
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro.
2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com>
Remove "using namespace std;"
https://bugs.webkit.org/show_bug.cgi?id=192973
Reviewed by Alex Christensen.
Removed "using namespace std" statement, and use std:: prefix.
No new tests since no behavior changes.
* accessibility/win/AXObjectCacheWin.cpp:
* platform/graphics/GraphicsContext3DPrivate.cpp:
* platform/graphics/cairo/ImageBufferCairo.cpp:
* platform/graphics/win/FontPlatformDataCairoWin.cpp:
* platform/graphics/win/FontWin.cpp:
(WebCore::FontCascade::floatWidthForComplexText const):
* platform/graphics/win/GraphicsContextCGWin.cpp:
* platform/graphics/win/GraphicsContextCairoWin.cpp:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
* platform/graphics/win/GraphicsContextWin.cpp:
* platform/graphics/win/SimpleFontDataCGWin.cpp:
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController):
(WebCore::UniscribeController::shapeAndPlaceItem):
* platform/image-decoders/ScalableImageDecoder.cpp:
* platform/text/LocaleICU.cpp:
* platform/text/win/LocaleWin.cpp:
* platform/win/ScrollbarThemeWin.cpp:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderThemeWin.cpp:
(WebCore::RenderThemeWin::adjustMenuListButtonStyle const):
(WebCore::RenderThemeWin::paintSearchFieldCancelButton):
(WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const):
(WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const):
(WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart):
(WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const):
(WebCore::RenderThemeWin::paintSearchFieldResultsButton):
2018-12-24 Simon Fraser <simon.fraser@apple.com>
Change ScrollingNodeType to an enum class
https://bugs.webkit.org/show_bug.cgi?id=193009
Reviewed by Zalan Bujtas.
Change the ScrollingNodeType enum to an enum class.
No behavior change.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::operator<<):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode):
* page/scrolling/ScrollingStateNode.h:
(WebCore::ScrollingStateNode::isFixedNode const):
(WebCore::ScrollingStateNode::isStickyNode const):
(WebCore::ScrollingStateNode::isFrameScrollingNode const):
(WebCore::ScrollingStateNode::isOverflowScrollingNode const):
* page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
(WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode):
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::createNode):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::isFixedNode const):
(WebCore::ScrollingTreeNode::isStickyNode const):
(WebCore::ScrollingTreeNode::isFrameScrollingNode const):
(WebCore::ScrollingTreeNode::isOverflowScrollingNode const):
* page/scrolling/ScrollingTreeOverflowScrollingNode.cpp:
(WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode):
* page/scrolling/ios/ScrollingTreeIOS.cpp:
(WebCore::ScrollingTreeIOS::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
* page/scrolling/mac/ScrollingTreeMac.cpp:
(ScrollingTreeMac::createScrollingTreeNode):
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
* platform/graphics/GraphicsLayerClient.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::scrollCoordinationRoleForNodeType):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2018-12-22 Carlos Garcia Campos <cgarcia@igalia.com>
[HarfBuzz] Width not correctly reported as 0 for zero font size
https://bugs.webkit.org/show_bug.cgi?id=192986
Reviewed by Michael Catanzaro.
Fixes test fast/text/font-size-zero.html
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font
size is zero.
2018-12-20 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Use Ref<> as much as possible
https://bugs.webkit.org/show_bug.cgi?id=192808
Reviewed by Alex Christensen.
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::bodyAsFormData const):
* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::getCurrentPosition):
(WebCore::Geolocation::watchPosition):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::objectStoreNames const):
* Modules/indexeddb/IDBDatabase.h:
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::indexNames const):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::scheduleOperation):
* Modules/indexeddb/IDBTransaction.h:
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::createTransactionOperation):
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia const):
(WebCore::MediaDevices::getDisplayMedia const):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::create):
* Modules/mediastream/UserMediaRequest.h:
* Modules/webaudio/AudioParam.cpp:
(WebCore::AudioParam::calculateFinalValues):
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::initialize):
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::execute):
* Modules/webgpu/WebGPU.cpp:
(WebCore::WebGPU::requestAdapter const):
* Modules/webgpu/WebGPUAdapter.cpp:
(WebCore::WebGPUAdapter::create):
* Modules/webgpu/WebGPUAdapter.h:
* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::create):
* Modules/webgpu/WebGPUBuffer.h:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::createBuffer const):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::createCommandBuffer const):
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
* Modules/webgpu/WebGPURenderPipeline.h:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
* Modules/webgpu/WebGPUShaderModule.h:
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::create):
* Modules/webgpu/WebGPUTextureView.h:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::rangeMatchesTextNearRange):
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
* accessibility/atk/WebKitAccessibleHyperlink.cpp:
(webkitAccessibleHyperlinkGetStartIndex):
(webkitAccessibleHyperlinkGetEndIndex):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getSelectionOffsetsForObject):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _convertToNSRange:]):
* bindings/js/JSDOMGlobalObjectTask.cpp:
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::queueTaskToEventLoop):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
* bindings/js/ScriptControllerMac.mm:
(WebCore::ScriptController::createScriptInstanceForWidget):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
(WebCore::SerializedScriptValue::create):
* bridge/objc/objc_instance.h:
* bridge/objc/objc_instance.mm:
(ObjcInstance::create):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::currentColorOrValidColor const):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
* css/CSSComputedStyleDeclaration.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::rules):
* css/FontFace.cpp:
(WebCore::FontFace::unicodeRange const):
(WebCore::FontFace::featureSettings const):
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents):
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::strokeDashArrayToCSSValueList):
(WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::createFilterOperations):
* css/StyleRule.cpp:
(WebCore::StyleRuleBase::createCSSOMWrapper const):
* css/StyleRule.h:
* dom/ChildListMutationScope.cpp:
(WebCore::ChildListMutationAccumulator::getOrCreate):
* dom/ChildListMutationScope.h:
* dom/DocumentMarkerController.cpp:
(WebCore::updateRenderedRectsForMarker):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/PointerEvent.h:
* dom/UserGestureIndicator.h:
(WebCore::UserGestureToken::create):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
(WebCore::AlternativeTextController::respondToUnappliedEditing):
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
(WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::applyBlockStyle):
(WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::targetRanges const):
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::mergeParagraphs):
* editing/Editing.cpp:
(WebCore::visiblePositionForIndexUsingCharacterIterator):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode):
(WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
(WebCore::EditingStyle::prepareToApplyAt):
(WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement):
(WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
(WebCore::EditingStyle::removeStyleFromRulesAndContext):
(WebCore::extractPropertiesNotIn):
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::setComposition):
* editing/EditorCommand.cpp:
(WebCore::executeApplyParagraphStyle):
(WebCore::executeMakeTextWritingDirectionLeftToRight):
(WebCore::executeMakeTextWritingDirectionNatural):
(WebCore::executeMakeTextWritingDirectionRightToLeft):
* editing/FormatBlockCommand.cpp:
(WebCore::FormatBlockCommand::formatRange):
* editing/RemoveFormatCommand.cpp:
(WebCore::RemoveFormatCommand::doApply):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::targetRanges const):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
(WebCore::handleStyleSpansBeforeInsertion):
(WebCore::ReplaceSelectionCommand::handleStyleSpans):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::targetRanges const):
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
* editing/VisibleUnits.cpp:
(WebCore::distanceBetweenPositions):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInWebArchiveFormat):
* editing/ios/DictationCommandIOS.cpp:
(WebCore::DictationCommandIOS::doApply):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
(WebCore::Editor::removeUnchangeableStyles):
(WebCore::Editor::writeImageToPasteboard):
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard):
(WebCore::Editor::imageInWebArchiveFormat):
* editing/markup.cpp:
(WebCore::styleFromMatchedRulesAndInlineDecl):
(WebCore::createFragmentForTransformToFragment):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::didFinishLoading):
* html/FTPDirectoryDocument.cpp:
(WebCore::createTemplateDocumentData):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::scheduleEvent):
(WebCore::HTMLMediaElement::createMediaControls):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::createSharedCellStyle):
* html/HTMLTableElement.h:
* html/URLUtils.h:
(WebCore::URLUtils<T>::origin const):
* html/parser/HTMLConstructionSite.cpp:
(WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
* html/shadow/TextControlInnerElements.cpp:
(WebCore::TextControlInnerElement::resolveCustomStyle):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::createNewCue):
* inspector/DOMPatchSupport.cpp:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::buildAction):
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab):
* inspector/InspectorStyleSheet.cpp:
(WebCore::asCSSRuleList):
(WebCore::InspectorStyle::styleWithProperties const):
(WebCore::InspectorStyleSheet::ensureSourceData):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
* inspector/agents/InspectorIndexedDBAgent.cpp:
(WebCore::Inspector::keyPathFromIDBKeyPath):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::archive):
* loader/EmptyClients.cpp:
(WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace):
(WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace):
(WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace):
(WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::loadResourceSynchronously):
* loader/archive/mhtml/MHTMLParser.cpp:
(WebCore::MHTMLParser::addResourceToArchive):
(WebCore::MHTMLParser::parseNextPart):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
(WebCore::MemoryCache::removeResourcesWithOrigin):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules const):
(WebCore::DOMWindow::createWindow):
* page/EventHandler.cpp:
(WebCore::textDistance):
* page/Page.cpp:
(WebCore::Page::userStyleSheet const):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilterOperations):
* page/ios/FrameIOS.mm:
(WebCore::Frame::initWithSimpleHTMLDocument):
(WebCore::Frame::interpretationsForCurrentRoot const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::tryCreateArrayBuffer const):
* platform/audio/HRTFElevation.cpp:
(WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
* platform/audio/SincResampler.cpp:
(WebCore::SincResampler::consumeSource):
* platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
(WebCore::AudioFileReader::createBus):
* platform/audio/mac/AudioFileReaderMac.cpp:
(WebCore::AudioFileReader::createBus):
* platform/graphics/Icon.h:
(WebCore::Icon::create):
* platform/graphics/InbandTextTrackPrivate.h:
(WebCore::InbandTextTrackPrivate::create):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::fulfillRequestWithKeyData):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::create):
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::create):
(WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
* platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::createTileLayer):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
(WebCore::CACFLayerTreeHost::create):
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::create):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateTracks):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paint):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsinkNewSample):
* platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
(WebCore::ISOProtectionSystemSpecificHeaderBox::parse):
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
(WebCore::ISOTrackEncryptionBox::parse):
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::applyFilterAnimation):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::clone):
* platform/graphics/transforms/TransformOperations.cpp:
(WebCore::TransformOperations::blendByMatchingOperations const):
* platform/image-decoders/ico/ICOImageDecoder.cpp:
(WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
* platform/mock/mediasource/MockBox.cpp:
(WebCore::MockInitializationBox::MockInitializationBox):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::create):
(WebCore::MockSourceBufferPrivate::append):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
* platform/mock/mediasource/MockTracks.h:
(WebCore::MockTextTrackPrivate::create):
(WebCore::MockVideoTrackPrivate::create):
* platform/network/FormData.h:
(WebCore::FormData::decode):
* platform/network/cocoa/CookieStorageObserver.h:
* platform/network/cocoa/CookieStorageObserver.mm:
(WebCore::CookieStorageObserver::create):
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::appendEncodedBlobItemToSoupMessageBody):
(WebCore::ResourceRequest::updateSoupMessageBody const):
* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::HyphenationDictionary::createNull):
(WebCore::HyphenationDictionary::create):
* platform/win/SearchPopupMenuWin.cpp:
(WebCore::SearchPopupMenuWin::SearchPopupMenuWin):
(WebCore::SearchPopupMenuWin::popupMenu):
* platform/win/SearchPopupMenuWin.h:
* rendering/RenderThemeIOS.mm:
(WebCore::applyCommonButtonPaddingToStyle):
(WebCore::RenderThemeIOS::paintProgressBar):
(WebCore::RenderThemeIOS::adjustButtonStyle const):
(WebCore::paintAttachmentIcon):
* rendering/svg/SVGRenderTreeAsText.cpp:
(WebCore::writeSVGResourceContainer):
* storage/Storage.cpp:
(WebCore::Storage::create):
(WebCore::Storage::Storage):
* storage/Storage.h:
(WebCore::Storage::area const):
* storage/StorageNamespace.h:
* storage/StorageNamespaceProvider.cpp:
(WebCore::StorageNamespaceProvider::localStorageArea):
* storage/StorageNamespaceProvider.h:
* svg/SVGElement.cpp:
(WebCore::SVGElement::getPresentationAttribute):
* svg/SVGFEBlendElement.cpp:
(WebCore::SVGFEBlendElement::build):
* svg/SVGFEColorMatrixElement.cpp:
(WebCore::SVGFEColorMatrixElement::build):
* svg/SVGFEComponentTransferElement.cpp:
(WebCore::SVGFEComponentTransferElement::build):
* svg/SVGFECompositeElement.cpp:
(WebCore::SVGFECompositeElement::build):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDisplacementMapElement.cpp:
(WebCore::SVGFEDisplacementMapElement::build):
* svg/SVGFEDropShadowElement.cpp:
(WebCore::SVGFEDropShadowElement::build):
* svg/SVGFEGaussianBlurElement.cpp:
(WebCore::SVGFEGaussianBlurElement::build):
* svg/SVGFEMergeElement.cpp:
(WebCore::SVGFEMergeElement::build):
* svg/SVGFEMorphologyElement.cpp:
(WebCore::SVGFEMorphologyElement::build):
* svg/SVGFEOffsetElement.cpp:
(WebCore::SVGFEOffsetElement::build):
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFETileElement.cpp:
(WebCore::SVGFETileElement::build):
* testing/GCObservation.h:
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::parseDocumentFragment):
2018-12-21 Chris Dumez <cdumez@apple.com>
navigator.userAgent in service workers does not reflect customUserAgent set by client
https://bugs.webkit.org/show_bug.cgi?id=192951
Reviewed by Youenn Fablet.
Whenever a service worker client registers itself, also pass its effective user agent.
In the network process, for each origin, we store the latest client's user agent and
use it when starting the service worker.
* dom/Document.cpp:
(WebCore::Document::setServiceWorkerConnection):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
* workers/service/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::serviceWorkerClientUserAgent const):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::registerServiceWorkerClient):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerToContextConnection.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::userAgent const):
* workers/service/server/SWServerWorker.h:
2018-12-21 Youenn Fablet <youenn@apple.com>
RTCRtpSender.setParameters() does set active parameter
https://bugs.webkit.org/show_bug.cgi?id=192848
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::updateRTCRtpSendParameters):
The routine was updating the local value, not the out parameter.
2018-12-21 Eric Carlson <eric.carlson@apple.com>
'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged
https://bugs.webkit.org/show_bug.cgi?id=187896
<rdar://problem/42681445>
Reviewed by Jer Noble.
No new tests, tested manually.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::deviceDisconnected):
(-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
(-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]):
* platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
(WebCore::deviceHasInputStreams):
(WebCore::isValidCaptureDevice):
(WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
(WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
(WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted.
* platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setCaptureDevice):
(WebCore::CoreAudioSharedUnit::devicesChanged):
(WebCore::CoreAudioSharedUnit::startProducingData):
(WebCore::CoreAudioSharedUnit::startInternal):
(WebCore::CoreAudioSharedUnit::verifyIsCapturing):
(WebCore::CoreAudioSharedUnit::captureFailed):
(WebCore::CoreAudioCaptureSourceFactory::devicesChanged):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
2018-12-20 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running
TestWebKitAPI.QuickLook.LegacyQuickLookContent
https://bugs.webkit.org/show_bug.cgi?id=192859
<rdar://problem/46887237>
Reviewed by Antti Koivisto.
After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread
is inside a delegate callback even when there is a ScriptDisallowedScope defined.
Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed()
by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion.
Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent
* dom/ContainerNodeAlgorithms.cpp:
(WebCore::notifyChildNodeInserted):
(WebCore::notifyChildNodeRemoved):
* dom/Document.cpp:
(WebCore::Document::nodeChildrenWillBeRemoved):
(WebCore::Document::nodeWillBeRemoved):
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope):
* html/HTMLFormElement.cpp:
(WebCore:: const):
2018-12-21 Joseph Pecoraro <pecoraro@apple.com>
Update status of some WebCore features in features.json
https://bugs.webkit.org/show_bug.cgi?id=192998
Reviewed by Tim Horton.
* features.json:
- Variation Fonts: Supported
- Conic Gradients: Supported in Preview
- Web Share: Supported in Preview
- <datalist>: Supported in Preview
- Intersection Observers: Supported in Preview
2018-12-21 Zalan Bujtas <zalan@apple.com>
[iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations()
https://bugs.webkit.org/show_bug.cgi?id=192357
<rdar://problem/42852260>
Reviewed by Simon Fraser.
Do not try to paint the file picker when painting is disabled.
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
2018-12-21 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] userPresence should always be true
https://bugs.webkit.org/show_bug.cgi?id=192835
<rdar://problem/46538788>
Reviewed by Brent Fulgham.
In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification.
This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123.
After discussing with other members of the working group, we decided to make userPresence always default to true.
Covered by exisiting tests.
* Modules/webauthn/fido/DeviceRequestConverter.cpp:
(fido::encodeGetAssertionRequestAsCBOR):
2018-12-21 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import an APDU coder from Chromium
https://bugs.webkit.org/show_bug.cgi?id=192949
<rdar://problem/46879933>
Reviewed by Brent Fulgham.
This patch imports an APDU coder from Chromium. Here is the documentation:
https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing
APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2.
Here is a list of files that are imported from Chromium:
https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090
https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6
Covered by API tests.
* Modules/webauthn/apdu/ApduCommand.cpp: Added.
(apdu::ApduCommand::createFromMessage):
(apdu::ApduCommand::ApduCommand):
(apdu::ApduCommand::getEncodedCommand const):
* Modules/webauthn/apdu/ApduCommand.h: Added.
* Modules/webauthn/apdu/ApduResponse.cpp: Added.
(apdu::ApduResponse::createFromMessage):
(apdu::ApduResponse::ApduResponse):
(apdu::ApduResponse::getEncodedResponse const):
* Modules/webauthn/apdu/ApduResponse.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-12-21 Jer Noble <jer.noble@apple.com>
Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC
https://bugs.webkit.org/show_bug.cgi?id=192985
<rdar://problem/46750743>
Reviewed by Eric Carlson.
Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr.
* Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp:
(WebCore::WebKitMediaKeys::setMediaElement):
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession):
2018-12-21 Justin Michaud <justin_michaud@apple.com>
CSS variables don't work for colors in "border" property
https://bugs.webkit.org/show_bug.cgi?id=192922
Reviewed by Simon Fraser.
ParseColorFunction no longer consumes anything if the color was not valid.
Test: css-custom-properties-api/border-variable-parsing.html
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseColorFunction):
2018-12-21 Justin Fan <justin_fan@apple.com>
[WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging
https://bugs.webkit.org/show_bug.cgi?id=192990
Reviewed by Myles C. Maxfield.
Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation.
Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions.
No new tests; no change in behavior.
* Modules/webgpu/WebGPUBindGroupLayout.cpp:
(WebCore::WebGPUBindGroupLayout::create):
(WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
* Modules/webgpu/WebGPUBindGroupLayout.h:
(WebCore::WebGPUBindGroupLayout::bindGroupLayout const):
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroupLayout const):
* platform/graphics/gpu/GPUBindGroupLayout.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr.
(WebCore::GPUDevice::createBindGroupLayout const): Deleted.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::appendArgumentToArray):
(WebCore::newEncoder):
(WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr.
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
(WebCore::appendArgumentToArrayInMap): Deleted.
(WebCore::GPUBindGroupLayout::create): Deleted.
Deleted unneeded GPUBindGroupLayout.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed.
2018-12-21 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Add DeviceIdHashSaltStorage disk persistence
https://bugs.webkit.org/show_bug.cgi?id=190466
Reviewed by Youenn Fablet.
Added persistency to the DeviceIdHashSaltStorage.
* platform/glib/FileSystemGlib.cpp:
(WebCore::FileSystem::getFileSize): Implemented this function to
allow sharing code with the statistics storage class.
* platform/glib/KeyedDecoderGlib.cpp:
(WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a
condition to control situations where the key is empty, it can
happen if the user modifies the file in the disk.
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include
to make work compilation with debug, unified builds.
2018-12-21 Zalan Bujtas <zalan@apple.com>
Synchronous media query evaluation could destroy current Frame/FrameView.
https://bugs.webkit.org/show_bug.cgi?id=192781
<rdar://problem/34416793>
Reviewed by Chris Dumez.
Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
Test: printing/print-with-media-query-destory.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):
* page/PrintContext.cpp:
(WebCore::PrintContext::PrintContext):
(WebCore::PrintContext::computePageRects):
(WebCore::PrintContext::computePageRectsWithPageSizeInternal):
(WebCore::PrintContext::begin):
(WebCore::PrintContext::computeAutomaticScaleFactor):
(WebCore::PrintContext::spoolPage):
(WebCore::PrintContext::spoolRect):
(WebCore::PrintContext::end):
* page/PrintContext.h:
(WebCore::PrintContext::frame const): Deleted.
2018-12-21 Wenson Hsieh <wenson_hsieh@apple.com>
Setting the file wrapper and content type of an attachment to a PDF should update its image
https://bugs.webkit.org/show_bug.cgi?id=192984
<rdar://problem/46798028>
Reviewed by Tim Horton.
Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment.
Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment.
* html/HTMLAttachmentElement.cpp:
(WebCore::mimeTypeIsSuitableForInlineImageAttachment):
(WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
2018-12-21 Justin Michaud <justin_michaud@apple.com>
Repeated background images with zero size should display the background color
https://bugs.webkit.org/show_bug.cgi?id=192962
Reviewed by Antti Koivisto.
Test: fast/backgrounds/background-repeat-with-zero-size.html
* platform/LengthSize.h:
(WebCore::LengthSize::isEmpty const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/style/FillLayer.h:
(WebCore::FillLayer::isEmpty const):
2018-12-21 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Fix percentages in relative offsets for grid items
https://bugs.webkit.org/show_bug.cgi?id=190492
Reviewed by Sergio Villar Senin.
The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items,
where the containing block is the grid area.
The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required.
Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html
* rendering/RenderBox.cpp: Implement the physical versions of the already existent methods.
(WebCore::RenderBox::overrideContainingBlockContentWidth const):
(WebCore::RenderBox::overrideContainingBlockContentHeight const):
(WebCore::RenderBox::hasOverrideContainingBlockContentWidth const):
(WebCore::RenderBox::hasOverrideContainingBlockContentHeight const):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method
to take into account overrideContainingBlockContentWidth|Height for grid items.
* rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods
that will be overridden in RenderBox.
(WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const):
(WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const):
(WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const):
(WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const):
2018-12-20 Justin Fan <justin_fan@apple.com>
[WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders
https://bugs.webkit.org/show_bug.cgi?id=192956
Reviewed by Myles Maxfield.
No testable behavior change. Existing tests cover possible crashing.
Add GPUBindGroupLayoutMetal.mm:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
Flesh out GPUBindGroupLayout::create:
* platform/graphics/gpu/GPUBindGroupLayout.cpp:
* platform/graphics/gpu/GPUBindGroupLayout.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createBindGroupLayout const):
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added.
(WebCore::appendArgumentToArrayInMap): Added.
(WebCore::GPUBindGroupLayout::create):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
(WebCore::MTLDataTypeForBindingType): Added.
2018-12-20 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, remove stray #pragma once added to .cpp file
* svg/properties/SVGAttributeOwnerProxy.cpp:
2018-12-20 Justin Michaud <justin_michaud@apple.com>
Adding runtime-enabled attribute to Element prevents inlining property access
https://bugs.webkit.org/show_bug.cgi?id=192901
Add a call to flattenDictionaryObject after disabling runtime-enabled attributes.
Reviewed by Ryosuke Niwa.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::JSTestEnabledBySettingPrototype::finishCreation):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::JSTestGenerateIsReachablePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::JSTestNodePrototype::finishCreation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjPrototype::finishCreation):
2018-12-20 Chris Dumez <cdumez@apple.com>
Use Optional::hasValue() instead of Optional::has_value()
https://bugs.webkit.org/show_bug.cgi?id=192948
Reviewed by Tim Horton.
* bindings/js/DOMPromiseProxy.h:
(WebCore::DOMPromiseProxy<IDLType>::isFulfilled const):
(WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const):
(WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const):
* dom/DataTransferItemList.h:
(WebCore::DataTransferItemList::hasItems const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::captionDisplayMode):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::wouldTaintOrigin const):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcUpdatePresentationSize):
* platform/mac/NSScrollerImpDetails.mm:
(WebCore::ScrollerStyle::recommendedScrollerStyle):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::setExplicitValue):
2018-12-20 Chris Dumez <cdumez@apple.com>
Move HTTPS_UPGRADE code behind a runtime flag, off by default
https://bugs.webkit.org/show_bug.cgi?id=192937
Reviewed by Youenn Fablet.
Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag.
* page/Settings.yaml:
2018-12-20 Youenn Fablet <youenn@apple.com>
Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader
https://bugs.webkit.org/show_bug.cgi?id=192838
Reviewed by Chris Dumez.
Generate constructor code in case of a Private but not Public constructor.
Make sure this is correctly exposed in global objects.
Add JS built-in constructor implementations for those two objects.
Also add JS built-in constructors for controller and byob request.
To keep existing behavior, JS built-ins calling these constructors need to pass
an additional parameter that allows making the difference between a JS builtin caller or a JS caller.
In the latter case, the constructor will throw.
Covered by existing tests, no observable change of behavior.
* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableByteStreamController.js:
(initializeReadableByteStreamController):
(getter.byobRequest):
* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Deleted.
(privateInitializeReadableStreamBYOBRequest): Deleted.
* Modules/streams/ReadableStream.js:
(initializeReadableStream):
* Modules/streams/ReadableStreamBYOBReader.js:
(initializeReadableStreamBYOBReader):
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamBYOBRequest.js:
(initializeReadableStreamBYOBRequest):
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultController.js:
(initializeReadableStreamDefaultController):
(enqueue):
* Modules/streams/ReadableStreamDefaultReader.js:
(initializeReadableStreamDefaultReader):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamDefaultControllerError): Deleted.
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMBuiltinConstructor.h:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::addBuiltinGlobals):
* bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed.
* bindings/js/JSReadableStreamPrivateConstructors.h: Removed.
* bindings/scripts/CodeGeneratorJS.pm:
(GeneratePropertiesHashTable):
* bindings/scripts/preprocess-idls.pl:
(shouldExposeInterface):
2018-12-20 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Remove hash from Client Data
https://bugs.webkit.org/show_bug.cgi?id=192727
<rdar://problem/46746673>
Reviewed by Brent Fulgham.
The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec:
https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it.
Covered by existing tests.
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
2018-12-20 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Add a runtime flag for local authenticator
https://bugs.webkit.org/show_bug.cgi?id=192792
<rdar://problem/46798738>
Reviewed by Brent Fulgham.
No tests.
This patch adds a runtime flag for local authenticator and removes ways to
set the runtime flag for web authentication in LegacyWebKit.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled):
(WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const):
2018-12-20 Jeremy Jones <jeremyj@apple.com>
Pointer lock causes abandoned documents
https://bugs.webkit.org/show_bug.cgi?id=188727
rdar://problem/44248197
Reviewed by Simon Fraser.
Fixes --world-leaks in these tests:
pointer-lock/locked-element-removed-from-dom.html
pointer-lock/mouse-event-delivery.html
fast/shadow-dom/pointerlockelement-in-slot.html
PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document.
* page/PointerLockController.cpp:
(WebCore::PointerLockController::elementRemoved):
(WebCore::PointerLockController::documentDetached):
(WebCore::PointerLockController::didAcquirePointerLock):
* page/PointerLockController.h:
2018-12-20 Chris Dumez <cdumez@apple.com>
Use Optional::valueOr() instead of Optional::value_or()
https://bugs.webkit.org/show_bug.cgi?id=192933
Reviewed by Geoffrey Garen.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::convert):
(WebCore::ApplePayPaymentHandler::didAuthorizePayment):
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::load):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::open):
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::applyConstraints):
* Modules/mediastream/RTCDTMFSender.cpp:
(WebCore::RTCDTMFSender::insertDTMF):
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::executeSql):
* Modules/webvr/VRFrameData.cpp:
(WebCore::VRFrameData::update):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSTransitionsForElement):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::cancel):
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/KeyframeEffect.cpp:
(WebCore::computeMissingKeyframeOffsets):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::runPendingPauseTask):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::write):
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
(WebCore::CryptoAlgorithmHMAC::generateKey):
(WebCore::CryptoAlgorithmHMAC::importKey):
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
(WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::importSpki):
(WebCore::CryptoKeyRSA::importPkcs8):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::counterToCSSValue):
* css/CSSFontFace.cpp:
(WebCore::calculateItalicRange):
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::doubleValue const):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::addRule):
* css/DOMMatrix.cpp:
(WebCore::DOMMatrix::rotateSelf):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::validateAndFixup):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueCounter):
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::commitMediaQuery):
* dom/Document.h:
(WebCore::Document::referrerPolicy const):
* dom/Element.cpp:
(WebCore::toScrollAlignment):
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::observe):
* editing/cocoa/FontAttributeChangesCocoa.mm:
(WebCore::FontChanges::platformFontFamilyNameForCSS const):
* fileapi/File.cpp:
(WebCore::File::File):
* html/DOMTokenList.cpp:
(WebCore::DOMTokenList::toggle):
* html/HTMLOListElement.h:
* html/ImageBitmap.cpp:
(WebCore::croppedSourceRectangleWithFormatting):
* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::setTransform):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::setTransform):
(WebCore::CanvasRenderingContext2DBase::isPointInPathInternal):
(WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal):
* html/canvas/Path2D.cpp:
(WebCore::Path2D::addPath):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* inspector/InspectorFrontendHost.cpp:
(WebCore::populateContextMenu):
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/MarginTypes.h:
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::width const):
(WebCore::Display::Box::height const):
(WebCore::Display::Box::contentBoxTop const):
(WebCore::Display::Box::contentBoxLeft const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::Iterator::set):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
* loader/NavigationAction.cpp:
* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOverrideRect):
(WebCore::FrameView::documentToAbsoluteScaleFactor const):
(WebCore::FrameView::viewportSizeForCSSViewportUnits const):
* page/Page.cpp:
(WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::databaseIdentifier const):
* page/SecurityOriginData.h:
(WebCore::SecurityOriginDataHash::hash):
* page/SecurityOriginHash.h:
(WebCore::SecurityOriginHash::hash):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize):
* page/WindowFeatures.cpp:
(WebCore::parseDialogFeatures):
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine):
(WebCore::AnimationBase::fireAnimationEventsIfNeeded):
(WebCore::AnimationBase::getTimeToNextEvent const):
(WebCore::AnimationBase::freezeAtTime):
(WebCore::AnimationBase::getElapsedTime const):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformThreadBody):
* page/linux/ResourceUsageThreadLinux.cpp:
(WebCore::ResourceUsageThread::platformThreadBody):
* platform/graphics/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::computeHash const):
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::drawText const):
(WebCore::FontCascade::drawEmphasisMarks const):
(WebCore::FontCascade::displayListForTextRun const):
(WebCore::FontCascade::adjustSelectionRectForText const):
(WebCore::FontCascade::codePath const):
* platform/graphics/FontSelectionAlgorithm.cpp:
(WebCore::FontSelectionAlgorithm::styleDistance const):
* platform/graphics/FontSelectionAlgorithm.h:
(WebCore::operator<<):
(WebCore::FontSelectionSpecifiedCapabilities::computeWeight const):
(WebCore::FontSelectionSpecifiedCapabilities::computeWidth const):
(WebCore::FontSelectionSpecifiedCapabilities::computeSlope const):
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::calculateLayerBoundingRect):
* platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
(WebCore::WebCoreAVCFResourceLoader::startLoading):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::naturalSize):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica):
(WebCore::TextureMapperLayer::replicaTransform):
(WebCore::TextureMapperLayer::syncAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::transformedVisibleRect):
(WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect):
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mappedPoint const):
(WebCore::TransformState::mapQuad const):
(WebCore::TransformState::flattenWithTransform):
* platform/network/CacheValidation.cpp:
(WebCore::computeCurrentAge):
(WebCore::computeFreshnessLifetimeForHTTPFamily):
* platform/network/NetworkStateNotifier.cpp:
(WebCore::NetworkStateNotifier::onLine):
* rendering/FloatingObjects.cpp:
(WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const):
(WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const):
* rendering/GridBaselineAlignment.cpp:
(WebCore::GridBaselineAlignment::ascentForChild const):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrack::setGrowthLimit):
(WebCore::GridTrackSizingAlgorithm::initialBaseSize const):
(WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const):
(WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
(WebCore::sortByGridTrackGrowthPotential):
(WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
* rendering/PaintInfo.h:
(WebCore::PaintInfo::applyTransform):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight const):
* rendering/RenderCounter.cpp:
(WebCore::planCounter):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::baselinePosition const):
(WebCore::RenderFlexibleBox::marginBoxAscentForChild):
(WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridGap const):
(WebCore::RenderGrid::baselinePosition const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerByApplyingTransform):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItem):
(WebCore::RenderListBox::listIndexIsVisible):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::cellBaselinePosition const):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::firstLineBaseline const):
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
(WebCore::RenderText::previousOffset const):
(WebCore::RenderText::previousOffsetForBackwardDeletion const):
(WebCore::RenderText::nextOffset const):
(WebCore::RenderText::stringView const):
* rendering/RenderView.cpp:
(WebCore::RenderView::layout):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::baselinePosition const):
* rendering/mathml/RenderMathMLBlock.h:
(WebCore::RenderMathMLBlock::ascentForChild):
* rendering/style/GridPosition.cpp:
(WebCore::GridPosition::max):
* rendering/style/TextUnderlineOffset.h:
(WebCore::TextUnderlineOffset::lengthOr const):
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::nodeAtFloatPoint):
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::nodeAtFloatPoint):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::nodeAtFloatPoint):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::hitTestClipContent):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::nodeAtPoint):
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::nodeAtFloatPoint):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::nodeAtFloatPoint):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::clipToImageBuffer):
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::processGlyphElement):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
2018-12-20 Jer Noble <jer.noble@apple.com>
REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback()
https://bugs.webkit.org/show_bug.cgi?id=192941
<rdar://problem/46874096>
Reviewed by Brent Fulgham.
Don't delete the locked lock before unlocking the lock.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):
2018-12-20 Keith Rollin <krollin@apple.com>
Improve release-level page-load logging
https://bugs.webkit.org/show_bug.cgi?id=192872
<rdar://problem/46850309>
Reviewed by Chris Dumez.
There are a number of reported bugs that are difficult or impossible
to track down with our current level of logging. Additionally, some
software groups lower in the page-loading stack have requested logging
sufficient for tracking a user-visible error message down to the
requested resource that caused the message. Add more-comprehensive
logging to address these issues/requests.
No new tests -- no changed functionality.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setMainDocumentError):
(WebCore::DocumentLoader::mainReceivedError):
(WebCore::DocumentLoader::stopLoading):
(WebCore::DocumentLoader::notifyFinished):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::DocumentLoader::startLoadingMainResource):
(WebCore::DocumentLoader::loadMainResource):
(WebCore::DocumentLoader::cancelMainResourceLoad):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::urlSelected):
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadArchive):
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::reloadWithOverrideEncoding):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::setState):
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/ProgressTracker.cpp:
(WebCore::ProgressItem::ProgressItem):
(WebCore::ProgressTracker::reset):
(WebCore::ProgressTracker::progressStarted):
(WebCore::ProgressTracker::progressCompleted):
(WebCore::ProgressTracker::finalProgressComplete):
(WebCore::ProgressTracker::incrementProgress):
(WebCore::ProgressTracker::completeProgress):
(WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const):
* loader/ProgressTracker.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::willSendRequestInternal):
(WebCore::ResourceLoader::didFinishLoading):
(WebCore::ResourceLoader::didFail):
(WebCore::ResourceLoader::willSendRequestAsync):
(WebCore::ResourceLoader::wasBlocked):
(WebCore::ResourceLoader::cannotShowURL):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willSendRequestInternal):
(WebCore::=):
(WebCore::SubresourceLoader::didReceiveResponse):
(WebCore::SubresourceLoader::didFinishLoading):
(WebCore::SubresourceLoader::didFail):
(WebCore::SubresourceLoader::willCancel):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
2018-12-20 Jeremy Jones <jeremyj@apple.com>
Switch tabs before retuning PiP video to inline.
https://bugs.webkit.org/show_bug.cgi?id=192767
rdar://problem/46006046
Reviewed by Jer Noble.
No new tests because this code path only happens with a user action on system UI.
When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting.
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
2018-12-19 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix GTK build after r239410
It added a new file to the build, breaking the unified sources magic that obscured a bug in
URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was
included via another source file in the unified source bundle.
* platform/network/soup/URLSoup.h:
2018-12-19 Chris Dumez <cdumez@apple.com>
wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from
https://bugs.webkit.org/show_bug.cgi?id=192728
<rdar://problem/46746779>
Reviewed by Geoff Garen.
* Modules/*:
* animation/*:
* bindings/*:
* crypto/*:
* css/*:
* dom/*:
* editing/*:
* fileapi/*:
* html/*:
* inspector/*:
* layout/*:
* loader/*:
* mathml/*:
* page/*:
* platform/*:
* plugins/*:
* rendering/*:
* testing/*:
* workers/*:
* xml/*:
2018-12-19 Jer Noble <jer.noble@apple.com>
Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
https://bugs.webkit.org/show_bug.cgi?id=192896
<rdar://46732186>
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::initCallback):
2018-12-19 Timothy Hatcher <timothy@apple.com>
REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent
https://bugs.webkit.org/show_bug.cgi?id=188891
rdar://problem/42344352
Reviewed by Simon Fraser.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
Don't return early when m_layerForOverhangAreas is null to avoid skipping
setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate().
2018-12-19 Justin Fan <justin_fan@apple.com>
[WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout
https://bugs.webkit.org/show_bug.cgi?id=192843
<rdar://problem/46820395>
Reviewed by Myles Maxfield.
Test: webgpu/pipeline-layouts.html
Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout:
* Modules/webgpu/WebGPUBindGroupLayout.cpp:
(WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
* Modules/webgpu/WebGPUBindGroupLayout.h:
(WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createPipelineLayout const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout.
* Modules/webgpu/WebGPUPipelineLayout.cpp: Added.
(WebCore::WebGPUPipelineLayout::create):
(WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout):
* Modules/webgpu/WebGPUPipelineLayout.h: Added.
* Modules/webgpu/WebGPUPipelineLayout.idl: Added.
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added.
* Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createPipelineLayout const): Added.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/GPUPipelineLayout.cpp: Added.
(WebCore::GPUPipelineLayout::create):
(WebCore::GPUPipelineLayout::GPUPipelineLayout):
* platform/graphics/gpu/GPUPipelineLayout.h: Added.
* platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added.
Add files and symbols to project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Add missing include:
* Modules/webgpu/WebGPUQueue.h:
2018-12-18 Ryosuke Niwa <rniwa@webkit.org>
SVGUseElement::findTarget should return nullptr when there is a cycle
https://bugs.webkit.org/show_bug.cgi?id=192840
Reviewed by Tim Horton.
r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target.
Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when
the SVG use element itself had a corresponding element.
No new tests since there should be no behavioral change.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree):
(WebCore::SVGUseElement::findTarget const):
2018-12-19 Myles C. Maxfield <mmaxfield@apple.com>
[WHLSL] Add a handwritten lexer
https://bugs.webkit.org/show_bug.cgi?id=192294
Reviewed by Jon Lee.
This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The
implementation matches the lexing rules in the spec (specifically, the rules that start
with an uppercase letter). The spec is at
https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4.
This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283.
No new tests because the lexer isn't hooked up yet; there are tests in the parser,
once that gets committed.
* Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added.
(WebCore::WHLSL::Lexer::Token::typeName):
(WebCore::WHLSL::Lexer::recognizeKeyword):
(WebCore::WHLSL::Lexer::consumeTokenFromStream):
(WebCore::WHLSL::Lexer::skipWhitespaceAndComments):
(WebCore::WHLSL::isWhitespace):
(WebCore::WHLSL::isNewline):
(WebCore::WHLSL::Lexer::skipWhitespace):
(WebCore::WHLSL::Lexer::skipLineComment):
(WebCore::WHLSL::Lexer::skipLongComment):
(WebCore::WHLSL::Lexer::coreDecimalIntLiteral const):
(WebCore::WHLSL::Lexer::decimalIntLiteral const):
(WebCore::WHLSL::Lexer::decimalUintLiteral const):
(WebCore::WHLSL::isHexadecimalCharacter):
(WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const):
(WebCore::WHLSL::Lexer::hexadecimalIntLiteral const):
(WebCore::WHLSL::Lexer::hexadecimalUintLiteral const):
(WebCore::WHLSL::Lexer::intLiteral const):
(WebCore::WHLSL::Lexer::uintLiteral const):
(WebCore::WHLSL::Lexer::digit const):
(WebCore::WHLSL::Lexer::digitStar const):
(WebCore::WHLSL::Lexer::character const):
(WebCore::WHLSL::Lexer::coreFloatLiteralType1 const):
(WebCore::WHLSL::Lexer::coreFloatLiteral const):
(WebCore::WHLSL::Lexer::floatLiteral const):
(WebCore::WHLSL::Lexer::validIdentifier const):
(WebCore::WHLSL::Lexer::identifier const):
(WebCore::WHLSL::Lexer::operatorName const):
* Modules/webgpu/WHLSL/WHLSLLexer.h: Added.
(WebCore::WHLSL::Lexer::Lexer):
(WebCore::WHLSL::Lexer::consumeToken):
(WebCore::WHLSL::Lexer::unconsumeToken):
(WebCore::WHLSL::Lexer::state const):
(WebCore::WHLSL::Lexer::setState):
(WebCore::WHLSL::Lexer::isFullyConsumed const):
(WebCore::WHLSL::Lexer::errorString):
(WebCore::WHLSL::Lexer::string const):
(WebCore::WHLSL::Lexer::anyCharacter const):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-12-18 Simon Fraser <simon.fraser@apple.com>
Web Inspector: Timelines: correctly label Intersection Observer callbacks
https://bugs.webkit.org/show_bug.cgi?id=192669
<rdar://problem/46702490>
Reviewed by Joseph Pecoraro.
Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls
to Intersection Observer, Performance Observer and Mutation Observer callbacks so
that they get correctly labeled in the Inspector timeline.
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::deliver):
* en.lproj/Localizable.strings:
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willFireObserverCallbackImpl):
(WebCore::InspectorInstrumentation::didFireObserverCallbackImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willFireObserverCallback):
(WebCore::InspectorInstrumentation::didFireObserverCallback):
* inspector/TimelineRecordFactory.cpp:
(WebCore::TimelineRecordFactory::createObserverCallbackData):
* inspector/TimelineRecordFactory.h:
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::willFireObserverCallback):
(WebCore::InspectorTimelineAgent::didFireObserverCallback):
(WebCore::toProtocol):
* inspector/agents/InspectorTimelineAgent.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::notify):
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::deliver):
2018-12-19 Claudio Saavedra <csaavedra@igalia.com>
ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { }
https://bugs.webkit.org/show_bug.cgi?id=192854
Reviewed by Alex Christensen.
* contentextensions/DFANode.h: Define CharRange's chars as signed
2018-12-19 Youenn Fablet <youenn@apple.com>
Remove RTCRtpTransceiver.setDirection
https://bugs.webkit.org/show_bug.cgi?id=192869
Reviewed by Alex Christensen.
Covered by rebased test.
* Modules/mediastream/RTCRtpTransceiver.idl:
2018-12-19 Jer Noble <jer.noble@apple.com>
Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync()
https://bugs.webkit.org/show_bug.cgi?id=192856
<rdar://problem/46843245>
Reviewed by Alex Christensen.
Some decoders exposed through VideoToolbox will decode asynchronously even when
kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::decodeSampleSync):
2018-12-19 Megan Gardner <megan_gardner@apple.com>
Allow clients to set the navigator platform
https://bugs.webkit.org/show_bug.cgi?id=192735
Reviewed by Tim Horton.
Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm.
Lots of piping to allow the setting of a custom navigator platform.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomNavigatorPlatform):
(WebCore::DocumentLoader::customNavigatorPlatform const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::navigatorPlatform const):
* loader/FrameLoader.h:
* page/Navigator.cpp:
(WebCore::Navigator::platform const):
* page/Navigator.h:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::platform const):
(WebCore::NavigatorBase::platform): Deleted.
* page/NavigatorBase.h:
2018-12-19 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r239347.
Caused the leaks bot to hit an exception and the new test
crashes on certain configurations.
Reverted changeset:
"Synchronous media query evaluation could destroy current
Frame/FrameView."
https://bugs.webkit.org/show_bug.cgi?id=192781
https://trac.webkit.org/changeset/239347
2018-12-19 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r239358.
Revision caused imported/w3c/web-platform-tests/IndexedDB/ to
crash on Debug bots
Reverted changeset:
"Clean up IndexedDB files between tests"
https://bugs.webkit.org/show_bug.cgi?id=192796
https://trac.webkit.org/changeset/239358
2018-12-19 Don Olmstead <don.olmstead@sony.com>
Sync some include directories in WebCore
https://bugs.webkit.org/show_bug.cgi?id=192819
Reviewed by Michael Catanzaro.
Added missing include directories around features that have only been enabled on
Apple ports. Removes obsolete directories from list and moves harfbuzz directories
into the freetype cmake file.
* CMakeLists.txt:
* platform/FreeType.cmake:
2018-12-19 Alicia Boya García <aboya@igalia.com>
[MSE] Remove unused method: stopAskingForMoreSamples()
https://bugs.webkit.org/show_bug.cgi?id=192754
Reviewed by Xabier Rodriguez-Calvar.
The stopAskingForMoreSamples() method from SourceBufferPrivate is not
being used by anyone. SourceBuffer is not calling it and no
SourceBufferPrivate is implementing it. Let's remove that noise.
* platform/graphics/SourceBufferPrivate.h:
(WebCore::SourceBufferPrivate::setActive):
(WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted.
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2018-12-19 Alicia Boya García <aboya@igalia.com>
[MSE] Remove dead code: sourceBufferPrivateSeekToTime()
https://bugs.webkit.org/show_bug.cgi?id=192827
Reviewed by Xabier Rodriguez-Calvar.
This patch makes two dead code removal changes in
SourceBufferPrivateClient:
First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure
virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient
is only inherited by SourceBuffer, it makes no sense to have default
implementations there (they will never be used), moreso it being a
client interface.
Second, sourceBufferPrivateSeekToTime() is removed entirely. It used
to had an empty implementation, which SourceBuffer did not overwrite,
therefore making any calls to it useless.
All calls to sourceBufferPrivateSeekToTime() have been removed:
SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code
itself, used to call this method. This patch deletes it completely.
MockSourceBufferPrivate::seekToTime(), which only called this empty
method, has also been removed along with its only usage in
MockMediaSourcePrivate::seekToTime().
* platform/graphics/SourceBufferPrivateClient.h:
(WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
(WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted.
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::seekToTime):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::seekToTime): Deleted.
* platform/mock/mediasource/MockSourceBufferPrivate.h:
2018-12-19 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional
https://bugs.webkit.org/show_bug.cgi?id=192815
Reviewed by Jer Noble.
https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration
says that distinctiveIdentifier and persistentState default to
optional. Our implementation does not define a default leaving it
to the first option of the enum, which currently is Required.
* platform/encryptedmedia/CDMKeySystemConfiguration.h:
2018-12-19 Rob Buis <rbuis@igalia.com>
Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
https://bugs.webkit.org/show_bug.cgi?id=192288
Reviewed by Frédéric Wang.
Prefer return value to out parameter for parseAccessControlAllowList.
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::parse):
* platform/network/HTTPParsers.h:
(WebCore::parseAccessControlAllowList):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2018-12-18 Zan Dobersek <zdobersek@igalia.com>
REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab
https://bugs.webkit.org/show_bug.cgi?id=192230
Reviewed by Carlos Garcia Campos.
Single tile can after r235165 be assigned multiple content updates
without a commit occurring between each update, whereas before these
commits were done for each update.
To avoid repeating updates for a single tile purging information about
the previous update, these updates are now accumulated inside a Vector
and then iterated over during the commit phase.
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
(WebCore::CoordinatedBackingStoreTile::addUpdate):
(WebCore::CoordinatedBackingStoreTile::swapBuffers):
(WebCore::CoordinatedBackingStore::updateTile):
(WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
(WebCore::CoordinatedBackingStoreTile::scale const):
2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages
https://bugs.webkit.org/show_bug.cgi?id=192842
<rdar://problem/46823586>
Reviewed by Tim Horton.
Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a
registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently
inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for
this is internally tracked in <rdar://problem/46830277>.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
2018-12-18 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, add a missing UNUSED_PARAM()
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::getPrivateImpl):
2018-12-18 Justin Michaud <justin_michaud@apple.com>
Update CSS Properties and Values API to use new cycle fallback behaviour
https://bugs.webkit.org/show_bug.cgi?id=192800
Reviewed by Antti Koivisto.
Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the
wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing.
* css/CSSCustomPropertyValue.h:
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableReference):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyCascadedCustomProperty):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2018-12-18 Daniel Bates <dabates@apple.com>
Wrong value for key property in keydown and keyup events generated holding Control key
https://bugs.webkit.org/show_bug.cgi?id=192788
<rdar://problem/46795214>
Reviewed by Wenson Hsieh.
Similar to what we do on Mac, compute the DOM key property from the characters ignoring
modifier keys input string when the Control key is held down.
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyForKeyEvent):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyForKeyEvent):
2018-12-18 Sihui Liu <sihui_liu@apple.com>
Clean up IndexedDB files between tests
https://bugs.webkit.org/show_bug.cgi?id=192796
Reviewed by Geoffrey Garen.
We should clean up the IndexedDB files between tests to make sure each test is independent of others.
This patch also fixes some issues in IDB.
Covered by existing tests.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
We should shut down all open databases instead of databases from open database connections before deleting
files, because database starts accessing files before connection to database is established.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase
and UniqueIDBDatabase can be destructed after shutdown.
(WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be
invoked during the hard close.
(WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
Tasks like didOpenBackingStore could be posted from database thread to main thread after
immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any
database operation.
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access
m_backingStore when m_backingStore may already be deleted.
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort.
m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in
transactionCompleted, so they do not need to be cleared here.
2018-12-18 Myles C. Maxfield <mmaxfield@apple.com>
Thick overlines and line-throughs grow in the wrong direction
https://bugs.webkit.org/show_bug.cgi?id=192264
Reviewed by Dean Jackson.
Overlines should grow upward, and line-throughs should stay centered.
Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):
2018-12-18 Ryosuke Niwa <rniwa@webkit.org>
Some iOS app crash in FrameLoader::checkCompleted
https://bugs.webkit.org/show_bug.cgi?id=192804
<rdar://problem/44240573>
Reviewed by Tim Horton.
It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread
is trying to send a delegate message. Disable the release assertion while this is happening
so that iOS app would not crash.
Unfortunately no new test as there is no way to easily test UIWebView in iOS,
and this requires a race between the web thread & the main thread.
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed):
* platform/ios/wak/WebCoreThread.h:
* platform/ios/wak/WebCoreThread.mm:
(WebThreadDelegateMessageScope::WebThreadDelegateMessageScope):
(WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope):
(SendDelegateMessage):
2018-12-18 David Kilzer <ddkilzer@apple.com>
clang-tidy: Use const reference for MediaTime parameter to prevent object copy
<https://webkit.org/b/192814>
Reviewed by Mark Lam.
* bindings/js/JSDOMConvertNumbers.h:
(WebCore::JSConverter<IDLUnrestrictedDouble>::convert):
2018-12-18 Justin Fan <justin_fan@apple.com>
[WebGPU] BindGroupLayout and Device::createBindGroupLayout
https://bugs.webkit.org/show_bug.cgi?id=192817
Reviewed by Dean Jackson.
Update bind-group-layouts to test new functionality.
Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout:
* Modules/webgpu/WebGPUBindGroupLayout.cpp: Added.
(WebCore::WebGPUBindGroupLayout::create):
(WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout):
* Modules/webgpu/WebGPUBindGroupLayout.h: Added.
* Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBindGroupLayout const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* platform/graphics/gpu/GPUBindGroupLayout.cpp: Added.
(WebCore::GPUBindGroupLayout::tryCreate):
(WebCore::GPUBindGroupLayout::GPUBindGroupLayout):
* platform/graphics/gpu/GPUBindGroupLayout.h: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::tryCreateBindGroupLayout const): Added.
* platform/graphics/gpu/GPUDevice.h:
Add files and symbols to project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Missing includes that were previously provided via UnifiedSources:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/sql/SQLiteFileSystem.h:
2018-12-18 Youenn Fablet <youenn@apple.com>
Make ReadableStreamXX constructs use PrivateIdentifier
https://bugs.webkit.org/show_bug.cgi?id=192771
Reviewed by Chris Dumez.
PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope.
Covered by existing binding tests.
* Modules/streams/ReadableByteStreamController.idl:
* Modules/streams/ReadableStreamBYOBReader.idl:
* Modules/streams/ReadableStreamBYOBRequest.idl:
* Modules/streams/ReadableStreamDefaultController.idl:
* Modules/streams/ReadableStreamDefaultReader.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsConstructorProperty):
* bindings/scripts/preprocess-idls.pl:
(shouldExposeInterface):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed.
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed.
* bindings/scripts/test/TestCustomConstructor.idl: Removed.
2018-12-18 Zalan Bujtas <zalan@apple.com>
Synchronous media query evaluation could destroy current Frame/FrameView.
https://bugs.webkit.org/show_bug.cgi?id=192781
<rdar://problem/34416793>
Reviewed by Chris Dumez.
Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid.
Test: printing/print-with-media-query-destory.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):
2018-12-18 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: m3u8 content not shown, it should be text
https://bugs.webkit.org/show_bug.cgi?id=192731
<rdar://problem/46747728>
Reviewed by Devin Rousso.
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::setResourceContent):
Don't clobber data if setting empty content on a resource that has content.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::shouldTreatAsText):
Additional non-"text/" mime types that can be treated as text.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType):
* platform/MIMETypeRegistry.h:
Detect media playlist mime types that are text (m3u8/m3u).
2018-12-18 Daniel Bates <dabates@apple.com>
Remove <meta http-equiv=set-cookie> support
https://bugs.webkit.org/show_bug.cgi?id=185077
<rdar://problem/41791397>
Reviewed by Brent Fulgham.
Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649>
the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also
removed support for this pragma and Firefox has an open bug to remove it.
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and
was ignored instead of setting the cookie.
* html/parser/XSSAuditor.cpp:
(WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma
as dangerous and erase attribute http-equiv when we find it because we no longer honor
this pragma.
2018-12-18 Justin Michaud <justin_michaud@apple.com>
CSS Typed OM should expose attributeStyleMap
https://bugs.webkit.org/show_bug.cgi?id=192671
Reviewed by Ryosuke Niwa.
Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing
TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap.
Test: css-typedom/attributeStyleMap.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* css/ElementCSSInlineStyle.idl:
* css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h.
* css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl.
* css/typedom/StylePropertyMapReadOnly.cpp: Added.
(WebCore::StylePropertyMapReadOnly::reifyValue):
(WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault):
* css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::create): Deleted.
(WebCore::StylePropertyMapReadOnly::get const): Deleted.
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted.
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h:
* dom/Element.cpp:
(WebCore::Element::attributeStyleMap):
(WebCore::Element::setAttributeStyleMap):
* dom/Element.h:
* dom/ElementRareData.cpp:
* dom/ElementRareData.h:
(WebCore::ElementRareData::attributeStyleMap):
(WebCore::ElementRareData::setAttributeStyleMap):
* dom/StyledElement.cpp:
(WebCore::StyledElement::ensureAttributeStyleMap):
* dom/StyledElement.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2DBase::drawImage):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::extractComputedProperty):
(WebCore::CustomPaintImage::doCustomPaint):
2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com>
Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle
https://bugs.webkit.org/show_bug.cgi?id=192785
<rdar://problem/45321184>
Reviewed by Tim Horton.
Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're
currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that
need to know when the user is typing in a text form control, but the page is preventing default text insertion
behavior and instead updating values programmatically.
Test: fast/forms/call-text-did-change-in-text-field-when-typing.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::setValue):
2018-12-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter
https://bugs.webkit.org/show_bug.cgi?id=192801
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
2018-12-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance
https://bugs.webkit.org/show_bug.cgi?id=192799
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2018-12-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore
https://bugs.webkit.org/show_bug.cgi?id=192798
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2018-12-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192794
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
2018-12-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192791
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
2018-12-18 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic
https://bugs.webkit.org/show_bug.cgi?id=192787
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::hasClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
2018-12-17 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] Fix compilation warnings WebCore/platform/graphics directory
https://bugs.webkit.org/show_bug.cgi?id=192752
Reviewed by Don Olmstead.
No new tests, no behavior changes.
* platform/graphics/win/DIBPixelData.cpp:
Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG.
* platform/graphics/win/FontPlatformDataWin.cpp:
(WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT.
* platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample.
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
Reorder the initializer list.
(WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT.
(WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto.
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case.
* platform/graphics/win/SimpleFontDataCairoWin.cpp:
(WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2.
* platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'.
(WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2.
(WebCore::Font::boundsForGDIGlyph const): Ditto.
(WebCore::Font::widthForGDIGlyph const): Ditto.
* platform/graphics/win/UniscribeController.cpp:
(WebCore::UniscribeController::UniscribeController):
Reorder the initializer list.
(WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||.
(WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'.
2018-12-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] A stream's first video frame should be rendered
https://bugs.webkit.org/show_bug.cgi?id=192629
<rdar://problem/46664353>
Reviewed by Youenn Fablet.
Test: fast/mediastream/media-stream-renders-first-frame.html
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::size const):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
2018-12-17 Justin Michaud <justin_michaud@apple.com>
Bindings generator should support Conditional= along with CachedAttribute
https://bugs.webkit.org/show_bug.cgi?id=192721
Reviewed by Ryosuke Niwa.
Fix a bug where specifying both attributes causes compilation errors because the compile-time
condition is not included in the derived code.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjCachedAttribute3Getter):
(WebCore::jsTestObjCachedAttribute3):
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/TestObj.idl:
2018-12-17 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit()
<https://webkit.org/b/192707>
<rdar://problem/46734926>
Reviewed by Daniel Bates.
* platform/CPUMonitor.cpp:
(WebCore::CPUMonitor::setCPULimit):
* platform/CPUMonitor.h:
(WebCore::CPUMonitor::setCPULimit):
- Change parameter to const reference to fix unnecessary copies.
2018-12-17 Ryosuke Niwa <rniwa@webkit.org>
offsetLeft and offsetParent should adjust across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=157437
<rdar://problem/26154021>
Reviewed by Simon Fraser.
Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match
the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497
and https://github.com/w3c/webcomponents/issues/763
The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget).
In practice, this would mean that we need to keep walking up the offset parent ancestors until we find
the one which is in the same tree as a shadow-inclusive ancestor of the context object.
For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot
inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent,
then its offset parent, etc... until we find the offset parent in the same tree as the context object.
Note it's possible that the context object is inside a shadow tree which does not have its own offset parent.
(e.g. all elements have position: static) For this reason, we need to consider not just offset parent in
the same tree as the context object but as well as any offset parent which is in its ancestor trees.
Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html
* dom/Element.cpp:
(WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop.
(WebCore::collectAncestorTreeScopeAsHashSet): Added.
(WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent
which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor).
(WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout.
(WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's
until it finds the first offset parent which is a shadow-including ancestor.
(WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout.
(WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other
functions meant to be used for bindings code.
* dom/Element.h:
* html/HTMLElement.idl:
2018-12-17 Simon Fraser <simon.fraser@apple.com>
Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled
https://bugs.webkit.org/show_bug.cgi?id=192780
rdar://problem/43394387
Reviewed by Tim Horton.
macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the
memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them.
Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available,
and consult it when making decisions that affect layer backing store format.
Tested by new results for existing tests.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::isSubpixelAntialiasingAvailable):
* platform/graphics/FontCascade.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch
it once.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterDescendants):
* testing/Internals.cpp:
(WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore::
2018-12-17 Daniel Bates <dabates@apple.com>
Make DocumentMarker::allMarkers() constexpr
https://bugs.webkit.org/show_bug.cgi?id=192634
Reviewed by Simon Fraser.
The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate
it constexpr to do just that.
* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):
2018-12-17 Justin Fan <justin_fan@apple.com>
[WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries
https://bugs.webkit.org/show_bug.cgi?id=192726
Reviewed by Myles C. Maxfield.
Test: webgpu/bind-group-layouts.html
Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs:
* Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added.
* Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added.
* Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added.
* Modules/webgpu/WebGPUShaderStageBit.h: Added.
* Modules/webgpu/WebGPUShaderStageBit.idl: Added.
* platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added.
* platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added.
Add the new symbols and files to the project:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Small FIXME update for later:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):
2018-12-17 Zalan Bujtas <zalan@apple.com>
Unreviewed build fix.
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const):
2018-12-17 Zalan Bujtas <zalan@apple.com>
Reproducible ASSERTion failure when toggling layer borders with find-in-page up
https://bugs.webkit.org/show_bug.cgi?id=192762
<rdar://problem/46676873>
Reviewed by Simon Fraser.
DocumentMarkerController::markersFor() should take a reference instead of a Node*.
Test: editing/document-marker-null-check.html
* dom/DocumentMarkerController.cpp:
(DocumentMarkerController::hasMarkers):
* dom/DocumentMarkerController.h:
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToChangedSelection):
* editing/Editor.cpp:
(WebCore::Editor::selectionStartHasMarkerFor const):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::paint):
* rendering/RenderText.cpp:
(WebCore::RenderText::draggedContentRangesBetweenOffsets const):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForWithReason):
* testing/Internals.cpp:
(WebCore::Internals::markerCountForNode):
2018-12-17 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239265 and r239274.
https://bugs.webkit.org/show_bug.cgi?id=192765
unorm_normalize is deprecated, and broke an internal build
(Requested by Truitt on #webkit).
Reverted changesets:
"[GTK][WPE] Need a function to convert internal URI to display
("pretty") URI"
https://bugs.webkit.org/show_bug.cgi?id=174816
https://trac.webkit.org/changeset/239265
"Fix the Apple Internal Mac build with a newer SDK"
https://trac.webkit.org/changeset/239274
2018-12-17 Daniel Bates <dabates@apple.com>
[iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:]
https://bugs.webkit.org/show_bug.cgi?id=192633
Reviewed by Wenson Hsieh.
UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an
input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:]
for binary compatibility.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted.
2018-12-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r239254.
This broke the Windows 10 Debug build
Reverted changeset:
"Replace many uses of String::format with more type-safe
alternatives"
https://bugs.webkit.org/show_bug.cgi?id=192742
https://trac.webkit.org/changeset/239254
2018-12-17 Antoine Quint <graouts@apple.com>
[Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation
https://bugs.webkit.org/show_bug.cgi?id=192758
Reviewed by Dean Jackson.
We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending
gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is
less bookkeeping to perform.
No new test since there is no user-observable change.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::updateFinishedState):
(WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted.
(WebCore::WebAnimation::performMicrotask): Deleted.
* animation/WebAnimation.h:
2018-12-17 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure we don't update an animation's finished state twice when updating animations
https://bugs.webkit.org/show_bug.cgi?id=192757
Reviewed by Dean Jackson.
When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state
twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of
whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate
next call to resolve(), unless any of the timing properties have changed in the meantime.
No new test since there is no user-observable change.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timingDidChange):
(WebCore::WebAnimation::tick):
(WebCore::WebAnimation::resolve):
* animation/WebAnimation.h:
2018-12-17 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r233268): Elements animated in from offscreen sometimes don't display
https://bugs.webkit.org/show_bug.cgi?id=192725
rdar://problem/46011418
Reviewed by Antoine Quint.
There were two problems with backing store attachment and animation.
First, animations are an input into the "backing store attached" logic, so when they change
we should set the CoverageRectChanged bit on GraphicsLayerCA.
Secondly, when an ancestor has unknown animation extent, all its descendants need to
get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when
the current layer has no animation extent.
Tests: compositing/backing/animate-into-view-with-descendant.html
compositing/backing/animate-into-view.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::removeAnimation):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
2018-12-17 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Unify margin collapse function naming
https://bugs.webkit.org/show_bug.cgi?id=192747
Reviewed by Antti Koivisto.
Rename some margin collapse getters.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginAfterCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted.
2018-12-17 David Kilzer <ddkilzer@apple.com>
clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools
<https://webkit.org/b/192751>
<rdar://problem/46771623>
Reviewed by Daniel Bates.
Change loop variables to const references to avoid unnecessary
copies.
* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::IDBDatabaseInfo):
(WebCore::IDBDatabaseInfo::loggingString const):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::removeSamplesFromTrackBuffer):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::headerObject):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
* crypto/keys/CryptoKeyRSA.cpp:
(WebCore::CryptoKeyRSA::importJwk):
(WebCore::CryptoKeyRSA::exportJwk const):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::OrderedNamedLinesCollector::appendLines const):
* dom/DataTransfer.cpp:
(WebCore::readURLsFromPasteboardAsString):
* dom/TreeScope.cpp:
(WebCore::TreeScope::elementsFromPoint):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::checkAndStoreRegion):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::setInstruments):
* page/Page.cpp:
(WebCore::Page::updateIntersectionObservations):
* page/TextIndicator.cpp:
(WebCore::estimatedBackgroundColorForRange):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeLayoutDependency):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
(WebCore::GraphicsLayerCA::updateAnimations):
(WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
* platform/graphics/mac/ImageMac.mm:
(WebCore::BitmapImage::tiffRepresentation):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::append):
* testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):
2018-12-17 Ms2ger <Ms2ger@igalia.com>
[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI
https://bugs.webkit.org/show_bug.cgi?id=174816
Reviewed by Michael Catanzaro.
Tests: enabled fast/url/user-visible/.
* testing/Internals.cpp:
(WebCore::Internals::userVisibleString): Enable method on all platforms.
2018-12-15 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Null pointer dereference in JSC::WriteBarrierBase()
https://bugs.webkit.org/show_bug.cgi?id=191252
Reviewed by Keith Miller.
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::JSCustomElementRegistry::whenDefined):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createDeferredPromise):
* bindings/js/JSDOMPromiseDeferred.h:
(WebCore::DeferredPromise::create):
(WebCore::callPromiseFunction):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::moduleLoaderFetch):
(WebCore::JSDOMWindowBase::moduleLoaderImportModule):
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::fetch):
(WebCore::rejectPromise):
2018-12-15 Darin Adler <darin@apple.com>
Use warning-ignoring macros more consistently and simply
https://bugs.webkit.org/show_bug.cgi?id=192743
Reviewed by Mark Lam.
* bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than
IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++
files like this one with non-clang compilers, and no need to worry about
them when choosing the macro.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
* css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for
the "unknown-pragmas" trick, which the macro should take care of.
* css/makevalues.pl: Ditto.
* platform/ColorData.gperf: Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use
ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto.
* platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END.
* platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END
(see rationale above for Objective-C++).
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const): Use
ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END.
2018-12-15 Darin Adler <darin@apple.com>
Replace many uses of String::format with more type-safe alternatives
https://bugs.webkit.org/show_bug.cgi?id=192742
Reviewed by Mark Lam.
A while back, String::format was more efficient than string concatenation,
but that is no longer true, and we should prefer String::number, makeString,
or concatenation with the "+" operator to String::format for new code.
This is not as good for programmers who are fond of printf formatting
style, and in some cases it's a little harder to read the strings
interspersed with variables rather than a format string, but it's better
in a few ways:
- more efficient (I didn't measure the difference, but it's definitely
slower to use String::Format which calls vsnprintf twice than to use
the WTF code)
- works in a type-safe way without a need to use a format specifier such
as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
subtle differences between platforms
- allows us to use StringView in some cases to sidestep the need to
allocate temporary WTF::String objects
- does not require converting each WTF::String to a C string, allowing
us to remove many cases of ".utf8().data()" and similar expressions,
eliminating the allocation of temporary WTF::CString objects
This patch covers a batch of easiest-to-convert call sites.
Later patches will allow us to deprecate or remove String::format.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::loggingString const): Ditto.
(WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString const): Ditto.
* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
* Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
(WebCore::IDBResourceIdentifier::loggingString const): Ditto.
* Modules/webdatabase/Database.cpp:
(WebCore::formatErrorMessage): Ditto.
* Modules/webdatabase/SQLError.h:
(WebCore::SQLError::create): Ditto.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Use makeString.
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
Updated expected results.
:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
and makeString.
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::setLength): Use makeString.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::imageUpdated): Ditto.
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init): Ditto.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
(WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
(WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
(WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
(WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
* inspector/agents/InspectorCSSAgent.cpp: Ditto.
* inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
* page/MemoryRelease.cpp:
(WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::formatByteNumber): Use String::number.
(WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::logFootprintComparison): Use makeString.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const): Ditto.
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
(WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
(WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
(WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
* platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
* platform/network/ParsedContentRange.cpp:
(WebCore::ParsedContentRange::headerValue const): Use makeString.
* platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
compiler conditionals and reorganized the start/stop of namespaces.
(WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::unauthorizedSQLFunction): Use makeString.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
(WebCore::RegistrationDatabase::importRecords): Ditto.
2018-12-15 Youenn Fablet <youenn@apple.com>
Make RTCRtpSender.setParameters to activate specific encodings
https://bugs.webkit.org/show_bug.cgi?id=192732
Reviewed by Eric Carlson.
The conversion between libwebrtc and WebCore is lossy for send parameters.
Libwebrtc checking the differences of values, call to setParameters will often fail.
Given some parameters cannot be exposed, the sender backend keeps the
current set of parameters when gathered and reuses them when parameters are set.
For encodings, we only change activate/maxBitRate/maxFrameRate as
these are the most important parameters to be able to modify.
Covered by added tests in webrtc/video.html.
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
(WebCore::LibWebRTCRtpSenderBackend::setParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRTCRtpSendParameters):
(WebCore::fromRTCEncodingParameters): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
2018-12-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused
https://bugs.webkit.org/show_bug.cgi?id=192724
<rdar://problem/46745911>
Reviewed by Devin Rousso.
iOS never installs the InspectorOverlay page as a page overlay.
It also uses its own node highlighting painting. Avoid any work
and resources associated with the overlay page for iOS.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
(WebCore::InspectorOverlay::update):
(WebCore::InspectorOverlay::overlayPage):
(WebCore::evaluateCommandInOverlay):
2018-12-14 Youenn Fablet <youenn@apple.com>
MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member
https://bugs.webkit.org/show_bug.cgi?id=192720
Reviewed by Eric Carlson.
Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member,
as the latter is a ref counted object.
Made some refactoring to return early in case of error.
Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream
the MediaRecorder will stop listening for its tracks.
Otherwise, the tracks will continue calling the MediaRecorder even after it is dead.
Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::setNewRecordingState): Deleted.
* Modules/mediarecorder/MediaRecorder.h:
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp:
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::fetchData):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
(WebCore::MediaRecorderPrivateWriter::create):
(WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted.
2018-12-14 Youenn Fablet <youenn@apple.com>
getSenders/getReceivers() should not return closed transceiver senders/receivers
https://bugs.webkit.org/show_bug.cgi?id=192706
Reviewed by Eric Carlson.
Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a
This forces us to compute the sender/receiver list at getter call time.
Updated the internal call sites of senders to use the list of transceivers instead.
Covered by updated WPT tests.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::addTrack):
(WebCore::RTCPeerConnection::getSenders const):
(WebCore::RTCPeerConnection::getReceivers const):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::stopped const):
(WebCore::RtpTransceiverSet::append):
(WebCore::RtpTransceiverSet::senders const):
(WebCore::RtpTransceiverSet::receivers const):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RtpTransceiverSet::senders const): Deleted.
(WebCore::RtpTransceiverSet::receivers const): Deleted.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::findExistingSender):
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
2018-12-14 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary copy of objects for operator==() methods
<https://webkit.org/b/192712>
<rdar://problem/46739332>
Reviewed by Andy Estes.
* contentextensions/HashableActionList.h:
(WebCore::ContentExtensions::HashableActionList::operator== const):
(WebCore::ContentExtensions::HashableActionList::operator!= const):
* platform/network/FormData.h:
(WebCore::FormDataElement::EncodedFileData::operator== const):
(WebCore::FormDataElement::EncodedBlobData::operator== const):
- Change arguments from const to const reference to avoid
copies.
2018-12-14 Jer Noble <jer.noble@apple.com>
CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&)
https://bugs.webkit.org/show_bug.cgi?id=192713
<rdar://problem/46739706>
Reviewed by Eric Carlson.
A callback is being called twice, and the second time has a null Promise. Instead of these
callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and
have ASSERTS() that they are called once-and-only-once.
* platform/encryptedmedia/CDMInstanceSession.h:
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceSessionClearKey::closeSession):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
2018-12-14 David Kilzer <ddkilzer@apple.com>
clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/
<https://webkit.org/b/192708>
<rdar://problem/46735907>
Reviewed by Jer Noble.
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::toSample):
- Make argument a const reference.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
- Update method signatures for implementation changes.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange):
- Make RetainPtr<> argument an rvalue reference and use WTFMove().
(WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange):
- Make RetainPtr<> argument a const reference.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch):
- Change for loop keys to be const references.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
- Update method signatures for implementation changes.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime):
(WebCore::SourceBufferPrivateAVFObjC::seekToTime):
- Make Mediatime arguments a const reference.
2018-12-14 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear
https://bugs.webkit.org/show_bug.cgi?id=188655
rdar://problem/43382687
Reviewed by Antoine Quint.
The logic that computes animation extent, used by backing store attachment code, failed
to account for the behavior where a keyframe animation with a missing 0% keyframe uses
the transform from the unanimated style. This resulted in the computed extent being wrong,
which caused us to remove the layer's backing store in some scenarios.
Fix both animation code paths to use the renderer style if the first keyframe doesn't
contain a transform.
Tests: compositing/backing/backing-store-attachment-empty-keyframe.html
legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
* page/animation/KeyframeAnimation.cpp:
(WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const):
2018-12-14 Chris Dumez <cdumez@apple.com>
[PSON] Stop exposing PolicyAction::Suspend to WebCore
https://bugs.webkit.org/show_bug.cgi?id=192701
Reviewed by Brady Eidson.
Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::continueAfterContentPolicy):
* loader/FrameLoaderTypes.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
(WebCore::PolicyChecker::checkNewWindowPolicy):
2018-12-14 Youenn Fablet <youenn@apple.com>
IDB should store RTCCertificate
https://bugs.webkit.org/show_bug.cgi?id=192599
Reviewed by Brady Eidson.
In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate.
Instead, create an empty object so that the deserialization can still succeed.
This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper.
Test: webrtc/certificates-indexeddb.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readTerminal):
2018-12-14 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Transition to logical margin types.
https://bugs.webkit.org/show_bug.cgi?id=192699
Reviewed by Antti Koivisto.
This is in preparation for moving over to logical types.
(This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin))
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingContextQuirks.cpp:
(WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight):
* layout/MarginTypes.h:
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginBefore):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted.
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted.
(WebCore::Layout::hasPrecomputedMarginTop): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted.
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::hasMarginBeforeQuirkValue):
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore):
(WebCore::Layout::hasMarginTopQuirkValue): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginBeforeCollapsedWithSibling):
(WebCore::Layout::isMarginAfterCollapsedWithSibling):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent):
(WebCore::Layout::isMarginAfterCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter):
(WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted.
(WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted.
(WebCore::Layout::isMarginBottomCollapsedThrough): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
(WebCore::Display::Box::marginBox const):
(WebCore::Display::Box::nonCollapsedMarginBox const):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::rectWithMargin const):
(WebCore::Display::Box::estimatedMarginBefore const):
(WebCore::Display::Box::setEstimatedMarginBefore):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::marginBefore const):
(WebCore::Display::Box::marginStart const):
(WebCore::Display::Box::marginAfter const):
(WebCore::Display::Box::marginEnd const):
(WebCore::Display::Box::nonCollapsedMarginBefore const):
(WebCore::Display::Box::nonCollapsedMarginAfter const):
(WebCore::Display::Box::nonComputedMarginStart const):
(WebCore::Display::Box::nonComputedMarginEnd const):
(WebCore::Display::Box::estimatedMarginTop const): Deleted.
(WebCore::Display::Box::setEstimatedMarginTop): Deleted.
(WebCore::Display::Box::marginTop const): Deleted.
(WebCore::Display::Box::marginLeft const): Deleted.
(WebCore::Display::Box::marginBottom const): Deleted.
(WebCore::Display::Box::marginRight const): Deleted.
(WebCore::Display::Box::nonCollapsedMarginTop const): Deleted.
(WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted.
(WebCore::Display::Box::nonComputedMarginLeft const): Deleted.
(WebCore::Display::Box::nonComputedMarginRight const): Deleted.
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
(WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
* layout/floats/FloatAvoider.h:
(WebCore::Layout::FloatAvoider::marginBefore const):
(WebCore::Layout::FloatAvoider::marginAfter const):
(WebCore::Layout::FloatAvoider::marginStart const):
(WebCore::Layout::FloatAvoider::marginEnd const):
(WebCore::Layout::FloatAvoider::marginBoxWidth const):
(WebCore::Layout::FloatAvoider::marginTop const): Deleted.
(WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
(WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
(WebCore::Layout::FloatAvoider::marginRight const): Deleted.
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::rect const):
(WebCore::Layout::FloatBox::horizontalPositionCandidate):
(WebCore::Layout::FloatBox::verticalPositionCandidate):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-12-14 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Introduce VerticalMargin and HorizontalMargin types.
https://bugs.webkit.org/show_bug.cgi?id=192692
Reviewed by Antti Koivisto.
This is in preparation for completing block margin collapsing.
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted.
* layout/MarginTypes.h: Added.
(WebCore::Layout::VerticalMargin::nonCollapsedValues const):
(WebCore::Layout::VerticalMargin::collapsedValues const):
(WebCore::Layout::VerticalMargin::setCollapsedValues):
(WebCore::Layout::VerticalMargin::VerticalMargin):
(WebCore::Layout::VerticalMargin::usedValues const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHorizontalMargin):
(WebCore::Display::Box::setVerticalMargin):
(WebCore::Display::Box::setHorizontalNonComputedMargin):
(WebCore::Display::Box::verticalMargin const):
(WebCore::Display::Box::marginTop const):
(WebCore::Display::Box::marginLeft const):
(WebCore::Display::Box::marginBottom const):
(WebCore::Display::Box::marginRight const):
(WebCore::Display::Box::nonCollapsedMarginTop const):
(WebCore::Display::Box::nonCollapsedMarginBottom const):
(WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted.
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2018-12-14 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] Fix compilation warnings under Source/WebCore/platform/win
https://bugs.webkit.org/show_bug.cgi?id=192693
Reviewed by Ross Kirsling.
No new tests, no behavior changes.
* platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list.
* platform/win/CursorWin.cpp:
(WebCore::loadCursorByName): Changed the argument type of 'name' to const char*.
* platform/win/DefWndProcWindowClass.cpp:
(WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'.
* platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'.
* platform/win/PasteboardWin.cpp:
(WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'.
(WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning.
* platform/win/PlatformMouseEventWin.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'.
* platform/win/PopupMenuWin.h: Marked override methods with 'override'.
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace.
(WebCore::signedPublicKeyAndChallengeString): Ditto.
* platform/win/SearchPopupMenuDB.cpp:
(WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT.
* platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86).
* platform/win/SystemInfo.cpp:
(WebCore::osVersionForUAString): Added default case.
2018-12-13 Youenn Fablet <youenn@apple.com>
RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected
https://bugs.webkit.org/show_bug.cgi?id=192685
Reviewed by Eric Carlson.
In case the remote description contains a rejected m section,
the corresponding transceiver should be marked as stopped.
Libwebrtc backend has that information so pipe it up to JS.
Covered by updated WPT test.
* Modules/mediastream/RTCRtpTransceiver.cpp:
(WebCore::RTCRtpTransceiver::stopped const):
* Modules/mediastream/RTCRtpTransceiver.h:
(WebCore::RTCRtpTransceiver::stopped const): Deleted.
* Modules/mediastream/RTCRtpTransceiverBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
(WebCore::LibWebRTCRtpTransceiverBackend::stopped const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h:
2018-12-13 Mark Lam <mark.lam@apple.com>
Ensure that StructureFlags initialization always starts with Base::StructureFlags.
https://bugs.webkit.org/show_bug.cgi?id=192686
Reviewed by Keith Miller.
No new tests needed because there's no new functionality. Just refactoring.
* bindings/js/JSDOMWindowProperties.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePrototypeDeclaration):
* bindings/scripts/test/JS/JSTestActiveDOMObject.h:
* bindings/scripts/test/JS/JSTestEnabledBySetting.h:
* bindings/scripts/test/JS/JSTestEventTarget.h:
* bindings/scripts/test/JS/JSTestGlobalObject.h:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bindings/scripts/test/JS/JSTestTypedefs.h:
2018-12-13 Ryosuke Niwa <rniwa@webkit.org>
Make HTMLConverter work across shadow boundaries
https://bugs.webkit.org/show_bug.cgi?id=192640
Reviewed by Wenson Hsieh.
Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions.
Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html
editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html
* dom/Position.cpp:
(WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter
and serializePreservingVisualAppearanceInternal.
* dom/Position.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::convert):
(HTMLConverterCaches::propertyValueForNode):
(HTMLConverterCaches::floatPropertyValueForNode):
(HTMLConverter::_blockLevelElementForNode):
(HTMLConverterCaches::colorPropertyValueForNode):
(HTMLConverter::aggregatedAttributesForAncestors):
(HTMLConverter::aggregatedAttributesForElementAndItsAncestors):
(HTMLConverter::_processElement):
(HTMLConverter::_traverseNode):
(HTMLConverter::_traverseFooterNode):
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted):
(WebCore::attributedStringFromSelection):
* editing/markup.cpp:
(WebCore::commonShadowIncludingAncestor): Moved to Position.cpp.
2018-12-13 Youenn Fablet <youenn@apple.com>
Trying to play a media element synchronously after setting srcObject should succeed without user gesture
https://bugs.webkit.org/show_bug.cgi?id=192679
Reviewed by Eric Carlson.
Check the srcObject mediaProvider value which is set synchronously.
Covered by updated fast/mediastream/local-audio-playing-event.html.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::hasMediaStreamSrcObject const):
2018-12-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Support dropping contact card data (public.vcard) in editable content
https://bugs.webkit.org/show_bug.cgi?id=192570
<rdar://problem/35626913>
Reviewed by Tim Horton.
Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details.
Tests: DragAndDropTests.ExternalSourceContactIntoEditableAreas
DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea
DragAndDropTests.ExternalSourceMapItemIntoEditableAreas
WKAttachmentTestsIOS.InsertDroppedContactAsAttachment
WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attachmentForFilePath):
Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths`
as well as `readVirtualContactFile`.
(WebCore::WebContentReader::readFilePaths):
(WebCore::WebContentReader::readVirtualContactFile):
Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting
fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is
empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a
contact, there is no associated URL, so we only have an attachment.
* platform/Pasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for
"public.vcard" data, which is then passed on to the web content reader. Additionally, by returning
`ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents
of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since
"public.vcard" conforms to "public.text").
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_fileUploadContentTypes]):
Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is
tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only
suitable for deserialization into an `MKMapItem`.
2018-12-13 Devin Rousso <drousso@apple.com>
Web Inspector: remove DOM.BackendNodeId and associated commands/events
https://bugs.webkit.org/show_bug.cgi?id=192478
Reviewed by Matt Baker.
Removing unused code, so no change in functionality.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted.
(WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted.
(WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted.
2018-12-13 Chris Dumez <cdumez@apple.com>
[PSON] We should not need to navigate to 'about:blank' to suspend pages
https://bugs.webkit.org/show_bug.cgi?id=192668
<rdar://problem/46701466>
Reviewed by Alex Christensen.
* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable):
* history/PageCache.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::stopAllLoaders):
(WebCore::FrameLoader::setDocumentLoader):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
* loader/FrameLoaderTypes.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:
2018-12-13 Per Arne Vollan <pvollan@apple.com>
[macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences
https://bugs.webkit.org/show_bug.cgi?id=192638
Reviewed by Eric Carlson.
It is currently not possible to override caption styles generated from System Preferences with inline
WebVTT styles without adding !important. The reason for this is that the generated styles from
System preferences are author styles which have higher priority than the inline WebVTT styles, which
are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated
styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since
they are added after the generated styles. This patch also fixes a problem where inline styles could be
added twice to the video user agent shadow root.
Test: media/track/track-cue-css.html
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getDisplayTree):
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
* page/Page.cpp:
(WebCore::Page::setCaptionUserPreferencesStyleSheet):
2018-12-13 Jer Noble <jer.noble@apple.com>
Fix leak of AVPlayer boundaryTimeObserver object.
https://bugs.webkit.org/show_bug.cgi?id=192674
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
2018-12-13 Brent Fulgham <bfulgham@apple.com>
Don't attempt to animate invalid CSS properties
https://bugs.webkit.org/show_bug.cgi?id=192630
<rdar://problem/46664433>
Reviewed by Antoine Quint.
Inherited animation properties can cause child elements to think they need to animate CSS properties
that they do not support, leading to nullptr crashes.
Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it
cleanly.
Tests: animations/invalid-property-animation.html
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateTransitions):
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2018-12-13 Timothy Hatcher <timothy@apple.com>
REGRESSION (r230064): Focus rings on webpages are fainter than in native UI.
https://bugs.webkit.org/show_bug.cgi?id=192639
rdar://problem/42669297
Reviewed by Tim Horton.
The focus ring color passed to CoreGraphics is expected to be opaque, since they
will apply opacity when drawing (because opacity is normally animated).
We were getting this by accident before when the old `RenderThemeMac::systemColor()`
used the old `convertNSColorToColor()`, which ignored alpha on NSColor.
Existing tests use fixed test focus ring color.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto.
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`.
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing): Ditto.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`.
* rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color.
(WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here.
2018-12-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Calculate width or height when constraints contain only the other
https://bugs.webkit.org/show_bug.cgi?id=192632
<rdar://problem/46665734>
Unreviewed, remove an unneeded assert.
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers):
2018-12-13 Zach Li <zachli@apple.com>
Update Credit Card AutoFill button icon
https://bugs.webkit.org/show_bug.cgi?id=192637
rdar://problem/46545006
Reviewed by Chris Dumez.
* css/html.css:
(input::-webkit-credit-card-auto-fill-button):
2018-12-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Calculate width or height when constraints contain only the other
https://bugs.webkit.org/show_bug.cgi?id=192632
<rdar://problem/46665734>
Reviewed by Youenn Fablet.
Test: fast/mediastream/constraint-intrinsic-size.html
* platform/graphics/RemoteVideoSample.cpp:
(WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR.
* platform/graphics/cv/ImageTransferSessionVT.h:
(WebCore::ImageTransferSessionVT::pixelFormat const): New.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size.
(WebCore::RealtimeMediaSource::setSize): Don't notify about width and height.
(WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary.
(WebCore::RealtimeMediaSource::setIntrinsicSize): New.
(WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly.
(WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize().
(WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable.
(WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
(WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset): Report intrinsic size.
(WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source.
* platform/mock/MockRealtimeVideoSource.h:
2018-12-13 David Kilzer <ddkilzer@apple.com>
clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp
<https://webkit.org/b/192661>
<rdar://problem/46694035>
Reviewed by Daniel Bates.
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::notifyIntersectionObserversTimerFired):
* dom/Element.cpp:
(WebCore::Element::didMoveToNewDocument):
(WebCore::Element::disconnectFromIntersectionObservers):
- Change loop variables from `auto` to `const auto&` to prevent
unnecessary copies of WeakPtr<IntersectionObserver> or
struct IntersectionObserverRegistration objects.
2018-12-13 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Remove HarfBuzzFace
https://bugs.webkit.org/show_bug.cgi?id=192589
Reviewed by Michael Catanzaro.
This was used to share the common implementation with the chromium port, but now that only freetype based ports
use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
since we are already caching glyphs in Font.
* platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
* platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
OpenType math.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::doubleToHarfBuzzPosition): Ditto.
(WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
(WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Add initial implementation of variation fonts
https://bugs.webkit.org/show_bug.cgi?id=192151
Reviewed by Michael Catanzaro.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const):
* platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
pattern.
(WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
(WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::defaultVariationValues): Parse font variations table.
(WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
* platform/graphics/freetype/FontCacheFreeType.h: Added.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
(WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
(WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
FC_FONT_VARIATIONS value from the pattern.
(WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
pattern.
(WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
(WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
(WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
2018-12-12 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
https://bugs.webkit.org/show_bug.cgi?id=192618
Reviewed by Alex Christensen.
No new tests, no behavior changes.
* platform/win/PopupMenuWin.h:
* platform/win/WCDataObject.cpp:
* platform/win/WCDataObject.h:
2018-12-12 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090): CAPCHA UI jumps to the wrong location
https://bugs.webkit.org/show_bug.cgi?id=192651
rdar://problem/46531919
Reviewed by Zalan Bujtas.
When a RenderLayer becomes non-composited because of a style change, we need to set a dirty
bit to say that descendants need their geometry updated (because they now have to
compute their positions relative to a different ancestor). This wasn't happening
in the layerStyleChanged() code path.
In the code path that did do this correctly (in the computeCompositingRequirements() tree walk),
we can address a FIXME and only dirty direct children, not all descendants (that code was
written before the child-only dirty bit existed).
Test: compositing/geometry/update-child-geometry-on-compositing-change.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-12-13 Ryosuke Niwa <rniwa@webkit.org>
Make TextInputController.legacyAttributedString take DOM nodes and offsets
https://bugs.webkit.org/show_bug.cgi?id=192653
Reviewed by Wenson Hsieh.
No new tests since there should be no observable behavioral change other than
TextInputController API in DumpRenderTree.
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(WebCore::attributedStringFromSelection):
(WebCore::attributedStringBetweenStartAndEnd): Added.
2018-12-12 Ryosuke Niwa <rniwa@webkit.org>
Fix macOS builds after r239145.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
2018-12-12 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238357): Pins on Yelp map disappear
https://bugs.webkit.org/show_bug.cgi?id=192597
rdar://problem/46578285
Reviewed by Zalan Bujtas.
RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained
a negative z-order child (triggering creation of a foreground layer), we'd fail to
call the "setChildren()" with the vector containing that foreground layer.
When updateBackingAndHierarchy() stops visiting descendants because none are composited,
it may still have to update the child list with the foreground layer, so make sure
the code handles this case.
Tests: compositing/z-order/add-negative-z-child.html
compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2018-12-12 YUHAN WU <yuhan_wu@apple.com>
Implement non-timeslice mode encoding for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=192069
<rdar://problem/46443290>
Reviewed by Eric Carlson.
Implement the encoding for non-timeslice mode of MediaRecorder.
It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
Add a API in internals to allow testings to turn on the mock source.
Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
(WebCore::MediaRecorder::getPrivateImpl):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::stopRecordingInternal):
(WebCore::MediaRecorder::createRecordingDataBlob):
(WebCore::MediaRecorder::scheduleDeferredTask):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediarecorder/MediaRecorderPrivate.h:
(WebCore::MediaRecorderPrivate::stopRecording):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::fetchData):
(WebCore::MediaRecorderPrivateAVFImpl::mimeType):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::fetchData):
(WebCore::MediaRecorderPrivateMock::mimeType):
* platform/mediarecorder/MediaRecorderPrivateMock.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added.
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
(WebCore::MediaRecorderPrivateWriter::clear):
(WebCore::MediaRecorderPrivateWriter::setupWriter):
(WebCore::MediaRecorderPrivateWriter::setVideoInput):
(WebCore::MediaRecorderPrivateWriter::setAudioInput):
(WebCore::copySampleBufferWithCurrentTimeStamp):
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::stopRecording):
* testing/Internals.cpp:
(WebCore::createRecorderMockSource):
(WebCore::Internals::setCustomPrivateRecorderCreator):
* testing/Internals.h:
* testing/Internals.idl:
2018-12-12 Justin Fan <justin_fan@apple.com>
[WebGPU] Vertex buffers and WebGPUInputState
https://bugs.webkit.org/show_bug.cgi?id=192611
Reviewed by Dean Jackson.
Test: webgpu/vertex-buffer-triangle-strip.html
Basic implementation of vertex buffers with Metal shading language in WebGPU. In
WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add
WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers.
Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode,
WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
Add and implement interfaces and dictionaries for WebGPUInputState:
* Modules/webgpu/WebGPUBuffer.cpp:
(WebCore::WebGPUBuffer::WebGPUBuffer):
* Modules/webgpu/WebGPUBuffer.h:
(WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer.
* Modules/webgpu/WebGPUBufferDescriptor.h:
* Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUIndexFormat.h: Added.
* Modules/webgpu/WebGPUIndexFormat.idl: Added.
* Modules/webgpu/WebGPUInputStateDescriptor.h: Added.
* Modules/webgpu/WebGPUInputStateDescriptor.idl: Added.
* Modules/webgpu/WebGPUInputStepMode.h: Added.
* Modules/webgpu/WebGPUInputStepMode.idl: Added.
* Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added.
* Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added.
* Modules/webgpu/WebGPUVertexFormat.h: Added.
* Modules/webgpu/WebGPUVertexFormat.idl: Added.
* Modules/webgpu/WebGPUVertexInputDescriptor.h: Added.
* Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added.
* platform/graphics/gpu/GPUInputStateDescriptor.h: Added.
* platform/graphics/gpu/GPURenderPassEncoder.h: Added.
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added.
* platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added.
* platform/graphics/gpu/GPUVertexInputDescriptor.h: Added.
Refactor to support updated structure of pipeline descriptor in sketch IDL:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::validateAndConvertPipelineStage):
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUPipelineDescriptorBase.h:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineStageDescriptor.h:
* Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPUShaderStage.*: Removed.
Add and implement setVertexBuffers:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added.
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::setVertexBuffers):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setInputStateForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
2018-12-12 Tim Horton <timothy_horton@apple.com>
REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight
https://bugs.webkit.org/show_bug.cgi?id=192642
<rdar://problem/46498246>
Reviewed by Geoffrey Garen.
No new tests; adjusted an existing test instead.
* platform/graphics/PathUtilities.cpp:
(WebCore::PathUtilities::pathsWithShrinkWrappedRects):
Instead of uniting when we fail to shrink-wrap, just return the original rects.
This seems like a more reasonable default in most cases.
2018-12-12 Vivek Seth <v_seth@apple.com>
HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened
https://bugs.webkit.org/show_bug.cgi?id=192375
<rdar://problem/45851159>
Reviewed by Chris Dumez.
Use simulated redirect to tell clients that HTTPS Upgrade happened.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::syntheticRedirectResponse):
* platform/network/ResourceResponseBase.h:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::synthesizeRedirectResponseIfNecessary):
2018-12-12 Chris Dumez <cdumez@apple.com>
Add a preference to enable / disable devicemotion and deviceorientation events
https://bugs.webkit.org/show_bug.cgi?id=192631
<rdar://problem/46646244>
Reviewed by Geoffrey Garen.
Add setting to toggle support for the deviceorientation / devicemotion events:
- https://w3c.github.io/deviceorientation/
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
* page/Settings.yaml:
2018-12-11 Ryosuke Niwa <rniwa@webkit.org>
Make HTMLConverter take two Positions in preparation to make it work with shadow DOM
https://bugs.webkit.org/show_bug.cgi?id=192613
Reviewed by Darin Adler.
This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with
a selection which spans across shadow boundaries in the future.
No new tests since there should be no observable behavioral change.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::HTMLConverter): Now takes two Position's.
(HTMLConverter::convert): Updated to work with Position's.
(HTMLConverter::_processText): Ditto.
(HTMLConverter::_traverseNode): Ditto.
(HTMLConverter::_traverseFooterNode): Ditto.
(HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto.
(WebCore::attributedStringFromRange): Ditto.
(WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange
in order to preserve the exact behavior.
2018-12-12 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed manual rollout of r239100-r239102 and r239116
https://bugs.webkit.org/show_bug.cgi?id=192151
<rdar://problem/46655586>
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData):
* platform/FreeType.cmake:
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const): Deleted.
* platform/graphics/cairo/FontCustomPlatformData.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::createFontPlatformData):
(WebCore::getFontPropertiesFromPattern): Deleted.
(WebCore::defaultVariationValues): Deleted.
(WebCore::buildVariationSettings): Deleted.
* platform/graphics/freetype/FontCacheFreeType.h: Removed.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData):
(WebCore::FontCustomPlatformData::~FontCustomPlatformData):
(WebCore::FontCustomPlatformData::fontPlatformData):
(WebCore::FontCustomPlatformData::supportsFormat):
(WebCore::defaultFontconfigOptions): Deleted.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern):
(WebCore::getDefaultFontconfigOptions):
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::operator=):
(WebCore::FontPlatformData::harfBuzzFace const):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::buildScaledFont):
(WebCore::FontPlatformData::fcPattern const): Deleted.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const):
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::fontFeatures):
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
(WebCore::floatToHarfBuzzPosition): Deleted.
(WebCore::doubleToHarfBuzzPosition): Deleted.
(WebCore::harfBuzzFontFunctions): Deleted.
(WebCore::findScriptForVerticalGlyphSubstitution): Deleted.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added.
(WebCore::HarfBuzzFace::CacheEntry::CacheEntry):
(WebCore::HarfBuzzFace::CacheEntry::~CacheEntry):
(WebCore::HarfBuzzFace::cache):
(WebCore::HarfBuzzFace::HarfBuzzFace):
(WebCore::HarfBuzzFace::~HarfBuzzFace):
(WebCore::findScriptForVerticalGlyphSubstitution):
(WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution):
* platform/graphics/harfbuzz/HarfBuzzFace.h: Added.
(WebCore::HarfBuzzFace::CacheEntry::create):
(WebCore::HarfBuzzFace::CacheEntry::face):
(WebCore::HarfBuzzFace::CacheEntry::glyphCache):
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added.
(WebCore::floatToHarfBuzzPosition):
(WebCore::doubleToHarfBuzzPosition):
(WebCore::CairoGetGlyphWidthAndExtents):
(WebCore::harfBuzzGetGlyph):
(WebCore::harfBuzzGetGlyphHorizontalAdvance):
(WebCore::harfBuzzGetGlyphHorizontalOrigin):
(WebCore::harfBuzzGetGlyphExtents):
(WebCore::harfBuzzCairoTextGetFontFuncs):
(WebCore::harfBuzzCairoGetTable):
(WebCore::HarfBuzzFace::createFace):
(WebCore::HarfBuzzFace::createFont):
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData):
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
2018-12-12 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix Windows Cairo build after r239100.
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
2018-12-12 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] A few API tests are failing after r239086
https://bugs.webkit.org/show_bug.cgi?id=192608
Reviewed by Zalan Bujtas.
These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing
the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest
fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab
the highest fidelity path using Vector::first().
While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths,
this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear.
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readRespectingUTIFidelities):
(WebCore::Pasteboard::readFilePaths):
2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix WPE build after r239101.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h>
2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Remove HarfBuzzFace
https://bugs.webkit.org/show_bug.cgi?id=192589
Reviewed by Michael Catanzaro.
This was used to share the common implementation with the chromium port, but now that only freetype based ports
use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either,
since we are already caching glyphs in Font.
* platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp.
* platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling.
(WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for
OpenType math.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::doubleToHarfBuzzPosition): Ditto.
(WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation
functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler.
(WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp.
(WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp.
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here.
* platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Removed.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed.
* platform/graphics/harfbuzz/HbUniquePtr.h:
(WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t.
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont().
2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com>
[FreeType] Add initial implementation of variation fonts
https://bugs.webkit.org/show_bug.cgi?id=192151
Reviewed by Michael Catanzaro.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): Remove platform ifdefs.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::platformDataFromCustomData): Ditto.
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isFixedWidth const):
* platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig
pattern.
(WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern().
(WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings()
before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::defaultVariationValues): Parse font variations table.
(WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo.
* platform/graphics/freetype/FontCacheFreeType.h: Added.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global.
(WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy.
(WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType.
(WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the
FontPlatformData to set FC_FONT_VARIATIONS on the pattern.
(WebCore::FontCustomPlatformData::supportsFormat): Add variation formats.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the
FC_FONT_VARIATIONS value from the pattern.
(WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig
pattern.
(WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern.
(WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr.
(WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
(WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz.
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
2018-12-11 Justin Michaud <justin_michaud@apple.com>
Implement feature flag for CSS Typed OM
https://bugs.webkit.org/show_bug.cgi?id=192610
Reviewed by Ryosuke Niwa.
* Configurations/FeatureDefines.xcconfig:
* bindings/js/JSTypedOMCSSStyleValueCustom.cpp:
* css/typedom/StylePropertyMapReadOnly.h:
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h:
* css/typedom/TypedOMCSSImageValue.idl:
* css/typedom/TypedOMCSSNumericValue.h:
* css/typedom/TypedOMCSSNumericValue.idl:
* css/typedom/TypedOMCSSStyleValue.h:
* css/typedom/TypedOMCSSStyleValue.idl:
* css/typedom/TypedOMCSSUnitValue.h:
* css/typedom/TypedOMCSSUnitValue.idl:
* css/typedom/TypedOMCSSUnparsedValue.h:
* css/typedom/TypedOMCSSUnparsedValue.idl:
* features.json:
* html/ImageBitmap.cpp:
* html/ImageBitmap.h:
* html/canvas/CanvasDrawImage.idl:
* html/canvas/CanvasFillStrokeStyles.idl:
* html/canvas/CanvasRenderingContext2DBase.cpp:
* html/canvas/CanvasRenderingContext2DBase.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled):
(WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const):
* page/WindowOrWorkerGlobalScope.idl:
2018-12-10 Ryosuke Niwa <rniwa@webkit.org>
connectedCallback is invoked during the removal of the element inside another element's connectedCallback
https://bugs.webkit.org/show_bug.cgi?id=183586
<rdar://problem/38403504>
Reviewed by Frédéric Wang.
Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760
After much discussion, it's unclear that there is a clear path forward to fixing the oddness that
the presence of a custom element reaction changes the timing at which another reaction callback gets invoked.
So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability.
Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element
does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in:
https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction
1. Let definition be element's custom element definition.
2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName.
3. If callback is null, then return
4. If callbackName is "attributeChangedCallback", then:
1. Let attributeName be the first element of args.
2. If definition's observed attributes does not contain attributeName, then return.
5. Add a new callback reaction to element's custom element reaction queue, with callback function callback
and arguments args.
6. Enqueue an element on the appropriate element queue given element.
Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
(WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
(WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue.
* dom/CustomElementReactionQueue.h:
2018-12-11 Justin Fan <justin_fan@apple.com>
[WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU
https://bugs.webkit.org/show_bug.cgi?id=192516
Reviewed by Dean Jackson.
Test: webgpu/buffers.html
Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation.
Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor:
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* Modules/webgpu/WebGPUBuffer.cpp: Added.
(WebCore::WebGPUBuffer::create):
(WebCore::WebGPUBuffer::WebGPUBuffer):
* Modules/webgpu/WebGPUBuffer.h: Added.
(WebCore::WebGPUBuffer::mapping const):
(WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear.
(WebCore::WebGPUBuffer::destroy): Unimplemented stub.
* Modules/webgpu/WebGPUBuffer.idl: Added.
* Modules/webgpu/WebGPUBufferDescriptor.h: Added.
* Modules/webgpu/WebGPUBufferDescriptor.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createBuffer const): Added.
* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::platformBuffer const):
(WebCore::GPUBuffer::mapping const):
* platform/graphics/gpu/GPUBufferDescriptor.h: Added.
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::createBuffer const): Added.
* platform/graphics/gpu/GPUDevice.h:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added.
(WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer.
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first.
Small benign edits, most to make nullability more consistent in WebGPU classes:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
(WebCore::WebGPUDevice::createRenderPipeline const):
(WebCore::WebGPUDevice::createCommandBuffer const):
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::device const):
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create):
* Modules/webgpu/WebGPURenderPassEncoder.h:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
(WebCore::WebGPUShaderModule::WebGPUShaderModule):
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes.
* Modules/webgpu/WebGPUTexture.cpp:
(WebCore::WebGPUTexture::create):
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::create):
* Modules/webgpu/WebGPUTextureView.h:
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::create):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::create):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::setDevice):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
2018-12-11 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] Fix warning -Wmissing-field-initializers
https://bugs.webkit.org/show_bug.cgi?id=192584
Reviewed by Yusuke Suzuki.
Initialize a struct with '{ }' instead of '= {0}'.
No new tests, no behavior changes.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::setFileDescriptorData):
(WebCore::setFileContentData):
(WebCore::setUCharData):
(WebCore::setUtf8Data):
(WebCore::setCFData):
* platform/win/CursorWin.cpp:
(WebCore::createSharedCursor):
* platform/win/DefWndProcWindowClass.cpp:
(WebCore::registerClass):
* platform/win/DragImageWin.cpp:
(WebCore::createDragImageIconForCachedImageFilename):
* platform/win/PasteboardWin.cpp:
(WebCore::writeURL):
(WebCore::Pasteboard::writeString):
(WebCore::Pasteboard::writeRangeToDataObject):
(WebCore::Pasteboard::writePlainTextToDataObject):
(WebCore::writeFileToDataObject):
(WebCore::Pasteboard::writeMarkup):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::show):
* platform/win/SSLKeyGeneratorWin.cpp:
(WebCore::WebCore::signedPublicKeyAndChallengeString):
2018-12-11 Jer Noble <jer.noble@apple.com>
Globally namespaced objects shouldn't use framework-prefixed names
https://bugs.webkit.org/show_bug.cgi?id=192600
Reviewed by Eric Carlson.
Rename CMSampleBufferIs... -> isCMSampleBuffer...
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::isCMSampleBufferRandomAccess):
(WebCore::isCMSampleBufferNonDisplaying):
(WebCore::MediaSampleAVFObjC::flags const):
(WebCore::CMSampleBufferIsRandomAccess): Deleted.
(WebCore::CMSampleBufferIsNonDisplaying): Deleted.
2018-12-11 Brent Fulgham <bfulgham@apple.com>
Don't attempt to compute animated values when there is no relevant animation
https://bugs.webkit.org/show_bug.cgi?id=192591
<rdar://problem/34336946>
Reviewed by Dean Jackson.
Check if the property is supposed to be animated, or has animatable features, before
attempting to calculate the current animated value.
Test: svg/animations/avoid-calculating-for-non-animating-elements.html
* svg/SVGAnimateElementBase.cpp:
(WebCore::SVGAnimateElementBase::calculateAnimatedValue):
2018-12-11 Chris Dumez <cdumez@apple.com>
Unreviewed, fix typos in console log from r239087.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
2018-12-11 Tim Horton <timothy_horton@apple.com>
WebCore shouldn't have a Objective-C class named NSCursor
https://bugs.webkit.org/show_bug.cgi?id=192602
<rdar://problem/46615532>
Reviewed by Wenson Hsieh.
* platform/ios/wak/WAKAppKitStubs.h:
* platform/ios/wak/WAKAppKitStubs.m:
(+[NSCursor setHiddenUntilMouseMoves:]): Deleted.
Get rid of the class.
Also remove a comment that seems to have detached from wherever it's supposed to be.
2018-12-11 Chris Dumez <cdumez@apple.com>
Restrict DeviceMotion / DeviceOrientation APIs to secure contexts
https://bugs.webkit.org/show_bug.cgi?id=192595
<rdar://problem/46382603>
Reviewed by Dean Jackson.
Tests: http/tests/events/device-orientation-motion-non-secure-context.html
http/tests/events/device-orientation-motion-secure-context.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::setIsPotentiallyTrustworthy):
* testing/Internals.cpp:
(WebCore::Internals::markContextAsInsecure):
(WebCore::Internals::postTask):
* testing/Internals.h:
* testing/Internals.idl:
2018-12-11 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Send the full list of file upload URLs and types in PasteboardItemInfo
https://bugs.webkit.org/show_bug.cgi?id=192598
Work towards <rdar://problem/35626913>
Reviewed by Tim Horton.
Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just
a "preferred" file upload URL and type. See below for more details.
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::pathForContentType const):
Add a helper method to find a file upload URL corresponding to a given type.
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`.
* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::readRespectingUTIFidelities):
Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`.
(WebCore::Pasteboard::readFilePaths):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_containsFileURLAndFileUploadContent]):
(-[NSItemProvider web_fileUploadContentTypes]):
Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file
upload content types (rather than just a `BOOL` indicating whether one or more of these types exist).
(-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]):
(-[WebItemProviderPasteboard numberOfFiles]):
(-[NSItemProvider web_containsFileUploadContent]): Deleted.
(-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted.
Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest
fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that
shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal
data serialization for an `NSURL` as a file on the web).
Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file
uploads, and return all of these file types that we've loaded.
2018-12-11 Don Olmstead <don.olmstead@sony.com>
Resource Load Statistics: Use common implementation within NetworkStorageSession
https://bugs.webkit.org/show_bug.cgi?id=192592
Reviewed by Alex Christensen.
There's nothing within the resource load statistics implementation contained
in NetworkStorageSessionCFNet that was CF specific. All of the resource load
statistics methods are moved from that file to the root NetworkStorageSession
implementation.
* platform/network/NetworkStorageSession.cpp:
(WebCore::getPartitioningDomain):
(WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
(WebCore::NetworkStorageSession::shouldBlockCookies const):
(WebCore::NetworkStorageSession::maxAgeCacheCap):
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
(WebCore::NetworkStorageSession::removePrevalentDomains):
(WebCore::NetworkStorageSession::hasStorageAccess const):
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
(WebCore::NetworkStorageSession::grantStorageAccess):
(WebCore::NetworkStorageSession::removeStorageAccessForFrame):
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
(WebCore::NetworkStorageSession::removeAllStorageAccess):
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::getPartitioningDomain): Deleted.
(WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted.
(WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted.
(WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted.
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted.
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted.
(WebCore::NetworkStorageSession::removePrevalentDomains): Deleted.
(WebCore::NetworkStorageSession::hasStorageAccess const): Deleted.
(WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted.
(WebCore::NetworkStorageSession::grantStorageAccess): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted.
(WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted.
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted.
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted.
2018-12-11 Devin Rousso <drousso@apple.com>
Web Inspector: overlay bounds rulers don't match element when page is scrolled
https://bugs.webkit.org/show_bug.cgi?id=192577
Reviewed by Joseph Pecoraro.
When drawing the highlight for a node, the canvas is translated based on the scroll position
of the node. This translation was not applied to the bounds calculations, which meant that
the bounds always drew where the node would have been if it wasn't scrolled.
* inspector/InspectorOverlayPage.js:
(Bounds.prototype.get minX):
(Bounds.prototype.get minY):
(Bounds.prototype.get maxX):
(Bounds.prototype.get maxY):
(Bounds.prototype.offset): Added.
(drawNodeHighlight):
Drive-by: draw bounds for every node being highlighted instead of just the first one.
Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast.
2018-12-11 Andy Estes <aestes@apple.com>
Introduce makeBlockPtr for lambdas
https://bugs.webkit.org/show_bug.cgi?id=192594
Reviewed by Alex Christensen.
Adopted makeBlockPtr.
* platform/cocoa/FileMonitorCocoa.mm:
(WebCore::FileMonitor::FileMonitor):
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
(WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer):
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm:
(WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession addDelegateOperation:]):
(-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2018-12-10 Brent Fulgham <bfulgham@apple.com>
SVGViewSpec objects should mark relevant SVG elements
https://bugs.webkit.org/show_bug.cgi?id=192567
<rdar://problem/46491325>
Reviewed by Ryosuke Niwa.
SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to
recognize the relevant SVGElement as active as long as the SVGViewSpec is active.
Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare
pointer to the SVGElement, so switched to a WeakPtr.
Test: svg/animations/view-dependency-crash.html
* Sources.txt: Add new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSSVGViewSpecCustom.cpp: Added.
(WebCore::JSSVGViewSpec::visitAdditionalChildren):
* svg/SVGElement.h:
* svg/SVGPathElement.h:
* svg/SVGViewSpec.cpp:
(WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element.
* svg/SVGViewSpec.h:
* svg/SVGViewSpec.idl:
* svg/properties/SVGAttributeOwnerProxy.cpp: Added.
(WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to
the underling SVGElement.
(WebCore::SVGAttributeOwnerProxy::element const): Ditto.
* svg/properties/SVGAttributeOwnerProxy.h:
(WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file.
(WebCore::SVGAttributeOwnerProxy::element const): Ditto.
* svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use.
2018-12-10 Benjamin Poulain <benjamin@webkit.org>
<rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading
https://bugs.webkit.org/show_bug.cgi?id=192439
Reviewed by Dean Jackson.
This broken when WebKit switched to NSURLSession.
In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW.
Test: http/tests/contentextensions/video-element-resource-type.html
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):
2018-12-10 Don Olmstead <don.olmstead@sony.com>
Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig
https://bugs.webkit.org/show_bug.cgi?id=192573
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
2018-12-10 Justin Michaud <justin_michaud@apple.com>
CS Painting API should support multiple worklets.
https://bugs.webkit.org/show_bug.cgi?id=192335
Reviewed by Dean Jackson.
Adds a new map to support separate paint worklet global scopes (one for each worklet). Also
adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required
for paint would not trigger a repaint if there had not been a valid value set before.
Test: fast/css-custom-paint/multiple-worklets.html
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
(WebCore::Document::paintWorkletGlobalScope):
(WebCore::Document::setPaintWorkletGlobalScope):
* dom/Document.h:
(WebCore::Document::paintWorkletGlobalScope): Deleted.
* rendering/style/RenderStyle.cpp:
(WebCore::changedCustomPaintWatchedProperty):
* worklets/Worklet.cpp:
(WebCore::Worklet::addModule):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::prepareForDestruction):
2018-12-10 Youenn Fablet <youenn@apple.com>
Remove derived classes of RealtimeMediaSourceCenter
https://bugs.webkit.org/show_bug.cgi?id=192546
Reviewed by Eric Carlson.
Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it.
Instead port specific implementation directly implement the needed default factory methods.
Renamed some methods for improved consistency.
Moved some static variables as RealtimeMediaSourceCenter members.
No change of behavior.
* WebCore.xcodeproj/project.pbxproj:
* page/DeprecatedGlobalSettings.cpp:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
(WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState):
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::audioCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::setVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
(WebCore::RealtimeMediaSourceCenter::videoCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::~RealtimeVideoSource):
(WebCore::RealtimeVideoSource::prepareToProduceData):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton):
(WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton):
(WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
(WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
2018-12-10 Youenn Fablet <youenn@apple.com>
DataChannels created asynchronously never open and are unusable
https://bugs.webkit.org/show_bug.cgi?id=192566
Reviewed by Eric Carlson.
For every new data channel (remote or local), we should check the underlying backend state.
This allows firing events if needed.
We were not always doing that which was prohibiting sending some open
events for data channels created after the SCTP connection is set up.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
(WebCore::LibWebRTCDataChannelHandler::channelEvent):
(WebCore::LibWebRTCDataChannelHandler::setClient):
(WebCore::LibWebRTCDataChannelHandler::OnStateChange):
(WebCore::LibWebRTCDataChannelHandler::checkState):
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
2018-12-10 Ryosuke Niwa <rniwa@webkit.org>
Use WeakPtr to refer to VTTCue in VTTCueBox
https://bugs.webkit.org/show_bug.cgi?id=192575
Reviewed by Eric Carlson.
Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away.
This is implemented by simply using WeakPtr.
No new tests since there shoul be no behaivoral change.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::VTTCueBox):
(WebCore::VTTCueBox::getCue const):
(WebCore::VTTCueBox::applyCSSProperties):
(WebCore::VTTCue::~VTTCue):
* html/track/VTTCue.h:
(WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const):
2018-12-10 Mark Lam <mark.lam@apple.com>
PropertyAttribute needs a CustomValue bit.
https://bugs.webkit.org/show_bug.cgi?id=191993
<rdar://problem/46264467>
Reviewed by Saam Barati.
This patch revealed a bug in the CodeGenerator where a constructor property is
set with a ReadOnly attribute. This conflicts with the WebIDL link (see clause
12 in https://heycam.github.io/webidl/#interface-prototype-object) which states
that it should be [Writable]. The ReadOnly attribute is now removed.
On the WebCore side, this change is covered by existing tests.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
2018-12-10 Antti Koivisto <antti@apple.com>
Rename "forced style recalc" to "full style rebuild"
https://bugs.webkit.org/show_bug.cgi?id=192572
Reviewed by Zalan Bujtas.
The old name is confusing.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::hasValidStyleForProperty):
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRebuild):
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::unscheduleStyleRecalc):
(WebCore::Document::hasPendingStyleRebuild const):
(WebCore::Document::resolveStyle):
(WebCore::Document::needsStyleRecalc const):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc):
(WebCore::Document::setDesignMode):
(WebCore::Document::webkitDidExitFullScreenForElement):
(WebCore::Document::setAnimatingFullScreen):
(WebCore::Document::setFullscreenControlsHidden):
(WebCore::Document::scheduleForcedStyleRecalc): Deleted.
(WebCore::Document::hasPendingForcedStyleRecalc const): Deleted.
* dom/Document.h:
* dom/Element.cpp:
(WebCore::Element::needsStyleInvalidation const):
* page/Page.cpp:
(WebCore::Page::updateStyleAfterChangeInEnvironment):
* style/StyleScope.cpp:
(WebCore::Style::Scope::updateActiveStyleSheets):
2018-12-10 Alexey Proskuryakov <ap@apple.com>
Include CoreGraphics.h from WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=192557
Reviewed by Tim Horton.
The theory is that this will improve build time. Let's try and see what bots say.
* WebCorePrefix.h:
2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Unable to upload data that conforms to "public.item" but not "public.content"
https://bugs.webkit.org/show_bug.cgi?id=192555
<rdar://problem/35204990>
Reviewed by Tim Horton.
Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only
supports data that conforms to "public.content", but there exist several types of files that conform to
"public.item" but not "public.content". See below for more detail.
Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::supportedFileUploadPasteboardTypes):
Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder"
conforms to "public.item".
* platform/ios/WebItemProviderPasteboard.mm:
(-[NSItemProvider web_containsFileURLAndFileUploadContent]):
Pull out the "contains content that is supported for file uploads" part of this helper method into a separate
method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"-
conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file).
Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when
dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput
for an example of this corner case).
(-[NSItemProvider web_containsFileUploadContent]):
(-[WebItemProviderPasteboard numberOfFiles]):
Refactor this to use `-web_containsFileUploadContent`.
2018-12-10 Chris Dumez <cdumez@apple.com>
Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192509
<rdar://problem/46500832>
Reviewed by Alex Christensen.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setCustomUserAgent):
(WebCore::DocumentLoader::customUserAgent const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::userAgent const):
2018-12-10 Adrian Perez de Castro <aperez@igalia.com>
[GLib] FileSystem::moveFile() should fall back to copying
https://bugs.webkit.org/show_bug.cgi?id=192562
Reviewed by Michael Catanzaro.
No new tests needed.
* platform/glib/FileSystemGlib.cpp:
(WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which
provides a fall-back which does copy+delete when a direct move or rename cannot be done.
2018-12-10 Simon Fraser <simon.fraser@apple.com>
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
<rdar://problem/46542237>
Re-land r239010 after over-zealous rollout.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::attachToStateTree):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::attachToStateTree):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::indexOfChild const):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingStateTree.h:
2018-12-10 Antti Koivisto <antti@apple.com>
Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true.
https://bugs.webkit.org/show_bug.cgi?id=191695
Reviewed by Zalan Bujtas.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
Don't test for m_pendingStyleRecalcShouldForce.
(WebCore::Document::hasPendingStyleRecalc const):
(WebCore::Document::hasPendingForcedStyleRecalc const):
Don't base the pending status of these function on whether the timer is running.
Instead check if the style is invalid.
2018-12-10 Rob Buis <rbuis@igalia.com>
XMLHttpRequest removes spaces from content-types before processing
https://bugs.webkit.org/show_bug.cgi?id=8644
Reviewed by Chris Dumez.
Stop trimming white space characters from the middle of
type/subtype value. Also make sure whitespace being parsed
adheres to OWS definition from RFC 7230 Section 3.2.3
(referenced by RFC 7231), i.e. space or HT.
Based on http://crrev.com/416586.
Behavior matches Firefox and Chrome.
Tests: http/tests/xmlhttprequest/supported-xml-content-types.html
web-platform-tests/mimesniff/mime-types/parsing.any.html
web-platform-tests/mimesniff/mime-types/parsing.any.worker.html
* platform/network/HTTPParsers.cpp:
(WebCore::extractMIMETypeFromMediaType):
2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Caret is obscured by finger when dragging over an editable element
https://bugs.webkit.org/show_bug.cgi?id=192499
<rdar://problem/46570101>
Reviewed by Tim Horton.
* page/DragActions.h:
Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes
use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for
DragHandlingMethod so that it may be encoded over IPC.
* page/DragController.cpp:
(WebCore::dragIsHandledByDocument):
Simplify this helper function.
(WebCore::DragController::tryDocumentDrag):
* page/DragController.h:
Expose the current DragHandlingMethod via a const getter method.
(WebCore::DragController::dragHandlingMethod const):
2018-12-10 Youenn Fablet <youenn@apple.com>
Make mock capture happen in the process used for real capture
https://bugs.webkit.org/show_bug.cgi?id=192544
Reviewed by Eric Carlson.
MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on.
Add booleans to choose which source (audio, video, display) will actually be toggled on.
Covered by existing tests.
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
* platform/mock/MockRealtimeMediaSourceCenter.h:
(WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled):
(WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled):
(WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled):
2018-12-10 Dean Jackson <dino@apple.com>
Use text/javascript as recommended by the HTML specification
https://bugs.webkit.org/show_bug.cgi?id=192525
<rdar://problem/46569636>
Reviewed by Jon Lee.
The HTML specification says we should use text/javascript for
JavaScript files:
https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type
* loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript.
(WebCore::CachedScript::CachedScript):
* platform/network/ios/WebCoreURLResponseIOS.mm: Ditto.
(WebCore::createExtensionToMIMETypeMap):
* platform/network/mac/WebCoreURLResponse.mm: Ditto.
(WebCore::createExtensionToMIMETypeMap):
2018-12-10 Dean Jackson <dino@apple.com>
[iOS] Make WebGPU work with remote layer hosting
https://bugs.webkit.org/show_bug.cgi?id=192508
<rdar://problem/46560649>
Reviewed by Tim Horton.
WebGPU wasn't working on iOS because we were not correctly
identifying the CALayers for remote hosting. Fix this by
adding a new CALayer type, WebGPULayer. This will also
eventually hold the code to render WebGPU into a canvas.
Covered by the existing reference tests (on device).
* SourcesCocoa.txt: Add new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
class for remote hosting.
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
* platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
from CAMetalLayer.
* platform/graphics/cocoa/WebGPULayer.mm: Added.
(-[WebGPULayer init]):
(-[WebGPULayer copyImageSnapshotWithColorSpace:]):
* platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
than CALayer.
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
the WebGPULayer has a reference back to this object, which it
will use in the future.
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):
2018-12-10 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238965.
Caused internal iOS build failures
Reverted changeset:
"[iOS] Make WebGPU work with remote layer hosting"
https://bugs.webkit.org/show_bug.cgi?id=192508
https://trac.webkit.org/changeset/238965
2018-12-10 Youenn Fablet <youenn@apple.com>
MockLibWebRTCPeerConnectionFactory should isolate copy its test case
https://bugs.webkit.org/show_bug.cgi?id=192545
Reviewed by Eric Carlson.
Isolate copy the test case member so that it can be destroyed on another thread.
Covered by existing test that should no longer crash.
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::useMockRTCPeerConnectionFactory):
(WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockLibWebRTCPeerConnectionFactory::create):
2018-12-09 Youenn Fablet <youenn@apple.com>
Move capture manager from RealtimeMediaSourceCenter to capture factory
https://bugs.webkit.org/show_bug.cgi?id=192542
Reviewed by Eric Carlson.
We should be able to run mock captures in wither UIProcess or WebProcess.
Currently, mock capture is only done in WebProcess.
This patch is a first step towards that goal.
It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods.
Further refactoring will remove the need to subclass RealtimeMediaSourceCenter.
Instead, remaining virtual methods will become non virtual and their
implementation will become port specific.
Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter.
No visible change of behavior.
Covered by existing tests.
* platform/mediastream/CaptureDeviceManager.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::singleton):
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices):
(WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices):
(WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoFactory):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
(WebCore::MockRealtimeMediaSourceCenter::audioCaptureDeviceManager):
(WebCore::MockRealtimeMediaSourceCenter::videoCaptureDeviceManager):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureDeviceManager):
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2018-12-09 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r239010.
https://bugs.webkit.org/show_bug.cgi?id=192537
Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed-
scrolling-layers-state.html again (Requested by ap on
#webkit).
Reverted changeset:
"Allow control over child order when adding nodes to the
scrolling tree"
https://bugs.webkit.org/show_bug.cgi?id=176914
https://trac.webkit.org/changeset/239010
2018-12-08 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Scaled video frames should be resized in letterbox mode
https://bugs.webkit.org/show_bug.cgi?id=192528
<rdar://problem/46576638>
Reviewed by Darin Adler.
Test: fast/mediastream/resize-letterbox.html
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT): Use letterbox resize mode, not trim.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::captureSize const): "Capture" at the preset size, not
necessarily at the requested size to be more like a physical camera.
(WebCore::MockRealtimeVideoSource::settingsDidChange):
(WebCore::MockRealtimeVideoSource::drawAnimation):
(WebCore::MockRealtimeVideoSource::drawBoxes):
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::generateFrame):
(WebCore::MockRealtimeVideoSource::imageBuffer const):
* platform/mock/MockRealtimeVideoSource.h:
2018-12-08 Alex Christensen <achristensen@webkit.org>
Don't programmatically capitalize safe browsing warning buttons
https://bugs.webkit.org/show_bug.cgi?id=192531
<rdar://problem/46417791>
Reviewed by Darin Adler.
This doesn't work so well in other languages.
Capitalize the source strings in English instead.
* en.lproj/Localizable.strings:
2018-12-08 Frederic Wang <fwang@igalia.com>
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
<rdar://problem/46542237>
Reviewed by Simon Fraser.
Based on an earlier patch by Simon Fraser.
Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
but with no control over sibling order. To allow for correct hit-testing overflow and
frame scrolling nodes, we have to build the scrolling tree in z-order.
This patch adds a 'childIndex' parameter to attachNode() which gives control over
sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
for childIndex so the current behavior (appending new nodes at the end of child list) is
preserved.
One test marked as flakey, since scrolling tree order is currently dependent on HashSet
traversal order.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::attachToStateTree):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::attachToStateTree):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::indexOfChild const):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingStateTree.h:
2018-12-07 Eric Carlson <eric.carlson@apple.com>
[MediaStream] 'devicechange' event should not fire in frames that can't access capture devices
https://bugs.webkit.org/show_bug.cgi?id=192511
<rdar://problem/46562063>
Reviewed by Youenn Fablet.
Test: http/tests/media/media-stream/device-change-event-in-iframe.html
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::addEventListener): Don't fire the event unless the document can
access a camera or microphone.
2018-12-07 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Address post-review comments after r238904
https://bugs.webkit.org/show_bug.cgi?id=192514
<rdar://problem/46564302>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::ImageTransferSessionVT::setSize):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
2018-12-07 Antti Koivisto <antti@apple.com>
[LFC] Rename LayoutFormattingState files to LayoutState
https://bugs.webkit.org/show_bug.cgi?id=192520
Reviewed by Zalan Bujtas.
Match the class name.
* layout/FormattingContext.cpp:
* layout/FormattingContextQuirks.cpp:
* layout/FormattingState.h:
* layout/LayoutFormattingState.cpp: Removed.
* layout/LayoutFormattingState.h: Removed.
* layout/LayoutState.cpp: Copied from Source/WebCore/layout/LayoutFormattingState.cpp.
* layout/LayoutState.h: Copied from Source/WebCore/layout/LayoutFormattingState.h.
* layout/Verification.cpp:
* layout/blockformatting/BlockFormattingContext.cpp:
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
* layout/blockformatting/BlockInvalidation.cpp:
* layout/floats/FloatAvoider.cpp:
* layout/floats/FloatingContext.cpp:
* layout/floats/FloatingState.cpp:
* layout/inlineformatting/InlineFormattingContext.cpp:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
* layout/inlineformatting/InlineInvalidation.cpp:
* layout/layouttree/LayoutTreeBuilder.cpp:
* page/FrameViewLayoutContext.cpp:
2018-12-07 Justin Michaud <justin_michaud@apple.com>
CSS Painting API code cleanup
https://bugs.webkit.org/show_bug.cgi?id=192480
Reviewed by Dean Jackson.
No new tests, since the existing tests should cover it.
* bindings/js/JSDOMWrapper.cpp:
(WebCore::outputConstraintSubspaceFor):
(WebCore::globalObjectOutputConstraintSubspaceFor):
* bindings/js/JSWorkletGlobalScopeBase.cpp:
(WebCore::toJS):
* css/CSSPaintCallback.h:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCustomPaintWatchProperty):
(WebCore::changedCustomPaintWatchedProperty):
(WebCore::RenderStyle::changeRequiresRepaint const):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
* worklets/PaintWorkletGlobalScope.h:
2018-12-07 Youenn Fablet <youenn@apple.com>
Update libwebrtc up to 0d007d7c4f
https://bugs.webkit.org/show_bug.cgi?id=192316
Reviewed by Eric Carlson.
Update include according new libwebrtc.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2018-12-07 Dean Jackson <dino@apple.com>
[iOS] Make WebGPU work with remote layer hosting
https://bugs.webkit.org/show_bug.cgi?id=192508
<rdar://problem/46560649>
Reviewed by Tim Horton.
WebGPU wasn't working on iOS because we were not correctly
identifying the CALayers for remote hosting. Fix this by
adding a new CALayer type, WebGPULayer. This will also
eventually hold the code to render WebGPU into a canvas.
Covered by the existing reference tests (on device).
* SourcesCocoa.txt: Add new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer
class for remote hosting.
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
* platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance
from CAMetalLayer.
* platform/graphics/cocoa/WebGPULayer.mm: Added.
(-[WebGPULayer init]):
(-[WebGPULayer copyImageSnapshotWithColorSpace:]):
* platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather
than CALayer.
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that
the WebGPULayer has a reference back to this object, which it
will use in the future.
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):
2018-12-07 Antti Koivisto <antti@apple.com>
Rename LayoutState to RenderLayoutState
https://bugs.webkit.org/show_bug.cgi?id=192504
Reviewed by Zalan Bujtas.
The name is better used in LFC.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layoutState const):
(WebCore::FrameViewLayoutContext::pushLayoutState):
(WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
* page/FrameViewLayoutContext.h:
* rendering/LayoutState.cpp: Removed.
* rendering/LayoutState.h: Removed.
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderEmbeddedObject.cpp:
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderGrid.cpp:
* rendering/RenderImage.cpp:
* rendering/RenderInline.cpp:
* rendering/RenderLayoutState.cpp: Copied from Source/WebCore/rendering/LayoutState.cpp.
(WebCore::RenderLayoutState::RenderLayoutState):
(WebCore::RenderLayoutState::computeOffsets):
(WebCore::RenderLayoutState::computeClipRect):
(WebCore::RenderLayoutState::computePaginationInformation):
(WebCore::RenderLayoutState::pageLogicalOffset const):
(WebCore::RenderLayoutState::computeLineGridPaginationOrigin):
(WebCore::RenderLayoutState::propagateLineGridInfo):
(WebCore::RenderLayoutState::establishLineGrid):
(WebCore::RenderLayoutState::addLayoutDelta):
(WebCore::RenderLayoutState::layoutDeltaMatches const):
(WebCore::LayoutState::LayoutState): Deleted.
(WebCore::LayoutState::computeOffsets): Deleted.
(WebCore::LayoutState::computeClipRect): Deleted.
(WebCore::LayoutState::computePaginationInformation): Deleted.
(WebCore::LayoutState::pageLogicalOffset const): Deleted.
(WebCore::LayoutState::computeLineGridPaginationOrigin): Deleted.
(WebCore::LayoutState::propagateLineGridInfo): Deleted.
(WebCore::LayoutState::establishLineGrid): Deleted.
(WebCore::LayoutState::addLayoutDelta): Deleted.
(WebCore::LayoutState::layoutDeltaMatches const): Deleted.
* rendering/RenderLayoutState.h: Copied from Source/WebCore/rendering/LayoutState.h.
(WebCore::RenderLayoutState::RenderLayoutState):
(WebCore::LayoutState::LayoutState): Deleted.
(WebCore::LayoutState::isPaginated const): Deleted.
(WebCore::LayoutState::pageLogicalHeight const): Deleted.
(WebCore::LayoutState::pageLogicalHeightChanged const): Deleted.
(WebCore::LayoutState::lineGrid const): Deleted.
(WebCore::LayoutState::lineGridOffset const): Deleted.
(WebCore::LayoutState::lineGridPaginationOrigin const): Deleted.
(WebCore::LayoutState::paintOffset const): Deleted.
(WebCore::LayoutState::layoutOffset const): Deleted.
(WebCore::LayoutState::pageOffset const): Deleted.
(WebCore::LayoutState::needsBlockDirectionLocationSetBeforeLayout const): Deleted.
(WebCore::LayoutState::renderer const): Deleted.
(WebCore::LayoutState::clipRect const): Deleted.
(WebCore::LayoutState::isClipped const): Deleted.
(WebCore::LayoutState::layoutDelta const): Deleted.
* rendering/RenderListBox.cpp:
* rendering/RenderMediaControlElements.cpp:
* rendering/RenderMultiColumnFlow.cpp:
* rendering/RenderTable.cpp:
* rendering/RenderTableRow.cpp:
* rendering/RenderTableSection.cpp:
* rendering/RenderVTTCue.cpp:
* rendering/RenderView.cpp:
* rendering/RenderView.h:
* rendering/RootInlineBox.cpp:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::layout):
2018-12-07 Antti Koivisto <antti@apple.com>
[LFC] Rename formattingContext() to createFormattingContext()
https://bugs.webkit.org/show_bug.cgi?id=192500
Reviewed by Zalan Bujtas.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingState.h:
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::createFormattingContext):
(WebCore::Layout::BlockFormattingState::formattingContext): Deleted.
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingState.h:
2018-12-07 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238947.
Revision caused fast/visual-viewport/tiled-drawing/zoomed-
fixed-scrolling-layers-state.html to constantly fail
Reverted changeset:
"Allow control over child order when adding nodes to the
scrolling tree"
https://bugs.webkit.org/show_bug.cgi?id=176914
https://trac.webkit.org/changeset/238947
2018-12-07 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Cloned attachment elements lose their unique identifiers
https://bugs.webkit.org/show_bug.cgi?id=192483
Reviewed by Tim Horton.
This patch adds logic to ensure that the unique identifier of a cloned attachment element is the same as the
unique identifier of the original attachment element. If the cloned attachment is inserted into the same
document as the original attachment, then we will exercise the same codepath for copied-and-pasted attachments,
and assign a new unique identifier to the attachment element, while creating a new `_WKAttachment` in the client
that's backed by the same `NSFileWrapper`.
Test: WKAttachmentTests.AttachmentIdentifierOfClonedAttachment
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::copyNonAttributePropertiesFromElement):
* html/HTMLAttachmentElement.h:
2018-12-07 Rob Buis <rbuis@igalia.com>
Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
https://bugs.webkit.org/show_bug.cgi?id=192288
Reviewed by Frédéric Wang.
Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList
as they do the same thing. Also remove std::optional from parseAccessControlAllowList
since the function can't fail.
* WebCore.order:
* loader/CrossOriginAccessControl.cpp:
(WebCore::validatePreflightResponse):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::CrossOriginPreflightResultCacheItem::parse):
* loader/CrossOriginPreflightResultCache.h:
* platform/network/HTTPParsers.cpp:
(WebCore::parseAccessControlExposeHeadersAllowList): Deleted.
* platform/network/HTTPParsers.h:
(WebCore::parseAccessControlAllowList):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::filter):
(WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
2018-12-07 Eric Carlson <eric.carlson@apple.com>
[iOS] Don't update AVPlayerViewController currentTime while scrubbing
https://bugs.webkit.org/show_bug.cgi?id=192438
<rdar://problem/42977046>
Reviewed by Jer Noble.
No new tests, tested manually.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing.
(-[WebAVPlayerController endScrubbing:]): Ditto.
(-[WebAVPlayerController isScrubbing]): Return _isScrubbing.
2018-12-07 Thibault Saunier <tsaunier@igalia.com>
[WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs
https://bugs.webkit.org/show_bug.cgi?id=186933
Reusing the AudioSourceProviderGStreamer itself as it was doing almost everything we needed,
just added a constructor to be able to create it from a MediaStreamTrackPrivate and made it a
WebAudioSourceProvider which only means it is now a ThreadSafeRefCounted.
Sensibily refactored GStreamerMediaStreamSource so that we could reuse it to track a single
MediaStreamTrack.
Reviewed by Philippe Normand.
Enabled all tests depending on that feature.
* platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
(WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer):
(WebCore::AudioSourceProviderGStreamer::setClient):
* platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::audioSourceProvider):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer):
* platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::webkitMediaStreamSrcSetupSrc):
(WebCore::webkitMediaStreamSrcSetupAppSrc):
(WebCore::webkitMediaStreamSrcAddTrack):
(WebCore::webkitMediaStreamSrcSetStream):
(WebCore::webkitMediaStreamSrcNew):
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.h:
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource):
(WebCore::WrappedMockRealtimeAudioSource::start):
(WebCore::WrappedMockRealtimeAudioSource::addHum):
(WebCore::WrappedMockRealtimeAudioSource::render):
(WebCore::WrappedMockRealtimeAudioSource::settingsDidChange):
(WebCore::MockGStreamerAudioCaptureSource::startProducingData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Handle the case where input buffers
are "big" and process all the data we can for each runs of the method.
2018-12-06 Alexey Proskuryakov <ap@apple.com>
Move USE_NEW_THEME out of WebCore's config.h
https://bugs.webkit.org/show_bug.cgi?id=192426
Reviewed by Tim Horton.
* config.h:
2018-12-06 Frederic Wang <fwang@igalia.com>
Allow control over child order when adding nodes to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=176914
Reviewed by Simon Fraser.
Based on an earlier patch by Simon Fraser.
Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent,
but with no control over sibling order. To allow for correct hit-testing overflow and
frame scrolling nodes, we have to build the scrolling tree in z-order.
This patch adds a 'childIndex' parameter to attachNode() which gives control over
sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value
for childIndex so the current behavior (appending new nodes at the end of child list) is
preserved.
No new tests, behavior unchanged and already covered by existing tests.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::attachToStateTree):
(WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::attachToStateTree):
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::insertChild):
(WebCore::ScrollingStateNode::indexOfChild const):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::nodeTypeAndParentMatch const):
(WebCore::ScrollingStateTree::attachNode):
* page/scrolling/ScrollingStateTree.h:
2018-12-06 Yongjun Zhang <yongjun_zhang@apple.com>
We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag.
https://bugs.webkit.org/show_bug.cgi?id=192377
<rdar://problem/46364206>
Reviewed by Tim Horton.
If the page specifies width=device-width or initial-scale=1 in the viewport meta tag, we should use the
native device width and ignore the minimum effective device width in ViewportConfiguration. The patch
also introduces scalableNativeWebpageParameters() which uses the device width as default and also allows the page
to shrink-to-fit. If a page doesn't have viewport meta tag, or if the width argument isn't device-width
and the initial scale isn't 1, we will use scalableNativeWebpageParameters() as the default configuration.
Tests: fast/viewport/ios/ignore-minimum-device-width-for-page-with-viewport-device-width.html
fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::updateDefaultConfiguration): pick the default configuration based on
the page's viewport arguments. Also, we will always fall back to scalableNativeWebpageParameters() if we
can ignore scaling constraints.
(WebCore::ViewportConfiguration::setViewportArguments): When page sends us new ViewportArguments, pick
up the correponsding default configuration before updating the configuration.
(WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): When m_canIgnoreScalingConstraints is
changed, try to pick up the correponsding default configuration.
(WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Add a new default set of viewport Parameters
this is very close to nativeWebpageParameters() excpet that it allows shrink to fit and its minimum scale
is 0.25. We will use this Parameters for pages that doesn't have viewport meta tag; or the width is
not device-width and initial scale is not 1.
(WebCore::ViewportConfiguration::updateConfiguration): If the page's viewport argument doesn't override
the default width, use the m_minimumLayoutSize.width().
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): A helper method to tell
if we should avoid using minimum effective device width.
(WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): If we are using a default
configuration that is neither nativeWebpageParameters() nor scalableNativeWebpageParameters(), don't override
it.
(WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add a helper method to return minimum
effective device width based on shouldIgnoreMinimumEffectiveDeviceWidth().
(WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor const): Use minimumEffectiveDeviceWidth().
2018-12-06 Adrian Perez de Castro <aperez@igalia.com>
Content Extensions: Misc fixes to debugging / perf testing code
https://bugs.webkit.org/show_bug.cgi?id=192474
Reviewed by Mark Lam.
This make it possible to build the content extensions support with the
debugging features enabled. In particular, building with
CONTENT_EXTENSIONS_PERFORMANCE_REPORTING enabled was broken.
No new tests needed.
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList): Remove usage of removed
variables machinesWihthoutConditionsCount,
totalBytecodeSizeForMachinesWithoutConditions,
machinesWithConditionsCount, and
totalBytecodeSizeForMachinesWithConditions.
* contentextensions/DFA.cpp:
(WebCore::ContentExtensions::DFA::debugPrintDot const):
Use "%" PRIu64 instead of "%llu" to format uint64_t values.
* contentextensions/NFA.cpp:
(WebCore::ContentExtensions::NFA::debugPrintDot const):
Use "%" PRIu64 instead of "%llu" to format uint64_t values.
2018-12-06 Alex Christensen <achristensen@webkit.org>
Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code
https://bugs.webkit.org/show_bug.cgi?id=192452
Reviewed by Anders Carlsson.
* loader/LoaderStrategy.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didRetrieveDerivedDataFromCache): Deleted.
* loader/ResourceLoader.h:
* loader/ResourceLoaderOptions.h:
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache): Deleted.
* loader/SubresourceLoader.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::isolatedCopy const):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::didRetrieveDerivedDataFromCache): Deleted.
2018-12-06 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] HeightAndMargin::margin is always the non-collapsed margin value.
https://bugs.webkit.org/show_bug.cgi?id=192345
Reviewed by Antti Koivisto.
Rename HeightAndMargin::margin to HeightAndMargin::nonCollapsedMargin.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
2018-12-06 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Add MarginCollapse::establishesBlockFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=192297
Reviewed by Antti Koivisto.
WebKit treats the document element renderer as a block formatting context root.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::establishesBlockFormattingContext):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
2018-12-06 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL
https://bugs.webkit.org/show_bug.cgi?id=191998
Reviewed by Philippe Normand.
Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL.
No new tests required. Only fixing the build with certain flags.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL).
2018-12-06 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds
https://bugs.webkit.org/show_bug.cgi?id=191997
Reviewed by Philippe Normand.
Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF.
No new tests required. Only fixing build.
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING)
2018-12-05 Don Olmstead <don.olmstead@sony.com>
[PlayStation] Enable WebCore
https://bugs.webkit.org/show_bug.cgi?id=192384
Reviewed by Brent Fulgham.
Implements WebCore for the PlayStation platform.
* PlatformPlayStation.cmake: Added.
* loader/cache/CachedResourceLoader.cpp:
* platform/generic/KeyedDecoderGeneric.cpp: Added.
(WebCore::KeyedDecoder::decoder):
(WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric):
(WebCore::KeyedDecoderGeneric::~KeyedDecoderGeneric):
(WebCore::KeyedDecoderGeneric::decodeBytes):
(WebCore::KeyedDecoderGeneric::decodeBool):
(WebCore::KeyedDecoderGeneric::decodeUInt32):
(WebCore::KeyedDecoderGeneric::decodeUInt64):
(WebCore::KeyedDecoderGeneric::decodeInt32):
(WebCore::KeyedDecoderGeneric::decodeInt64):
(WebCore::KeyedDecoderGeneric::decodeFloat):
(WebCore::KeyedDecoderGeneric::decodeDouble):
(WebCore::KeyedDecoderGeneric::decodeString):
(WebCore::KeyedDecoderGeneric::beginObject):
(WebCore::KeyedDecoderGeneric::endObject):
(WebCore::KeyedDecoderGeneric::beginArray):
(WebCore::KeyedDecoderGeneric::beginArrayElement):
(WebCore::KeyedDecoderGeneric::endArrayElement):
(WebCore::KeyedDecoderGeneric::endArray):
* platform/generic/KeyedDecoderGeneric.h: Added.
* platform/generic/KeyedEncoderGeneric.cpp: Added.
(WebCore::KeyedEncoder::encoder):
(WebCore::KeyedEncoderGeneric::KeyedEncoderGeneric):
(WebCore::KeyedEncoderGeneric::~KeyedEncoderGeneric):
(WebCore::KeyedEncoderGeneric::encodeBytes):
(WebCore::KeyedEncoderGeneric::encodeBool):
(WebCore::KeyedEncoderGeneric::encodeUInt32):
(WebCore::KeyedEncoderGeneric::encodeUInt64):
(WebCore::KeyedEncoderGeneric::encodeInt32):
(WebCore::KeyedEncoderGeneric::encodeInt64):
(WebCore::KeyedEncoderGeneric::encodeFloat):
(WebCore::KeyedEncoderGeneric::encodeDouble):
(WebCore::KeyedEncoderGeneric::encodeString):
(WebCore::KeyedEncoderGeneric::beginObject):
(WebCore::KeyedEncoderGeneric::endObject):
(WebCore::KeyedEncoderGeneric::beginArray):
(WebCore::KeyedEncoderGeneric::beginArrayElement):
(WebCore::KeyedEncoderGeneric::endArrayElement):
(WebCore::KeyedEncoderGeneric::endArray):
(WebCore::KeyedEncoderGeneric::finishEncoding):
* platform/generic/KeyedEncoderGeneric.h: Added.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultCookieJarPath):
* platform/network/playstation/CurlSSLHandlePlayStation.cpp: Added.
(WebCore::getCACertPathEnv):
(WebCore::CurlSSLHandle::platformInitialize):
* platform/network/playstation/NetworkStateNotifierPlayStation.cpp: Added.
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):
(WebCore::NetworkStateNotifier::startObserving):
* platform/playstation/EventLoopPlayStation.cpp: Added.
(WebCore::EventLoop::cycle):
* platform/playstation/MIMETypeRegistryPlayStation.cpp: Added.
(WebCore::MIMETypeRegistry::getMIMETypeForExtension):
(WebCore::MIMETypeRegistry::isApplicationPluginMIMEType):
(WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
* platform/playstation/PlatformScreenPlayStation.cpp: Added.
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
(WebCore::screenSupportsExtendedColor):
* platform/playstation/ScrollbarThemePlayStation.cpp: Added.
(WebCore::ScrollbarTheme::nativeTheme):
(WebCore::ScrollbarThemePlayStation::scrollbarThickness):
(WebCore::ScrollbarThemePlayStation::hasButtons):
(WebCore::ScrollbarThemePlayStation::hasThumb):
(WebCore::ScrollbarThemePlayStation::backButtonRect):
(WebCore::ScrollbarThemePlayStation::forwardButtonRect):
(WebCore::ScrollbarThemePlayStation::trackRect):
(WebCore::ScrollbarThemePlayStation::paintTrackBackground):
(WebCore::ScrollbarThemePlayStation::paintThumb):
* platform/playstation/ScrollbarThemePlayStation.h: Added.
* platform/playstation/UserAgentPlayStation.cpp: Added.
(WebCore::standardUserAgent):
(WebCore::standardUserAgentForURL):
* rendering/RenderThemePlayStation.cpp: Added.
(WebCore::RenderTheme::singleton):
(WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const):
* rendering/RenderThemePlayStation.h: Added.
2018-12-05 Ryosuke Niwa <rniwa@webkit.org>
Null pointer crash in DocumentOrderedMap::getElementById via FormAssociatedElement::findAssociatedForm
https://bugs.webkit.org/show_bug.cgi?id=192392
Reviewed by Dean Jackson.
The crash was caused by FormAssociatedElement::findAssociatedForm invoking DocumentOrderedMap::getElementById
and de-referencing nullptr Attribute* via IdTargetObserver before Element::attributeChanged had updated
ElementData::m_idForStyleResolution.
Fixed it by updating m_idForStyleResolution before invoking IdTargetObservers.
Test: fast/dom/remove-id-form-associated-elemet-id-observer-crash.html
* dom/Element.cpp:
(WebCore::Element::attributeChanged): Fixed the bug.
2018-12-05 Youenn Fablet <youenn@apple.com>
Enable the possibility to do video capture in UIProcess
https://bugs.webkit.org/show_bug.cgi?id=192394
Reviewed by Eric Carlson.
Create IOSurface-backed sample buffers so that we can easily send them through IPC.
Manually tested.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
2018-12-05 Youenn Fablet <youenn@apple.com>
Update ServiceWorkerContainer::getRegistration lambdas
https://bugs.webkit.org/show_bug.cgi?id=192376
Reviewed by Chris Dumez.
There is no need to pass 'this' in lambdas as the last lambda
takes a ScriptExecutionContext&.
No change of behavior.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
2018-12-05 Chris Dumez <cdumez@apple.com>
Crash under WebCore::cachedDocumentWrapper()
https://bugs.webkit.org/show_bug.cgi?id=192421
<rdar://problem/37114163>
Reviewed by Alex Christensen.
Fix potential null defererence of the value returned by toJSDOMWindow(). For example,
if the window is frameless, it would return null.
* bindings/js/JSDocumentCustom.cpp:
(WebCore::cachedDocumentWrapper):
2018-12-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Cleanup up Mac screen capture class
https://bugs.webkit.org/show_bug.cgi?id=192379
<rdar://problem/46465458>
Reviewed by Youenn Fablet.
No new tests, tested manually.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Screen devices first so
they are first in the list of devices.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the
native screen size to work around a bug.
(WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted.
2018-12-05 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r238844, r238846, and r238874.
https://bugs.webkit.org/show_bug.cgi?id=192414
The layout tests added with this change are flaky. (Requested
by ryanhaddad on #webkit).
Reverted changesets:
"Implement non-timeslice mode encoding for MediaRecorder"
https://bugs.webkit.org/show_bug.cgi?id=192069
https://trac.webkit.org/changeset/238844
"Fix the build"
https://trac.webkit.org/changeset/238846
"Fix MediaRecorder flaky tests"
https://bugs.webkit.org/show_bug.cgi?id=192371
https://trac.webkit.org/changeset/238874
2018-12-05 Frederic Wang <fwang@igalia.com>
Minor refactoring of the scrolling code
https://bugs.webkit.org/show_bug.cgi?id=192398
Reviewed by Simon Fraser.
Based on an earlier patch by Simon Fraser.
This patch performs some minor refactoring of the scrolling code:
- Rename ScrollingCoordinator::uniqueScrollLayerID() to uniqueScrollingNodeID() since it
is really a node id.
- Inline ScrollingStateTree::setRootStateNode() so we only need to forward declare
ScrollingStateFrameScrollingNode in headers.
- Pass argument to ScrollingStateTree::addNode() as a reference rather than a pointer.
- Initialize ScrollingStateTree::m_changedProperties and ScrollingStateTree::m_parent in
the header file.
- Remove obsolete comment about ScrollingCoordinatorMac.
No new tests, behavior unchanged.
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::uniqueScrollingNodeID):
(WebCore::ScrollingCoordinator::uniqueScrollLayerID): Deleted.
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::ScrollingStateNode):
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateTree.cpp:
(WebCore::ScrollingStateTree::attachNode):
(WebCore::ScrollingStateTree::setRootStateNode):
(WebCore::ScrollingStateTree::addNode):
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::setRootStateNode): Deleted.
* page/scrolling/ScrollingTree.cpp:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::attachScrollingNode):
2018-12-05 Wenson Hsieh <wenson_hsieh@apple.com>
Turn WritingDirection into an enum class
https://bugs.webkit.org/show_bug.cgi?id=192401
Work towards <rdar://problem/42075638>
Reviewed by Dan Bernstein.
Change WritingDirection from an enum to an enum class. No change in behavior.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
(WebCore::ApplyStyleCommand::applyInlineStyle):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::textDirection const):
(WebCore::EditingStyle::textDirectionForSelection):
* editing/Editor.cpp:
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::baseWritingDirectionForSelectionStart const):
* editing/EditorCommand.cpp:
(WebCore::stateTextWritingDirectionLeftToRight):
(WebCore::stateTextWritingDirectionNatural):
(WebCore::stateTextWritingDirectionRightToLeft):
* editing/WritingDirection.h:
Additionally wrap this enum in `namespace WebCore`, and update the copyright year.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
* testing/Internals.cpp:
(WebCore::Internals::setBaseWritingDirection):
2018-12-05 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Remove the AppendPipeline state machine
https://bugs.webkit.org/show_bug.cgi?id=192204
Reviewed by Xabier Rodriguez-Calvar.
This patch tries to reduce the complexity of the AppendPipeline by
removing the appendState state machine and cleaning all the
conditional code around it that is not necessary anymore.
For the most part the behavior is the same, but some edge cases have
been improved in the process:
Demuxing errors now result in the append being flagged as
ParsingFailed and the error being propagated to the application. This
fixes media/media-source/media-source-error-crash.html (or at least
gets it up to date with cross platform expectations).
AbortableTaskQueue now allows the task handler to perform an abort
safely. This is used in the GstBus error message sync handler, since
it needs to ask the MainThread to raise a parse error, which will in
turn abort. An API test has been added for this new functionality.
Also, code has been added to the API tests to ensure the correct
destruction of the response object, especially in this case.
The code handling invalid track codecs has been made clearer by also
explicitly raising a parse error, but it should not expose behavior
differences for the application. A test has been added for this
behavior: web-platform-tests/media-source/mediasource-invalid-codec.html
The reporting of EOS events have been made more rigorous. EOS is only
expected after a demuxing error, otherwise it's a g_critical.
AppendPipeline::abort() has been renamed to
AppendPipeline::resetParserState() to honor the fact that it's not
only called when the user calls abort() and match better the names
used in the spec.
Test: imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html
* platform/AbortableTaskQueue.h:
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::assertedElementSetState):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::handleErrorSyncMessage):
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleNeedContextSyncMessage):
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::handleEndOfAppend):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::didReceiveInitializationSegment):
(WebCore::AppendPipeline::resetParserState):
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromStreamingThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
(WebCore::AppendPipeline::dumpAppendState): Deleted.
(WebCore::AppendPipeline::demuxerNoMorePads): Deleted.
(WebCore::AppendPipeline::setAppendState): Deleted.
(WebCore::AppendPipeline::appsinkEOS): Deleted.
(WebCore::AppendPipeline::resetPipeline): Deleted.
(WebCore::AppendPipeline::abort): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
(WebCore::AppendPipeline::appendState): Deleted.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::abort):
(WebCore::MediaSourceClientGStreamerMSE::resetParserState):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
(WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):
* platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2018-12-05 Rob Buis <rbuis@igalia.com>
[Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html)
https://bugs.webkit.org/show_bug.cgi?id=114965
Reviewed by Frédéric Wang.
HEAD requests should not be changed to GET after 303 redirects, see [1].
This was fixed earlier for GTK [2].
Behavior matches Firefox and Chrome.
[1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4
[2] https://bugs.webkit.org/show_bug.cgi?id=110127
Tests: web-platform-tests/fetch/api/redirect/redirect-method.html
web-platform-tests/fetch/api/redirect/redirect-method-worker.html
http/tests/xmlhttprequest/head-redirection.html
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::willSendRequest):
2018-12-05 Rob Buis <rbuis@igalia.com>
Align with Fetch on data: URLs
https://bugs.webkit.org/show_bug.cgi?id=182325
Reviewed by Alex Christensen.
Do not accept data URLs that do not contain a comma
character, as specified in the relevant specs [1, 2].
Behavior matches Firefox and Chrome.
Test: web-platform-tests/fetch/api/basic/scheme-data.any.html
[1] https://tools.ietf.org/html/rfc2397
[2] https://fetch.spec.whatwg.org/#data-url-processor
* platform/network/DataURLDecoder.cpp:
(WebCore::DataURLDecoder::parseMediaType):
(WebCore::DataURLDecoder::DecodeTask::DecodeTask):
(WebCore::DataURLDecoder::DecodeTask::process):
(WebCore::DataURLDecoder::createDecodeTask):
(WebCore::DataURLDecoder::decode):
2018-12-05 Frederic Wang <fwang@igalia.com>
Unreviewed build fix.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Add missing header.
2018-12-05 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Crash on debug changing the style of a positioned element
https://bugs.webkit.org/show_bug.cgi?id=191473
Reviewed by Dean Jackson and Zalan Bujtas.
When an box becomes {out-of,in}-flow, it may be re-parented and it may become a grid
item. In that case, we must mark the RenderGrid as dirty, so that the grid items
placement logic is executed again.
Test: fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::childFlowStateChangesAndAffectsParentBlock): Consider the case of a box's new parent being a grid container.
2018-12-04 Frederic Wang <fwang@igalia.com>
Always pass scrollingGeometry to update*ScrollingNode functions
https://bugs.webkit.org/show_bug.cgi?id=192358
Reviewed by Simon Fraser.
Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used
while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly
null pointers. This commit makes things more consistent by making the parameter a reference
and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help
other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes /
subframes or for CSS overscroll-behavior) for which new data members have to be passed to the
scrolling nodes.
No new tests, no behavior changes.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::updateFrameScrollingNode):
(WebCore::ScrollingCoordinator::updateOverflowScrollingNode):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
2018-12-04 Ryosuke Niwa <rniwa@webkit.org>
Crash in HTMLCollection::updateNamedElementCache
https://bugs.webkit.org/show_bug.cgi?id=192347
Reviewed by Darin Adler.
The bug was caused by CollectionIndexCache's nodeAt caching the length of 1
when there are no matching elements in the subtree when the index is non-zero.
A related bug was fixed in r182125 but we were not considering the possibility
that the index given to this function might be non-zero even when there were
no matching elements.
Test: fast/dom/options-collection-zero-length-crash.html
* dom/CollectionIndexCache.h:
(WebCore::CollectionIndexCache<Collection, Iterator>::nodeAt):
2018-11-30 Jiewen Tan <jiewen_tan@apple.com>
Don't report resource timing to parent frame for history items
https://bugs.webkit.org/show_bug.cgi?id=192273
<rdar://problem/45163764>
Reviewed by Youenn Fablet.
We should not report history items to its parent frame as those are less
interested to its parent and might not be the first navigation in the iframes.
This change aligns the behavior when a cached document is not available for the
history item with the available case as we don't report resource timing for any
cached main document.
Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):
2018-12-04 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
https://bugs.webkit.org/show_bug.cgi?id=192320
<rdar://problem/46429833>
Reviewed by Zalan Bujtas.
Re-land r238840 with a more reliable test.
When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
for viewport-constrained objects so we update them.
This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
does enough dirtying that fixed layers nested inside scrollers get updated.
Test: compositing/fixed-with-main-thread-scrolling.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
2018-12-04 Youenn Fablet <youenn@apple.com>
Fix MediaRecorder flaky tests
https://bugs.webkit.org/show_bug.cgi?id=192371
Reviewed by Eric Carlson.
No change of behavior.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Reset to use real MediaRecorder by default.
2018-12-04 Justin Michaud <justin_michaud@apple.com>
CSS Painting API should allow image values in inputProperties
https://bugs.webkit.org/show_bug.cgi?id=192200
Reviewed by Dean Jackson.
Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing).
Finally, we let CanvasRenderingContext2DBase render these.
Tests: fast/css-custom-paint/arguments.html
fast/css-custom-paint/image.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CallTracerTypes.h:
* bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
* css/CSSCustomPropertyValue.h:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/typedom/StylePropertyMapReadOnly.h:
(WebCore::StylePropertyMapReadOnly::create):
(WebCore::StylePropertyMapReadOnly::get const):
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
* css/typedom/StylePropertyMapReadOnly.idl:
* css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h.
* css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl.
* css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h.
* css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl.
* css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h.
(WebCore::TypedOMCSSStyleValue::isImageValue):
* css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl.
* css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h.
* css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl.
* css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h.
* css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl.
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
* html/ImageBitmap.h:
* html/canvas/CanvasDrawImage.idl:
* html/canvas/CanvasFillStrokeStyles.idl:
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::checkOrigin):
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::size):
(WebCore::CanvasRenderingContext2DBase::drawImage):
(WebCore::CanvasRenderingContext2DBase::createPattern):
* html/canvas/CanvasRenderingContext2DBase.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildAction):
* page/WindowOrWorkerGlobalScope.idl:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):
2018-12-04 Chris Dumez <cdumez@apple.com>
Regression(r238817) PSON Page Cache API tests are failing
https://bugs.webkit.org/show_bug.cgi?id=192348
Reviewed by Alex Christensen.
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/MemoryRelease.h:
2018-12-04 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238838.
The layout test added with this change is failing on iOS.
Reverted changeset:
"Thick overlines and line-throughs grow in the wrong
direction"
https://bugs.webkit.org/show_bug.cgi?id=192264
https://trac.webkit.org/changeset/238838
2018-12-04 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238840.
The layout test added with this change is frequently failing.
Reverted changeset:
"REGRESSION (r238090): position:fixed sidebar on
https://www.w3.org/TR/SVG2/coords.html does not stay fixed"
https://bugs.webkit.org/show_bug.cgi?id=192320
https://trac.webkit.org/changeset/238840
2018-12-04 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Move URLSoup back to WebCore after r238771
https://bugs.webkit.org/show_bug.cgi?id=192306
Reviewed by Michael Catanzaro.
Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and
URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL
header.
* platform/Cookie.h:
* platform/SharedBuffer.h:
* platform/SourcesSoup.txt:
* platform/network/soup/CookieSoup.cpp:
* platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
(WebCore::NetworkStorageSession::deleteCookie const):
(WebCore::NetworkStorageSession::getCookies):
(WebCore::NetworkStorageSession::getRawCookies const):
(WebCore::cookiesForSession):
* platform/network/soup/ResourceErrorSoup.cpp:
(WebCore::failingURI):
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageMembers const):
(WebCore::ResourceRequest::updateFromSoupMessage):
(WebCore::ResourceRequest::createSoupURI const):
* platform/network/soup/ResourceResponseSoup.cpp:
(WebCore::ResourceResponse::updateFromSoupMessage):
* platform/network/soup/SocketStreamHandleImpl.h:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
(WebCore::SocketStreamHandleImpl::create):
* platform/network/soup/SoupNetworkSession.cpp:
* platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp.
(WebCore::soupURIToURL):
(WebCore::urlToSoupURI):
* platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp.
2018-12-04 Devin Rousso <drousso@apple.com>
Web Inspector: Audit: tests should support async operations
https://bugs.webkit.org/show_bug.cgi?id=192171
<rdar://problem/46423562>
Reviewed by Joseph Pecoraro.
* page/Settings.yaml:
* dom/ScriptExecutionContext.cpp:
(ScriptExecutionContext::reportUnhandledPromiseRejection):
Add setting for muting the "Unhandled Promise Rejection" console message.
2018-12-03 Tim Horton <timothy_horton@apple.com>
Fix the build
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
Unified sources, of course.
2018-12-03 Youenn Fablet <youenn@apple.com>
A sender created through addTransceiver and populated using addTrack should have its source set
https://bugs.webkit.org/show_bug.cgi?id=192136
Reviewed by Eric Carlson.
In case libwebrtc backend is already created, we need to make sure to
set the track source to the libwebrtc sender backend that is actually
tied to the sender.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::removeTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2018-12-03 YUHAN WU <yuhan_wu@apple.com>
Implement non-timeslice mode encoding for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=192069
Reviewed by Youenn Fablet.
Implement the encoding for non-timeslice mode of MediaRecorder.
It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods.
Add a API in internals to allow testings to turn on the mock source.
Tests: http/wpt/mediarecorder/MediaRecorder-AV-audio-only-dataavailable.html
http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html
http/wpt/mediarecorder/MediaRecorder-AV-video-only-dataavailable.html
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::setCustomPrivateRecorderCreator):
(WebCore::MediaRecorder::getPrivateImpl):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::stopRecordingInternal):
(WebCore::MediaRecorder::createRecordingDataBlob):
(WebCore::MediaRecorder::scheduleDeferredTask):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediarecorder/MediaRecorderPrivate.h:
(WebCore::MediaRecorderPrivate::stopRecording):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added.
(WebCore::MediaRecorderPrivateAVFImpl::create):
(WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVImpl):
(WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateAVFImpl::stopRecording):
(WebCore::MediaRecorderPrivateAVFImpl::fetchData):
(WebCore::MediaRecorderPrivateAVFImpl::mimeType):
* platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added.
* platform/mediarecorder/MediaRecorderPrivateMock.cpp:
(WebCore::MediaRecorderPrivateMock::fetchData):
(WebCore::MediaRecorderPrivateMock::mimeType):
* platform/mediarecorder/MediaRecorderPrivateMock.h:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: Added.
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added.
(WebCore::MediaRecorderPrivateWriter::setupWriter):
(WebCore::MediaRecorderPrivateWriter::setVideoInput):
(WebCore::MediaRecorderPrivateWriter::setAudioInput):
(WebCore::copySampleBufferWithCurrentTimeStamp):
(WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer):
(WebCore::MediaRecorderPrivateWriter::stopRecording):
(WebCore::MediaRecorderPrivateWriter::fetchData):
* testing/Internals.cpp:
(WebCore::createRecorderMockSource):
(WebCore::Internals::setCustomPrivateRecorderCreator):
* testing/Internals.h:
* testing/Internals.idl:
2018-12-03 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed
https://bugs.webkit.org/show_bug.cgi?id=192320
<rdar://problem/46429833>
Reviewed by Zalan Bujtas.
When we fall into slow scrolling mode (for example, because of background-attachment: fixed),
RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers
for viewport-constrained objects so we update them.
This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already
does enough dirtying that fixed layers nested inside scrollers get updated.
Test: compositing/fixed-with-main-thread-scrolling.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
2018-12-03 Justin Michaud <justin_michaud@apple.com>
CSS Painting API should scale display list when drawing
https://bugs.webkit.org/show_bug.cgi?id=192217
Reviewed by Simon Fraser.
When we replay the display list, fix the scaling. The separate buffer is needed to make sure that globalCompositeOperation functions correctly.
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::replayDisplayList const):
* html/CustomPaintCanvas.h:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):
2018-12-03 Myles C. Maxfield <mmaxfield@apple.com>
Thick overlines and line-throughs grow in the wrong direction
https://bugs.webkit.org/show_bug.cgi?id=192264
Reviewed by Dean Jackson.
Overlines should grow upward, and line-throughs should stay centered.
Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::visualOverflowForDecorations):
2018-12-03 Simon Fraser <simon.fraser@apple.com>
Viewport-constrained renderers are always RenderLayerModelObjects
https://bugs.webkit.org/show_bug.cgi?id=192342
Reviewed by Myles C. Maxfield.
addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects,
since all viewport-constrained renderers have layers.
* page/FrameView.cpp:
(WebCore::FrameView::addViewportConstrainedObject):
(WebCore::FrameView::removeViewportConstrainedObject):
* page/FrameView.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap,
which has a default value, and the comment was obsolete.
2018-12-03 Don Olmstead <don.olmstead@sony.com>
Fix some unused parameter warnings
https://bugs.webkit.org/show_bug.cgi?id=192336
Reviewed by Fujii Hironori.
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::isLegacySerializedIDBKeyData):
* platform/FileSystem.cpp:
(WebCore::FileSystem::openAndLockFile):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::bindVertexArray):
* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2018-12-03 Keith Rollin <krollin@apple.com>
Add .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192082
<rdar://problem/46312533>
Reviewed by Brent Fulgham.
Add .xcfilelist files for Generate Derived Sources and Generate
Unified Sources build phases in Xcode. These are just being staged for
now; they'll be added to the Xcode projects later.
No new tests -- no changed functionality.
* DerivedSources-input.xcfilelist: Added.
* DerivedSources-output.xcfilelist: Added.
* UnifiedSources-input.xcfilelist: Added.
* UnifiedSources-output.xcfilelist: Added.
2018-12-03 Alex Christensen <achristensen@webkit.org>
Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler
https://bugs.webkit.org/show_bug.cgi?id=192272
Reviewed by Brady Eidson.
This is needed for rdar://problem/45910057
Covered by an API test.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::prepareForLoadStart):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadProvisionalItemFromCachedPage):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
2018-12-03 Zalan Bujtas <zalan@apple.com>
[iOS] Unreviewed build fix.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
2018-12-03 Jer Noble <jer.noble@apple.com>
Get rid of old, dead Mac video fullscreen code.
https://bugs.webkit.org/show_bug.cgi?id=192315
Reviewed by Eric Carlson.
* PlatformMac.cmake:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
2018-12-03 Ryosuke Niwa <rniwa@webkit.org>
title attribute on style & link elements should be ignored inside a shadow tree
https://bugs.webkit.org/show_bug.cgi?id=191297
Reviewed by Antti Koivisto.
Fixed the by not setting the stylesheet's title even when the title content attribute is present
or set on SVG/HTML style and link elements inside a shadow tree.
Test: fast/shadow-dom/stylesheet-title-in-shadow-tree.html
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::initializeStyleSheet):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectActiveStyleSheets):
* svg/SVGStyleElement.cpp:
(WebCore::SVGStyleElement::parseAttribute):
2018-12-03 Zalan Bujtas <zalan@apple.com>
[iOS] Add logging channel for hover related content observation
https://bugs.webkit.org/show_bug.cgi?id=192312
Reviewed by Simon Fraser.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* platform/Logging.h:
2018-12-03 Michael Catanzaro <mcatanzaro@igalia.com>
[SOUP] Use SoupSession instead of SoupSessionAsync
https://bugs.webkit.org/show_bug.cgi?id=107451
Reviewed by Carlos Garcia Campos.
With glib-networking 2.57.1, WebKit is no longer able to load TLS error pages. The problem
is a network process deadlock caused by a change in how glib-networking performs certificate
verification. Previously it verified certificates *after* the TLS handshake had completed,
which was weirdly late, but previously not problematic. But now that TLS 1.3 exists,
application data can be sent before certificate verification occurs, which is no good. So I
moved verification to occur during the handshake. I needed to do this regardless because I
need to add a new callback in GnuTLS for another feature. This introduced a deadlock in
WebKit:
- glib-networking detects an unacceptable certificate, emits accept-certificate signal
- NetworkDataTaskSoup::tlsConnectionAcceptCertificate calls
NetworkDataTaskSoup::invalidateAndCancel calls NetworkDataTaskSoup::clearRequest
- NetworkDataTaskSoup::clearRequest calls soup_session_cancel_message
The problem is that, in the deprecated SoupSessionAsync used by WebKit, cancellation is
always *synchronous* despite the name of the class. So soup_session_cancel_message winds up
doing its thing to close everything out, and that eventually ends up in a synchronous call
to g_tls_connection_gnutls_close. The close operation can't proceed until the TLS handshake
is finished, and the handshake is blocked waiting for WebKit to return from its
accept-certificate handler. So the close operation winds up polling forever waiting for the
handshake to finish. Deadlock.
The only changes required in WebKit to use the modern SoupSession are adjustments for the
new default property values. Most of the properties we used to set explicitly are now
defaults and should be removed. Additionally, SoupSession has default timeouts, which we
want to override to allow NetworkDataTaskSoup to implement its own timeouts.
No new tests because this is covered by TestSSL (which would be failing if run with the
newer glib-networking).
* platform/network/soup/SoupNetworkSession.cpp:
(WebCore::SoupNetworkSession::SoupNetworkSession):
2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Use WallTime for file time
https://bugs.webkit.org/show_bug.cgi?id=192287
Reviewed by Darin Adler.
This patch changes a type of file time from double to WallTime to use strongly typed file time.
No behavior change.
* Modules/webdatabase/Database.cpp:
(WebCore::Database::details const):
* Modules/webdatabase/DatabaseDetails.h:
(WebCore::DatabaseDetails::DatabaseDetails):
(WebCore::DatabaseDetails::creationTime const):
(WebCore::DatabaseDetails::modificationTime const):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase):
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::detailsForNameAndOrigin):
* fileapi/AsyncFileStream.cpp:
(WebCore::AsyncFileStream::getSize):
* fileapi/AsyncFileStream.h:
* fileapi/File.cpp:
(WebCore::File::lastModified const):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
(WebCore::Page::userStyleSheet const):
* page/Page.h:
* platform/FileMetadata.h:
* platform/FileStream.cpp:
(WebCore::FileStream::getSize):
* platform/FileStream.h:
* platform/FileSystem.cpp:
(WebCore::FileSystem::getFileModificationTime): Deleted.
* platform/FileSystem.h:
(WebCore::FileSystem::invalidFileTime): Deleted.
(WebCore::FileSystem::isValidFileTime): Deleted.
* platform/glib/FileSystemGlib.cpp:
(WebCore::FileSystem::getFileCreationTime):
(WebCore::FileSystem::getFileModificationTime):
(WebCore::FileSystem::fileMetadataUsingFunction):
* platform/network/BlobDataFileReference.cpp:
(WebCore::BlobDataFileReference::BlobDataFileReference):
(WebCore::BlobDataFileReference::expectedModificationTime):
* platform/network/BlobDataFileReference.h:
* platform/network/FormData.cpp:
(WebCore::FormData::appendFile):
(WebCore::FormData::appendFileRange):
* platform/network/FormData.h:
(WebCore::FormDataElement::FormDataElement):
(WebCore::FormDataElement::EncodedFileData::decode):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::advanceCurrentStream):
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::appendEncodedBlobItemToSoupMessageBody):
* platform/posix/FileSystemPOSIX.cpp:
(WebCore::FileSystem::getFileCreationTime):
(WebCore::FileSystem::getFileModificationTime):
* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::databaseCreationTime):
(WebCore::SQLiteFileSystem::databaseModificationTime):
* platform/sql/SQLiteFileSystem.h:
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::getFileModificationTime):
(WebCore::FileSystem::getFileCreationTime):
(WebCore::FileSystem::findDataToFileMetadata):
2018-12-03 Dean Jackson <dino@apple.com>
Fix iOS Simulator Release test crashes.
* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary): Check for null before using the
new MIME type.
2018-12-03 Eric Carlson <eric.carlson@apple.com>
[MediaStream] 'devicechange' event when more capture device information are revealed.
https://bugs.webkit.org/show_bug.cgi?id=192268
Reviewed by Youenn Fablet.
Test: fast/mediastream/enumerate-devices-change-event.html
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): Remove code to modify device based on access, that is
now done in the UI process.
(WebCore::MediaDevicesRequest::filterDeviceList): Deleted.
* Modules/mediastream/MediaDevicesRequest.h:
* platform/mediastream/RealtimeMediaSourceCenter.h:
2018-12-03 Wenson Hsieh <wenson_hsieh@apple.com>
[iOSMac] Unable to upload non-image files using drag and drop in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=192283
<rdar://problem/46399461>
Reviewed by Ryosuke Niwa.
Currently on iOS, file URLs aren't generally written to the pasteboard during drag and drop unless the
application providing the data explicitly registers "public.file-url" to item providers. As such, our current
logic on iOS for handling drops does not attempt to prevent "public.file-url" from being advertised as the
"text/uri-list" MIME type in DataTransfer, though we do currently succeed in suppressing access to the file URL.
However, on iOSMac, the scenario in which file URLs are registered to item providers becomes pertinent when
uploading files from other macOS apps (e.g. Finder) into a WKWebView running in iOSMac. Furthermore, the
`preferredPresentationStyle` flag on `NSItemProvider` is unavailable in iOSMac; currently, this flag is our
primary cue on iOS that an item should be treated as an attachment rather than inline data. In order to support
file uploads in iOSMac, we make several adjustments to drop handling logic in iOS to handle the case where the
"public.file-url" type is registered. See below for more details.
Tests: DragAndDropTests.DataTransferExposePlainTextWithFileURLAsFile
DragAndDropTests.DataTransferGetDataWhenDroppingImageWithFileURL
* platform/PasteboardItemInfo.h:
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
Add a new flag that is set if and only if the item provider contains the "public.file-url" type, and also
contains some non-URL data type that conforms to one of the file types supported for file uploads (i.e.
"public.content", zip archives, and folders).
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
Consider the pasteboard to contain files in the case where one or more of the items contains a file URL, along
with some other pasteboard data that can be represented as a file upload.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
If the pasteboard contains "public.file-url", don't consider "text/uri-list" to be one of the data types that's
safe to expose to the page. Our current behavior in this case is that we will advertise "text/uri-list" as a
pasteboard type in the DataTransfer, but if the page attempts to request this information, we simply return the
empty string. Instead, we shouldn't expose "text/uri-list" as a type in the first place.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
Add a few more `__bridge`-ing casts where appropriate.
(typeConformsToTypes):
Move this further up the file so that it can be used in `NSItemProvider (WebCoreExtras)`.
(-[NSItemProvider web_containsFileURLAndFileUploadContent]):
Add a helper method on NSItemProvider to determine whether an item provider has a file URL, as well as a content
type suitable for file uploads.
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
This currently always returns `NO` in iOSMac; instead, return `YES` on both iOS and iOSMac in the case where the
item provider contains a file URL and content which may be uploaded.
(-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
(-[WebItemProviderPasteboard typeIdentifiersToLoad:]):
Refactor this to take an `NSItemProvider` instead of a list of type identifiers, and bail out of loading data
for "public.url" if the item provider contains a file URL.
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
(-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Deleted.
2018-12-02 Zalan Bujtas <zalan@apple.com>
Add a runtime feature flag for LayoutFormattingContext.
https://bugs.webkit.org/show_bug.cgi?id=192280
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextEnabled):
(WebCore::RuntimeEnabledFeatures::layoutFormattingContextEnabled const):
2018-12-01 Brent Fulgham <bfulgham@apple.com>
Lifetime of HTMLMediaElement is not properly handled in asynchronous actions
https://bugs.webkit.org/show_bug.cgi?id=192087
<rdar://problem/45975230>
Reviewed by Dean Jackson.
The HTMLMediaElement performs operations that allow arbitrary JavaScript to run. We need to make
sure the active media element is protected until those calls complete.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::didFinishInsertingNode):
(WebCore::HTMLMediaElement::exitFullscreen):
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
(WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
(WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
(WebCore::HTMLMediaElement::scheduleUpdatePlayState):
(WebCore::HTMLMediaElement::scheduleUpdateMediaState):
2018-12-01 Chris Dumez <cdumez@apple.com>
[PSON] process-swapping may occur even though opener has handle to openee
https://bugs.webkit.org/show_bug.cgi?id=192277
Reviewed by Antti Koivisto.
Process-swapping may occur even though opener has handle to openee, which is not Web-compatible. The reason
is that we rely on the window not having an opener to process-swap. However, the opener can be disowned,
which does not mean that the opener doesn't still have a handle to its openee.
To address the issue:
- Renamed openedViaWindowOpenWithOpener flag to openedByDOMWithOpener
- Make sure this flag gets set if an opener have ever been set for the browsing context
- Do not process-swap if this flag is set
- Drop opener from NavigationAction since it does not provide meaningful information to decide whether
to process-swap or not.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::setOpener):
* loader/NavigationAction.h:
(WebCore::NavigationAction::openedByDOMWithOpener const):
(WebCore::NavigationAction::setOpenedByDOMWithOpener):
(WebCore::NavigationAction::setOpener): Deleted.
(WebCore::NavigationAction::opener const): Deleted.
(WebCore::NavigationAction::openedViaWindowOpenWithOpener const): Deleted.
(WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener): Deleted.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/Page.h:
(WebCore::Page::openedByDOMWithOpener const):
(WebCore::Page::setOpenedByDOMWithOpener):
(WebCore::Page::openedViaWindowOpenWithOpener const): Deleted.
(WebCore::Page::setOpenedViaWindowOpenWithOpener): Deleted.
2018-12-01 Christopher Reid <chris.reid@sony.com>
Add generic implementations to FileSystemPOSIX.cpp
https://bugs.webkit.org/show_bug.cgi?id=192263
Reviewed by Yusuke Suzuki.
No new tests, no change in behavior.
Add generic FileSystemPOSIX implementations for:
- stringFromFileSystemRepresentation
- fileSystemRepresentation
- moveFile
- getVolumeFreeSpace
Also removing an unneeded PLATFORM(GTK) check since GTK is only using FileSystemGlib
* platform/posix/FileSystemPOSIX.cpp:
2018-12-01 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Call instrinsicWidthConstraints on the correct formatting state.
https://bugs.webkit.org/show_bug.cgi?id=192274
Reviewed by Antti Koivisto.
When we call intrinsic width on a formatting context root, we need to use the formatting state
that this root constructs and not the one it lives in.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): it's the caller's responsiblitiy to store the intrinsic values.
2018-11-30 Alex Christensen <achristensen@webkit.org>
Fix Windows build.
* platform/network/curl/CookieJarCurl.cpp:
* platform/network/curl/PublicSuffixCurl.cpp:
2018-11-30 Alex Christensen <achristensen@webkit.org>
Fix Windows build.
* platform/network/curl/CookieJarCurl.h:
2018-11-30 Alex Christensen <achristensen@webkit.org>
Move URL from WebCore to WTF
https://bugs.webkit.org/show_bug.cgi?id=190234
Reviewed by Keith Miller.
A URL is a low-level concept that does not depend on other classes in WebCore.
We are starting to use URLs in JavaScriptCore for modules.
I need URL and URLParser in a place with fewer dependencies for rdar://problem/44119696
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePayValidateMerchantEvent.h:
* Modules/applepay/PaymentCoordinator.cpp:
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* Modules/applepay/PaymentSession.h:
* Modules/applicationmanifest/ApplicationManifest.h:
* Modules/beacon/NavigatorBeacon.cpp:
* Modules/cache/DOMCache.cpp:
* Modules/fetch/FetchLoader.h:
* Modules/mediasession/MediaSessionMetadata.h:
* Modules/mediasource/MediaSourceRegistry.cpp:
* Modules/mediasource/MediaSourceRegistry.h:
* Modules/mediastream/MediaStream.cpp:
* Modules/mediastream/MediaStreamRegistry.cpp:
* Modules/mediastream/MediaStreamRegistry.h:
* Modules/navigatorcontentutils/NavigatorContentUtilsClient.h:
* Modules/notifications/Notification.h:
* Modules/paymentrequest/MerchantValidationEvent.h:
* Modules/paymentrequest/PaymentRequest.h:
* Modules/plugins/PluginReplacement.h:
* Modules/webaudio/AudioContext.h:
* Modules/websockets/ThreadableWebSocketChannel.h:
* Modules/websockets/WebSocket.h:
* Modules/websockets/WebSocketHandshake.cpp:
* Modules/websockets/WebSocketHandshake.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* PlatformMac.cmake:
* PlatformWin.cmake:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/CachedModuleScriptLoader.h:
* bindings/js/CachedScriptFetcher.h:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/ScriptController.h:
* bindings/js/ScriptModuleLoader.h:
* bindings/js/ScriptSourceCode.h:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
* bindings/scripts/test/JS/JSMapLike.cpp:
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestNode.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
* bindings/scripts/test/JS/JSTestSerialization.cpp:
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/JS/JSTestStringifier.cpp:
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad):
(WebCore::ContentExtensions::applyBlockedStatusToRequest):
* contentextensions/ContentExtensionsBackend.h:
* css/CSSValue.h:
* css/StyleProperties.h:
* css/StyleResolver.h:
* css/StyleSheet.h:
* css/StyleSheetContents.h:
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
(WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue):
* css/parser/CSSParserIdioms.h:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::setDataFromItemList):
* dom/Document.cpp:
(WebCore::Document::setURL):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::completeURL const):
(WebCore::Document::ensureTemplateDocument):
* dom/Document.h:
(WebCore::Document::urlForBindings const):
* dom/Element.cpp:
(WebCore::Element::isJavaScriptURLAttribute const):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::parserContextForElement):
* dom/Node.cpp:
(WebCore::Node::baseURI const):
* dom/Node.h:
* dom/ScriptElement.h:
* dom/ScriptExecutionContext.h:
* dom/SecurityContext.h:
* editing/Editor.cpp:
(WebCore::Editor::pasteboardWriterURL):
* editing/Editor.h:
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendQuotedURLAttributeValue):
* editing/cocoa/DataDetection.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::userVisibleString):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments):
(WebCore::WebContentReader::readWebArchive):
* editing/mac/EditorMac.mm:
(WebCore::Editor::plainTextFromPasteboard):
(WebCore::Editor::writeImageToPasteboard):
* editing/markup.cpp:
(WebCore::removeSubresourceURLAttributes):
(WebCore::createFragmentFromMarkup):
* editing/markup.h:
* fileapi/AsyncFileStream.cpp:
* fileapi/AsyncFileStream.h:
* fileapi/Blob.h:
* fileapi/BlobURL.cpp:
* fileapi/BlobURL.h:
* fileapi/File.h:
* fileapi/FileReaderLoader.h:
* fileapi/ThreadableBlobRegistry.h:
* history/CachedFrame.h:
* history/HistoryItem.h:
* html/DOMURL.cpp:
(WebCore::DOMURL::create):
* html/DOMURL.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::archiveResourceURL):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::isURLAllowed const):
(WebCore::HTMLFrameElementBase::openURL):
(WebCore::HTMLFrameElementBase::setLocation):
* html/HTMLInputElement.h:
* html/HTMLLinkElement.h:
* html/HTMLMediaElement.cpp:
(WTF::LogArgument<URL>::toString):
(WTF::LogArgument<WebCore::URL>::toString): Deleted.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
* html/ImageBitmap.h:
* html/MediaFragmentURIParser.h:
* html/PublicURLManager.cpp:
* html/PublicURLManager.h:
* html/URLInputType.cpp:
* html/URLRegistry.h:
* html/URLSearchParams.cpp:
(WebCore::URLSearchParams::URLSearchParams):
(WebCore::URLSearchParams::toString const):
(WebCore::URLSearchParams::updateURL):
(WebCore::URLSearchParams::updateFromAssociatedURL):
* html/URLUtils.h:
(WebCore::URLUtils<T>::setHost):
(WebCore::URLUtils<T>::setPort):
* html/canvas/CanvasRenderingContext.cpp:
* html/canvas/CanvasRenderingContext.h:
* html/parser/HTMLParserIdioms.cpp:
* html/parser/XSSAuditor.cpp:
(WebCore::semicolonSeparatedValueContainsJavaScriptURL):
(WebCore::XSSAuditor::filterScriptToken):
(WebCore::XSSAuditor::filterObjectToken):
(WebCore::XSSAuditor::filterParamToken):
(WebCore::XSSAuditor::filterEmbedToken):
(WebCore::XSSAuditor::filterFormToken):
(WebCore::XSSAuditor::filterInputToken):
(WebCore::XSSAuditor::filterButtonToken):
(WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
(WebCore::XSSAuditor::isLikelySafeResource):
* html/parser/XSSAuditor.h:
* html/parser/XSSAuditorDelegate.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::openInNewTab):
* inspector/InspectorInstrumentation.h:
* inspector/agents/InspectorNetworkAgent.cpp:
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorPageAgent.h:
* inspector/agents/InspectorWorkerAgent.h:
* loader/ApplicationManifestLoader.h:
* loader/CookieJar.h:
* loader/CrossOriginAccessControl.h:
* loader/CrossOriginPreflightResultCache.h:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::maybeLoadEmpty):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::serverRedirectSourceForHistory const):
* loader/DocumentWriter.h:
* loader/FormSubmission.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::createWindow):
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentItemShouldBeReplaced const):
(WebCore::HistoryController::initializeItem):
* loader/LinkLoader.h:
* loader/LoadTiming.h:
* loader/LoaderStrategy.h:
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::checkFormForMixedContent const):
* loader/MixedContentChecker.h:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation const):
* loader/NavigationScheduler.h:
* loader/PingLoader.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/ResourceLoadInfo.h:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.h:
* loader/ResourceLoader.h:
* loader/ResourceTiming.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestFrame):
* loader/SubframeLoader.h:
* loader/SubstituteData.h:
* loader/appcache/ApplicationCache.h:
* loader/appcache/ApplicationCacheGroup.h:
* loader/appcache/ApplicationCacheHost.h:
* loader/appcache/ApplicationCacheStorage.cpp:
* loader/appcache/ApplicationCacheStorage.h:
* loader/appcache/ManifestParser.cpp:
* loader/appcache/ManifestParser.h:
* loader/archive/ArchiveResourceCollection.h:
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection):
* loader/cache/CachedResource.cpp:
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedStyleSheetClient.h:
* loader/cache/MemoryCache.h:
* loader/icon/IconLoader.h:
* loader/mac/LoaderNSURLExtras.mm:
* page/CaptionUserPreferencesMediaAF.cpp:
* page/ChromeClient.h:
* page/ClientOrigin.h:
* page/ContextMenuClient.h:
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::isInsecureScriptAccess):
* page/DragController.cpp:
(WebCore::DragController::startDrag):
* page/DragController.h:
* page/EventSource.h:
* page/Frame.h:
* page/FrameView.h:
* page/History.h:
* page/Location.cpp:
(WebCore::Location::url const):
(WebCore::Location::reload):
* page/Location.h:
* page/Page.h:
* page/PageSerializer.h:
* page/Performance.h:
* page/PerformanceResourceTiming.cpp:
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::create):
* page/SecurityOrigin.h:
* page/SecurityOriginData.h:
* page/SecurityOriginHash.h:
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
* page/SecurityPolicy.h:
* page/SettingsBase.h:
* page/ShareData.h:
* page/SocketProvider.h:
* page/UserContentProvider.h:
* page/UserContentURLPattern.cpp:
* page/UserContentURLPattern.h:
* page/UserScript.h:
* page/UserStyleSheet.h:
* page/VisitedLinkStore.h:
* page/csp/ContentSecurityPolicy.h:
* page/csp/ContentSecurityPolicyClient.h:
* page/csp/ContentSecurityPolicyDirectiveList.h:
* page/csp/ContentSecurityPolicySource.cpp:
(WebCore::ContentSecurityPolicySource::portMatches const):
* page/csp/ContentSecurityPolicySource.h:
* page/csp/ContentSecurityPolicySourceList.cpp:
* page/csp/ContentSecurityPolicySourceList.h:
* page/csp/ContentSecurityPolicySourceListDirective.cpp:
* platform/ContentFilterUnblockHandler.h:
* platform/ContextMenuItem.h:
* platform/Cookie.h:
* platform/CookiesStrategy.h:
* platform/DragData.h:
* platform/DragImage.h:
* platform/FileStream.h:
* platform/LinkIcon.h:
* platform/Pasteboard.cpp:
(WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles):
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PasteboardWriterData.cpp:
(WebCore::PasteboardWriterData::setURLData):
(WebCore::PasteboardWriterData::setURL): Deleted.
* platform/PasteboardWriterData.h:
* platform/PlatformPasteboard.h:
* platform/PromisedAttachmentInfo.h:
* platform/SSLKeyGenerator.h:
* platform/SchemeRegistry.cpp:
(WebCore::SchemeRegistry::isBuiltinScheme):
* platform/SharedBuffer.h:
* platform/SharedStringHash.cpp:
* platform/SharedStringHash.h:
* platform/SourcesSoup.txt:
* platform/UserAgent.h:
* platform/UserAgentQuirks.cpp:
* platform/UserAgentQuirks.h:
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::willSendRequest):
* platform/glib/SSLKeyGeneratorGLib.cpp: Copied from Source/WebCore/page/ShareData.h.
(WebCore::getSupportedKeySizes):
(WebCore::signedPublicKeyAndChallengeString):
* platform/glib/UserAgentGLib.cpp:
* platform/graphics/GraphicsContext.h:
* platform/graphics/Image.cpp:
* platform/graphics/Image.h:
* platform/graphics/ImageObserver.h:
* platform/graphics/ImageSource.cpp:
* platform/graphics/ImageSource.h:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(webKitMediaSrcSetUri):
* platform/graphics/iso/ISOVTTCue.cpp:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
* platform/gtk/DragImageGtk.cpp:
* platform/gtk/PasteboardGtk.cpp:
* platform/gtk/PlatformPasteboardGtk.cpp:
* platform/gtk/SelectionData.h:
* platform/ios/PasteboardIOS.mm:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
* platform/ios/QuickLook.h:
* platform/mac/DragDataMac.mm:
(WebCore::DragData::asPlainText const):
* platform/mac/DragImageMac.mm:
* platform/mac/FileSystemMac.mm:
(WebCore::FileSystem::setMetadataURL):
* platform/mac/PasteboardMac.mm:
* platform/mac/PasteboardWriter.mm:
(WebCore::createPasteboardWriter):
* platform/mac/PlatformPasteboardMac.mm:
* platform/mac/PublicSuffixMac.mm:
(WebCore::decodeHostName):
* platform/mac/SSLKeyGeneratorMac.mm:
* platform/mac/WebCoreNSURLExtras.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::isArmenianLookalikeCharacter): Deleted.
(WebCore::isArmenianScriptCharacter): Deleted.
(WebCore::isASCIIDigitOrValidHostCharacter): Deleted.
(WebCore::isLookalikeCharacter): Deleted.
(WebCore::whiteListIDNScript): Deleted.
(WebCore::readIDNScriptWhiteListFile): Deleted.
(WebCore::allCharactersInIDNScriptWhiteList): Deleted.
(WebCore::isSecondLevelDomainNameAllowedByTLDRules): Deleted.
(WebCore::isRussianDomainNameCharacter): Deleted.
(WebCore::allCharactersAllowedByTLDRules): Deleted.
(WebCore::mapHostNameWithRange): Deleted.
(WebCore::hostNameNeedsDecodingWithRange): Deleted.
(WebCore::hostNameNeedsEncodingWithRange): Deleted.
(WebCore::decodeHostNameWithRange): Deleted.
(WebCore::encodeHostNameWithRange): Deleted.
(WebCore::decodeHostName): Deleted.
(WebCore::encodeHostName): Deleted.
(WebCore::collectRangesThatNeedMapping): Deleted.
(WebCore::collectRangesThatNeedEncoding): Deleted.
(WebCore::collectRangesThatNeedDecoding): Deleted.
(WebCore::applyHostNameFunctionToMailToURLString): Deleted.
(WebCore::applyHostNameFunctionToURLString): Deleted.
(WebCore::mapHostNames): Deleted.
(WebCore::stringByTrimmingWhitespace): Deleted.
(WebCore::URLByTruncatingOneCharacterBeforeComponent): Deleted.
(WebCore::URLByRemovingResourceSpecifier): Deleted.
(WebCore::URLWithData): Deleted.
(WebCore::dataWithUserTypedString): Deleted.
(WebCore::URLWithUserTypedString): Deleted.
(WebCore::URLWithUserTypedStringDeprecated): Deleted.
(WebCore::hasQuestionMarkOnlyQueryString): Deleted.
(WebCore::dataForURLComponentType): Deleted.
(WebCore::URLByRemovingComponentAndSubsequentCharacter): Deleted.
(WebCore::URLByRemovingUserInfo): Deleted.
(WebCore::originalURLData): Deleted.
(WebCore::createStringWithEscapedUnsafeCharacters): Deleted.
(WebCore::userVisibleString): Deleted.
(WebCore::isUserVisibleURL): Deleted.
(WebCore::rangeOfURLScheme): Deleted.
(WebCore::looksLikeAbsoluteURL): Deleted.
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/network/BlobPart.h:
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.h:
* platform/network/BlobResourceHandle.cpp:
* platform/network/CookieRequestHeaderFieldProxy.h:
* platform/network/CredentialStorage.cpp:
* platform/network/CredentialStorage.h:
* platform/network/DataURLDecoder.cpp:
* platform/network/DataURLDecoder.h:
* platform/network/FormData.h:
* platform/network/ProxyServer.h:
* platform/network/ResourceErrorBase.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::redirectedRequest const):
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
* platform/network/SocketStreamHandle.h:
* platform/network/cf/DNSResolveQueueCFNet.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
* platform/network/cf/ProxyServerCFNet.cpp:
* platform/network/cf/ResourceErrorCF.cpp:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
* platform/network/curl/CookieJarCurlDatabase.cpp: Added.
(WebCore::cookiesForSession):
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
(WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
(WebCore::CookieJarCurlDatabase::cookiesForDOM const):
(WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
(WebCore::CookieJarCurlDatabase::cookiesEnabled const):
(WebCore::CookieJarCurlDatabase::getRawCookies const):
(WebCore::CookieJarCurlDatabase::deleteCookie const):
(WebCore::CookieJarCurlDatabase::getHostnamesWithCookies const):
(WebCore::CookieJarCurlDatabase::deleteCookiesForHostnames const):
(WebCore::CookieJarCurlDatabase::deleteAllCookies const):
(WebCore::CookieJarCurlDatabase::deleteAllCookiesModifiedSince const):
* platform/network/curl/CookieJarDB.cpp:
* platform/network/curl/CookieUtil.h:
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlProxySettings.h:
* platform/network/curl/CurlResponse.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
* platform/network/curl/ProxyServerCurl.cpp:
* platform/network/curl/SocketStreamHandleImplCurl.cpp:
* platform/network/mac/ResourceErrorMac.mm:
* platform/network/soup/NetworkStorageSessionSoup.cpp:
* platform/network/soup/ProxyServerSoup.cpp:
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceRequestSoup.cpp:
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
* platform/network/soup/SoupNetworkSession.cpp:
* platform/network/soup/SoupNetworkSession.h:
* platform/text/TextEncoding.h:
* platform/win/BString.cpp:
* platform/win/BString.h:
* platform/win/ClipboardUtilitiesWin.cpp:
(WebCore::markupToCFHTML):
* platform/win/ClipboardUtilitiesWin.h:
* platform/win/DragImageWin.cpp:
* platform/win/PasteboardWin.cpp:
* plugins/PluginData.h:
* rendering/HitTestResult.h:
* rendering/RenderAttachment.cpp:
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::sourceURI const):
* svg/SVGURIReference.cpp:
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageCache.h:
* svg/graphics/SVGImageForContainer.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
* testing/Internals.mm:
(WebCore::Internals::userVisibleString):
* testing/MockContentFilter.cpp:
(WebCore::MockContentFilter::willSendRequest):
* testing/MockPaymentCoordinator.cpp:
* testing/js/WebCoreTestSupport.cpp:
* workers/AbstractWorker.h:
* workers/WorkerGlobalScope.h:
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerInspectorProxy.h:
* workers/WorkerLocation.h:
* workers/WorkerScriptLoader.h:
* workers/WorkerThread.cpp:
* workers/WorkerThread.h:
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerClientData.h:
* workers/service/ServiceWorkerContainer.cpp:
* workers/service/ServiceWorkerContextData.h:
* workers/service/ServiceWorkerData.h:
* workers/service/ServiceWorkerJobData.h:
* workers/service/ServiceWorkerRegistrationKey.cpp:
* workers/service/ServiceWorkerRegistrationKey.h:
(WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue):
* worklets/WorkletGlobalScope.h:
* xml/XMLHttpRequest.h:
2018-11-30 Chris Dumez <cdumez@apple.com>
Drop unused Cross-Origin-Window-Policy from HTTPHeaderNames.in
https://bugs.webkit.org/show_bug.cgi?id=192253
Reviewed by Geoffrey Garen.
* platform/network/HTTPHeaderNames.in:
2018-11-30 Justin Fan <justin_fan@apple.com>
[WebGPU] WebGPUQueue::submit and WebGPURenderingContext::present() implementation
https://bugs.webkit.org/show_bug.cgi?id=192254
Reviewed by Dean Jackson.
Final plumbing to render onto an HTMLCanvasElement with WebGPU. Also added ref-test that draws
a green square onto a canvas using WebGPU; reference uses 2D canvas.
Test: webgpu/simple-triangle-strip.html
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUSwapChain.h: Needs to override platformLayer() for CanvasBasedRenderingContext.
* platform/graphics/gpu/GPUQueue.h:
* platform/graphics/gpu/GPUSwapChain.h:
(WebCore::GPUSwapChain::metalLayer const): Renamed from platformLayer.
(WebCore::GPUSwapChain::platformLayer const): Deleted.
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::submit):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::getNextTexture): Returns the texture of the swap layer's next drawable.
(WebCore::GPUSwapChain::present): Presents the last-returned drawable from getNextTexture, and frees it.
(WebCore::GPUSwapChain::platformLayer const):
2018-11-30 Zalan Bujtas <zalan@apple.com>
Cant use RalphLauren.com on iPad because hover menus dont stay up
https://bugs.webkit.org/show_bug.cgi?id=192236
<rdar://problem/45792118>
Reviewed by Geoffrey Garen.
This patch introduces asynchronous content change observation.
1. Start observing synchronous content change and timer install as the result of dispatching mouseMoved event.
2. Start observing synchronous content change and style recalc schedule as the result of a timer callback (installed at #1).
3. Start observing synchronous content change as the result of a style recalc (scheduled at #2).
This patch also extends the timeout value from 100ms to 250ms. Certain content prefer longer timeouts (see http://briancherne.github.io/jquery-hoverIntent/ for details).
Test: fast/events/touch/ios/hover-when-style-change-is-async.html
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingStyleRecalcScheduling):
(WKStopObservingStyleRecalcScheduling):
(WKIsObservingStyleRecalcScheduling):
(WKSetShouldObserveNextStyleRecalc):
(WKShouldObserveNextStyleRecalc):
(WKSetObservedContentChange):
* platform/ios/wak/WKContentObservation.h:
2018-11-30 Ryosuke Niwa <rniwa@webkit.org>
ShadowRoot should have styleSheets property
https://bugs.webkit.org/show_bug.cgi?id=191311
Reviewed by Antti Koivisto.
Added the support for ShadowRoot.prototype.styleSheets by making StyleSheetList refer to either
a document or a shadow root. We don't support the named getter in shadow root since that's not
a standard feature: https://drafts.csswg.org/cssom/#the-stylesheetlist-interface
Tests: fast/shadow-dom/shadowroot-stylesheets-wrapper-gc.html
imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::StyleSheetList): Added a variant which takes ShadowRoot.
(WebCore::StyleSheetList::styleSheets const):
(WebCore::StyleSheetList::ownerNode): Added. The replacement for document() since now the opaque
root could be either a Document or a ShadowRoot.
(WebCore::StyleSheetList::detach): Renamed from detachFromDocument.
(WebCore::StyleSheetList::namedItem const): Added a comment that the named getter is only supported
for Document since it's not in the standard.
* css/StyleSheetList.h:
(WebCore::StyleSheetList::create): Added a variant which takes ShadowRoot.
(WebCore::StyleSheetList::document): Deleted. Replaced by StyleSheetList::ownerNode in .cpp file.
* css/StyleSheetList.idl:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::styleSheets):
* dom/Document.idl:
* dom/DocumentOrShadowRoot.idl: Moved the declaration of styleSheets here from Document.idl.
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::~ShadowRoot): Call detach.
(WebCore::ShadowRoot::styleSheets):
* dom/ShadowRoot.h:
2018-11-30 Chris Dumez <cdumez@apple.com>
[PSON] We are sometimes swapping processes even though there is an opened window with an opener link to us
https://bugs.webkit.org/show_bug.cgi?id=192242
Reviewed by Geoffrey Garen.
Move the setting of the openedViaWindowOpenWithOpener & hasOpenedFrames flags on the
NavigationAction from FrameLoader::loadURL(), to PolicyChecker::checkNavigationPolicy()
to make sure those are always accurate and so that the UIProcess can make correct process
swapping decisions.
NavigationAction objects are created in other places than FrameLoader::loadURL() as well.
Even PolicyChecker::checkNavigationPolicy() will create a NavigationAction object if
there is not already one.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
(WebCore::FrameLoader::hasOpenedFrames const):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
2018-11-30 Don Olmstead <don.olmstead@sony.com>
Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO
https://bugs.webkit.org/show_bug.cgi?id=192197
Reviewed by Jiewen Tan.
No new tests. No change in behavior.
* Configurations/FeatureDefines.xcconfig:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readTerminal):
* crypto/CommonCryptoUtilities.cpp:
* crypto/CommonCryptoUtilities.h:
* crypto/CryptoAlgorithm.cpp:
* crypto/CryptoAlgorithm.h:
* crypto/CryptoAlgorithmIdentifier.h:
* crypto/CryptoAlgorithmParameters.h:
* crypto/CryptoAlgorithmParameters.idl:
* crypto/CryptoAlgorithmRegistry.cpp:
* crypto/CryptoAlgorithmRegistry.h:
* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKey.idl:
* crypto/CryptoKeyFormat.h:
* crypto/CryptoKeyPair.h:
* crypto/CryptoKeyPair.idl:
* crypto/CryptoKeyType.h:
* crypto/CryptoKeyUsage.h:
* crypto/CryptoKeyUsage.idl:
* crypto/JsonWebKey.h:
* crypto/JsonWebKey.idl:
* crypto/RsaOtherPrimesInfo.h:
* crypto/RsaOtherPrimesInfo.idl:
* crypto/SerializedCryptoKeyWrap.h:
* crypto/SubtleCrypto.cpp:
* crypto/SubtleCrypto.h:
* crypto/SubtleCrypto.idl:
* crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CBC.h:
* crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CFB.h:
* crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
* crypto/algorithms/CryptoAlgorithmAES_CTR.h:
* crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
* crypto/algorithms/CryptoAlgorithmAES_GCM.h:
* crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
* crypto/algorithms/CryptoAlgorithmAES_KW.h:
* crypto/algorithms/CryptoAlgorithmECDH.cpp:
* crypto/algorithms/CryptoAlgorithmECDH.h:
* crypto/algorithms/CryptoAlgorithmECDSA.cpp:
* crypto/algorithms/CryptoAlgorithmECDSA.h:
* crypto/algorithms/CryptoAlgorithmHKDF.cpp:
* crypto/algorithms/CryptoAlgorithmHKDF.h:
* crypto/algorithms/CryptoAlgorithmHMAC.cpp:
* crypto/algorithms/CryptoAlgorithmHMAC.h:
* crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
* crypto/algorithms/CryptoAlgorithmPBKDF2.h:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
* crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
* crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
* crypto/algorithms/CryptoAlgorithmSHA1.cpp:
* crypto/algorithms/CryptoAlgorithmSHA1.h:
* crypto/algorithms/CryptoAlgorithmSHA224.cpp:
* crypto/algorithms/CryptoAlgorithmSHA224.h:
* crypto/algorithms/CryptoAlgorithmSHA256.cpp:
* crypto/algorithms/CryptoAlgorithmSHA256.h:
* crypto/algorithms/CryptoAlgorithmSHA384.cpp:
* crypto/algorithms/CryptoAlgorithmSHA384.h:
* crypto/algorithms/CryptoAlgorithmSHA512.cpp:
* crypto/algorithms/CryptoAlgorithmSHA512.h:
* crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
* crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
* crypto/gcrypt/CryptoKeyECGCrypt.cpp:
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
* crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp:
* crypto/keys/CryptoAesKeyAlgorithm.idl:
* crypto/keys/CryptoEcKeyAlgorithm.idl:
* crypto/keys/CryptoHmacKeyAlgorithm.idl:
* crypto/keys/CryptoKeyAES.cpp:
* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyAlgorithm.idl:
* crypto/keys/CryptoKeyEC.cpp:
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyHMAC.cpp:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.cpp:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeyRSAComponents.cpp:
* crypto/keys/CryptoKeyRSAComponents.h:
* crypto/keys/CryptoKeyRaw.cpp:
* crypto/keys/CryptoKeyRaw.h:
* crypto/keys/CryptoRsaHashedKeyAlgorithm.idl:
* crypto/keys/CryptoRsaKeyAlgorithm.idl:
* crypto/mac/CommonCryptoDERUtilities.cpp:
* crypto/mac/CommonCryptoDERUtilities.h:
* crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
* crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
* crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
* crypto/mac/CryptoAlgorithmECDHMac.cpp:
* crypto/mac/CryptoAlgorithmECDSAMac.cpp:
* crypto/mac/CryptoAlgorithmHKDFMac.cpp:
* crypto/mac/CryptoAlgorithmHMACMac.cpp:
* crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
* crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
* crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
* crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
* crypto/mac/CryptoAlgorithmRegistryMac.cpp:
* crypto/mac/CryptoDigestAlgorithm.h:
* crypto/mac/CryptoKeyECMac.cpp:
* crypto/mac/CryptoKeyMac.cpp:
* crypto/mac/CryptoKeyRSAMac.cpp:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
* crypto/parameters/AesCbcCfbParams.idl:
* crypto/parameters/AesCtrParams.idl:
* crypto/parameters/AesGcmParams.idl:
* crypto/parameters/AesKeyParams.idl:
* crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
* crypto/parameters/CryptoAlgorithmAesCtrParams.h:
* crypto/parameters/CryptoAlgorithmAesGcmParams.h:
* crypto/parameters/CryptoAlgorithmAesKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcKeyParams.h:
* crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
* crypto/parameters/CryptoAlgorithmEcdsaParams.h:
* crypto/parameters/CryptoAlgorithmHkdfParams.h:
* crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
* crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
* crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
* crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h:
* crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
* crypto/parameters/CryptoAlgorithmRsaPssParams.h:
* crypto/parameters/EcKeyParams.idl:
* crypto/parameters/EcdhKeyDeriveParams.idl:
* crypto/parameters/EcdsaParams.idl:
* crypto/parameters/HkdfParams.idl:
* crypto/parameters/HmacKeyParams.idl:
* crypto/parameters/Pbkdf2Params.idl:
* crypto/parameters/RsaHashedImportParams.idl:
* crypto/parameters/RsaHashedKeyGenParams.idl:
* crypto/parameters/RsaKeyGenParams.idl:
* crypto/parameters/RsaOaepParams.idl:
* crypto/parameters/RsaPssParams.idl:
* dom/Document.cpp:
* dom/Document.h:
* dom/ScriptExecutionContext.h:
* page/ChromeClient.h:
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
* page/Crypto.h:
* page/Crypto.idl:
* platform/GCrypt.cmake:
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* workers/WorkerGlobalScope.cpp:
* workers/WorkerGlobalScope.h:
* worklets/WorkletGlobalScope.h:
2018-11-30 Wenson Hsieh <wenson_hsieh@apple.com>
Replace "auto fill" with "AutoFill" in some localizable strings
https://bugs.webkit.org/show_bug.cgi?id=192233
<rdar://problem/46311614>
Reviewed by Chris Fleizach.
Replace "autofill" with "AutoFill".
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillCredentialsLabel):
(WebCore::AXAutoFillContactsLabel):
(WebCore::AXAutoFillStrongPasswordLabel):
(WebCore::AXAutoFillCreditCardLabel):
2018-11-29 Ryosuke Niwa <rniwa@webkit.org>
Add CEReactions=NotNeeded on all the relevant IDL files
https://bugs.webkit.org/show_bug.cgi?id=188368
<rdar://problem/42987753>
Rubber-stamped by Antti Koivisto.
Based on a patch written by Frederic Wang. Added CEReactions=NotNeeded to all the places
we don't need CEReactions because we don't implement customized builtins but are marked with
CEReactions in the HTML specification.
* html/HTMLAnchorElement.idl:
* html/HTMLAreaElement.idl:
* html/HTMLBRElement.idl:
* html/HTMLBaseElement.idl:
* html/HTMLBodyElement.idl:
* html/HTMLButtonElement.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLDListElement.idl:
* html/HTMLDataElement.idl:
* html/HTMLDetailsElement.idl:
* html/HTMLDirectoryElement.idl:
* html/HTMLDivElement.idl:
* html/HTMLEmbedElement.idl:
* html/HTMLFieldSetElement.idl:
* html/HTMLFontElement.idl:
* html/HTMLFormElement.idl:
* html/HTMLFrameElement.idl:
* html/HTMLFrameSetElement.idl:
* html/HTMLHRElement.idl:
* html/HTMLHeadingElement.idl:
* html/HTMLHtmlElement.idl:
* html/HTMLHyperlinkElementUtils.idl:
* html/HTMLImageElement.idl:
* html/HTMLInputElement.idl:
* html/HTMLLIElement.idl:
* html/HTMLLabelElement.idl:
* html/HTMLLegendElement.idl:
* html/HTMLLinkElement.idl:
* html/HTMLMapElement.idl:
* html/HTMLMarqueeElement.idl:
* html/HTMLMediaElement.idl:
* html/HTMLMenuElement.idl:
* html/HTMLMetaElement.idl:
* html/HTMLMeterElement.idl:
* html/HTMLModElement.idl:
* html/HTMLOListElement.idl:
* html/HTMLObjectElement.idl:
* html/HTMLOptGroupElement.idl:
* html/HTMLOptionElement.idl:
* html/HTMLOutputElement.idl:
* html/HTMLParagraphElement.idl:
* html/HTMLParamElement.idl:
* html/HTMLPreElement.idl:
* html/HTMLProgressElement.idl:
* html/HTMLQuoteElement.idl:
* html/HTMLScriptElement.idl:
* html/HTMLSlotElement.idl:
* html/HTMLSourceElement.idl:
* html/HTMLStyleElement.idl:
* html/HTMLTableCaptionElement.idl:
* html/HTMLTableCellElement.idl:
* html/HTMLTableColElement.idl:
* html/HTMLTableElement.idl:
* html/HTMLTableRowElement.idl:
* html/HTMLTableSectionElement.idl:
* html/HTMLTextAreaElement.idl:
* html/HTMLTimeElement.idl:
* html/HTMLTrackElement.idl:
* html/HTMLUListElement.idl:
* html/HTMLVideoElement.idl:
2018-11-30 Alexey Proskuryakov <ap@apple.com>
Move USE_CFNETWORK_IGNORE_HSTS to its proper place
https://bugs.webkit.org/show_bug.cgi?id=192173
Reviewed by Tim Horton.
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::schemeWasUpgradedDueToDynamicHSTS):
2018-11-30 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API for ProtectionSpace.
https://bugs.webkit.org/show_bug.cgi?id=191648
Reviewed by Alex Christensen.
Create a platform dependent header and implementation files for ProtectionSpace.
No new tests because there's no behavior change.
* platform/Curl.cmake:
* platform/network/ProtectionSpace.h:
* platform/network/curl/ProtectionSpaceCurl.cpp: Added.
(WebCore::ProtectionSpace::certificateInfo const):
* platform/network/curl/ProtectionSpaceCurl.h: Added.
(WebCore::ProtectionSpace::ProtectionSpace):
(WebCore::ProtectionSpace::encodingRequiresPlatformData const):
(WebCore::ProtectionSpace::platformCompare):
2018-11-30 Justin Fan <justin_fan@apple.com>
[WebGPU] Flesh out WebGPURenderPassDescriptor to match the WebGPU IDL
https://bugs.webkit.org/show_bug.cgi?id=192213
Reviewed by Dean Jackson.
WebGPU prototype now uses WebGPURenderPassColorAttachmentDescriptor in WebGPURenderPassDescriptor to match the WebGPU Sketch.
WebGPU developer can now also set the clearColor in WebGPURenderPassDescriptor.
No new tests. Older WebGPURenderPass* tests updated.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPUColor.h: Added. Typedef'd to GPUColor.h.
* Modules/webgpu/WebGPUColor.idl: Added.
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass): Updated to error check and support the new structure of WebGPURenderPassDescriptor.
* Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h: Added.
* Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.idl: Added.
* Modules/webgpu/WebGPURenderPassDescriptor.h:
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Updated to match the sketch IDL.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUColor.h: Added.
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Added. Backing struct for WebGPU__.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Updated to match new WebGPURenderPassDescriptor.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::create): Now also uses clearColor set by developer.
2018-11-30 Andy Estes <aestes@apple.com>
[Cocoa] Add some WKA extension points
https://bugs.webkit.org/show_bug.cgi?id=192131
<rdar://problem/46330293>
Reviewed by Tim Horton.
* DerivedSources.make: Added an extension point for derived sources.
* Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for
PaymentCoordinatorClient.
* SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source.
* WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm.
* bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names.
* page/SettingsBase.h: Added an extension point for settings.
* platform/cocoa/WebCoreAdditions.mm: Added.
2018-11-30 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] CDMInstance should be shipped as a GstContext to the decryptors
https://bugs.webkit.org/show_bug.cgi?id=192075
Reviewed by Philippe Normand.
So far, we were shipping the CDMInstance in an event to the
decryptors and they were requesting it with bus messages when it
was not found. Now we ship it with a GstContext that is set to the
pipeline and read from the decryptors, which is now always
available.
As a consequence of changing this flow, the attemptToDecrypt one
was affected as well because it was tied to CDMInstance
shipment. A workaround was added: when the decryptors send the
waitingForKey, an attemptToDecrypt will be performed. A FIXME was
added for this. A subconsequence is that
attemptToDecryptWithInstance is reworked to rely always in
attemptToDecryptWithLocal instance, the former becomes final and
the latter virtual.
This is a rework, no new tests needed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkit_media_common_encryption_decrypt_class_init):
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable):
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
(webKitMediaCommonEncryptionDecryptorSetContext):
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance):
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance): Deleted.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2018-11-30 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Compute min/maxHeight margins only when they are needed.
https://bugs.webkit.org/show_bug.cgi?id=192223
Reviewed by Antti Koivisto.
Test: fast/block/block-only/collapsed-margin-with-min-height.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2018-11-30 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context.
https://bugs.webkit.org/show_bug.cgi?id=192215
Reviewed by Antti Koivisto.
Check if the inline formatting context actually has any lines.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-11-30 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][MarginCollapsing] Do not use computed display box values for border and padding
https://bugs.webkit.org/show_bug.cgi?id=192214
Reviewed by Antti Koivisto.
Border and padding values are not necessarily computed yet when we try to estimate the margin top value. Estimating margin top is required
to be able to place floats (vertically) sooner than we would compute the final vertical position for a regular block box.
<body><div style="float: left"></div><div><div style="margin: 10px;"></div></div>
In the above example, to estimate a final vertical position of the floating box, we need to know whether the nested div's margin is collapsed
all the way up to the body. However in order to find it out we need to check for borders and paddings (they stop margin collapsing).
At the time when the floating box is being laied out, those <div> block boxes are still far down in the layout queue.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::hasBorder):
(WebCore::Layout::hasPadding):
(WebCore::Layout::hasBorderBefore):
(WebCore::Layout::hasBorderAfter):
(WebCore::Layout::hasPaddingBefore):
(WebCore::Layout::hasPaddingAfter):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
(WebCore::Layout::isMarginBottomCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
2018-11-29 Frederic Wang <fwang@igalia.com>
Separate paint and scroll offsets for RenderLayerBacking::m_scrollingContentsLayer
https://bugs.webkit.org/show_bug.cgi?id=183040
Currently, scroll offset of RenderLayerBacking::m_scrollingContentsLayer is stored in the
GraphicsLayer::m_offsetFromRenderer member used for paint offset. This patch separates these
two concept by introducing a new GraphicsLayer::m_scrollOffset for the scroll offset. This
makes the API a little bit cleaner, the code easier to understand and might avoid unnecessary
repaints in composited scroll.
Reviewed by Simon Fraser.
No new tests, already covered by existing tests.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setScrollOffset): Setter function to update the scroll offset
of the content layer inside its scrolling parent layer. Ask a repaint if it has changed and
is requested by the caller.
(WebCore::GraphicsLayer::paintGraphicsLayerContents): Take into account the scroll offset
when painting.
(WebCore::GraphicsLayer::dumpProperties const): Dump the scroll offset property.
* platform/graphics/GraphicsLayer.h: Include ScrollableArea for the ScrollOffset typedef.
Add member for the scroll offset of the content layer inside its scrolling parent layer.
(WebCore::GraphicsLayer::scrollOffset const): Getter function.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry): Do not include the scroll offset in the
paint offset of m_scrollingContentsLayer since it is now taken into account in
paintGraphicsLayerContents. Update the scroll offset of m_scrollingContentsLayer separately.
Leave the paint offset of m_foregroundLayer unchanged.
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Take into account the scroll
offset of m_scrollingContentsLayer when calculating the dirty rect.
2018-11-29 Simon Fraser <simon.fraser@apple.com>
Overflow scrolling layers need to be self-painting
https://bugs.webkit.org/show_bug.cgi?id=192201
Reviewed by Dean Jackson.
Overflow scrolling layers paint their contents, so need to be self-painting in the RenderLayer sense.
Without this change, the overflow in the testcase doesn't get any compositing layers.
Test: compositing/scrolling/overflow-scrolling-layers-are-self-painting.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
2018-11-29 Christopher Reid <chris.reid@sony.com>
[Win] listDirectory in FileSystemWin.cpp should not skip all directories
https://bugs.webkit.org/show_bug.cgi?id=192042
Reviewed by Fujii Hironori.
Covered by existing tests.
listDirectory is not returning any child directories which is causing
ASSERT(diskUsage >= databaseFileSize) in SQLiteIDBBackingStore.cpp to fail.
Change listDirectory in FileSystemWin to match FileSystemPOSIX's behavior.
listDirectory should only skip the current and previous directories.
* platform/win/FileSystemWin.cpp:
2018-11-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238713.
Breaks internal builds.
Reverted changeset:
"[Cocoa] Add some WKA extension points"
https://bugs.webkit.org/show_bug.cgi?id=192131
https://trac.webkit.org/changeset/238713
2018-11-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238680.
Caused existing webrtc layout tests to fail an assertion.
Reverted changeset:
"A sender created through addTransceiver and populated using
addTrack should have its source set"
https://bugs.webkit.org/show_bug.cgi?id=192136
https://trac.webkit.org/changeset/238680
2018-11-29 Justin Fan <justin_fan@apple.com>
Remove dangling WebGPU file references from WebCore project
https://bugs.webkit.org/show_bug.cgi?id=192185
Unreviewed project file gardening.
No new tests.
* WebCore.xcodeproj/project.pbxproj:
2018-11-29 Keith Rollin <krollin@apple.com>
Unreviewed build fix.
r238637 introduced some DerivedSources.make changes that could produce
some invalid .idl files, leading to IDLParser.pm error messages.
* DerivedSources.make:
2018-11-29 Simon Fraser <simon.fraser@apple.com>
Add an internal feature flag to enable async overflow scrolling
https://bugs.webkit.org/show_bug.cgi?id=192184
Reviewed by Tim Horton.
Add a new internal feature flag that will enable async overflow-scrolling for
most overflow:scroll elements. Defaults to off.
Make the "UseAcceleratedTouchScrolling" terminology in RenderLayer etc be more generic,
and refer to async overflow scrolling.
* page/Settings.yaml:
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext): Remove a line which is not necessary, since -webkit-overflow-scrolling: touch
already triggers non-auto z-index via code in StyleResolver::adjustRenderStyle().
(WebCore::RenderLayer::canUseCompositedScrolling const):
(WebCore::RenderLayer::hasCompositedScrollableOverflow const):
(WebCore::RenderLayer::handleTouchEvent):
(WebCore::RenderLayer::usesAsyncScrolling const):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::showsOverflowControls const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::canUseAcceleratedTouchScrolling const): Deleted.
(WebCore::RenderLayer::hasTouchScrollableOverflow const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
2018-11-29 Andy Estes <aestes@apple.com>
[Cocoa] Add some WKA extension points
https://bugs.webkit.org/show_bug.cgi?id=192131
<rdar://problem/46330293>
Reviewed by Tim Horton.
* DerivedSources.make: Added an extension point for derived sources.
* Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for
PaymentCoordinatorClient.
* SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source.
* WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm.
* bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names.
* page/SettingsBase.h: Added an extension point for settings.
* platform/cocoa/WebCoreAdditions.mm: Added.
2018-11-29 Tim Horton <timothy_horton@apple.com>
Make drawing tools available when an editable image is focused
https://bugs.webkit.org/show_bug.cgi?id=192172
<rdar://problem/30337960>
Reviewed by Dean Jackson.
* editing/Editor.cpp:
(WebCore::Editor::insertEditableImage):
* editing/Editor.h:
* editing/InsertEditableImageCommand.cpp:
(WebCore::InsertEditableImageCommand::insertEditableImage):
(WebCore::InsertEditableImageCommand::doApply):
* editing/InsertEditableImageCommand.h:
Add InsertEditableImageCommand::insertEditableImage, which returns the
inserted image element.
* html/HTMLImageElement.h:
Make HTMLImageElement focusable if it is editable.
2018-11-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][Quirk] Body and html height stretching.
https://bugs.webkit.org/show_bug.cgi?id=192154
Reviewed by Antti Koivisto.
This patch takes the document box's margin/border/padding into account when stretching html/body to the height of the initial containing block.
Tests: fast/block/block-only/body-height-with-auto-html-height-quirk.html
fast/block/block-only/body-height-with-auto-html-height-quirk2.html
fast/block/block-only/body-height-with-non-auto-html-height-quirk.html
fast/block/block-only/body-height-with-non-auto-html-height-quirk2.html
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight):
2018-11-29 Justin Fan <justin_fan@apple.com>
[WebGPU] Replace forward declare of WebGPUCommandBuffer with include
https://bugs.webkit.org/show_bug.cgi?id=192179
Unreviewed build fix.
No new tests. No behavior change.
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
* Modules/webgpu/WebGPUProgrammablePassEncoder.h:
2018-11-29 Zalan Bujtas <zalan@apple.com>
[ContentObservation] Make WKSetObservedContentChange logic more explicit.
https://bugs.webkit.org/show_bug.cgi?id=192183
Reviewed by Simon Fraser.
* platform/ios/wak/WKContentObservation.cpp:
(WKSetObservedContentChange):
(WebThreadRemoveObservedDOMTimer):
2018-11-29 Youenn Fablet <youenn@apple.com>
CSS subresource loads should not be observable from resource timing if the stylesheet is opaque
https://bugs.webkit.org/show_bug.cgi?id=192132
Reviewed by Ryosuke Niwa.
Introduce a new ResourceLoaderOptions to determine whether a load is made from a resource that is opaque.
Make use of that option to disable exposing such loads to the web page through resource timing.
The same option might later be used to bypass service workers.
Make use of this option for CSS subresource loads.
When the CSS stylesheet is opaque for the page, set this option.
Test: http/tests/security/clean-origin-exposed-resource-timing.html
http/tests/security/cross-origin-resource-timing.html
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue):
(WebCore::CSSCursorImageValue::loadImage):
* css/CSSCursorImageValue.h:
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::cachedFont):
* css/CSSFontFaceSrcValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::CSSImageSetValue):
(WebCore::CSSImageSetValue::loadBestFitImage):
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::CSSImageValue):
(WebCore::CSSImageValue::loadImage):
* css/CSSImageValue.h:
* css/CSSStyleSheet.h:
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::setCSSStyleSheet):
(WebCore::StyleRuleImport::requestStyleSheet):
* css/StyleSheetContents.h:
* css/parser/CSSParserContext.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCursor):
(WebCore::consumeFontFaceSrcURI):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeImageSet):
(WebCore::CSSPropertyParserHelpers::consumeImage):
* html/HTMLBodyElement.cpp:
(WebCore::HTMLBodyElement::collectStyleForPresentationAttribute):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::initializeStyleSheet):
(WebCore::HTMLLinkElement::setCSSStyleSheet):
* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute):
* loader/ResourceLoaderOptions.h:
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::shouldAddResourceTiming):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::srcValue const):
2018-11-29 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Not currenlty testable
DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-29 Joseph Pecoraro <pecoraro@apple.com>
[Cocoa] Move ServerTimingParser.* into a better group in the Xcode project
https://bugs.webkit.org/show_bug.cgi?id=192180
Reviewed by Simon Fraser.
* WebCore.xcodeproj/project.pbxproj:
2018-11-29 Zalan Bujtas <zalan@apple.com>
[ContentObservation] DOMTimer::install should explicitly check if timer observation is on
https://bugs.webkit.org/show_bug.cgi?id=192181
Reviewed by Simon Fraser.
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
* platform/ios/wak/WKContentObservation.cpp:
(WKIsObservingDOMTimerScheduling):
* platform/ios/wak/WKContentObservation.h:
2018-11-29 Ryosuke Niwa <rniwa@webkit.org>
Executing "insertunorderedlist" while selecting a contenteditable element inside a shadow dom hangs the browser
https://bugs.webkit.org/show_bug.cgi?id=184049
<rdar://problem/38931033>
Reviewed by Antti Koivisto.
The primary hung was caused by TextIterator::advance traversing the next node in the tree order using
NodeTraversal::next which doesn't take the composed tree into account. Fixed the bug by traversing
the composed tree while sharing code with StylizedMarkupAccumulator.
This revealed a second hang in InsertListCommand::doApply() caused by endingSelection() being null,
which was caused by CompositeEditCommand::moveParagraphs failing to restore the ending selection properly
because it was computing the text indices difference from the beginning of the document until the destination.
Fixed this second bug by computing the indices against the beginning of the root editable element.
Note that editability never crosses a shadow boundary.
Test: editing/execCommand/insert-unordered-list-in-shadow-tree.html
* dom/ComposedTreeIterator.h:
(WebCore::nextSkippingChildrenInComposedTreeIgnoringUserAgentShadow): Extracted out of nextSkippingChildren
in markup.cpp.
(WebCore::nextInComposedTreeIgnoringUserAgentShadow): Added.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Compute the index from the beginning of the root editable
element as opposed to the beginning of the document.
* editing/TextIterator.cpp:
(WebCore::nextNode): Added.
(WebCore::isDescendantOf): Added.
(WebCore::TextIterator::advance): Use the newly added functions to traverse the composed tree when the options
contains TextIteratorTraversesFlatTree.
* editing/markup.cpp:
2018-11-29 Zalan Bujtas <zalan@apple.com>
[ContentObservation] Decouple content change and DOM timer scheduling observation
https://bugs.webkit.org/show_bug.cgi?id=192170
Reviewed by Simon Fraser.
This is in preparation for adding style recalc scheduling observation (the main goal here is to simplify the indeterminate change logic).
* page/DOMTimer.cpp:
(WebCore::DOMTimer::fired):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::mouseMoved):
* platform/ios/wak/WKContentObservation.cpp:
(WKStartObservingContentChanges):
(WKStopObservingContentChanges):
(WKStartObservingDOMTimerSchedules):
(WKStopObservingDOMTimerSchedules):
(WKSetObservedContentChange):
(WebThreadAddObservedDOMTimer):
(WKBeginObservingContentChanges): Deleted.
* platform/ios/wak/WKContentObservation.h:
2018-11-29 Frederic Wang <fwang@igalia.com>
Make reconcileViewportConstrainedLayerPositions start from a specified scrolling node
https://bugs.webkit.org/show_bug.cgi?id=180002
Reviewed by Simon Fraser.
For non-programmatic scrolling of frames, AsyncScrollingCoordinator::reconcileScrollingState
currently always call reconcileViewportConstrainedLayerPositions for the main frame
since async subframe scrolling is not supported yet (bug 171667 and bug 149264). This
function in turn calls reconcileLayerPositionForViewportRect on the whole scrolling tree to
readjust position of fixed/sticky descendants. This patch refactors a bit the code so that
the operation is actually only applied to the descendants of the frame's scrolling node,
which would mean a small optimization when subframe are asynchronously scrollable. The code
is already covered by reconcile-layer-position-recursive.html.
No new tests, behavior unchanged and already covered by existing tests.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState): Pass the frame's scrolling
node id.
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Start
reconciliation from the specified scrolling node and log its ID.
* page/scrolling/AsyncScrollingCoordinator.h: Add ScrollingNodeID parameter.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Ditto.
2018-11-29 Zalan Bujtas <zalan@apple.com>
Rename *ObservedContentModifier(s) to *ObservedDOMTimer(s)
https://bugs.webkit.org/show_bug.cgi?id=192168
Reviewed by Simon Fraser.
* dom/Document.cpp:
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::clearTimeout):
* page/Frame.cpp:
(WebCore::Frame::willDetachPage):
* platform/ios/wak/WKContentObservation.cpp:
(WKBeginObservingContentChanges):
(WKSetObservedContentChange):
(WebThreadGetObservedDOMTimers):
(WebThreadCountOfObservedDOMTimers):
(WebThreadClearObservedDOMTimers):
(WebThreadContainsObservedDOMTimer):
(WebThreadAddObservedDOMTimer):
(WebThreadRemoveObservedDOMTimer):
(WebThreadCountOfObservedContentModifiers): Deleted.
(WebThreadClearObservedContentModifiers): Deleted.
(WebThreadContainsObservedContentModifier): Deleted.
(WebThreadAddObservedContentModifier): Deleted.
(WebThreadRemoveObservedContentModifier): Deleted.
* platform/ios/wak/WKContentObservation.h:
* platform/ios/wak/WKContentObservationInternal.h:
2018-11-29 Justin Fan <justin_fan@apple.com>
[WebGPU] WebGPURenderPassEncoder::setPipeline, draw, and endPass prototypes
https://bugs.webkit.org/show_bug.cgi?id=192134
Reviewed by Dean Jackson.
Wrap up prototype features for WebGPURenderPassEncoder.
Test: webgpu/render-command-encoding.html
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::beginRenderPass):
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp:
(WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder):
(WebCore::WebGPUProgrammablePassEncoder::endPass): Returns a reference to the WebGPUCommandBuffer that created this encoder.
(WebCore::WebGPUProgrammablePassEncoder::setPipeline):
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Updated to support endPass and setPipeline.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl:
* Modules/webgpu/WebGPURenderPassEncoder.cpp:
(WebCore::WebGPURenderPassEncoder::create): Must be provided with the WebGPUCommandBuffer.
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::draw):
* Modules/webgpu/WebGPURenderPassEncoder.h: Updated to cache a reference to the WebGPUCommandBuffer, and for draw.
* Modules/webgpu/WebGPURenderPassEncoder.idl:
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h:
(WebCore::WebGPURenderPipeline::renderPipeline):
* Modules/webgpu/WebGPUTexture.cpp:
* Modules/webgpu/WebGPUTexture.h: Replaced include with forward declaration.
* platform/graphics/gpu/GPUProgrammablePassEncoder.h: Updated to support new WebGPU_PassEncoder functionality.
* platform/graphics/gpu/GPURenderPassEncoder.h:
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): Now ends encoding on the MTLCommandEncoder, if not already ended, before freeing it.
* platform/graphics/gpu/GPURenderPipeline.h: Now remembers the GPUPrimitiveTopology that it was created with.
(WebCore::GPURenderPipeline::primitiveTopology const):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
(WebCore::GPUProgrammablePassEncoder::endPass): Calls endEncoding on the backing MTLCommandEncoder, if not already ended.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
(WebCore::GPURenderPassEncoder::setPipeline): Added.
(WebCore::primitiveTypeForGPUPrimitiveTopology): Added. Helper function to convert GPUPrimitiveTopology to MTLPrimitiveType.
(WebCore::GPURenderPassEncoder::draw): Added. Draws using primitive topology specified during pipeline creation.
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline): Now must store the GPURenderPipelineDescriptor for later reference.
2018-11-29 Justin Michaud <justin_michaud@apple.com>
CSS Painting API should pass 'this' correctly to paint callback, and repaint when properties change.
https://bugs.webkit.org/show_bug.cgi?id=191443
Reviewed by Dean Jackson.
Instantiate a new instance of the paint class, and pass it as 'this' object when the paint callback is called.
Also, this patch makes sure that custom paint elements get repainted when properties that they care about get changed.
Finally, we fix two reference cycles that caused WorkletGlobalScope to never be destroyed.
Tests: fast/css-custom-paint/animate-repaint.html
fast/css-custom-paint/animate.html
* bindings/js/JSDOMWrapper.cpp:
* bindings/js/JSPaintWorkletGlobalScopeCustom.cpp:
(WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
* bindings/js/JSWorkletGlobalScopeBase.cpp:
(WebCore::toJS):
* bindings/js/ScriptState.cpp:
(WebCore::execStateFromWorkletGlobalScope):
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* css/CSSPaintImageValue.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::vm):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::addCustomPaintWatchProperty):
(WebCore::RenderStyle::changeRequiresRepaint const):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* testing/Internals.cpp:
(WebCore::Internals::isAnyWorkletGlobalScopeAlive const):
* testing/Internals.h:
* testing/Internals.idl:
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::devicePixelRatio const):
(WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition):
(WebCore::PaintWorkletGlobalScope::registerPaint):
* worklets/PaintWorkletGlobalScope.h:
(WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope):
* worklets/WorkletGlobalScope.cpp:
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
(WebCore::WorkletGlobalScope::~WorkletGlobalScope):
(WebCore::WorkletGlobalScope::prepareForDestruction):
(WebCore::WorkletGlobalScope::allWorkletGlobalScopesSet):
(WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
(WebCore::WorkletGlobalScope::logExceptionToConsole):
(WebCore::WorkletGlobalScope::addConsoleMessage):
(WebCore::WorkletGlobalScope::addMessage):
* worklets/WorkletGlobalScope.h:
(WebCore::WorkletGlobalScope::script):
(WebCore::WorkletGlobalScope::responsibleDocument):
(WebCore::WorkletGlobalScope::responsibleDocument const):
(WebCore::WorkletGlobalScope::identifier const): Deleted.
(WebCore::WorkletGlobalScope::responsableDocument): Deleted.
(WebCore::WorkletGlobalScope::responsableDocument const): Deleted.
* worklets/WorkletScriptController.cpp:
(WebCore::WorkletScriptController::~WorkletScriptController):
(WebCore::WorkletScriptController::disableEval):
(WebCore::WorkletScriptController::disableWebAssembly):
(WebCore::WorkletScriptController::initScript):
2018-11-29 Alexey Proskuryakov <ap@apple.com>
Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence
https://bugs.webkit.org/show_bug.cgi?id=192041
Reviewed by Tim Horton.
* loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options.
There is a lot of code that needs to be cleaned up here.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
2018-11-29 Youenn Fablet <youenn@apple.com>
Updating a service worker during a navigation load sometimes makes the load fail
https://bugs.webkit.org/show_bug.cgi?id=191986
<rdar://problem/46259790>
Reviewed by Chris Dumez.
Previously, we were registering a document as service worker client at creation of the document.
According the service worker spec, this should be done when handling the fetch event of the corresponding navigation load.
This ensures that the service worker will have a client and will not get updated in the middle of the navigation load.
At navigation load start, we do not have a document yet since it is created when receiving the first bytes.
Instead, we register a temporary document when starting the navigation load and unregister it when the real document is registered.
Test: imported/w3c/web-platform-tests/service-workers/service-worker/update-on-navigation.https.html
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
(WebCore::DocumentLoader::registerTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient):
(WebCore::DocumentLoader::loadMainResource):
(WebCore::DocumentLoader::clearMainResource):
* loader/DocumentLoader.h:
2018-11-29 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238678.
Breaks internal builds.
Reverted changeset:
"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238678
2018-11-29 Youenn Fablet <youenn@apple.com>
A sender created through addTransceiver and populated using addTrack should have its source set
https://bugs.webkit.org/show_bug.cgi?id=192136
Reviewed by Eric Carlson.
In case libwebrtc backend is already created, we need to make sure to
set the track source to the libwebrtc sender backend that is actually
tied to the sender.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
2018-11-29 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Not currenlty testable
DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-29 Sihui Liu <sihui_liu@apple.com>
IndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store
https://bugs.webkit.org/show_bug.cgi?id=185869
<rdar://problem/40453623>
Reviewed by Geoffrey Garen.
lexicalGlobalObject is casted to JSDOMGlobalObject in CloneSerializer::dumpArrayBufferView,
so we should use JSDOMGlobalObject instead of JSGlobalObject in IDB database thread.
Covered by modified test: storage/indexeddb/objectstore-autoincrement.html
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM):
(WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::create):
* bindings/js/JSDOMGlobalObject.h:
* bindings/js/JSDOMWrapper.cpp:
(WebCore::JSDOMObject::JSDOMObject):
2018-11-29 Sihui Liu <sihui_liu@apple.com>
Unexpected constructor / instanceof behavior when retrieving indexedDB data in an iframe
https://bugs.webkit.org/show_bug.cgi?id=185906
<rdar://problem/40583100>
Reviewed by Geoffrey Garen.
ScriptExecutionContext::execState() returned state of main frame, so deserialization of
IDBValue in iframe used constructors of main frame, which is wrong.
Test: storage/indexeddb/instanceof-iframe.html
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::execState):
2018-11-29 Don Olmstead <don.olmstead@sony.com>
Make generic ScrollAnimator
https://bugs.webkit.org/show_bug.cgi?id=192128
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used
by other implementations. Fixed some compilation issues around using
this as a default implementation.
Removing ScrollAnimatorSmooth since it is dead code and doesn't even
compile at this time.
Fixing a compilation issue within LowPowerModeNotifierGLib
implementation that appeared due to unified sources changes.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/LowPowerModeNotifier.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::swipeVelocity const):
* platform/ScrollAnimatorSmooth.cpp: Removed.
* platform/ScrollAnimatorSmooth.h: Removed.
* platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp.
(WebCore::ScrollAnimator::create):
(WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric):
(WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation):
(WebCore::ScrollAnimatorGeneric::scroll):
(WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation):
(WebCore::ScrollAnimatorGeneric::computeVelocity):
(WebCore::ScrollAnimatorGeneric::handleWheelEvent):
(WebCore::ScrollAnimatorGeneric::willEndLiveResize):
(WebCore::ScrollAnimatorGeneric::updatePosition):
(WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar):
(WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar):
(WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity):
(WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired):
(WebCore::ScrollAnimatorGeneric::showOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars):
(WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea):
(WebCore::ScrollAnimatorGeneric::mouseExitedContentArea):
(WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea):
(WebCore::ScrollAnimatorGeneric::contentAreaDidShow):
(WebCore::ScrollAnimatorGeneric::contentAreaDidHide):
(WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled):
(WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden):
* platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h.
* platform/glib/LowPowerModeNotifierGLib.cpp:
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::swipeVelocity const): Deleted.
2018-11-28 Dean Jackson <dino@apple.com>
[ES Modules] Allow .mjs content when loaded from file://
https://bugs.webkit.org/show_bug.cgi?id=192100
<rdar://problem/46320065>
Reviewed by Sam Weinig.
Node JS requires ES Module files to be identified by the file
extension of ".mjs" (no relation to Maciej Stachowiak). This new
extension causes issues because it isn't recognised as a JavaScript
file. When using the script tag, the author is able to force the type
of the referenced file using an attribute, but this isn't possible
for the import() function or import statement.
Add a new entry into our table that maps file extensions to MIME types
so that when a .mjs file is loaded from a file:// reference it is
identified as JavaScript.
Test: js/dom/modules/import-mjs-module.html
* platform/network/mac/WebCoreURLResponse.mm: Add .mjs to the existing dictionary.
(WebCore::createExtensionToMIMETypeMap):
* platform/network/ios/WebCoreURLResponseIOS.mm: Add code just for .mjs.
(WebCore::createExtensionToMIMETypeMap):
2018-11-29 Zalan Bujtas <zalan@apple.com>
[LFC][BFC][Quirk] Width does not need stretching quirk.
https://bugs.webkit.org/show_bug.cgi?id=192135
Reviewed by Antti Koivisto.
In BFC the block box's width (auto) always streches to the content width of the containing block.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
* layout/blockformatting/BlockFormattingContextQuirks.cpp:
(WebCore::Layout::BlockFormattingContext::Quirks::needsStretching):
(WebCore::Layout::BlockFormattingContext::Quirks::isStretchedToInitialContainingBlock): Deleted.
(WebCore::Layout::BlockFormattingContext::Quirks::stretchedWidth): Deleted.
2018-11-29 Zalan Bujtas <zalan@apple.com>
[LFC][Quirk] Move quirk functions to dedicated classes.
https://bugs.webkit.org/show_bug.cgi?id=192133
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::initialContainingBlock): Deleted.
(WebCore::Layout::isStretchedToInitialContainingBlock): Deleted.
(WebCore::Layout::stretchHeightToInitialContainingBlockQuirk): Deleted.
(WebCore::Layout::stretchWidthToInitialContainingBlock): Deleted.
* layout/blockformatting/BlockFormattingState.cpp:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
(WebCore::Layout::isQuirkContainer): Deleted.
(WebCore::Layout::hasMarginTopQuirkValue): Deleted.
(WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): Deleted.
(WebCore::Layout::isMarginTopCollapsedWithParent): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
* layout/inlineformatting/text/TextUtil.h:
2018-11-29 Rob Buis <rbuis@igalia.com>
Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=192076
Reviewed by Frédéric Wang.
Since we do an early return if the protocol is not http or ws, the if check
for ws protocol and else statement are not needed, so use an ASSERT instead.
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const):
2018-11-29 Frederic Wang <fwang@igalia.com>
Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
https://bugs.webkit.org/show_bug.cgi?id=172914
Reviewed by Simon Fraser.
This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and
the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is
unchanged. In the future, this rect will be used for hit testing of subframes during
asynchronous macOS scrolling (but 172917).
No new tests, behavior unchanged.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties const):
* page/scrolling/ScrollingTreeScrollingNode.h:
(WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):
2018-11-28 Wenson Hsieh <wenson_hsieh@apple.com>
[iOSMac] Dropping text selections from web content into editable elements crashes the web process
https://bugs.webkit.org/show_bug.cgi?id=192113
<rdar://problem/46323701>
Reviewed by Ryosuke Niwa.
In iOSMac, registering invalid UTIs on NSItemProvider when starting a drag or handling a drop does not work.
Since iOS writes and reads only "Apple Web Archive pasteboard type" (a.k.a. `WebArchivePboardType`) during drag
and drop as well as copy and paste, we fail to read or write any web archive data, and subsequently fall back to
reading RTF or flat RTFD, both of which are not supported in iOSMac, since UIFoundation links against the
system's macOS WebKit stack.
To fix this, we add support for reading and writing com.apple.webarchive (`kUTTypeWebArchive`) on iOS, so that
WebKit-based iOSMac applications can understand web archive data from the host running macOS, and the host can
also understand web archive data written by the iOSMac app. Additionally, don't allow reading RTF and flat RTFD
as web content in iOSMac. (Note that writing RTF and flat RTFD is still safe, since it does not depend on
UIFoundation.framework but rather `WebCore::HTMLConverter`).
Test: DragAndDropTests.ModernWebArchiveType
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment):
Additionally make sure that we never call into UIFoundation's NSAttributedString to markup conversion codepath
by making `createFragment` an empty stub on iOSMac.
* platform/ios/PasteboardIOS.mm:
(WebCore::supportedImageTypes):
(WebCore::isTypeAllowedByReadingPolicy):
(WebCore::Pasteboard::readPasteboardWebContentDataForType):
(WebCore::Pasteboard::supportedWebContentPasteboardTypes):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
2018-11-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r238653 and r238656.
https://bugs.webkit.org/show_bug.cgi?id=192130
Breaks iOS build (Requested by smfr on #webkit).
Reverted changesets:
"Move Lookup Code for better cross platform usage"
https://bugs.webkit.org/show_bug.cgi?id=191732
https://trac.webkit.org/changeset/238653
"Attempt to fix the iOS build by only including RevealSPI.h
when it's needed."
https://trac.webkit.org/changeset/238656
2018-11-28 Simon Fraser <simon.fraser@apple.com>
Attempt to fix the iOS build by only including RevealSPI.h when it's needed.
* editing/cocoa/DictionaryLookup.mm:
2018-11-28 Alex Christensen <achristensen@webkit.org>
Modernize BlobRegistry::writeBlobsToTemporaryFiles
https://bugs.webkit.org/show_bug.cgi?id=192117
Reviewed by Dean Jackson.
No change in behavior. Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging
and manual completion handler management.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
* platform/network/BlobRegistryImpl.h:
2018-11-15 Megan Gardner <megan_gardner@apple.com>
Move Lookup Code for better cross platform usage
https://bugs.webkit.org/show_bug.cgi?id=191732
Reviewed by Alex Christensen.
Not currenlty testable
DictionaryLookup uses Reveal now, which is slated to be cross-platform.
That patch gates the parts of DictionaryLookup that currently do not have
an available implementation on iOS. Once Reveal is ready, this code will be
replaced or expanded upon, as appropriate.
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-28 Christopher Reid <chris.reid@sony.com>
SQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint: database table is locked" errors
https://bugs.webkit.org/show_bug.cgi?id=192111
Reviewed by Alex Christensen.
Ensure the journal_mode=WAL statement is finalized before wal_checkpoint is executed.
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
2018-11-28 Said Abou-Hallawa <sabouhallawa@apple.com>
Updating href on linearGradient and radialGradient doesn't update its rendering
https://bugs.webkit.org/show_bug.cgi?id=191934
Reviewed by Ryosuke Niwa.
Mark the gradient renderer for repaint when the value of the 'href'
attribute changes.
Tests: fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html
fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html
svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html
svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html
* svg/SVGGradientElement.cpp:
(WebCore::SVGGradientElement::svgAttributeChanged):
2018-11-28 Youenn Fablet <youenn@apple.com>
imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html is flaky on iOS simulator
https://bugs.webkit.org/show_bug.cgi?id=192037
Reviewed by Eric Carlson.
The stats report JS map should be created when resolving the stats promise with WebCore RTCStatsReport.
But resolving the promise might fail in case of a page being suspended.
In that case, no JSRTCStatsReport is created and there is no backing map.
Update the code to reflect that.
Covered by existing test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h:
2018-11-28 Keith Rollin <krollin@apple.com>
Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=192031
<rdar://problem/46286816>
Reviewed by Alex Christensen.
The Generate Derived Sources and Generate Unified Sources build phases
in Xcode need to have their inputs and outputs specified. This
specification will come in the form of .xcfilelist files that will be
attached to these build phases. There is one .xcfilelist file that
lists the input file and one that lists the output files. As part of
this work, the various generate-{derived,unified}-sources scripts that
are executed in these Generate build phases are modified to help in
the creation of these .xcfilelist files. In particular, they can now
be invoked with command-line parameters. These parameters are then
used to alter the normal execution of these scripts, causing them to
produce the .xcfilelist files as opposed to actually generating the
files that are listed in those files.
No new tests -- no changed functionality.
* Scripts/generate-derived-sources.sh:
* Scripts/generate-unified-sources.sh:
2018-11-28 Keith Rollin <krollin@apple.com>
Revert print_all_generated_files work in r238008; tighten up target specifications
https://bugs.webkit.org/show_bug.cgi?id=192025
<rdar://problem/46284301>
Reviewed by Alex Christensen.
In r238008, I added a facility for DerivedSources.make makefiles to
print out the list of files that they generate. This output was used
in the generation of .xcfilelist files used to specify the output of
the associated Generate Derived Sources build phases in Xcode. This
approach worked, but it meant that people would need to follow a
specific convention to keep this mechanism working.
Instead of continuing this approach, I'm going to implement a new
facility based on the output of `make` when passed the -d flag (which
prints dependency information). This new mechanism is completely
automatic and doesn't need maintainers to follow a convention. To that
end, remove most of the work performed in r238008 that supports the
print_all_generated_files target.
At the same time, it's important for the sets of targets and their
dependencies to be complete and correct. Therefore, also include
changes to bring those up-to-date. As part of that, you'll see
prevalent use of a particular technique. Here's an example:
BYTECODE_FILES = \
Bytecodes.h \
BytecodeIndices.h \
BytecodeStructs.h \
InitBytecodes.asm \
#
BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES))
all : $(BYTECODE_FILES)
$(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb
...
These lines indicate a set of generated files (those specified in
BYTECODE_FILES). These files are generated by the BytecodeList.rb
tool. But, as opposed to the normal rule where a single foo.output is
generated by foo.input plus some additional dependencies, this rule
produces multiple output files from a tool whose connection to the
output files is not immediately clear. A special approach is needed
where a single rule produces multiple output files. The normal way to
implement this is to use an .INTERMEDIATE target. However, we used
this approach in the past and ran into a problem with it, addressing
it with an alternate approach in r210507. The above example shows this
approach. The .'s in the list of target files are replaced with %'s,
and the result is used as the left side of the dependency rule.
No new tests -- no changed functionality.
* DerivedSources.make:
2018-11-28 Alex Christensen <achristensen@webkit.org>
Remove dead code from an earlier attempt at implementing safe browsing
https://bugs.webkit.org/show_bug.cgi?id=192067
Reviewed by Chris Dumez.
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): Deleted.
(WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadArchive):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/FrameLoaderClient.h:
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/PolicyChecker.h:
* loader/ShouldSkipSafeBrowsingCheck.h: Removed.
2018-11-28 Alex Christensen <achristensen@webkit.org>
Add SessionIDs wherever BlobURLs are used in SerializedScriptValue
https://bugs.webkit.org/show_bug.cgi?id=192062
Reviewed by Dean Jackson.
Just adding infrastructure for fixing "the blob bug"
* Modules/indexeddb/IDBDatabaseIdentifier.cpp:
(WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
(WebCore::IDBDatabaseIdentifier::isolatedCopy const):
* Modules/indexeddb/IDBDatabaseIdentifier.h:
(WebCore::IDBDatabaseIdentifier::hash const):
(WebCore::IDBDatabaseIdentifier::sessionID const):
(WebCore::IDBDatabaseIdentifier::encode const):
(WebCore::IDBDatabaseIdentifier::decode):
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):
* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):
(WebCore::IDBValue::setAsIsolatedCopy):
* Modules/indexeddb/IDBValue.h:
(WebCore::IDBValue::sessionID const):
(WebCore::IDBValue::encode const):
(WebCore::IDBValue::decode):
* Modules/indexeddb/server/MemoryIndexCursor.cpp:
(WebCore::IDBServer::MemoryIndexCursor::currentData):
* Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
(WebCore::IDBServer::MemoryObjectStoreCursor::currentData):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::deserializeIDBValueToJSValue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
(WebCore::CloneSerializer::CloneSerializer):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::deserialize):
(WebCore::CloneDeserializer::CloneDeserializer):
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore::SerializedScriptValue::create):
(WebCore::SerializedScriptValue::deserialize):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB):
(WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously):
* bindings/js/SerializedScriptValue.h:
(WebCore::SerializedScriptValue::sessionID const):
2018-11-28 Justin Fan <justin_fan@apple.com>
[WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor
https://bugs.webkit.org/show_bug.cgi?id=191990
Reviewed by Dean Jackson.
Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder.
Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing
a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass().
Test: webgpu/render-passes.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPUCommandBuffer.cpp:
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
(WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success.
* Modules/webgpu/WebGPUCommandBuffer.h:
* Modules/webgpu/WebGPUCommandBuffer.idl:
* Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added.
* Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder.
* Modules/webgpu/WebGPURenderPassDescriptor.h:
* Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now.
* Modules/webgpu/WebGPURenderPassEncoder.cpp: Added.
(WebCore::WebGPURenderPassEncoder::create):
(WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder):
(WebCore::WebGPURenderPassEncoder::passEncoder const):
* Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder.
* Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer.
* Modules/webgpu/WebGPUTextureView.cpp:
(WebCore::WebGPUTextureView::WebGPUTextureView):
* Modules/webgpu/WebGPUTextureView.h:
(WebCore::WebGPUTextureView::texture):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/graphics/gpu/GPUCommandBuffer.h:
(WebCore::GPUCommandBuffer::platformCommandBuffer const):
* platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder.
* platform/graphics/gpu/GPURenderPassDescriptor.h: Added.
* platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder.
* platform/graphics/gpu/GPUTexture.h:
(WebCore::GPUTexture::platformTexture const):
* platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added.
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added.
(WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails.
(WebCore::GPURenderPassEncoder::GPURenderPassEncoder):
(WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception.
(WebCore::GPURenderPassEncoder::platformPassEncoder const):
2018-11-28 Rob Buis <rbuis@igalia.com>
[XHR] Document.lastModified doesn't work for non-rendered documents
https://bugs.webkit.org/show_bug.cgi?id=179375
Reviewed by Alexey Proskuryakov.
Add setOverrideLastModified to override last modified date for
standalone Documents.
Behavior matches Firefox and Chrome.
Test: web-platform-tests/xhr/responsexml-document-properties.htm
* dom/Document.cpp:
(WebCore::Document::overrideLastModified):
(WebCore::Document::lastModified const): no need to test m_frame since that's already done in loader().
(WebCore::Document::lastModified): Deleted.
* dom/Document.h:
* xml/XMLHttpRequest.cpp:
2018-11-28 Yongjun Zhang <yongjun_zhang@apple.com>
Allow WebKit clients to specify a minimum effective width for layout.
https://bugs.webkit.org/show_bug.cgi?id=191499
<rdar://problem/45362678>
Reviewed by Wenson Hsieh.
If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device
width. For clients that wish to lay out the content with a different width value, we would need to add a way
to specify the effective width for layout.
Tests: fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html
fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize): Add a new argument effectiveWidth.
(WebCore::ViewportConfiguration::nativeWebpageParameters): Make sure minimumScale for nativeWebpageParameters
is small enough so that it won't clamp out the initial scale. If content is wider than the viewport, this
ensures we can still zoom out the page.
(WebCore::ViewportConfiguration::updateConfiguration): update _minimumEffectiveDeviceWidth and apply that to
the layout size scale computation.
(WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor): A helper method to return the effective
layout scale factor which is also effected by _minimumEffectiveDeviceWidth.
(WebCore::ViewportConfiguration::updateMinimumLayoutSize): Update m_minimumLayoutSize based on effectiveLayoutSizeScaleFactor().
(WebCore::ViewportConfiguration::description const): Also dump m_minimumEffectiveDeviceWidth.
* page/ViewportConfiguration.h: Add a member variable m_minimumEffectiveDeviceWidth.
2018-11-28 Stephan Szabo <stephan.szabo@sony.com>
Make generic EventHandler methods
https://bugs.webkit.org/show_bug.cgi?id=192032
Reviewed by Michael Catanzaro.
No new tests. No new behavior.
Move mostly generic for non-Apple platform implementations
of methods from EventHandlerGlib into EventHandler. Two
of these also had different Windows implementations, so
to limit behavior change from this, those are currently
overridden for Windows as well as Mac and IOS.
* page/EventHandler.cpp:
(WebCore::EventHandler::passMousePressEventToSubframe):
(WebCore::EventHandler::passMouseReleaseEventToSubframe):
(WebCore::EventHandler::widgetDidHandleWheelEvent):
(WebCore::EventHandler::tabsToAllFormControls const):
(WebCore::EventHandler::passWidgetMouseDownEventToWidget):
(WebCore::EventHandler::passMouseDownEventToWidget):
(WebCore::EventHandler::focusDocumentView):
(WebCore::EventHandler::eventActivatedView const):
(WebCore::EventHandler::passMouseMoveEventToSubframe):
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::passMouseMoveEventToSubframe):
(WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
(WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
(WebCore::EventHandler::tabsToAllFormControls const): Deleted.
(WebCore::EventHandler::focusDocumentView): Deleted.
(WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::accessKeyModifiers): Deleted.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::tabsToAllFormControls const): Deleted.
(WebCore::EventHandler::focusDocumentView): Deleted.
(WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::passMouseDownEventToWidget): Deleted.
(WebCore::EventHandler::eventActivatedView const): Deleted.
(WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted.
(WebCore::EventHandler::passMousePressEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseMoveEventToSubframe): Deleted.
(WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted.
(WebCore::EventHandler::accessKeyModifiers): Deleted.
2018-11-28 Zalan Bujtas <zalan@apple.com>
[LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB.
https://bugs.webkit.org/show_bug.cgi?id=192078
Reviewed by Antti Koivisto.
This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining).
However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead.
* layout/LayoutUnits.h:
(WebCore::Layout::HeightAndMargin::usedMarginValues const):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::stretchHeightToInitialContainingBlock):
2018-11-28 Zalan Bujtas <zalan@apple.com>
[LFC] Add support for quirk container's collapsing top margin in quirks mode.
https://bugs.webkit.org/show_bug.cgi?id=192070
Reviewed by Antti Koivisto.
In quirk mode when the top margin collapsing is computed for a quirk container (body, table cell) and the canditate margin value is
also a quirk value, we just ignore it.
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isQuirkContainer):
(WebCore::Layout::hasMarginTopQuirkValue):
(WebCore::Layout::shouldIgnoreMarginTopInQuirkContext):
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isTableCell const):
2018-11-28 Ali Juma <ajuma@chromium.org>
Intersection Observer: rootMargin: '' gives weird results
https://bugs.webkit.org/show_bug.cgi?id=191975
Reviewed by Simon Fraser.
When converting the rootMargin string into a LengthBox, explicitly construct a Length
of size 0px for each dimension, instead of using Length's default constructor. The
default constructor creates a Length with value Auto, which causes us to incorrectly
apply a non-zero rootMargin.
Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html
* page/IntersectionObserver.cpp:
(WebCore::parseRootMargin):
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[WebRTC][GStreamer] Make sure to have the default microphone on the top of the list
https://bugs.webkit.org/show_bug.cgi?id=192026
Reviewed by Philippe Normand.
Otherwise we might end up picking a useless one in some applications
(not sure what those application do though).
GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::sortDevices):
(WebCore::GStreamerCaptureDeviceManager::addDevice):
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h:
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode
https://bugs.webkit.org/show_bug.cgi?id=192028
Reviewed by Philippe Normand.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::capabilities):
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAudioSource
https://bugs.webkit.org/show_bug.cgi?id=192027
Reviewed by Xabier Rodriguez-Calvar.
Cleaning up a bit the code.
It is a minor refactoring, no new test required.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h:
2018-11-28 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Do not run device monitor for device type we do not handle
https://bugs.webkit.org/show_bug.cgi?id=191904
This is useless work and it throws warning about use GstDeviceMonitor without filters.
Reviewed by Philippe Normand.
* platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
(WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices):
2018-11-27 Rob Buis <rbuis@igalia.com>
Block more ports (427, 548, 6697)
https://bugs.webkit.org/show_bug.cgi?id=186092
Reviewed by Frédéric Wang.
Block port 427, ports 548 and 6697 are aleady blocked and
are tested by the updated request-bad-port.html wpt test.
Behavior matches Firefox and Chrome.
Test: web-platform-tests/fetch/api/request/request-bad-port.html
* platform/URL.cpp:
(WebCore::portAllowed):
2018-11-27 Youenn Fablet <youenn@apple.com>
Log WebRTC stats in inspector console only when setting is verbose
https://bugs.webkit.org/show_bug.cgi?id=192014
Reviewed by Eric Carlson.
Add a WebRTCStats channel that is used by default to output WebRTC stats in console.
When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel,
so that they appear as debug information in Web Inspector.
No change of JS behavior.
Covered by manually testing what is logged in inspector and console.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* platform/Logging.h:
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Fix the mis-spelled "m_clienstWaitingForAsyncDecoding"
https://bugs.webkit.org/show_bug.cgi?id=192060
Reviewed by Wenson Hsieh.
Fix the mis-spelling of "m_clienstWaitingForAsyncDecoding".
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didRemoveClient):
(WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
(WebCore::CachedImage::addClientWaitingForAsyncDecoding):
(WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
(WebCore::CachedImage::allClientsRemoved):
(WebCore::CachedImage::clear):
(WebCore::CachedImage::createImage):
(WebCore::CachedImage::imageFrameAvailable):
* loader/cache/CachedImage.h:
2018-11-27 Mark Lam <mark.lam@apple.com>
ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac.
https://bugs.webkit.org/show_bug.cgi?id=192055
<rdar://problem/46288783>
Reviewed by Saam Barati.
No new tests needed. Removing an invalid configuration that is not used in WebCore.
* Configurations/FeatureDefines.xcconfig:
2018-11-27 Jiewen Tan <jiewen_tan@apple.com>
Remove kCCNotVerified
https://bugs.webkit.org/show_bug.cgi?id=192034
<rdar://problem/46235863>
Reviewed by Alexey Proskuryakov.
No change of behaviours.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
(WebCore::verifyRSASSA_PKCS1_v1_5):
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Avoid triggering compositing updates when only the root layer is composited
https://bugs.webkit.org/show_bug.cgi?id=191813
Reviewed by Zalan Bujtas.
If we know that the only composited layer is the root, we can avoid triggering deep
compositing updates sometimes, for example when layout changes size or position,
or when z-order lists change.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
flag to cut off descendants traversal when possible.
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-27 Eric Carlson <eric.carlson@apple.com>
Refactor duplicate code for calling into media controls
https://bugs.webkit.org/show_bug.cgi?id=192040
<rdar://problem/46278931>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setupAndCallJS):
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::configureTextTrackDisplay):
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
(WebCore::HTMLMediaElement::setControllerJSProperty):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLMediaElement.h:
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Momentum scrolling ends at the wrong place when a scrolling overflow element has a non-zero border
https://bugs.webkit.org/show_bug.cgi?id=191322
Reviewed by Dean Jackson.
The scrolling momentum logic in ScrollController::handleWheelEvent() which computes whether the scroll is pinned
to the end makes use of ScrollableArea::visibleContentRect(). RenderLayer's implementation of this was incorrect when
the layer's element had borders, causing the momentum scroll to stop early.
Fix by using the correct size (visible size, not layer size).
Test: fast/scrolling/momentum-scroll-with-borders.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::visibleContentRectInternal const):
2018-11-27 Simon Fraser <simon.fraser@apple.com>
Composited and tiled layers fail to update on scrolling in WebView
https://bugs.webkit.org/show_bug.cgi?id=191821
rdar://problem/46009272
Reviewed by Zalan Bujtas.
We relied on AppKit calling -[NSView viewWillDraw] on scrolling to trigger compositing
layer flushes which are necessary to update backing store attachment, and tile coverage
for tiled layers. However, we no longer get these reliably in WebView, so explicitly trigger
flushes if necessary from FrameView::scrollOffsetChangedViaPlatformWidgetImpl().
didChangeVisibleRect() is the same code path used by iOS UIWebView for the same purpose.
Tests: compositing/backing/backing-store-attachment-scroll.html
compositing/tiling/tile-coverage-on-scroll.html
* page/FrameView.cpp:
(WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateCoverage):
2018-11-27 Timothy Hatcher <timothy@apple.com>
Web Inspector: Add support for forcing color scheme appearance in DOM tree.
https://bugs.webkit.org/show_bug.cgi?id=191820
rdar://problem/46153172
Reviewed by Devin Rousso.
Test: inspector/css/force-page-appearance.html
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::defaultAppearanceDidChangeImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::defaultAppearanceDidChange):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::enable): Fire defaultAppearanceDidChange() on macOS Majave.
(WebCore::InspectorPageAgent::disable): Call setForcedAppearance() with empty string.
(WebCore::InspectorPageAgent::defaultAppearanceDidChange): Added.
(WebCore::InspectorPageAgent::setForcedAppearance): Added.
* inspector/agents/InspectorPageAgent.h:
* page/Page.cpp:
(WebCore::Page::setUseDarkAppearance): Call InspectorInstrumentation::defaultAppearanceDidChange().
(WebCore::Page::useDarkAppearance const): Return override value if not nullopt.
(WebCore::Page::setUseDarkAppearanceOverride): Added.
* page/Page.h:
(WebCore::Page::defaultUseDarkAppearance const): Added.
2018-11-27 Tim Horton <timothy_horton@apple.com>
Serialize and deserialize editable image strokes
https://bugs.webkit.org/show_bug.cgi?id=192002
<rdar://problem/30900149>
Reviewed by Dean Jackson.
Test: editing/images/paste-editable-image.html
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::didFinishInsertingNode):
(WebCore::HTMLImageElement::removedFromAncestor):
(WebCore::HTMLImageElement::hasEditableImageAttribute const):
(WebCore::HTMLImageElement::updateEditableImage):
Call updateEditableImage() from didFinishInsertingNode instead of insertedIntoAncestor.
This is helpful because it means we get the final, deduplicated attachment identifier
instead of the original one when cloning or pasting.
This also means that isConnected() is now always accurate when updateEditableImage()
is called, so we can remove the argument that allowed us to lie from inside insertedIntoAncestor.
* html/HTMLImageElement.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isEditableImage const):
Make use of hasEditableImage instead of separately checking for the attribute.
2018-11-16 Jiewen Tan <jiewen_tan@apple.com>
Disallow loading webarchives as iframes
https://bugs.webkit.org/show_bug.cgi?id=191728
<rdar://problem/45524528>
Reviewed by Youenn Fablet.
Disallow loading webarchives as iframes. We don't allow loading remote webarchives.
Now, this policy is hardened to disallow loading webarchives as iframes for local
documents as well.
To allow old tests still be able to run, a flag is added to always allow loading local
webarchives in document. The flag can be set via window.internals.
Tests: webarchive/loading/test-loading-archive-subresource.html
webarchive/loading/test-loading-top-archive.html
* dom/Document.h:
(WebCore::Document::setAlwaysAllowLocalWebarchive):
(WebCore::Document::alwaysAllowLocalWebarchive):
* loader/DocumentLoader.cpp:
(WebCore::disallowWebArchive):
(WebCore::DocumentLoader::continueAfterContentPolicy):
(WebCore::isRemoteWebArchive): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::setAlwaysAllowLocalWebarchive const):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-27 Jer Noble <jer.noble@apple.com>
Unregister CDMSessionMediaSourceAVFObjC for error notifications during destruction.
https://bugs.webkit.org/show_bug.cgi?id=191985
<rdar://problem/45972018>
Reviewed by Eric Carlson.
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
(WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC):
2018-11-27 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Use LibWebRTC provided vp8 decoders and encoders
https://bugs.webkit.org/show_bug.cgi?id=191861
The GStreamer implementations are less feature full and less tested, now that Apple
also use the LibWebRTC provided implementations it makes a lot of sense for us to
do the same.
Basically everything related to temporal scalability is not implemented in GStreamer.
We should make sure to use GStreamer elements on low powered platforms and for
accelerated encoders and decoders.
Reviewed by Philippe Normand.
This is mostly refactoring, no new test required.
* platform/graphics/gstreamer/GStreamerCommon.h: Added GstMappedFrame similar to GstMappedBuffer but for video frames.
(WebCore::GstMappedFrame::GstMappedFrame):
(WebCore::GstMappedFrame::get):
(WebCore::GstMappedFrame::ComponentData):
(WebCore::GstMappedFrame::ComponentStride):
(WebCore::GstMappedFrame::info):
(WebCore::GstMappedFrame::width):
(WebCore::GstMappedFrame::height):
(WebCore::GstMappedFrame::format):
(WebCore::GstMappedFrame::~GstMappedFrame):
(WebCore::GstMappedFrame::operator bool const):
* platform/graphics/gstreamer/GUniquePtrGStreamer.h:
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::GStreamerVideoFrameLibWebRTC::ToI420): Implemented support for converting frame formats with the GstVideoConverter API
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GstDecoderFactory):
(WebCore::GStreamerVideoDecoder::HasGstDecoder):
(WebCore::VP8Decoder::Create): Creates a `webrtc::LibvpxVp8Decoder()` if GStreamer decoder would be the LibVPX based one.
(WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_class_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Stop using vp8enc and use LibWebRTC based implementation
(WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Renamed H264Encoder to GStreamerH264Encoder to be more coherent with what is done in LibVPX
(WebCore::GStreamerVP8Encoder::GStreamerVP8Encoder): Renamed VP8Encoder to GStreamerVP8Encoder to be more coherent with what is done in LibVPX
(WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder):
(WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
2018-11-27 Javier Fernandez <jfernandez@igalia.com>
[css-grid] align-self center and position sticky don't work together
https://bugs.webkit.org/show_bug.cgi?id=191963
Reviewed by Manuel Rego Casasnovas.
This is a fix for a regression introduced in r515391, where we landed
the implementation of alignment for positioned objects in a Grid Layout
container.
We assumed that items with non-static positions shouldn't honor the
CSS Box Alignment properties. This is only true for out-of-flow items,
absolute or fixed positioned elements. However, sticky positioned
elements are treated as relative positioned items, but they indeed use
non-static position to define their behavior.
No new tests, this change is covered by current tests and make several cases to pass now.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisPositionForChild const):
(WebCore::RenderGrid::rowAxisPositionForChild const):
2018-11-26 Daniel Bates <dabates@apple.com>
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>
Reviewed by Dean Jackson.
Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.
Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html
fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.
2018-11-26 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238357.
One of the layout tests added with this change is failing on Mojave.
Reverted changeset:
"REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown"
https://bugs.webkit.org/show_bug.cgi?id=191969
https://trac.webkit.org/changeset/238513
2018-11-26 Tim Horton <timothy_horton@apple.com>
Insert <attachment> elements under editable images to make their backing data accessible
https://bugs.webkit.org/show_bug.cgi?id=191844
<rdar://problem/30900149>
Reviewed by Simon Fraser.
Test: editing/images/editable-image-creates-attachment.html
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::removedFromAncestor):
When the x-apple-editable-image attribute changes, or the element is
moved into or out of a document, call updateEditableImage.
(WebCore::HTMLImageElement::editableImageViewID const):
Adopt EditableImageReference.
(WebCore::HTMLImageElement::updateEditableImage):
When the image element moves into a document, the setting is on, and
the appropriate attribute is applied, add an <attachment> into the
shadow DOM, and inform the UI process both of the editable image's
creation and that it should be associated with the new attachment.
Use an EditableImageReference to extend the lifetime of the
corresponding editable image in the UI process, and to communicate
the attachment association.
If the element was cloned from another editable image element, use the
EditableImageReference and attachmentID from the original; the embedded
view will be re-parented under this element's layer, and the attachment
will be cloned (with a new ID) by editing code if the element is parented.
(WebCore::HTMLImageElement::attachmentIdentifier const):
(WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement):
Store the aforementioned bits of information when cloned so that we can
reconstitute the appropriate attachment data and embedded view.
* html/HTMLImageElement.h:
* page/ChromeClient.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/EditableImageReference.cpp: Added.
(WebCore::EditableImageReference::EditableImageReference):
(WebCore::EditableImageReference::~EditableImageReference):
(WebCore::EditableImageReference::associateWithAttachment):
* page/EditableImageReference.h: Added.
(WebCore::EditableImageReference::create):
(WebCore::EditableImageReference::embeddedViewID const):
Add EditableImageReference, which manages the lifetime of the UI-side
EditableImage and helps clients communicate about it. It is refcounted
so that cloned <img> elements can potentially borrow the UI-side state
(in the case where they end up getting parented).
* page/NavigatorBase.cpp:
Fix an unrelated unified build failure that I exposed.
2018-11-26 Jer Noble <jer.noble@apple.com>
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>
Reviewed by Alex Christensen.
Request the correct route policy and context from the VideoFullscreenModel.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
(VideoFullscreenInterfaceAVKit::doSetup):
2018-11-24 Ryosuke Niwa <rniwa@webkit.org>
SVG use element inside a shadow tree cannot reference an element in the same tree
https://bugs.webkit.org/show_bug.cgi?id=174977
<rdar://problem/33665636>
Reviewed by Zalan Bujtas.
Make fragment URL references used by SVGelements within a shadow tree to refer to other elements
in the same shadow tree. To do this, this patch makes targetElementFromIRIString take a TreeScope
instead of a Document, and updates its call sites.
This patch updates the most uses of targetElementFromIRIString except CSS cursor image, altGraph,
and glyphRef since the cursor image isn't really a SVG feature, and there aren't really real world
use cases in which altGraph and glyphRef are used within shadow trees.
Tests: fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html
fast/shadow-dom/svg-animate-href-in-shadow-tree.html
fast/shadow-dom/svg-feimage-href-in-shadow-tree.html
fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html
fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html
fast/shadow-dom/svg-mpath-href-in-shadow-tree.html
fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html
fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html
fast/shadow-dom/svg-text-path-href-in-shadow-tree.html
fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html
fast/shadow-dom/svg-thref-href-in-shadow-tree.html
fast/shadow-dom/svg-use-href-change-in-shadow-tree.html
fast/shadow-dom/svg-use-href-in-shadow-tree.html
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::targetForUseElement const):
* css/CSSCursorImageValue.cpp:
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
(WebCore::SVGFEImageElement::build):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::targetElementFromIRIString):
* svg/SVGURIReference.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateShadowTree):
(WebCore::SVGUseElement::findTarget const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
(WebCore::SVGSMILElement::insertedIntoAncestor):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::FEImage):
(WebCore::FEImage::createWithIRIReference):
(WebCore::FEImage::referencedRenderer const):
* svg/graphics/filters/SVGFEImage.h:
2018-11-26 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238357.
Casued three css tests to fail and crash on ios sim
Reverted changeset:
"Avoid triggering compositing updates when only the root layer
is composited"
https://bugs.webkit.org/show_bug.cgi?id=191813
https://trac.webkit.org/changeset/238357
2018-11-26 Daniel Bates <dabates@apple.com>
Caret disappears at end of password field when caps lock indicator is shown; password field
not scrolled when caps lock indicator is shown
https://bugs.webkit.org/show_bug.cgi?id=191164
<rdar://problem/45738179>
Reviewed by Dean Jackson.
Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on
Mac and iOS, respectively.
If there has not been a previous selection in a focused password field, including a caret
selection made by pressing the arrow keys, then we never scroll the password field to reveal
the current selection when the caps lock indicator is made visible. When the caps lock indicator
is made visible or hidden the size of the inner text renderer changes as it shrinks or expands
to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator,
respectively. We should detect such size changes and schedule an update and reveal of the current
selection after layout.
Test: fast/forms/password-scrolled-after-caps-lock-toggled.html
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current
selection reveal mode for the next update.
* editing/FrameSelection.h:
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that
reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure
that the scheduled selection update scrolls to the reveal the current selection regardless of selection
reveal mode. This is necessary because typing into a password field does not change the current
selection reveal mode.
2018-11-26 Daniel Bates <dabates@apple.com>
Placeholder text is not repainted after caps lock indicator is hidden
https://bugs.webkit.org/show_bug.cgi?id=191968
<rdar://problem/46247234>
Reviewed by Zalan Bujtas.
Fixes an issue where the placeholder text in a password field is not repainted when the
caps lock indicator is hidden.
The placeholder renderer is special. It is an excluded child renderer and does not take
part in normal flow layout. It is also created and destroyed as needed. The caps lock
indicator is also special in that it is implemented as a RenderImage and we do not know
its dimensions before it is loaded and the load happens asynchronously. As a result we
detect when the inner text size changes and mark the placeholder as dirty as a way to
keep the dimensions of the placeholder in sync with the dimensions of the inner text.
Test: fast/repaint/placeholder-after-caps-lock-hidden.html
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout): Mark the placeholder as needing layout
the size of the inner text changes.
2018-11-26 Jeremy Jones <jeremyj@apple.com>
Picture-in-picture window size changes unnecesarily when URL changes.
https://bugs.webkit.org/show_bug.cgi?id=191787
Reviewed by Jer Noble.
When loading a new URL, the video dimensions are temporarily 0,0. Instead of
defaulting back to 4:3 sized pip window temporarily, keep the old dimensions until
there is a new valid size.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(VideoFullscreenInterfaceAVKit::videoDimensionsChanged):
2018-11-26 Andy Estes <aestes@apple.com>
[Cocoa] Make it easier to encode NSObjects
https://bugs.webkit.org/show_bug.cgi?id=191948
Reviewed by Dean Jackson.
* Modules/applepay/Payment.h: Changed the PKPayment * constructor to take a
RetainPtr<PKPayment>&& instead.
* Modules/applepay/PaymentContact.h: Ditto for PKContact.
* Modules/applepay/PaymentMerchantSession.h: Ditto for PKPaymentMerchantSession.
* Modules/applepay/PaymentMethod.h: Ditto for PKPaymentMethod.
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::Payment::Payment): Moved definition out-of-line.
(WebCore::Payment::pkPayment const): Ditto.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::PaymentContact::PaymentContact): Ditto.
(WebCore::PaymentContact::pkContact const): Ditto.
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::PaymentMethod::PaymentMethod): Ditto.
(WebCore::PaymentMethod::pkPaymentMethod const): Ditto.
2018-11-26 Daniel Bates <dabates@apple.com>
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>
Reviewed by Dean Jackson.
Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.
Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html
fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.
2018-11-26 Sam Weinig <sam@webkit.org>
Streamline ListHashSet use in floating object code
https://bugs.webkit.org/show_bug.cgi?id=191957
Reviewed by Alex Christensen.
Simplify use of ListHashSet by using new raw pointer overloads and
making use of reversed order of template arguments in the find() and
contains() overloads that take hash translators.
* rendering/FloatingObjects.cpp:
(WebCore::FloatingObjects::remove):
Use raw pointer overloads of contains and remove. Remove seperate call
to find / check agains end() which is unnecessary as remove() already
does that.
* rendering/FloatingObjects.h:
(WebCore::FloatingObjectHashFunctions::hash):
(WebCore::FloatingObjectHashFunctions::equal):
(WebCore::FloatingObjectHashTranslator::hash):
(WebCore::FloatingObjectHashTranslator::equal):
Add hash()/equal() overloads for the raw pointer cases. As the FIXME
notes, this could be simplified by changing PtrHashBase to use designated
bottleneck functions for hash() and equal().
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::containsFloat const):
(WebCore::RenderBlockFlow::insertFloatingObject):
(WebCore::RenderBlockFlow::removeFloatingObject):
(WebCore::RenderBlockFlow::hasOverhangingFloat):
(WebCore::RenderBlockFlow::addIntrudingFloats):
Use simplified calls.
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::linkToEndLineIfNeeded):
Use simplified calls.
2018-11-26 Jeremy Jones <jeremyj@apple.com>
Use Full Screen consistently in localizable strings.
https://bugs.webkit.org/show_bug.cgi?id=190363
rdar://problem/43882333
Reviewed by Jon Lee.
No new tests because only change is to localizable strings.
Rename "Fullscreen" to "Full Screen" in localizable strings for consistency.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagEnterVideoFullscreen):
(WebCore::contextMenuItemTagExitVideoFullscreen):
(WebCore::localizedMediaControlElementHelpText):
2018-11-26 Brent Fulgham <bfulgham@apple.com>
[Win] Reduce the use of WKSI library calls: CoreAnimation
https://bugs.webkit.org/show_bug.cgi?id=191777
<rdar://problem/46140542>
Reviewed by Zalan Bujtas.
Update the Windows build of WebKit to refer to the SPI headers, rather than WebKitSystemInterface.
Move a small amount of glue code from WKSI to WebCore, and remove any includes or link
directives for WebKitSystemInterface.lib.
No new tests. No change in behavior.
* platform/graphics/BitmapImage.cpp:
* platform/graphics/ca/win/CACFLayerTreeHost.h:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(layerTreeHostForLayer):
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cg/PathCG.cpp:
* platform/graphics/cg/PatternCG.cpp:
* platform/graphics/win/WKCAImageQueue.cpp:
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Use float box's margin box to adjust the line constraints.
https://bugs.webkit.org/show_bug.cgi?id=191961
Reviewed by Antti Koivisto.
Test: fast/inline/inline-content-with-float-and-margin.html
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2018-11-26 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*)
https://bugs.webkit.org/show_bug.cgi?id=150303
Reviewed by Michael Catanzaro.
Ensure gtk has been initialized before trying to get the default display.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
2018-11-26 Javier Fernandez <jfernandez@igalia.com>
[css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks
https://bugs.webkit.org/show_bug.cgi?id=191938
Reviewed by Manuel Rego Casasnovas.
The guttersSize function has a complex logic to compute the gaps in a
specific GridSpan, considering different scenarios of collapsed tracks
for such span.
The first case is avoiding the duplicated gap because of trailing
collapsed tracks.
The second case considered is looking for non-empty tracks before the
GridSpan end, if it points to an empty track, so we must add this gap.
The last case is to consider the gap of non-empty tracks after the
GridSpan end line, if it points to an empty track.
There are several cases that are not considered or incorrectly computed.
This patch addresses those cases; basically, we should only consider gaps
when there are non-empty tracks before and after the collapsed tracks.
Additionally, we should avoid duplicating the gaps size adding both,
before and after non-empty track's gap.
No new tests, this change is covered by current tests and make several cases to pass now.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::guttersSize const):
2018-11-26 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Fix grid container sizing under min-content height
https://bugs.webkit.org/show_bug.cgi?id=191889
Reviewed by Javier Fernandez.
The spec is quite clear
(https://drafts.csswg.org/css-sizing/#valdef-width-min-content):
"min-content
If specified for the inline axis, use the min-content inline size;
otherwise behaves as the propertys initial value."
So if a grid container has "height: min-content" it should behave
the same than with "height: auto".
The patch removes computeIntrinsicLogicalContentHeightUsing() in
RenderGrid as we don't need a custom one anymore.
We can also get rid of m_minContentHeight and m_maxContentHeight
attributes that were only used for this logic.
Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html
fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
* rendering/RenderGrid.h:
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC] Remove PointInContainingBlock and PositionInContainingBlock
https://bugs.webkit.org/show_bug.cgi?id=191954
Reviewed by Antti Koivisto.
Use Point and Position instead. Points and positions are by default in the containing block's coordinate system.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
* layout/LayoutUnits.h:
(WebCore::Layout::Position::operator LayoutUnit const):
(WebCore::Layout::operator<):
(WebCore::Layout::operator==):
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
(WebCore::Layout::FloatAvoider::setHorizontalConstraints):
(WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
(WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::horizontalPositionCandidate):
(WebCore::Layout::FloatBox::verticalPositionCandidate):
(WebCore::Layout::FloatBox::initialVerticalPosition const):
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
(WebCore::Layout::FloatingContext::floatingPosition const):
(WebCore::Layout::FloatingPair::horizontalConstraints const):
(WebCore::Layout::FloatingPair::bottom const):
* layout/floats/FloatingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::FloatItem::bottom const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC] Rename Layout::Position to Layout::Point
https://bugs.webkit.org/show_bug.cgi?id=191950
Reviewed by Antti Koivisto.
It actually represents a point.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
(WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
* layout/FormattingContext.h:
* layout/LayoutUnits.h:
(WebCore::Layout::Point::Point):
(WebCore::Layout::Point::moveBy):
(WebCore::Layout::Position::operator LayoutPoint const): Deleted.
(WebCore::Layout::Position::Position): Deleted.
(WebCore::Layout::Position::moveBy): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
2018-11-25 Zalan Bujtas <zalan@apple.com>
[LFC] Floating code should use typed positions (PositionInContextRoot).
https://bugs.webkit.org/show_bug.cgi?id=191949
Reviewed by Antti Koivisto.
Use PositionInContextRoot instead of LayoutUnit.
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
(WebCore::Layout::FloatingState::bottom const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::leftBottom const):
(WebCore::Layout::FloatingState::rightBottom const):
(WebCore::Layout::FloatingState::bottom const):
2018-11-25 Zalan Bujtas <zalan@apple.com>
Fix build after r238472.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::textWidth const):
2018-11-25 Tim Horton <timothy_horton@apple.com>
Make it possible to insert editable images with a gesture
https://bugs.webkit.org/show_bug.cgi?id=191937
Reviewed by Wenson Hsieh.
Tests:
editing/images/redo-insert-editable-image-maintains-strokes.html,
editing/images/undo-insert-editable-image.html,
editing/images/basic-editable-image-from-execCommand.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/editing/EditorCommand.cpp:
* Source/WebCore/en.lproj/Localizable.strings:
* editing/EditAction.h:
* editing/Editor.cpp:
(WebCore::Editor::insertEditableImage):
* editing/Editor.h:
* editing/InsertEditableImageCommand.cpp: Added.
(WebCore::InsertEditableImageCommand::InsertEditableImageCommand):
(WebCore::InsertEditableImageCommand::doApply):
* editing/InsertEditableImageCommand.h: Added.
(WebCore::InsertEditableImageCommand::create):
* editing/VisibleSelection.cpp:
Add an editor command that inserts an editable image.
It will likely get a bit more complicated, but for now it just inserts
a 100% by 300px editable image.
2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm
https://bugs.webkit.org/show_bug.cgi?id=191945
Reviewed by Anders Carlsson.
Run `update-webkit-localizable-strings`.
* en.lproj/Localizable.strings:
2018-11-24 Sam Weinig <sam@webkit.org>
Remove now unnecessary specialized ListHashSet from InlineItem.h
https://bugs.webkit.org/show_bug.cgi?id=191946
Reviewed by Zalan Bujtas.
Now that ListHashSet supports raw pointer overloads for smart pointers,
we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet
and ListHashSet::find calls.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItemHashFunctions::hash): Deleted.
(WebCore::Layout::InlineItemHashFunctions::equal): Deleted.
(WebCore::Layout::InlineItemHashTranslator::hash): Deleted.
(WebCore::Layout::InlineItemHashTranslator::equal): Deleted.
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::textWidth const):
2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Add WKWebView SPI to trigger and remove data detection
https://bugs.webkit.org/show_bug.cgi?id=191918
<rdar://problem/36185051>
Reviewed by Tim Horton.
Add a helper method on DataDetection to remove all data detected links in the given document. See WebKit changes
for more detail.
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::removeDataDetectedLinksInDocument):
2018-11-24 Andy Estes <aestes@apple.com>
[Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function
https://bugs.webkit.org/show_bug.cgi?id=191899
Reviewed by Dean Jackson.
* editing/cocoa/DataDetection.mm:
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/graphics/cocoa/ColorCocoa.mm:
* platform/ios/PlatformScreenIOS.mm:
2018-11-23 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Enable Web Authentication as an experimental feature for macOS
https://bugs.webkit.org/show_bug.cgi?id=191932
rdar://problem/46225210
Reviewed by Brent Fulgham.
Add myself to the contact of Web Authentication.
* features.json:
2018-11-23 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSerialization
https://bugs.webkit.org/show_bug.cgi?id=191921
Reviewed by Dean Jackson.
The bug was caused by traverseNodesForSerialization not being able to traverse past the end of shadow root
when skipping children of a node for which enterNode returns false because it was using NodeTraversal's
nextSkippingChildren instead of a member function which supports traversing the composed tree.
Fixed the crash by using variant of nextSkippingChildren which knows how to traverse past the last node
in a shadow tree. Also added more assertions to help debug issues like this in the future.
Test: editing/pasteboard/copy-paste-across-shadow-boundaries-5.html
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2018-11-22 Ryosuke Niwa <rniwa@webkit.org>
Updating href on textPath doesn't update its rendering
https://bugs.webkit.org/show_bug.cgi?id=191920
Reviewed by Dean Jackson.
Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged
in addition to updating the pending resources.
Test: svg/text/textpath-reference-update.html
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::svgAttributeChanged):
2018-11-23 Ross Kirsling <ross.kirsling@sony.com>
Introduce user-defined literal for LayoutUnit
https://bugs.webkit.org/show_bug.cgi?id=191915
Reviewed by Dean Jackson.
* platform/LayoutUnit.h:
Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function.
* layout/FormattingContextGeometry.cpp:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
* layout/inlineformatting/InlineLineBreaker.cpp:
* page/FrameView.cpp:
* page/FrameViewLayoutContext.h:
* page/Page.cpp:
* page/SpatialNavigation.h:
* platform/ScrollableArea.cpp:
* rendering/EllipsisBox.cpp:
* rendering/FlexibleBoxAlgorithm.cpp:
* rendering/FloatingObjects.cpp:
* rendering/GridLayoutFunctions.cpp:
* rendering/GridTrackSizingAlgorithm.cpp:
* rendering/InlineFlowBox.cpp:
* rendering/InlineTextBox.cpp:
* rendering/LayoutState.h:
* rendering/LogicalSelectionOffsetCaches.h:
* rendering/RenderBlock.cpp:
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
* rendering/RenderBox.cpp:
* rendering/RenderBoxModelObject.cpp:
* rendering/RenderDeprecatedFlexibleBox.cpp:
* rendering/RenderDeprecatedFlexibleBox.h:
* rendering/RenderElement.cpp:
* rendering/RenderFlexibleBox.cpp:
* rendering/RenderFlexibleBox.h:
* rendering/RenderFragmentContainer.cpp:
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderGrid.cpp:
* rendering/RenderGrid.h:
* rendering/RenderImage.cpp:
* rendering/RenderLayer.cpp:
* rendering/RenderListMarker.cpp:
* rendering/RenderMultiColumnFlow.cpp:
* rendering/RenderMultiColumnSet.cpp:
* rendering/RenderReplaced.cpp:
* rendering/RenderReplaced.h:
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
* rendering/RenderTable.h:
* rendering/RenderTableSection.cpp:
* rendering/RenderTheme.cpp:
* rendering/RenderTreeAsText.cpp:
* rendering/RenderView.cpp:
* rendering/RootInlineBox.h:
* rendering/SimpleLineLayout.cpp:
* rendering/SimpleLineLayoutPagination.cpp:
* rendering/TableLayout.h:
* rendering/line/BreakingContext.h:
* rendering/line/LineLayoutState.h:
* rendering/line/LineWidth.h:
* rendering/mathml/MathOperator.cpp:
* rendering/mathml/MathOperator.h:
* rendering/mathml/RenderMathMLBlock.h:
* rendering/mathml/RenderMathMLFraction.cpp:
* rendering/mathml/RenderMathMLFraction.h:
* rendering/mathml/RenderMathMLMath.cpp:
* rendering/mathml/RenderMathMLMath.h:
* rendering/mathml/RenderMathMLMenclose.h:
* rendering/mathml/RenderMathMLOperator.cpp:
* rendering/mathml/RenderMathMLOperator.h:
* rendering/mathml/RenderMathMLPadded.h:
* rendering/mathml/RenderMathMLRoot.cpp:
* rendering/mathml/RenderMathMLRoot.h:
* rendering/mathml/RenderMathMLRow.h:
* rendering/mathml/RenderMathMLScripts.cpp:
* rendering/mathml/RenderMathMLScripts.h:
* rendering/mathml/RenderMathMLSpace.h:
* rendering/mathml/RenderMathMLToken.cpp:
* rendering/mathml/RenderMathMLToken.h:
* rendering/mathml/RenderMathMLUnderOver.h:
* rendering/shapes/ShapeOutsideInfo.cpp:
* rendering/style/CollapsedBorderValue.h:
Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other
literal conversions that will be needed when making non-int LayoutUnit constructors explicit.
For good measure, also mark all default values for LayoutUnit parameters.
2018-11-23 Jim Mason <jmason@ibinx.com>
[GTK] Scrollbars not following gtk-primary-button-warps-slider setting
https://bugs.webkit.org/show_bug.cgi?id=191067
Updated code per the style guide, removed unreachable break (non-semantic change)
Reviewed by Michael Catanzaro.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com>
Enable drag and drop support for iOSMac
https://bugs.webkit.org/show_bug.cgi?id=191818
<rdar://problem/43907454>
Reviewed by Dean Jackson.
Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This
enables support for dragging links, text selections, and images, though many advanced features (e.g. custom
pasteboard data) will require additional support from the platform.
* Configurations/FeatureDefines.xcconfig:
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::registerItemToPasteboard):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
(-[WebItemProviderPasteboard numberOfFiles]):
Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider`
in iOSMac, since these are currently unimplemented.
2018-11-23 Zalan Butjas <zalan@apple.com>
[LFC][IFC] Add support for variable height runs.
https://bugs.webkit.org/show_bug.cgi?id=191925
Reviewed by Antti Koivisto.
https://www.w3.org/TR/CSS22/visudet.html#inline-box-height
10.8 Line height calculations: the 'line-height' and 'vertical-align' properties
The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements,
and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'.
The line box height is the distance between the uppermost box top and the lowermost box bottom.
The minimum height consists of a minimum height above the baseline and a minimum depth below it,
exactly as if each line box starts with a zero-width inline box with the element's font and line height properties.
We call that imaginary box a "strut." (The name is inspired by TeX.).
Test: fast/inline/inline-content-with-image-simple.html
* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingNonTextRuns):
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::logicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::logicalWidth const):
(WebCore::Layout::InlineRun::logicalHeight const):
(WebCore::Layout::InlineRun::setLogicalWidth):
(WebCore::Layout::InlineRun::width const): Deleted.
(WebCore::Layout::InlineRun::height const): Deleted.
(WebCore::Layout::InlineRun::setWidth): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
2018-11-23 Antti Koivisto <antti@apple.com>
UI side compositing doesn't paint on Mac
https://bugs.webkit.org/show_bug.cgi?id=191908
Reviewed by Tim Horton.
For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::IOSurface):
(WebCore::IOSurface::ensurePlatformContext):
(WebCore::IOSurface::format const):
(WebCore::operator<<):
2018-11-23 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Implement Baseline Alignment for grid items
https://bugs.webkit.org/show_bug.cgi?id=145566
Reviewed by Manuel Rego Casasnovas.
This patch impements the Baseline Self-Alignment feature for grid items according to
the CSS Box Alignment specification [1].
This new layout logic is handled by the Self-Alignment (justify-self and align-self)
and Default-Alignment (justify-items and align-items) CSS properties.
This feature allows users to align the grid items sharing a Baseline Alignment Context,
either row or column contexts, based on their respective baselines.
[1] https://drafts.csswg.org/css-align-3/#baseline-align-self
Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html
fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html
fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html
fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html
fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html
fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html
* Sources.txt:
* rendering/GridBaselineAlignment.cpp: Added.
(WebCore::GridBaselineAlignment::marginOverForChild const):
(WebCore::GridBaselineAlignment::marginUnderForChild const):
(WebCore::GridBaselineAlignment::logicalAscentForChild const):
(WebCore::GridBaselineAlignment::ascentForChild const):
(WebCore::GridBaselineAlignment::descentForChild const):
(WebCore::GridBaselineAlignment::isDescentBaselineForChild const):
(WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const):
(WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const):
(WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const):
(WebCore::GridBaselineAlignment::baselineGroupForChild const):
(WebCore::GridBaselineAlignment::updateBaselineAlignmentContext):
(WebCore::GridBaselineAlignment::baselineOffsetForChild const):
(WebCore::GridBaselineAlignment::clear):
(WebCore::BaselineGroup::BaselineGroup):
(WebCore::BaselineGroup::update):
(WebCore::BaselineGroup::isOppositeBlockFlow const):
(WebCore::BaselineGroup::isOrthogonalBlockFlow const):
(WebCore::BaselineGroup::isCompatible const):
(WebCore::BaselineContext::BaselineContext):
(WebCore::BaselineContext::sharedGroup const):
(WebCore::BaselineContext::updateSharedGroup):
(WebCore::BaselineContext::findCompatibleSharedGroup):
* rendering/GridBaselineAlignment.h: Added.
(WebCore::BaselineGroup::maxAscent const):
(WebCore::BaselineGroup::maxDescent const):
(WebCore::BaselineGroup::size const):
(WebCore::isBaselinePosition):
(WebCore::GridBaselineAlignment::setBlockFlow):
* rendering/GridLayoutFunctions.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::gridAxisForDirection):
(WebCore::gridDirectionForAxis):
(WebCore::GridTrackSizingAlgorithm::availableSpace const):
(WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const):
(WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const):
(WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext):
(WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const):
(WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem):
(WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache):
(WebCore::GridTrackSizingAlgorithm::setup):
(WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext):
* rendering/GridTrackSizingAlgorithm.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::synthesizedBaselineFromMarginBox):
(WebCore::RenderGrid::isBaselineAlignmentForChild const):
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::firstLineBaseline const):
(WebCore::RenderGrid::inlineBlockBaseline const):
(WebCore::RenderGrid::columnAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::rowAxisBaselineOffsetForChild const):
(WebCore::RenderGrid::columnAxisOffsetForChild const):
(WebCore::RenderGrid::rowAxisOffsetForChild const):
* rendering/RenderGrid.h:
2018-11-22 Wenson Hsieh <wenson_hsieh@apple.com>
Address post-review feedback after r238438
https://bugs.webkit.org/show_bug.cgi?id=191913
Reviewed by Ryosuke Niwa.
Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and
`Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following:
FrameSelection::ShouldCloseTyping { No, Yes }
Editor::SelectReplacement { No, Yes }
Editor::SmartReplace { No, Yes }
Editor::MatchStyle { No, Yes }
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectText):
* editing/Editor.cpp:
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::replaceSelectionWithText):
(WebCore::Editor::setComposition):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::transpose):
(WebCore::Editor::insertAttachment):
At various call sites, replace boolean arguments with named enums.
* editing/Editor.h:
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity):
(WebCore::executeDeleteToMark):
(WebCore::executeSelectToMark):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectedRange):
* editing/FrameSelection.h:
* page/Page.cpp:
(WebCore::replaceRanges):
Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s.
(WebCore::Page::replaceRangesWithText):
(WebCore::Page::replaceSelectionWithText):
* page/Page.h:
2018-11-21 Ryosuke Niwa <rniwa@webkit.org>
Modernize SVGURIReference::targetElementFromIRIString
https://bugs.webkit.org/show_bug.cgi?id=191898
Reviewed by Daniel Bates.
Made targetElementFromIRIString return an element and the fragment identifier,
and merged urlFromIRIStringWithFragmentIdentifier into it.
Also replaced the code computing the full URL using the base URL after removing
the fragment identifier and rejoining it later with a single call to completeURL.
No new tests since there should be no observable behavior change.
* accessibility/AccessibilitySVGElement.cpp:
(WebCore::AccessibilitySVGElement::targetForUseElement const):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateCursorElement):
* rendering/svg/RenderSVGTextPath.cpp:
(WebCore::RenderSVGTextPath::layoutPath const):
* svg/SVGAltGlyphElement.cpp:
(WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::buildPendingResource):
* svg/SVGGlyphRefElement.cpp:
(WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
* svg/SVGLinearGradientElement.cpp:
(WebCore::SVGLinearGradientElement::collectGradientAttributes):
* svg/SVGMPathElement.cpp:
(WebCore::SVGMPathElement::buildPendingResource):
(WebCore::SVGMPathElement::pathElement):
* svg/SVGRadialGradientElement.cpp:
(WebCore::SVGRadialGradientElement::collectGradientAttributes):
* svg/SVGTRefElement.cpp:
(WebCore::SVGTRefElement::detachTarget):
(WebCore::SVGTRefElement::buildPendingResource):
* svg/SVGTextPathElement.cpp:
(WebCore::SVGTextPathElement::buildPendingResource):
* svg/SVGURIReference.cpp:
(WebCore::SVGURIReference::targetElementFromIRIString):
(WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted.
* svg/SVGURIReference.h:
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::findTarget const):
* svg/animation/SVGSMILElement.cpp:
(WebCore::SVGSMILElement::buildPendingResource):
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::referencedRenderer const):
2018-11-22 Dean Jackson <dino@apple.com>
Implement WebGPUQueue and device.getQueue()
https://bugs.webkit.org/show_bug.cgi?id=191911
<rdar://problem/46214871>
Reviewed by Antoine Quint.
Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue
instance if necessary. Also link WebGPUQueue to the existing
GPUQueue object, and expose the label IDL property.
This patch is based on some work from Justin Fan.
Test: webgpu/queue-creation.html
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
New files.
* Modules/webgpu/WebGPUCommandBuffer.h:
(WebCore::WebGPUCommandBuffer::commandBuffer const):
Expose a GPUCommandBuffer getter, used when submitting (even though
the actual GPU submission isn't implemented yet).
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::getQueue):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
Implement getQueue().
* Modules/webgpu/WebGPUQueue.cpp:
(WebCore::WebGPUQueue::create):
(WebCore::WebGPUQueue::WebGPUQueue):
(WebCore::WebGPUQueue::submit):
* Modules/webgpu/WebGPUQueue.h:
(WebCore::WebGPUQueue::label const):
(WebCore::WebGPUQueue::setLabel):
* Modules/webgpu/WebGPUQueue.idl:
New class. Mostly sends stuff onto GPUQueue.
* bindings/js/WebCoreBuiltinNames.h:
Add WebGPUQueue.
* platform/graphics/gpu/GPUQueue.h:
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm:
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::submit):
(WebCore::GPUQueue::label const):
(WebCore::GPUQueue::setLabel const):
"label" getter/setter that uses
the underlying MTLCommandQueue label property, but prefixes
it with a WebKit identifier, so it can be correctly
identified in system crash logs as coming from WebGPU.
2018-11-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls.
https://bugs.webkit.org/show_bug.cgi?id=191903
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Offset formatting context root runs with horizontal margins.
https://bugs.webkit.org/show_bug.cgi?id=191900
Reviewed by Antti Koivisto.
Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins.
(The test case has padding and border as well, but they are _inside_ the formatting context.)
Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-22 Simon Fraser <simon.fraser@apple.com>
Extremely small monospace text size when SVG is included as an img
https://bugs.webkit.org/show_bug.cgi?id=191834
Reviewed by Myles C. Maxfield.
Give defaultFixedFontSize a reasonable default value in Settings, so that clients
who omit to set it (like SVGImages) don't get broken rendering.
Test: svg/text/monospace-text-size-in-img.html
* page/Settings.yaml:
2018-11-22 Javier Fernandez <jfernandez@igalia.com>
Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline
https://bugs.webkit.org/show_bug.cgi?id=191881
Reviewed by Manuel Rego Casasnovas.
We should use the font's descent value when wriring-mode flips line flow (vertical-lr).
This change also fixes bug 170175, since Flexbox use the same code to determine the first
line baseline of a flex item.
Test: fast/writing-mode/vertical-align-table-baseline-latin.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
2018-11-21 Ryosuke Niwa <rniwa@webkit.org>
Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener
https://bugs.webkit.org/show_bug.cgi?id=179990
Reviewed by Tim Horton.
The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange
to set and restore the selection putting the focus on the newly mouse-down'ed input element
and restoring the focus back to the input element which originally had the focus immediately.
Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here.
Also made TemporarySelectionOption an enum class.
Unfortunately, no new tests since force click testing is broken :( See <rdar://problem/31301721>.
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding
FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set.
* editing/Editor.h:
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus.
2018-11-21 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WebKit2] Add support for replacing find-in-page text matches
https://bugs.webkit.org/show_bug.cgi?id=191786
<rdar://problem/45813871>
Reviewed by Ryosuke Niwa.
Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a
new API test.
Tests: editing/find/find-and-replace-adjacent-words.html
editing/find/find-and-replace-at-editing-boundary.html
editing/find/find-and-replace-basic.html
editing/find/find-and-replace-in-subframes.html
editing/find/find-and-replace-no-matches.html
editing/find/find-and-replace-noneditable-matches.html
editing/find/find-and-replace-replacement-text-input-events.html
API test: WebKit.FindAndReplace
* page/Page.cpp:
(WebCore::replaceRanges):
(WebCore::Page::replaceRangesWithText):
Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map
each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable
root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the
map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain
that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from
clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement
ranges when performing each replacement.
Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same
frame, we compare their position in the document, and for nodes in different frames, we instead compare their
frames in frame tree traversal order.
We map Ranges to editing offsets and back when performing text replacement because each text replacement may
split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier
attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for
each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing
the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for
replacement.
(WebCore::Page::replaceSelectionWithText):
Add a helper method on Page to replace the current selection with some text. This simply calls out to
`Editor::replaceSelectionWithText`.
* page/Page.h:
2018-11-21 Andy Estes <aestes@apple.com>
[Cocoa] Create a soft-linking file for PassKit
https://bugs.webkit.org/show_bug.cgi?id=191875
<rdar://problem/46203215>
Reviewed by Myles Maxfield.
* Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
* Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto.
* SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm.
* WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target.
* rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead.
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC] LayoutState should always be initialized with the initial containing block.
https://bugs.webkit.org/show_bug.cgi?id=191896
Reviewed by Antti Koivisto.
There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB).
The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts
first need to be laid out (partially at least e.g margin) in their parent formatting context.
Having a non-null parent formatting context as root could lead to undefined behaviour.
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::initializeRoot): Deleted.
* layout/LayoutFormattingState.h:
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Horizontal margins should be considered as non-breakable space
https://bugs.webkit.org/show_bug.cgi?id=191894
Reviewed by Antti Koivisto.
Like padding and border, horizontal margins also force run breaks and offset them.
Test: fast/inline/inline-content-with-margin-left-right.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-20 Ryosuke Niwa <rniwa@webkit.org>
Mutation observers doesn't get notified of character data mutation made by the parser
https://bugs.webkit.org/show_bug.cgi?id=191874
Reviewed by Antti Koivisto.
Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver.
Test: fast/dom/MutationObserver/observe-parser-character-data-change.html
* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
2018-11-21 Claudio Saavedra <csaavedra@igalia.com>
[SOUP] Follow-up robustness improvements to the certificate decoder
https://bugs.webkit.org/show_bug.cgi?id=191892
Reviewed by Michael Catanzaro.
If at any point the certificate fails to be constructed from
the DER data, bail out. Likewise, if the certificate returned
is NULL, return false from the decoder to notify the failure
to decode it.
* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::certificateFromCertificatesDataList):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Border should be considered as non-breakable space
https://bugs.webkit.org/show_bug.cgi?id=191891
Reviewed by Antti Koivisto.
Like padding, border also forces run breaks and offsets them.
Test: fast/inline/inline-content-with-border-left-right.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
2018-11-21 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently
https://bugs.webkit.org/show_bug.cgi?id=191890
Rearrange the comment numbers to match the logic below.
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2018-11-20 Dean Jackson <dino@apple.com>
Move WebGPU platform code to platform/graphics/gpu
https://bugs.webkit.org/show_bug.cgi?id=191867
<rdar://problem/46190993>
Reviewed by Antoine Quint.
The underlying implementation of WebGPU doesn't need to live in
Modules, since it technically could be used by other parts of the system. It
makes more sense for it to be in platform/graphics/gpu.
Move...
- Modules/webgpu/GPU* -> platform/graphics/gpu
- Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa
- platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/
- platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h.
* platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp.
(WebCore::GPUDevice::createShaderModule const):
(WebCore::GPUDevice::createRenderPipeline const):
(WebCore::GPUDevice::createCommandBuffer):
(WebCore::GPUDevice::getQueue):
* platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h.
(WebCore::GPUDevice::platformDevice const):
* platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h.
* platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h.
* platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h.
(WebCore::GPUQueue::platformQueue const):
* platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h.
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h.
* platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h.
(WebCore::GPUShaderModule::platformShaderModule const):
* platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h.
* platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h.
(WebCore::GPUSwapChain::platformLayer const):
* platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h.
* platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h.
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm.
(WebCore::GPUCommandBuffer::create):
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
* platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm.
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::GPUDevice):
* platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm.
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::GPUQueue):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm.
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline):
* platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm.
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
* platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm.
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::setDevice):
(WebCore::platformTextureFormatForGPUTextureFormat):
(WebCore::GPUSwapChain::setFormat):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::getNextTexture):
(WebCore::GPUSwapChain::present):
* platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm.
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::createDefaultTextureView):
* platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp.
(WebCore::GPULegacyBuffer::~GPULegacyBuffer):
(WebCore::GPULegacyBuffer::length const):
* platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h.
(WebCore::GPULegacyBuffer::contents const):
(WebCore::GPULegacyBuffer::metal const):
* platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp.
(WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer):
* platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h.
(WebCore::GPULegacyCommandBuffer::metal const):
* platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp.
(WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue):
* platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h.
(WebCore::GPULegacyCommandQueue::metal const):
* platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp.
(WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder):
* platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h.
* platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp.
(WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState):
* platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h.
(WebCore::GPULegacyComputePipelineState::metal const):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp.
(WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h.
(WebCore::GPULegacyDepthStencilDescriptor::metal const):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp.
(WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState):
* platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h.
(WebCore::GPULegacyDepthStencilState::metal const):
* platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp.
(WebCore::GPULegacyDevice::~GPULegacyDevice):
* platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h.
(WebCore::GPULegacyDevice::layer const):
(WebCore::GPULegacyDevice::metal const):
(WebCore::GPULegacyDevice::markLayerComposited const):
* platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp.
(WebCore::GPULegacyDrawable::~GPULegacyDrawable):
* platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h.
* platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h.
* platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp.
(WebCore::GPULegacyFunction::~GPULegacyFunction):
* platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h.
(WebCore::GPULegacyFunction::metal const):
* platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp.
(WebCore::GPULegacyLibrary::~GPULegacyLibrary):
* platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h.
(WebCore::GPULegacyLibrary::metal const):
* platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp.
(WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder):
* platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp.
(WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp.
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp.
(WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor):
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h.
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp.
(WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState):
* platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h.
* platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h.
* platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp.
(WebCore::GPULegacyTexture::~GPULegacyTexture):
* platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h.
* platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp.
(WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor):
* platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h.
* platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm.
(WebCore::GPULegacyBuffer::GPULegacyBuffer):
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm.
(WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer):
(WebCore::GPULegacyCommandBuffer::presentDrawable const):
(WebCore::GPULegacyCommandBuffer::commit const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm.
(WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue):
(WebCore::GPULegacyCommandQueue::label const):
(WebCore::GPULegacyCommandQueue::setLabel const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm.
(WebCore::MTLSizeMake):
(WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder):
(WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const):
(WebCore::GPULegacyComputeCommandEncoder::setBuffer const):
(WebCore::GPULegacyComputeCommandEncoder::dispatch const):
(WebCore::GPULegacyComputeCommandEncoder::endEncoding const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm.
(WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm.
(WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor):
(WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const):
(WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const):
(WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const):
(WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm.
(WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState):
(WebCore::GPULegacyDepthStencilState::label const):
(WebCore::GPULegacyDepthStencilState::setLabel const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm.
(WebCore::GPULegacyDevice::GPULegacyDevice):
(WebCore::GPULegacyDevice::disconnect):
(WebCore::GPULegacyDevice::reshape const):
(WebCore::GPULegacyDevice::platformLayer const):
(WebCore::GPULegacyDevice::operator! const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm.
(WebCore::GPULegacyDrawable::GPULegacyDrawable):
(WebCore::GPULegacyDrawable::release):
(WebCore::GPULegacyDrawable::metal const):
(WebCore::GPULegacyDrawable::texture const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm.
(WebCore::GPULegacyFunction::GPULegacyFunction):
(WebCore::GPULegacyFunction::name const):
(WebCore::GPULegacyFunction::operator! const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm.
(WebCore::GPULegacyLibrary::GPULegacyLibrary):
(WebCore::GPULegacyLibrary::label const):
(WebCore::GPULegacyLibrary::setLabel const):
(WebCore::GPULegacyLibrary::functionNames const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm.
(WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder):
(WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const):
(WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const):
(WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const):
(WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const):
(WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const):
(WebCore::GPULegacyRenderCommandEncoder::endEncoding const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const):
(WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor):
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const):
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const):
(WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor):
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const):
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const):
(WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm.
(WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor):
(WebCore::GPULegacyRenderPassDescriptor::colorAttachments const):
(WebCore::GPULegacyRenderPassDescriptor::depthAttachment const):
(WebCore::GPULegacyRenderPassDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm.
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor):
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const):
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const):
(WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm.
(WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor):
(WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const):
(WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const):
(WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const):
(WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const):
(WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const):
(WebCore::GPULegacyRenderPipelineDescriptor::reset const):
(WebCore::GPULegacyRenderPipelineDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm.
(WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState):
(WebCore::GPULegacyRenderPipelineState::label const):
(WebCore::GPULegacyRenderPipelineState::setLabel const):
(WebCore::GPULegacyRenderPipelineState::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm.
(WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor):
(WebCore::GPULegacyTextureDescriptor::width const):
(WebCore::GPULegacyTextureDescriptor::setWidth const):
(WebCore::GPULegacyTextureDescriptor::height const):
(WebCore::GPULegacyTextureDescriptor::setHeight const):
(WebCore::GPULegacyTextureDescriptor::sampleCount const):
(WebCore::GPULegacyTextureDescriptor::setSampleCount const):
(WebCore::GPULegacyTextureDescriptor::textureType const):
(WebCore::GPULegacyTextureDescriptor::setTextureType const):
(WebCore::GPULegacyTextureDescriptor::storageMode const):
(WebCore::GPULegacyTextureDescriptor::setStorageMode const):
(WebCore::GPULegacyTextureDescriptor::usage const):
(WebCore::GPULegacyTextureDescriptor::setUsage const):
(WebCore::GPULegacyTextureDescriptor::metal const):
* platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm.
(WebCore::GPULegacyTexture::GPULegacyTexture):
(WebCore::GPULegacyTexture::width const):
(WebCore::GPULegacyTexture::height const):
(WebCore::GPULegacyTexture::metal const):
2018-11-21 Adrian Perez de Castro <aperez@igalia.com>
[SOUP] Certificate decoder always returns GByteArray with zero size
https://bugs.webkit.org/show_bug.cgi?id=191888
Reviewed by Žan Doberšek.
No new tests needed.
* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing
call to g_byte_array_set_size() to make sure byteArray->len has the
correct value.
2018-11-21 Zalan Butjas <zalan@apple.com>
[LFC][IFC] Take nonBreakableStart/End into use.
https://bugs.webkit.org/show_bug.cgi?id=191873
Reviewed by Antti Koivisto.
Offset the final inline runs with the nonBreakableStart/End values.
(This patch also fixes relative positioned run verification.)
Test: fast/inline/inline-content-with-padding-left-right.html
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2018-11-21 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r237845): [cairo] Hyperlink underscore layout issue
https://bugs.webkit.org/show_bug.cgi?id=191630
Reviewed by Michael Catanzaro.
Only flip Y in GlyphToPathTranslator for ports using CG.
* platform/graphics/FontCascade.cpp:
(WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
2018-11-21 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Refactor AppendPipeline deinitialization
https://bugs.webkit.org/show_bug.cgi?id=191759
Reviewed by Xabier Rodriguez-Calvar.
AppendPipeline currently has a method, clearPlayerPrivate(), that the
client code uses to deinitialize most of the AppendPipeline... just
before actually destructing it in the next line of code.
Since at that point there should not be alive RefPtr's pointing to the
AppendPipeline there is no need for this kind of pre-deinitialization
in this usage pattern. Instead, we can just rely on C++ destructors,
cleaning the code a bit and removing the potential for the question
"what if `clearPlayerPrivate() has been called before?`": it has not.
Assertions have been added to ensure that there is only one alive
RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate
destruction.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::deinitialize):
(WebCore::AppendPipeline::clearPlayerPrivate): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE):
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource):
2018-11-20 Dean Jackson <dino@apple.com>
Removing using namespace WebCore from WebLayer
https://bugs.webkit.org/show_bug.cgi?id=191870
<rdar://problem/46192206>
Rubber-stamped by Sam Weinig.
Remove "using namespace WebCore" from WebLayer.mm
because it will cause type clashes in unified source
builds.
* platform/graphics/mac/WebLayer.mm:
(-[WebLayer drawInContext:]):
(-[WebSimpleLayer setNeedsDisplay]):
(-[WebSimpleLayer setNeedsDisplayInRect:]):
(-[WebSimpleLayer display]):
(-[WebSimpleLayer drawInContext:]):
2018-11-20 Ryosuke Niwa <rniwa@webkit.org>
Input element gains focus when a selectstart event listener on document prevents the default action
https://bugs.webkit.org/show_bug.cgi?id=191714
<rdar://problem/46174389>
Reviewed by Antti Koivisto.
The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started
when preventDefault had been called in the previous firings of selectstart event. Because input element
has its own editable element and fires selectstart on the input element itself, which won't be prevented
by selectstart on docuemnt, this allowed the selection to be set inside the input element even though
the mouse cursor was simply passing over the input element after the drag had already started.
Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing
of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome
and Firefox.
Test: fast/events/selectstart-prevent-default-should-not-focus-input.html
* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart):
(WebCore::EventHandler::updateSelectionForMouseDrag):
2018-11-20 Christopher Reid <chris.reid@sony.com>
Remove the need for LocalizedStringsWPE.cpp
https://bugs.webkit.org/show_bug.cgi?id=191854
Reviewed by Michael Catanzaro.
No change in behavior.
Consolidate "Search the Web" as the default search context menu text on non-COCOA ports.
GTK, WPE, and non-CF WIN all had the same default localizedString function
of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation
for all ports not using CF.
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
* platform/gtk/LocalizedStringsGtk.cpp:
* platform/win/LocalizedStringsWin.cpp:
* platform/wpe/LocalizedStringsWPE.cpp: Removed.
2018-11-20 Zan Dobersek <zdobersek@igalia.com>
Segfaults on https://terminalizer.com/
https://bugs.webkit.org/show_bug.cgi?id=191805
Reviewed by Michael Catanzaro.
In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode
codepoints and their corresponding glyph indices should allow zero
values as valid keys since zero is a valid Unicode codepoint.
This change enables properly caching zero codepoints, avoiding
repetitive additions to the HashMap cache that end up in a crash.
* platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated
GlyphCache type alias to the public section of HarfBuzzFace class
declaration, making it reusable in the helper HarfBuzzFontData struct.
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2018-11-20 Antti Koivisto <antti@apple.com>
Update hover state in composed tree
https://bugs.webkit.org/show_bug.cgi?id=191860
Reviewed by Zalan Bujtas.
The code was already mostly switched over from render tree to composed tree.
This patch replaces the remaining common ancestor search code with a DOM based equivalent.
* dom/Document.cpp:
(WebCore::findNearestCommonComposedAncestor):
(WebCore::Document::updateHoverActiveState):
(WebCore::nearestCommonHoverAncestor): Deleted.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::hoverAncestor const): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::hoverAncestor const): Deleted.
No longer needed.
* rendering/RenderElement.h:
2018-11-20 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Measure run with non-breakable start/end.
https://bugs.webkit.org/show_bug.cgi?id=191850
Reviewed by Antti Koivisto.
Line breaking needs to know the complete width of the run including padding etc.
* layout/Verification.cpp:
(WebCore::Layout::collectFlowBoxSubtree):
(WebCore::Layout::collectInlineBoxes):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::runWidth):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::runWidth const):
(WebCore::Layout::InlineLineBreaker::textWidth const):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/text/TextUtil.cpp:
(WebCore::Layout::TextUtil::hyphenPositionBefore):
(WebCore::Layout::TextUtil::width):
(WebCore::Layout::TextUtil::fixedPitchWidth):
(WebCore::Layout::TextUtil::TextUtil): Deleted.
(WebCore::Layout::TextUtil::width const): Deleted.
(WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted.
(WebCore::Layout::TextUtil::textWidth const): Deleted.
(WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted.
* layout/inlineformatting/text/TextUtil.h:
2018-11-20 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line.
https://bugs.webkit.org/show_bug.cgi?id=191845
Reviewed by Antti Koivisto.
Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing.
(In the most common cases, this is only one extra vector::append() call.)
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::runs):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
(WebCore::Layout::InlineFormattingContext::Geometry::alignRuns):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::Line): Deleted.
2018-11-20 Zalan Butjas <zalan@apple.com>
[LFC][IFC] Introduce InlineItem::nonBreakableStart/End
https://bugs.webkit.org/show_bug.cgi?id=191839
Reviewed by Antti Koivisto.
Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box)
<span style="padding: 5px"><span>nested content with padding parent</span</span>
<nested content with padding parent> <- inline run has 5px non-breakable start/end.
<span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span> 3</span>
<1> <- inline run has 5px non-breakable start and 11px non-breakable end.
<2> <- inline run has 0px non-breakable start and 5px non-breakable end.
<3> <- no non-breakable values.
This is what the runs look like (input to line breaking)
< 1 2 >
< > (whitespace)
<3>
The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity.
With the given runs the first position where we can break the line is at the whitespace.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::nonBreakableStart const):
(WebCore::Layout::InlineItem::nonBreakableEnd const):
(WebCore::Layout::InlineItem::addNonBreakableStart):
(WebCore::Layout::InlineItem::addNonBreakableEnd):
2018-11-20 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem
https://bugs.webkit.org/show_bug.cgi?id=191838
Reviewed by Antti Koivisto.
This is in preparation for adding more context to InlineItem. In addition to
detaching rules it will also hold non-breakable start/end information.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
(WebCore::Layout::InlineFormattingState::detachingRules const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted.
* layout/inlineformatting/InlineItem.h:
(WebCore::Layout::InlineItem::addDetachingRule):
(WebCore::Layout::InlineItem::detachingRules const):
2018-11-20 Zalan Bujjtas <zalan@apple.com>
[LFC][IFC] InlineRunProvider::append() should just take const InlineItem&.
https://bugs.webkit.org/show_bug.cgi?id=191837
Reviewed by Antti Koivisto.
This allows us to remove the InlineFormattingState dependency as well.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::InlineRunProvider):
(WebCore::Layout::InlineRunProvider::append):
* layout/inlineformatting/InlineRunProvider.h:
2018-11-20 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer
https://bugs.webkit.org/show_bug.cgi?id=191586
Reviewed by Xabier Rodriguez-Calvar.
This is minor changes that do not require tests.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::commitLoad):
(WebCore::MediaPlayerPrivateGStreamer::readyTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::pause):
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const):
(WebCore::MediaPlayerPrivateGStreamer::seek):
(WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
(WebCore::MediaPlayerPrivateGStreamer::paused const):
(WebCore::MediaPlayerPrivateGStreamer::enableTrack):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats):
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
(WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const):
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const):
(WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
(WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback):
(WebCore::MediaPlayerPrivateGStreamer::sourceSetup):
(WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::didEnd):
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2018-11-20 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Consider scrollbars in populateGridPositionsForDirection()
https://bugs.webkit.org/show_bug.cgi?id=191656
Reviewed by Javier Fernandez.
We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
The patch modifies the method so it takes into account scrollbar size
in order to compute the position of the columns/rows depending on the direction and the writing mode.
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):
2018-11-19 Ryosuke Niwa <rniwa@webkit.org>
Click on node assigned to slot in button's shadow cause loss of button focus
https://bugs.webkit.org/show_bug.cgi?id=191694
<rdar://problem/46107920>
Reviewed by Wenson Hsieh.
Fixed the bug by traversing the parent in the composed tree when looking for an element to focus.
Test: fast/shadow-dom/focus-slot-parent.html
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer.
2018-11-19 Fujii Hironori <Hironori.Fujii@sony.com>
REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>'
https://bugs.webkit.org/show_bug.cgi?id=191849
Unreviewed build fix for clang-cl builds.
No new tests because there's no behaviour change.
* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
2018-11-19 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API for CertificateInfo.
https://bugs.webkit.org/show_bug.cgi?id=191647
Reviewed by Alex Christensen.
Minor changes for WebKit API.
Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp
* platform/network/curl/CertificateInfo.h:
* platform/network/curl/CertificateInfoCurl.cpp:
(WebCore::CertificateInfo::CertificateInfo):
(WebCore::CertificateInfo::makeCertificate):
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::BIOHolder::asCertificate):
2018-11-19 Justin Fan <justin_fan@apple.com>
[WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades
https://bugs.webkit.org/show_bug.cgi?id=191794
Reviewed by Dean Jackson.
Test: webgpu/textures-textureviews.html
Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext
to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to
configure the context with a chosen texture format.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set.
* Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture.
* Modules/webgpu/GPUTextureFormatEnum.h: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast.
* Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it.
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer.
(WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture.
* Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture().
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/WebGPUTexture.cpp: Added.
(WebCore::WebGPUTexture::create):
(WebCore::WebGPUTexture::WebGPUTexture):
(WebCore::WebGPUTexture::createDefaultTextureView):
* Modules/webgpu/WebGPUTexture.h: Added.
* Modules/webgpu/WebGPUTexture.idl: Added.
* Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum.
* Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU.
* Modules/webgpu/WebGPUTextureView.cpp: Added.
(WebCore::WebGPUTextureView::create):
(WebCore::WebGPUTextureView::WebGPUTextureView):
* Modules/webgpu/WebGPUTextureView.h: Added.
* Modules/webgpu/WebGPUTextureView.idl: Added.
* Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure().
(WebCore::GPUSwapChain::getNextTexture):
* Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added.
(WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat.
* Modules/webgpu/cocoa/GPUTextureMetal.mm: Added.
(WebCore::GPUTexture::create):
(WebCore::GPUTexture::GPUTexture):
(WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-11-19 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: "Reload Web Inspector" button no longer partially works
https://bugs.webkit.org/show_bug.cgi?id=191773
<rdar://problem/46139932>
Reviewed by Devin Rousso.
* inspector/InspectorFrontendClient.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::reopen):
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.idl:
Provide a host call to reopen an inspector window to reload it.
* testing/Internals.cpp:
Stub implementation, this is not used in tests.
2018-11-19 Rob Buis <rbuis@igalia.com>
Setting document.title should have no effect for non SVG/HTML documents
https://bugs.webkit.org/show_bug.cgi?id=191643
Reviewed by Chris Dumez.
Setting document.title should have no effect for non SVG/HTML documents,
see https://html.spec.whatwg.org/multipage/dom.html#document.title.
Behavior matches Firefox and Chrome.
Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html
* dom/Document.cpp:
(WebCore::Document::setTitle):
2018-11-19 Wenson Hsieh <wenson_hsieh@apple.com>
Dragging image with a border-image larger than the image element crashes
https://bugs.webkit.org/show_bug.cgi?id=191817
<rdar://problem/46159222>
Reviewed by Ryosuke Niwa.
When dragging an image element, if the image element has:
(1) box-sizing: border-box;
(2) a border-image
(3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is
at least as large as the width of the element
...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element
since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent
codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an
icon representation for the drag image.
Test: fast/events/drag-image-with-border-image.html
* page/DragController.cpp:
(WebCore::DragController::doImageDrag):
2018-11-18 Zan Dobersek <zdobersek@igalia.com>
HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap
https://bugs.webkit.org/show_bug.cgi?id=191825
Reviewed by Michael Catanzaro.
The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry
objects is used to map given Unicode codepoints to corresponding
glyph indices (which occurs in the harfBuzzGetGlyph() function that's
invoked by HarfBuzz).
The 16-bit unsigned integer as the map's value type is not enough here
when the glyph index mapping is done through Freetype -- its API returns
32-bit glyph indices, and Cairo assigns this value to the 64-bit
unsigned index variable in the cairo_glyph_t struct. The value type is
thus bumped to 32 bits to match the unsigned type size of the index's
origin.
* platform/graphics/harfbuzz/HarfBuzzFace.h:
* platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp:
2018-11-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes
https://bugs.webkit.org/show_bug.cgi?id=191819
Reviewed by Dan Bernstein.
Replace UIItemProvider (and related classes) with NSItemProvider.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::registerItemToPasteboard):
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderDataRegistrar registerItemProvider:]):
(-[WebItemProviderWritableObjectRegistrar initWithObject:]):
(-[WebItemProviderWritableObjectRegistrar representingObject]):
(-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
(-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
(-[WebItemProviderRegistrationInfoList itemProvider]):
(-[WebItemProviderPasteboard pasteboardTypes]):
(-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]):
(-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
(allLoadableClasses):
(classForTypeIdentifier):
(-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
(-[WebItemProviderPasteboard numberOfFiles]):
(-[WebItemProviderPasteboard itemProviderAtIndex:]):
(-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsURL const):
2018-11-17 Ross Kirsling <ross.kirsling@sony.com>
Remove superfluous LayoutUnit initializations
https://bugs.webkit.org/show_bug.cgi?id=191791
Reviewed by Simon Fraser.
First step toward making LayoutUnit constructors explicit:
eliminate `= 0` when constructing LayoutUnit lvalues.
* editing/Editor.cpp:
(WebCore::Editor::firstRectForRange const):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation):
* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
* page/FrameView.cpp:
(WebCore::FrameView::forceLayoutForPagination):
* page/SpatialNavigation.cpp:
(WebCore::scrollInDirection):
(WebCore::distanceDataForNode):
* rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::layout):
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::marginIntrinsicLogicalWidthForChild):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
(WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
(WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const):
(WebCore::RenderBlock::layoutPositionedObject):
(WebCore::RenderBlock::selectionGapRectsForRepaint):
(WebCore::RenderBlock::paintSelection):
(WebCore::RenderBlock::textIndentOffset const):
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths const):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
(WebCore::RenderBlockFlow::layoutBlock):
(WebCore::RenderBlockFlow::layoutBlockChildren):
(WebCore::RenderBlockFlow::marginValuesForChild const):
(WebCore::RenderBlockFlow::estimateLogicalTopPosition):
(WebCore::RenderBlockFlow::applyBeforeBreak):
(WebCore::RenderBlockFlow::applyAfterBreak):
(WebCore::RenderBlockFlow::adjustBlockChildForPagination):
(WebCore::RenderBlockFlow::clearFloats):
(WebCore::RenderBlockFlow::lowestFloatLogicalBottom const):
(WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const):
(WebCore::RenderBlockFlow::addOverhangingFloats):
(WebCore::RenderBlockFlow::getClearDelta):
(WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::determineStartPosition):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::fillAvailableMeasure const):
(WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const):
(WebCore::RenderBox::computeLogicalWidthInFragmentUsing const):
(WebCore::RenderBox::computePercentageLogicalHeight const):
(WebCore::RenderBox::computeReplacedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthUsing const):
(WebCore::RenderBox::computePositionedLogicalHeightUsing const):
(WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
(WebCore::RenderBox::computePositionedLogicalHeightReplaced const):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::computedCSSPadding const):
(WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const):
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::marginWidthForChild):
(WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
(WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
(WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::paint):
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::positionListMarker):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::computePreferredLogicalWidths):
(WebCore::RenderListMarker::updateMargins):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::layoutBlock):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth):
(WebCore::RenderTable::layout):
(WebCore::RenderTable::offsetWidthForColumn const):
(WebCore::RenderTable::offsetHeightForColumn const):
(WebCore::RenderTable::outerBorderBefore const):
(WebCore::RenderTable::outerBorderAfter const):
(WebCore::RenderTable::outerBorderStart const):
(WebCore::RenderTable::outerBorderEnd const):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::logicalWidthFromColumns const):
(WebCore::RenderTableCell::computeIntrinsicPadding):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::calcRowLogicalHeight):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows):
(WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows):
(WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight):
(WebCore::RenderTableSection::layoutRows):
(WebCore::RenderTableSection::calcOuterBorderBefore const):
(WebCore::RenderTableSection::calcOuterBorderAfter const):
(WebCore::RenderTableSection::calcOuterBorderStart const):
(WebCore::RenderTableSection::calcOuterBorderEnd const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::alignBoxesInBlockDirection):
(WebCore::RootInlineBox::beforeAnnotationsAdjustment const):
(WebCore::RootInlineBox::lineSnapAdjustment const):
(WebCore::RootInlineBox::verticalPositionForBox):
* rendering/line/BreakingContext.h:
(WebCore::inlineLogicalWidth):
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::RenderMathMLBlock::layoutItems):
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore::RenderMathMLFraction::layoutBlock):
* rendering/mathml/RenderMathMLOperator.cpp:
(WebCore::RenderMathMLOperator::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLRoot.cpp:
(WebCore::RenderMathMLRoot::computePreferredLogicalWidths):
(WebCore::RenderMathMLRoot::paint):
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::computePreferredLogicalWidths):
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::layoutBlock):
* rendering/mathml/RenderMathMLUnderOver.cpp:
(WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren):
(WebCore::RenderMathMLUnderOver::layoutBlock):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getShadowInsetExtent const):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Avoid triggering compositing updates when only the root layer is composited
https://bugs.webkit.org/show_bug.cgi?id=191813
Reviewed by Zalan Bujtas.
If we know that the only composited layer is the root, we can avoid triggering deep
compositing updates sometimes, for example when layout changes size or position,
or when z-order lists change.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant()
flag to cut off descendants traversal when possible.
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Fix an error in 238354 - !=, not ==.
Fixes test failures.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code.
https://bugs.webkit.org/show_bug.cgi?id=191810
Reviewed by Zalan Bujtas.
Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other
than the RenderView's layer.
hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing
because no content layer is composited, and overlays don't require compositing, so
rename it.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const):
(WebCore::RenderLayerCompositor::layerBecameComposited):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::layerTreeAsText):
(WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted.
* rendering/RenderLayerCompositor.h:
2018-11-17 Simon Fraser <simon.fraser@apple.com>
Rename RenderLayerCompositor::inCompositingMode() to usesCompositing()
https://bugs.webkit.org/show_bug.cgi?id=191808
Reviewed by Zalan Bujtas.
Other code uses "usesCompositing" so standardize on that (future changes will make
"compositing mode" more ambiguous). Also remove a FrameView function that only
had one caller.
* page/FrameView.cpp:
(WebCore::FrameView::clearBackingStores):
(WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange):
(WebCore::FrameView::delegatesScrollingDidChange):
(WebCore::FrameView::hasCompositedContent const): Deleted.
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingPolicy):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::needsToBeComposited const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
* rendering/RenderLayerCompositor.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::repaintViewAndCompositedLayers):
(WebCore::RenderView::usesCompositing const):
2018-11-17 Devin Rousso <drousso@apple.com>
Web Inspector: Network: add button to show system certificate dialog
https://bugs.webkit.org/show_bug.cgi?id=191458
<rdar://problem/45977019>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/network/getSerializedCertificate.html
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::getSerializedCertificate): Added.
* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::supportsShowCertificate): Added.
(WebCore::InspectorFrontendHost::showCertificate): Added.
* inspector/InspectorFrontendClient.h:
(InspectorFrontendClient::showCertificate): Added.
* testing/Internals.cpp:
(InspectorStubFrontend::showCertificate): Added.
* platform/network/cf/CertificateInfo.h:
(WTF::Persistence::encodeCFData): Added.
(WTF::Persistence::decodeCFData): Added.
(WTF::Persistence::encodeSecTrustRef): Added.
(WTF::Persistence::decodeSecTrustRef): Added.
(WTF::Persistence::encodeCertificateChain): Added.
(WTF::Persistence::decodeCertificateChain): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
* platform/network/cf/CertificateInfoCFNet.cpp:
* platform/network/cocoa/CertificateInfoCocoa.mm:
* platform/network/curl/CertificateInfo.h:
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
* platform/network/soup/CertificateInfo.h:
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added.
(WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added.
(WTF::Persistence::certificatesDataListFromCertificateInfo): Added.
(WTF::Persistence::certificateFromCertificatesDataList): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added.
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added.
2018-11-17 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules.
https://bugs.webkit.org/show_bug.cgi?id=191801
Reviewed by Antti Koivisto.
before<span style="position: relative">positioned</span>after
In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules.
While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too,
we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule.
Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::addDetachingRule):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted.
2018-11-17 Jonathan Hammer <jonathan@e3software.com>
Caret stops blinking after context menu shown
https://bugs.webkit.org/show_bug.cgi?id=191715
Reviewed by Ryosuke Niwa.
Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that
the caret continues to blink even after the context menu is dismissed. The normal
way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does
not apply in the case of context menus because handleMouseReleaseEvent is not
called once the context menu is up.
Test: fast/events/contextmenu-dismiss-blink-caret.html
* page/EventHandler.cpp:
(WebCore::EventHandler::sendContextMenuEvent):
* testing/Internals.cpp:
(WebCore::Internals::isCaretBlinkingSuspended):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-16 Antoine Quint <graouts@apple.com>
[Pointer Events] event.isPrimary doesn't always represent the oldest active touch
https://bugs.webkit.org/show_bug.cgi?id=191752
<rdar://problem/46129270>
Reviewed by Dean Jackson.
Provide isPrimary to the constructor so its value can be determined at the call site.
Test: pointerevents/ios/pointer-events-is-primary.html
* dom/PointerEvent.h:
* dom/ios/PointerEventIOS.cpp:
(WebCore::PointerEvent::create):
(WebCore::PointerEvent::PointerEvent):
(WebCore::m_isPrimary):
2018-11-16 Alex Christensen <achristensen@webkit.org>
Tweak _showSafeBrowsingWarningWithTitle SPI
https://bugs.webkit.org/show_bug.cgi?id=191799
Reviewed by Wenson Hsieh.
It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari.
Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning.
The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings.
Covered by updated API tests.
* en.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlCancelButtonTitle):
Make "Cancel"'s description a little more generic.
2018-11-16 Simon Fraser <simon.fraser@apple.com>
Optimize composited iframe layer hookup
https://bugs.webkit.org/show_bug.cgi?id=191778
Reviewed by Zalan Bujtas.
The change made in r238229 can be more targeted; we only need to hook up iframe content
layers when the layer is already composited (otherwise the updateBacking() above would have triggered
the work), and when it's a RenderWidget layer.
Tested by existing tests.
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-16 Ross Kirsling <ross.kirsling@sony.com>
Provide default implementation of Widget
https://bugs.webkit.org/show_bug.cgi?id=191784
Reviewed by Michael Catanzaro.
* SourcesWPE.txt:
* platform/Widget.cpp:
(WebCore::Widget::Widget):
(WebCore::Widget::frameRect const):
(WebCore::Widget::~Widget):
(WebCore::Widget::setFrameRect):
(WebCore::Widget::paint):
(WebCore::Widget::setFocus):
(WebCore::Widget::setCursor):
(WebCore::Widget::show):
(WebCore::Widget::hide):
(WebCore::Widget::setIsSelected):
* platform/gtk/WidgetGtk.cpp:
(WebCore::Widget::Widget): Deleted.
(WebCore::Widget::frameRect const): Deleted.
* platform/win/WidgetWin.cpp:
(WebCore::Widget::Widget): Deleted.
(WebCore::Widget::frameRect const): Deleted.
* platform/wpe/WidgetWPE.cpp: Removed.
2018-11-16 Chris Dumez <cdumez@apple.com>
[macOS] Label "prewarmed" WebContent processes in Activity Monitor
https://bugs.webkit.org/show_bug.cgi?id=191765
<rdar://problem/45953463>
Reviewed by Geoffrey Garen.
* en.lproj/Localizable.strings:
2018-11-16 Jeremy Jones <jeremyj@apple.com>
Enable external playback for video in element fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=190359
rdar://problem/42560085
Reviewed by Jer Noble.
No new tests because we don't have a good way to test external playback.
Any video that might be auto-pipped from element fullscreen should also enable external playback for video out.
PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active,
allow PiP, but disable external playback while PiP is active.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setVideoFullscreenStandby):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setVideoFullscreenStandby):
(WebCore::MediaPlayer::videoFullscreenStandby const):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
2018-11-16 Jer Noble <jer.noble@apple.com>
Regression(r233865): Causes synchronous IPC in the middle of layout
https://bugs.webkit.org/show_bug.cgi?id=188307
<rdar://problem/42807306>
Reviewed by Eric Carlson.
Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to
query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the
steps of the requestFullscreen() method on the next run loop, allowing messages from the
UIProcess about page visibilty to be delivered first.
* dom/Document.cpp:
(WebCore::Document::requestFullScreenForElement):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
* html/HTMLMediaElement.h:
* page/ChromeClient.h:
2018-11-16 Ross Kirsling <ross.kirsling@sony.com>
Provide default implementation of Cursor
https://bugs.webkit.org/show_bug.cgi?id=191772
Reviewed by Michael Catanzaro.
* SourcesWPE.txt:
* platform/Cursor.cpp:
(WebCore::Cursor::ensurePlatformCursor const):
* platform/wpe/CursorWPE.cpp: Removed.
2018-11-16 Don Olmstead <don.olmstead@sony.com>
EditorWPE should be EditorLibWPE
https://bugs.webkit.org/show_bug.cgi?id=191774
Reviewed by Michael Catanzaro.
The platform specific implementations of Editor are all around the
platform's Pasteboard. Since the Pasteboard implementation is now based
around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE.
* SourcesWPE.txt:
* editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp.
2018-11-16 Jeremy Jones <jeremyj@apple.com>
Include AirPlay destination name in AirPlay placard.
https://bugs.webkit.org/show_bug.cgi?id=191574
rdar://problem/45536144
Reviewed by Eric Carlson.
Updated existing tests.
Include the name of the AirPlay destination in the video element's AirPlay placard.
* Modules/modern-media-controls/controls/airplay-placard.js:
(AirplayPlacard):
* Modules/modern-media-controls/controls/placard.js:
* Modules/modern-media-controls/media/placard-support.js:
(PlacardSupport.prototype._updatePlacard):
(PlacardSupport.prototype._updateAirPlayPlacard):
(PlacardSupport):
* en.lproj/modern-media-controls-localized-strings.js:
2018-11-16 Zalan Bujtas <zalan@apple.com>
Add DidFirstMeaningfulPaint milestone.
https://bugs.webkit.org/show_bug.cgi?id=191754
Reviewed by Simon Fraser.
This milestone fires sone after the paint triggered by the first visually non-empty layout.
* page/FrameView.cpp:
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
* page/LayoutMilestone.h:
2018-11-16 Don Olmstead <don.olmstead@sony.com>
Provide default implementations of Image and Icon
https://bugs.webkit.org/show_bug.cgi?id=191764
Reviewed by Michael Catanzaro.
Makes IconWPE and ImageWPE implementations the default.
* Sources.txt:
* SourcesWPE.txt:
* platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp.
* platform/graphics/Image.cpp:
(WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports.
(WebCore::Image::loadPlatformResource):
* platform/graphics/wpe/ImageWPE.cpp: Removed.
2018-11-16 Brent Fulgham <bfulgham@apple.com>
[Win] Reduce the use of WKSI library calls: CFNetwork
https://bugs.webkit.org/show_bug.cgi?id=191718
<rdar://problem/46108732>
Reviewed by Alex Christensen.
Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just
make the same calls on Windows, like we did for iOS and macOS back in 2017.
Stop including WebKitSystemInterface.h for files that used to rely on it
for font-related features.
Tested by existing Windows regression tests. There should be no change in behavior.
* platform/graphics/win/FontCacheWin.cpp:
* platform/graphics/win/FontCustomPlatformData.cpp:
* platform/graphics/win/FontPlatformDataCGWin.cpp:
* platform/network/cf/CookieStorageCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::createPrivateStorageSession):
(WebCore::NetworkStorageSession::switchToNewTestingSession):
(WebCore::NetworkStorageSession::ensureSession):
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
(WebCore::getSSLPeerCertificateData):
(WebCore::setSSLPeerCertificateData):
(WebCore::ResourceError::getSSLPeerCertificateDataBytePtr):
(WebCore::ResourceError::platformLazyInit):
(WebCore::ResourceError::cfError const):
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::setClientCertificateInSSLProperties):
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceRequestCFNet.cpp:
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2018-11-16 Timothy Hatcher <timothy@apple.com>
Add html{color:text} to the simpleUserAgentStyleSheet on macOS.
https://bugs.webkit.org/show_bug.cgi?id=191760
Reviewed by Antti Koivisto.
* css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside
a PLATFORM(MAC) copy of the string.
2018-11-16 Jer Noble <jer.noble@apple.com>
An early return from updateSchedulingInfo can leave some variables uninitialized.
https://bugs.webkit.org/show_bug.cgi?id=191755
<rdar://problem/39910089>
Reviewed by Brent Fulgham.
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::process):
* Modules/webaudio/AudioScheduledSourceNode.cpp:
(WebCore::AudioScheduledSourceNode::updateSchedulingInfo):
* Modules/webaudio/OscillatorNode.cpp:
(WebCore::OscillatorNode::process):
2018-11-16 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Ignore caps notifications when tearing down the pipeline
https://bugs.webkit.org/show_bug.cgi?id=191578
Reviewed by Xabier Rodriguez-Calvar.
Changing the demuxer to READY state (which is done only in the main
thread) triggers the unlinking of its srcpads, which in turns emits a
caps change notification in the previously linked element since they
become unnegotiated again.
We are not interested in caps notifications in these cases, so let's
just ignore caps notifications emitted from the main thread.
This fixes an assertion failure in the debug builds.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
2018-11-16 Sihui Liu <sihui_liu@apple.com>
Storing blobs in IDB on iOS: "Error preparing blob/file"
https://bugs.webkit.org/show_bug.cgi?id=188438
<rdar://problem/43097279>
Reviewed by Alex Christensen.
Grant sandbox extension of temp folder to network process, because we suggested network process had access to
the folder on iOS device but it didn't.
This makes some existing tests about IDB blob pass on iOS device.
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
(WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
(WebCore::IDBServer::SQLiteIDBTransaction::abort):
* Modules/indexeddb/shared/InProcessIDBServer.h:
2018-11-16 Don Olmstead <don.olmstead@sony.com>
Add USE(LIBWPE) to WebCore
https://bugs.webkit.org/show_bug.cgi?id=191401
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to
USE(LIBWPE) instead.
Renames classes and files to use the suffix LibWPE.
* PlatformWPE.cmake:
* SourcesWPE.txt:
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformPasteboard.h:
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
* platform/graphics/PlatformDisplay.h:
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp.
(WebCore::GLContextEGL::createWPEContext):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
* platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp.
(WebCore::PlatformDisplayLibWPE::create):
(WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE):
(WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE):
(WebCore::PlatformDisplayLibWPE::initialize):
* platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h.
* platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp.
* platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp.
* platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp.
2018-11-16 Zalan Bujtas <zalan@apple.com>
[iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click).
https://bugs.webkit.org/show_bug.cgi?id=191712
<rdar://problem/45612900>
Reviewed by Simon Fraser.
In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click.
In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar)
and no need to dispatch a click event.
The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely
only for tooltip-like reasons and it's ok to proceed with the click event.
Test: fast/events/touch/ios/click-instead-of-hover-simple.html
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
2018-11-16 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for out-of-flow positioned boxes
https://bugs.webkit.org/show_bug.cgi?id=191726
Reviewed by Antti Koivisto.
While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure
that their out-of-flow descendants get laid out as well.
Test: fast/inline/simple-inline-with-out-of-flow-descendant.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root.
(WebCore::Layout::TreeBuilder::createSubTree):
2018-11-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add API to enable/disable device mocks
https://bugs.webkit.org/show_bug.cgi?id=191699
This basically us to test MediaStream/WebRTC support without
requiring cameras or microphones and is quite useful.
Also fix the GStreamerAudioMock by:
- Stop setting `leaky-upstream` on the GStreamerCapturer queue,
this was usefull when we were trying to bring the MediaStream
sources inside the main pipeline, it is not the case anymore
(and not doable with latest version of LibWebRTC).
- Use a 'ticks' wave on the gstreamer audiotestsrc so the test
stream is similar to what Apple port does.
Reviewed by Xabier Rodriguez-Calvar.
The mocks are already tested and the API is really simple.
* platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp:
(WebCore::GStreamerAudioCapturer::createSource):
* platform/mediastream/gstreamer/GStreamerAudioCapturer.h:
* platform/mediastream/gstreamer/GStreamerCapturer.cpp:
(WebCore::GStreamerCapturer::addSink):
* platform/mediastream/gstreamer/GStreamerCapturer.h:
2018-11-16 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][MediaStream] Handle track addition and removal
https://bugs.webkit.org/show_bug.cgi?id=191599
Reviewed by Xabier Rodriguez-Calvar.
Test: fast/mediastream/MediaStream-video-element-remove-track.html
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
(WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver):
(WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver):
(WebCore::webkitMediaStreamSrcFinalize):
(WebCore::webkitMediaStreamSrcChangeState):
(WebCore::webkit_media_stream_src_init):
(WebCore::webkitMediaStreamSrcSetupSrc):
(WebCore::webkitMediaStreamSrcAddTrack):
(WebCore::webkitMediaStreamSrcRemoveTrackByType):
(WebCore::webkitMediaStreamSrcSetStream):
2018-11-16 Zan Dobersek <zdobersek@igalia.com>
ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration
https://bugs.webkit.org/show_bug.cgi?id=191354
Reviewed by Michael Catanzaro.
ScalableImageDecoder::frameIsCompleteAtIndex() should only check the
index validity and, if the index is valid, check for completeness of the
corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should
also only retrieve duration for already-complete frames.
Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex()
as that method goes on and decodes image data to determine specific
information. The ImageSource class that's querying this information
doesn't anticipate this, and doesn't handle the increased memory
consumption of the decoded data, leaving MemoryCache in the blind about
the image resource's actual amount of consumed memory. ImageSource can
instead gracefully handle any incomplete frame by marking the decoding
status for this frame as only partial.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const):
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const):
(WebCore::ScalableImageDecoder::frameDurationAtIndex const):
2018-11-16 Antoine Quint <graouts@apple.com>
PointerEvents should not require touch event listeners to be registered
https://bugs.webkit.org/show_bug.cgi?id=191333
<rdar://problem/45857523>
Reviewed by Dean Jackson.
Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html
pointerevents/ios/pointer-events-prevent-default.html
* dom/EventNames.h:
(WebCore::EventNames::isTouchEventType const):
(WebCore::EventNames::touchAndPointerEventNames const):
(WebCore::EventNames::touchEventNames const): Deleted.
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
2018-11-15 Zalan Bujtas <zalan@apple.com>
[iOS] Do not get stuck in indeterminate content observation state.
https://bugs.webkit.org/show_bug.cgi?id=191719
Reviewed by Simon Fraser.
Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in
the "can't decide yet if it's a hover or click" state.
This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch.
Test: fast/events/touch/ios/stuck-with-hover-state.html
* platform/ios/wak/WKContentObservation.cpp:
(WebThreadRemoveObservedContentModifier):
2018-11-15 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r238090) Composited iframes that resize from zero don't show
https://bugs.webkit.org/show_bug.cgi?id=191733
rdar://problem/46107764
Reviewed by Zalan Bujtas.
A zero-sized iframe whose contents are composited should not trigger compositing in the
parent document (see code in requiresCompositingForFrame()), but when the <iframe> element
was resized without a style change (e.g. because it's width: 100%, height: 100% and the
parent resizes), there was no code that triggered a compositing update.
Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes,
for a RenderWidget whose contents are composited.
Test: compositing/iframes/resize-from-zero-size.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateLayerPosition):
2018-11-15 Simon Fraser <simon.fraser@apple.com>
Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342
rdar://problem/26652811
Reviewed by Zalan Bujtas.
Patch partly by Frédéric Wang.
This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch
overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly
created and hence the UIProcess receives a null UIScrollView pointer. This triggers an
assertion in debug mode and prevents the user from scrolling the overflow node in release
mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses
the remaining issues by forcing a configuration update after layout in order to ensure that
RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet
composited, trigger a post-layout update that is necessary to check if we need to make it
composited when it gains scrollable overflow.
Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html
fast/scrolling/ios/change-scrollability-on-content-resize.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that
RenderLayerCompositor::updateBackingAndHierarchy will later instantiate
RenderLayerBacking::m_scrollingLayer.
2018-11-15 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
https://bugs.webkit.org/show_bug.cgi?id=191582
Reviewed by Alex Christensen.
No new tests because there's no behaviour change.
* platform/network/curl/CurlDownload.h: Marked CurlDownload final.
2018-11-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238244.
Caused High Sierra test runs to fail early with 50 crashes and
casued 25 API failures.
Reverted changeset:
"[css-logical] Implement flow-relative margin, padding and
border shorthands"
https://bugs.webkit.org/show_bug.cgi?id=188697
https://trac.webkit.org/changeset/238244
2018-11-15 Jer Noble <jer.noble@apple.com>
AVKit will set videoGravity to a nil string when building against iosmac
https://bugs.webkit.org/show_bug.cgi?id=191573
Reviewed by Dean Jackson.
Workaround AVKit behavior by treating nil videoGravity as the default,
which is AVLayerVideoGravityResizeAspect.
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
2018-11-15 Brent Fulgham <bfulgham@apple.com>
[Win] Reduce the use of WKSI library calls: Font Handling
https://bugs.webkit.org/show_bug.cgi?id=191701
<rdar://problem/46104809>
Reviewed by Myles C. Maxfield.
Move the old Windows font handling code out of WKSI to our regular
repository. We now handle SPI differently, and don't need to keep
these implementations in a separate library. This should also help
avoid the somewhat frequent build failures caused when WKSI is not
updated in sync with WebKit.
Tested by existing Windows test cases.
* platform/graphics/FontCascade.h:
* platform/graphics/win/FontCGWin.cpp:
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::setFontSmoothingLevel):
(WebCore::setCGFontSmoothingStyle):
(WebCore::FontCascade::setFontSmoothingStyle):
(WebCore::FontCascade::setFontSmoothingContrast):
(WebCore::clearTypeContrast):
(WebCore::FontCascade::systemFontSmoothingChanged):
(WebCore::FontCascade::setCGContextFontRenderingStyle):
(WebCore::renderingStyleForFont):
(WebCore::FontCascade::getGlyphAdvances):
* platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
(WebCore::GlyphPage::fill):
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawFocusRing):
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
* platform/graphics/win/SimpleFontDataCGWin.cpp:
(WebCore::Font::platformWidthForGlyph const):
* rendering/RenderMediaControls.cpp:
(WebCore::RenderMediaControls::adjustMediaSliderThumbSize):
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Use a real nonce for CTAPHID_INIT
https://bugs.webkit.org/show_bug.cgi?id=191533
<rdar://problem/46103502>
Reviewed by Brent Fulgham.
New tests are added into existing test files.
* Modules/webauthn/fido/FidoConstants.h:
2018-11-15 Justin Fan <justin_fan@apple.com>
[WebGPU] WebGPUCommandBuffer prototype
https://bugs.webkit.org/show_bug.cgi?id=191663
Reviewed by Dean Jackson.
Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue).
Test: webgpu/command-buffers.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer.
* Modules/webgpu/GPUDevice.cpp:
(WebCore::GPUDevice::createCommandBuffer): Added.
(WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue.
* Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue.
(WebCore::GPUDevice::platformDevice const):
* Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue.
(WebCore::GPUQueue::platformQueue const):
* Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h.
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* Modules/webgpu/GPUShaderModule.h:
(WebCore::GPUShaderModule::platformShaderModule const):
* Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h.
(WebCore::GPUSwapChain::platformLayer const):
* Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer.
(WebCore::WebGPUCommandBuffer::create):
(WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
* Modules/webgpu/WebGPUCommandBuffer.h: Added.
* Modules/webgpu/WebGPUCommandBuffer.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createCommandBuffer const): Added.
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer.
(WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue.
(WebCore::GPUCommandBuffer::GPUCommandBuffer):
* Modules/webgpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::GPUDevice):
* Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue.
(WebCore::GPUQueue::create):
(WebCore::GPUQueue::GPUQueue):
* Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::GPURenderPipeline::GPURenderPipeline):
* Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-11-15 Oriol Brufau <obrufau@igalia.com>
[css-logical] Implement flow-relative margin, padding and border shorthands
https://bugs.webkit.org/show_bug.cgi?id=188697
Reviewed by Simon Fraser and Antti Koivisto.
Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
webexposed/css-properties-as-js-properties.html
webexposed/css-properties-behind-flags.html
webexposed/css-property-listing.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
Allow the new properties to serialize their computed value.
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
* css/CSSComputedStyleDeclaration.h:
Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
shorthands.
* css/CSSProperties.json:
Add the new properties behind the CSSLogicalEnabled runtime flag.
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
Prevent CSS properties disabled behind a runtime flag from being exposed in
style declarations.
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
Allow the new properties to serialize their specified value.
(WebCore::StyleProperties::get2Values const):
Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
(WebCore::StyleProperties::borderPropertyValue const):
Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
corresponding to width, style and color.
(WebCore::MutableStyleProperties::setProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.
(WebCore::StyleProperties::asText const):
Allow the new properties to be serialized in cssText.
Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
and serialize the longhands instead. Note that there could be another shorthand
available which is enabled, but a proper solution would require bug 190496.
* css/StyleProperties.h:
Update declarations of borderPropertyValue and get2Values.
* css/makeprop.pl:
(addProperty):
Add isEnabledCSSProperty function for checking that a CSS property is not
disabled behind a runtime flag.
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
Prevent CSS properties disabled behind a runtime flag from being exposed in
computed styles.
(WebCore::CSSPropertyParser::addProperty):
Prevent CSS properties disabled behind a runtime flag from being set a value.
(WebCore::CSSPropertyParser::consumeBorder):
Change consumeBorder to provide the caller with the parsed values instead of
setting properties. Then the caller can decide to which properties the values
should be set, and whether border-image should be reset or not.
(WebCore::CSSPropertyParser::consume2ValueShorthand):
(WebCore::CSSPropertyParser::consume4ValueShorthand):
Rename consume4Values to consume4ValueShorthand, and add analogous
consume2ValueShorthand for parsing shorthands with two longhands.
(WebCore::CSSPropertyParser::parseShorthand):
Allow the new properties to be parsed.
* css/parser/CSSPropertyParser.h:
Update declarations of consumeBorder, consume2ValueShorthand and
consume4ValueShorthand.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Prevent CSS properties disabled behind a runtime flag from being exposed in
the CSS inspector tool.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
(WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
Add the CSSLogicalEnabled runtime flag.
2018-11-15 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r238220.
Introduced failing tests to iOS and is slowing down EWS
Reverted changeset:
"[css-grid] Consider scrollbars in
populateGridPositionsForDirection()"
https://bugs.webkit.org/show_bug.cgi?id=191656
https://trac.webkit.org/changeset/238220
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional
https://bugs.webkit.org/show_bug.cgi?id=191522
Reviewed by Brent Fulgham.
Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional.
https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria
Covered by existing tests.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
2018-11-15 Ross Kirsling <ross.kirsling@sony.com>
DragImage should have a complete default implementation
https://bugs.webkit.org/show_bug.cgi?id=191666
Reviewed by Dean Jackson.
Move WPE's stub implementation down into the base implementation file.
* SourcesWPE.txt:
* platform/DragImage.cpp:
(WebCore::dragImageSize):
(WebCore::deleteDragImage):
(WebCore::scaleDragImage):
(WebCore::dissolveDragImageToFraction):
(WebCore::createDragImageFromImage):
(WebCore::createDragImageIconForCachedImageFilename):
(WebCore::createDragImageForLink):
* platform/wpe/DragImageWPE.cpp: Removed.
2018-11-15 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] UserHandle can be null
https://bugs.webkit.org/show_bug.cgi?id=191521
Reviewed by Alex Christensen.
According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f.
UserHandle can now be null.
Covered by existing tests.
* Modules/webauthn/AuthenticatorAssertionResponse.h:
(WebCore::AuthenticatorAssertionResponse::create):
(WebCore::AuthenticatorAssertionResponse::userHandle const):
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
* Modules/webauthn/AuthenticatorAssertionResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::tryCreate):
* Modules/webauthn/PublicKeyCredentialData.h:
(WebCore::PublicKeyCredentialData::encode const):
(WebCore::PublicKeyCredentialData::decode):
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPGetAssertionResponse):
2018-11-15 Youenn Fablet <youenn@apple.com>
Modernize RTCPeerConnection handling of pendingActivity
https://bugs.webkit.org/show_bug.cgi?id=191661
Reviewed by Eric Carlson.
makePendingActivity is the modern way to handle set/unset of pending activity.
No change of behavior.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
(WebCore::RTCPeerConnection::doStop):
* Modules/mediastream/RTCPeerConnection.h:
2018-11-15 Keith Rollin <krollin@apple.com>
Delete old .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=191669
<rdar://problem/46081994>
Reviewed by Chris Dumez.
.xcfilelist files were created and added to the Xcode project files in
https://trac.webkit.org/changeset/238008/webkit. However, they caused
build issues and they were removed from the Xcode projects in
https://trac.webkit.org/changeset/238055/webkit. This check-in removes
the files from the repository altogether. They'll ultimately be
replaced with new files with names that indicate whether the
associated files are inputs to the Run Script phase or are files
created by the Run Script phase.
No new tests -- no changed functionality.
* DerivedSources.xcfilelist: Removed.
* UnifiedSources.xcfilelist: Removed.
2018-11-15 Youenn Fablet <youenn@apple.com>
Update RTCPeerConnection JS built-ins to be closer to specWe
https://bugs.webkit.org/show_bug.cgi?id=191665
Reviewed by Eric Carlson.
Simplify JS built-ins since we no longer need to support callback versions of the API.
Make sure to have the right number of parameters in the JS built-in functions.
Make some simplification to the code.
Covered by existing tests and rebased test.
* Modules/mediastream/RTCPeerConnection.js:
(createOffer):
(createAnswer):
(setLocalDescription):
(setRemoteDescription):
(addIceCandidate):
* Modules/mediastream/RTCPeerConnectionInternals.js:
(enqueueOperation):
(callbacksAndDictionaryOverload): Deleted.
2018-11-15 Simon Fraser <simon.fraser@apple.com>
REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari
https://bugs.webkit.org/show_bug.cgi?id=191673
rdar://problem/46083440
Reviewed by Antti Koivisto.
Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer
tree for every Frame. They get re-attached on tab show, and for subframes this involves
the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition().
The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that
fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary
layer configuration update that gets iframe layers parented.
This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future
patch will optimize this, and add a layout test.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-15 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Skip non-inflow boxes while splitting the inline runs.
https://bugs.webkit.org/show_bug.cgi?id=191690
Reviewed by Antti Koivisto.
Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context.
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
2018-11-15 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext base class should not declare computeStaticPosition.
https://bugs.webkit.org/show_bug.cgi?id=191683
Reviewed by Antti Koivisto.
Apparently only BlockFormattingContext uses it.
* layout/FormattingContext.h:
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-11-14 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for in-flow positioned inline boxes.
https://bugs.webkit.org/show_bug.cgi?id=191672
Reviewed by Antti Koivisto.
We might offset the in-flow positioned runs differently once runs are moved over to the display tree.
Test: fast/inline/simple-inline-inflow-positioned.html
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::moveVertically):
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
2018-11-15 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add support for sending silence or silencing an incoming track
https://bugs.webkit.org/show_bug.cgi?id=191631
Reviewed by Xabier Rodriguez-Calvar.
This will be tested once webkit.org/b/186933 is implemented.
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
2018-11-15 Antti Koivisto <antti@apple.com>
REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out
https://bugs.webkit.org/show_bug.cgi?id=191642
Reviewed by Zalan Bujtas.
Invalidate access key map even when thorttling style recalcs.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
2018-11-15 Antti Koivisto <antti@apple.com>
Remove fonts from CSSFontFaceSet safely
https://bugs.webkit.org/show_bug.cgi?id=191676
Reviewed by Zalan Bujtas.
Test: fast/text/font-face-set-remove-safely.html
* css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::remove):
2018-11-15 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Consider scrollbars in populateGridPositionsForDirection()
https://bugs.webkit.org/show_bug.cgi?id=191656
Reviewed by Javier Fernandez.
We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(),
that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction)
but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction).
The patch modifies the method so it takes into account scrollbar size
in order to compute the position of the columns/rows depending on the direction and the writing mode.
Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateGridPositionsForDirection):
2018-11-14 Keith Rollin <krollin@apple.com>
Move scripts for Derived and Unified Sources to external files
https://bugs.webkit.org/show_bug.cgi?id=191670
<rdar://problem/46082278>
Reviewed by Keith Miller.
Move the scripts in the Generate Derived Sources and Generate Unified
Sources Run Script phases from the Xcode projects to external shell
script files. Then invoke those scripts from the Run Script phases.
This refactoring is being performed to support later work that will
invoke these scripts in other contexts.
The scripts were maintained as-is when making the move. I did a little
reformatting and added 'set -e' to the top of each file, but that's
it.
No new tests -- no changed functionality.
* Scripts/generate-derived-sources.sh: Added.
* Scripts/generate-unified-sources.sh: Added.
* WebCore.xcodeproj/project.pbxproj:
2018-11-14 Keith Rollin <krollin@apple.com>
Fix #end vs. #endif typo.
https://bugs.webkit.org/show_bug.cgi?id=191668
<rdar://problem/46081704>
Reviewed by Alexey Proskuryakov.
Source/WebCore/SourcesCocoa.txt had a #end that should have been a
#endif. Fix this, an add a check to generate-unified-source-bundles.rb
to detect similar typos.
No new tests -- no changed functionality.
* SourcesCocoa.txt:
2018-11-14 Keith Rollin <krollin@apple.com>
Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt
https://bugs.webkit.org/show_bug.cgi?id=191667
<rdar://problem/46081286>
Reviewed by Eric Carlson.
VideoFullscreenLayerManager.mm no longer exists.
No new tests -- No changed functionality.
* SourcesCocoa.txt:
2018-11-14 Timothy Hatcher <timothy@apple.com>
Enabled dark mode CSS support by default.
https://bugs.webkit.org/show_bug.cgi?id=191609
rdar://problem/46046861
Reviewed by Megan Gardner.
* page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true.
2018-11-14 Timothy Hatcher <timothy@apple.com>
Default the view background color and text color to different values when in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=191607
rdar://problem/46045854
Reviewed by Dean Jackson.
Test: css-dark-mode/default-colors.html
* css/html.css:
(html): Set color: text on macOS.
* dom/Document.cpp:
(WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor().
* editing/EditingStyle.cpp:
(WebCore::caretColorFromStyle): Added.
(WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for
caret-color directly since removeEquivalentProperties fails with semantic colors.
(WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color
directly since removeEquivalentProperties fails with semantic colors.
* page/Frame.cpp:
(WebCore::Frame::createView): Drop backgroundColor.
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::recalculateBaseBackgroundColor): Added.
(WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument.
Calculate the backgroundColor based on the transparent argument only.
* page/FrameView.h:
* platform/graphics/Color.h:
(WebCore::equalIgnoringSemanticColor): Added for EditingStyle.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor().
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor()
since it ignores the semantic color flag.
* testing/Internals.cpp:
(WebCore::Internals::setViewIsTransparent): Drop backgroundColor.
(WebCore::Internals::viewBaseBackgroundColor): Added.
* testing/Internals.h:
* testing/Internals.idl: Added viewBaseBackgroundColor.
2018-11-14 Justin Fan <justin_fan@apple.com>
[WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
https://bugs.webkit.org/show_bug.cgi?id=191383
Reviewed by Dean Jackson.
Covered by existing WebGPU tests introduced in original patch.
* Modules/webgpu/GPUDevice.h:
* Modules/webgpu/GPUPipelineStageDescriptor.h:
* Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member.
(): Refactored into enum class.
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction.
(WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member.
* Modules/webgpu/GPUShaderModule.h:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL.
* Modules/webgpu/cocoa/GPURenderPipeline.h:
* Modules/webgpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
* Modules/webgpu/cocoa/GPUSwapChain.h:
* WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase.
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods
https://bugs.webkit.org/show_bug.cgi?id=191612
Reviewed by Matt Baker.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
(WebCore::InspectorController::disconnectFrontend):
(WebCore::InspectorController::show):
* inspector/InspectorController.h:
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::connectFrontend):
(WebCore::WorkerInspectorController::disconnectFrontend):
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
* page/PageDebuggable.h:
* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::InspectorStubFrontend):
(WebCore::InspectorStubFrontend::closeWindow):
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::connect):
(WebCore::ServiceWorkerDebuggable::disconnect):
* workers/service/context/ServiceWorkerDebuggable.h:
* workers/service/context/ServiceWorkerInspectorProxy.cpp:
(WebCore::ServiceWorkerInspectorProxy::connectToWorker):
(WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker):
* workers/service/context/ServiceWorkerInspectorProxy.h:
2018-11-14 Timothy Hatcher <timothy@apple.com>
Update prefers-color-scheme media query matching based on GitHub issue #3278.
https://bugs.webkit.org/show_bug.cgi?id=191654
rdar://problem/46074307
Reviewed by Simon Fraser.
Test: css-dark-mode/prefers-color-scheme.html
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false
for `no-preference` since there is no macOS option for no user preference.
* css/MediaQueryExpression.cpp:
(WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme.
2018-11-14 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: send a call stack with each action instead of an array of call frames
https://bugs.webkit.org/show_bug.cgi?id=191628
Reviewed by Dean Jackson.
Updated existing test: inspector/model/recording.html
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::indexForData):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::buildAction):
Drive-by: prevent de-duplicated objects from being destroyed while recording.
2018-11-14 Stephan Szabo <stephan.szabo@sony.com>
[Win] Compile Service Worker support
https://bugs.webkit.org/show_bug.cgi?id=191409
Reviewed by Youenn Fablet.
Fix compilation errors when ENABLE(SERVICE_WORKER)
on Windows with clang-cl. Clang on dllexport
platforms does not support specifying the
dllexport on both a class and members of the class
and unistd.h isn't provided but also appeared to
not be used.
No new tests, should be covered by existing tests.
* workers/service/ServiceWorkerProvider.h:
* workers/service/context/SWContextManager.cpp:
2018-11-14 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector)
https://bugs.webkit.org/show_bug.cgi?id=191494
<rdar://problem/45469854>
Reviewed by Devin Rousso.
* inspector/InspectorClient.h:
(WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const):
Provide a hook so that a client may wish to allow direct remote inspection of the Page.
This is used by WebKitLegacy only.
* page/Page.cpp:
(Page::Page):
Only enable the PageDebuggable if the client wishes remote inspection of the Page directly.
This is used by WebKitLegacy only.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::connectFrontend):
* inspector/InspectorController.h:
* page/PageDebuggable.cpp:
(WebCore::PageDebuggable::connect):
(WebCore::PageDebuggable::disconnect):
* page/PageDebuggable.h:
When a frontend connects, always enable the developer extras for the Page.
This is pretty much only for the remote path, which allows inspection if developer
extras were not already enabled (iOS). This simplifies the logic, and toggling
developer extras after it was already enabled is not really important.
2018-11-14 Per Arne Vollan <pvollan@apple.com>
REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing
https://bugs.webkit.org/show_bug.cgi?id=190884
Reviewed by Dean Jackson.
Only notify display refresh monitors with matching display ID.
Test: fast/animation/request-animation-frame-in-two-pages.html
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::displayWasUpdated):
* platform/graphics/DisplayRefreshMonitorManager.h:
2018-11-14 Youenn Fablet <youenn@apple.com>
Convert libwebrtc error types to DOM exceptions
https://bugs.webkit.org/show_bug.cgi?id=191590
Reviewed by Alex Christensen.
Make use of overloaded callback method that provides an error type.
This type is then used to create a DOM exception with the correct type.
Covered by existing tests.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
(WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
(WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCObservers.h:
(WebCore::toExceptionCode):
2018-11-14 Youenn Fablet <youenn@apple.com>
Allow to remove MediaStreamPrivate observers when iterating over observers
https://bugs.webkit.org/show_bug.cgi?id=187256
Reviewed by Eric Carlson.
Migrate the observer list from a Vector to a HashSet.
This is more robust to multiple observing and keeping of order of observers is not required.
Copy the set of observers to a vector before iterating over it.
This allows to remove an observer while iterating, which is now used in UserMediaRequest.
Covered by existing tests.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::mediaStreamIsReady):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::addObserver):
(WebCore::MediaStreamPrivate::removeObserver):
(WebCore::MediaStreamPrivate::forEachObserver const):
(WebCore::MediaStreamPrivate::updateActiveState):
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
(WebCore::MediaStreamPrivate::characteristicsChanged):
* platform/mediastream/MediaStreamPrivate.h:
2018-11-14 Youenn Fablet <youenn@apple.com>
Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError
https://bugs.webkit.org/show_bug.cgi?id=191603
Reviewed by Chris Dumez.
Make sure to check that the sender peer connection backend is matching.
Covered by rebased WPT test.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::removeTrack):
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::isCreatedBy const):
* Modules/mediastream/RTCRtpSender.h:
2018-11-14 Fujii Hironori <Hironori.Fujii@sony.com>
[curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl
https://bugs.webkit.org/show_bug.cgi?id=191620
Reviewed by Alex Christensen.
Remove a abstract class CookieJarCurl which is not needed anymore.
And, rename CookieJarCurlDatabase to CookieJarCurl.
No new tests because there's no behaviour change in WebCore.
* platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp.
* platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp.
* platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h.
* platform/network/curl/CookieJarCurlDatabase.h: Removed.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl.
2018-11-14 Christopher Reid <chris.reid@sony.com>
[WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp
https://bugs.webkit.org/show_bug.cgi?id=191606
Reviewed by Michael Catanzaro.
No behavior change.
Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString.
* platform/wpe/PlatformKeyboardEventWPE.cpp:
(WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
(WebCore::PlatformKeyboardEvent::singleCharacterString):
2018-11-13 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Construct dedicated runs when the inline element requires it (part 2)
https://bugs.webkit.org/show_bug.cgi?id=191623
Reviewed by Antti Koivisto.
This patch expands the breaking behaviour to support separate start/end breaks.
<span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span>
input to line breaking -> <parent start middle end parent>
output of line breaking (considering infinite constraint) -> <parent start middle end parent>
due to padding, final runs -> <parent><start middle end><parent>
"parent" -> n/a
"start" -> BreakAtStart
" middle " -> n/a
"end" -> BreakAtEnd
"parent" -> n/a
Another example:
<span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span>
line breaking -> <parent start middle end parent>
due to padding-right, final runs -> <parent start middle end><parent>
"parent" -> n/a
"start" -> n/a
" middle " -> n/a
"end" -> BreakAtEnd
"parent" -> n/a
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep)
(WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::detachingRules const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::lastInlineItem const):
(WebCore::Layout::InlineFormattingState::addDetachingRule):
2018-11-14 Youenn Fablet <youenn@apple.com>
Add support for RTCRtpCodecParameters.sdpFmtpLine
https://bugs.webkit.org/show_bug.cgi?id=191591
Reviewed by Eric Carlson.
Covered by rebased test.
* Modules/mediastream/RTCRtpCodecParameters.h:
* Modules/mediastream/RTCRtpCodecParameters.idl:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCCodecParameters):
2018-11-14 Youenn Fablet <youenn@apple.com>
Add support for transport and peerConnection stats
https://bugs.webkit.org/show_bug.cgi?id=191592
Reviewed by Alex Christensen.
Covered by rebased tests.
* Modules/mediastream/RTCStatsReport.h:
(WebCore::RTCStatsReport::TransportStats::TransportStats):
(WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats):
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillRTCTransportStats):
(WebCore::fillRTCPeerConnectionStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2018-11-14 Ali Juma <ajuma@chromium.org>
Transform of composited layer not updated when layer also needs repaint
https://bugs.webkit.org/show_bug.cgi?id=191598
Reviewed by Simon Fraser.
Trigger a compositing geometry update whenever a RenderLayer's transform changes,
even when other parts of its style have changed in a way that produces a
StyleDifference greater than RecompositeLayer.
Test: compositing/geometry/transform-and-repaint-updates-geometry.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::layerStyleChanged):
2018-11-13 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Support CTAP HID authenticators on macOS
https://bugs.webkit.org/show_bug.cgi?id=188623
<rdar://problem/43353777>
Reviewed by Brent Fulgham and Chris Dumez.
This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore
any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic
dependency. Also, it adds a hack to temporarily deal with nullable userhandle.
Tests: http/wpt/webauthn/ctap-hid-failure.https.html
http/wpt/webauthn/ctap-hid-success.https.html
http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html
http/wpt/webauthn/public-key-credential-create-failure-hid.https.html
http/wpt/webauthn/public-key-credential-create-success-hid.https.html
http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html
http/wpt/webauthn/public-key-credential-get-failure-hid.https.html
http/wpt/webauthn/public-key-credential-get-success-hid.https.html
* Modules/webauthn/AuthenticatorCoordinatorClient.cpp:
(WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted.
* Modules/webauthn/AuthenticatorCoordinatorClient.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/fido/DeviceResponseConverter.cpp:
(fido::readCTAPGetAssertionResponse):
* Modules/webauthn/fido/FidoConstants.h:
2018-11-13 Ross Kirsling <ross.kirsling@sony.com>
[WebRTC] Provide default implementation of LibWebRTCProvider
https://bugs.webkit.org/show_bug.cgi?id=191611
Reviewed by Michael Catanzaro.
Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults.
* PlatformWin.cmake:
* platform/GStreamer.cmake:
* platform/SourcesGLib.txt:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp.
* platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h.
* platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed.
2018-11-13 Timothy Hatcher <timothy@apple.com>
Use a light scrollbar for transparent web views in dark mode.
https://bugs.webkit.org/show_bug.cgi?id=191559
rdar://problem/46000489
Reviewed by Dean Jackson.
Test: css-dark-mode/supported-color-schemes-scrollbar.html
* css/CSSProperties.json: Marked supported-color-schemes as a custom Value.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes):
* editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance().
(WebCore::createFragment):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance().
* page/FrameView.cpp:
(WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for
transparent web views in dark mode.
(WebCore::FrameView::rendererForSupportedColorSchemes const): Added.
Return the body for document element renderer.
(WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes.
(WebCore::FrameView::styleColorOptions const): Added. Ditto.
* page/FrameView.h:
* rendering/style/RenderStyle.cpp:
(WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added.
(WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added.
(WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Use FrameView's useDarkAppearance().
* testing/Internals.cpp:
(WebCore::Internals::setViewIsTransparent): Added.
(WebCore::Internals::scrollbarOverlayStyle const): Added.
* testing/Internals.h:
* testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle.
2018-11-13 Ross Kirsling <ross.kirsling@sony.com>
[AppleWin] Unreviewed build fix after r238108.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(printLayer):
(PlatformCALayerWin::embeddedViewID const):
* platform/graphics/ca/win/PlatformCALayerWin.h:
2018-11-13 Youenn Fablet <youenn@apple.com>
RTCPeerConnection.getTransceivers is not always exposing all transceivers
https://bugs.webkit.org/show_bug.cgi?id=191589
Reviewed by Eric Carlson.
Implement the collect transceiver algorithm using libwebrtc backend.
Call this algorithm everytime transceivers are retrieved from JS.
For Plan B, make this a no-op as this is not supported.
Introduce senders/receivers/transceivers getters where we just look at already created transceivers.
Covered by existing and rebased tests.
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::collectTransceivers):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getSenders const):
(WebCore::RTCPeerConnection::getReceivers const):
(WebCore::RTCPeerConnection::getTransceivers const):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::collectTransceivers):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers):
(WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
(WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2018-11-13 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Do not show selection UI for editable elements with opacity near zero
https://bugs.webkit.org/show_bug.cgi?id=191442
<rdar://problem/45958625>
Reviewed by Simon Fraser.
Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html
editing/selection/ios/hide-selection-after-hiding-contenteditable.html
editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html
editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html
editing/selection/ios/hide-selection-in-hidden-contenteditable.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::isTransparentRespectingParentFrames const):
Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent
frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01).
Opacity on ancestor elements is applied multiplicatively.
* rendering/RenderObject.h:
2018-11-13 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Observer AVCaptureDevice "suspended" property
https://bugs.webkit.org/show_bug.cgi?id=191587
<rdar://problem/46030598>
Reviewed by Youenn Fablet.
No new tests, AVCapture can only be tested manually.
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes"
the first time the device list is scanned.
(WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't
change device availability.
(WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all
devices and add them to the cached list.
(WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above.
(WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of
devices.
(WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices.
(WebCore::AVCaptureDeviceManager::registerForDeviceNotifications):
(-[WebCoreAVCaptureDeviceManagerObserver disconnect]):
(-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]):
(-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]):
(WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted.
(WebCore::AVCaptureDeviceManager::deviceConnected): Deleted.
(WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted.
(-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted.
(-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate")
and "suspended".
(WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended".
(WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange):
(-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
2018-11-13 Devin Rousso <drousso@apple.com>
Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers
https://bugs.webkit.org/show_bug.cgi?id=191597
Reviewed by Joseph Pecoraro.
When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched,
meaning that we may try to fetch in situations previously unexpected.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
2018-11-13 Timothy Hatcher <timothy@apple.com>
Treat supported-color-schemes as the second highest priority property.
https://bugs.webkit.org/show_bug.cgi?id=191556
rdar://problem/46000076
Reviewed by Dean Jackson.
Test: css-dark-mode/supported-color-schemes-priority.html
* css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes
after -webkit-ruby-position, before other properties, so it can affect resolved colors.
2018-11-13 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes.
https://bugs.webkit.org/show_bug.cgi?id=191316
Reviewed by Xabier Rodriguez-Calvar.
Another preparation in patch getting ready to move the decryption
logic behind the CDMInstance and out of the GStreamer decryptors
themselves. The first step taken here is to arrange for the
instances to always be available in the decryptors when they need
to decrypt content.
In doing so, there were a number of hairy bits of code that could
use some abstraction, so the opportunity was taken to do that as
well.
Covered by tests in media/encrypted-media and
imported/w3c/web-platform-tests/encrypted-media.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove
drm-key-needed since it was not being used anywhere.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
Factor out the parsing of decryption system information from
GStreamer, since it was not clear what that code was doing unless
you squinted pretty hard. Also remove the duplicated
initialization-data-encountered posting.
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
Refactored to make it a more general method and usable in more
situations. It now has an optional to stop it from eliding init
datas for a different key system. This is required the first time
we post them, since if a CDM instance has already been set, and if
the stream init datas are for different systems, we ended up never
posting an encrypted event.
(WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance):
Actually send a CDMInstance now when in regular playback mode.
(WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey):
Remove m_needToSendCredentials, it was not being used.
(WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
Refactored to use the new initializationDataEncountered.
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
Log the waiting state, since it was currently not clear what that
logging message was even telling you!
(WebCore::extractEventsAndSystemsFromMessage): Deleted.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::InitData::InitData): New class that encapsulates both
single instantiation and streaming instantiation.
(WebCore::InitData::append): Used for the streaming mode, when you
are concatenating init datas together.
(WebCore::InitData::payload const):
(WebCore::InitData::systemId const):
(WebCore::InitData::payloadContainerType const):
(WebCore::InitData::isFromDifferentContainer):
(WebCore::ProtectionSystemEvents::ProtectionSystemEvents):
(WebCore::ProtectionSystemEvents::events const):
(WebCore::ProtectionSystemEvents::availableSystems const):
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace): If you post
waiting-for-key after requesting a CDM instance, it will flap back
to not waiting for a key almost immediately, didn't make sense
positing after requesting an instance. Also post key-received when
we receive the key.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now
been arranged that a CDMInstance will always be present in an OOB
message, so parse it out here.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
As above, make sure when posting the OOB that a CDMInstance is present.
2018-11-13 Charlie Turner <cturner@igalia.com>
Various compiler warnings/errors fixes.
https://bugs.webkit.org/show_bug.cgi?id=191583
Reviewed by Frédéric Wang.
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore):
ASSERT is only compiled in DEBUG mode, so guarding with
!LOG_DISABLED is wrong.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING)
mode, so guarding with !LOG_DISABLED was wrong.
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
Ditto, this time with member .depth.
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto.
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::styleChanged): Add another unused
parameter.
2018-11-12 Antoine Quint <graouts@apple.com>
[Web Animations] Don't schedule animation frames or update style while an accelerated animation is running
https://bugs.webkit.org/show_bug.cgi?id=191542
<rdar://problem/45356027>
Reviewed by Simon Fraser.
Test: animations/no-style-recalc-during-accelerated-animation.html
In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated
animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and
when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated
animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled
for that time when we'll schedule animation resolution.
By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure
we also update animations in-flight to dispatch "animationiteration" events.
* animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick().
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded().
(WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time.
(WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next.
(WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can
cache the current time in suspendAnimations() without also automatically clearing the current time.
(WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been
factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly
by virtue of using cacheCurrentTime(). This fixes some flakiness.
(WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime().
(WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended.
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already,
scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead.
(WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution.
(WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents()
and call scheduleNextTick().
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running.
(WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated.
Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations.
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new
function to get that information directly through the WebAnimation object without bothering about its effect.
(WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential
change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated.
(WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration.
* animation/WebAnimation.h:
2018-11-13 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area
https://bugs.webkit.org/show_bug.cgi?id=191545
Reviewed by Žan Doberšek.
Keep track of layer size changes even if they happen when the layer is not in the visible
area, so we can update edge tiles when the layer gets visible.
* platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
(WebCore::TiledBackingStore::createTiles):
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
2018-11-12 Rob Buis <rbuis@igalia.com>
Content-Type parameter values should allow empty quoted strings
https://bugs.webkit.org/show_bug.cgi?id=191388
Reviewed by Dean Jackson.
According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty
quoted strings are acceptable for Content-Type parameter values. They
are accepted by Firefox and Chrome implementations as well.
Test: web-platform-tests/xhr/overridemimetype-blob.html
* platform/network/ParsedContentType.cpp:
(WebCore::parseToken):
(WebCore::parseQuotedString):
(WebCore::parseContentType):
* platform/network/ParsedContentType.h:
2018-11-12 Christopher Reid <chris.reid@sony.com>
[Curl] Reject entire cookie if the domain fails a tailmatch.
https://bugs.webkit.org/show_bug.cgi?id=191406
Reviewed by Youenn Fablet.
Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox
and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead.
Also cleanup Cookie database implementation to make them testable better.
Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::canAcceptCookie): Added.
(WebCore::CookieJarDB::setCookie):
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieAttributes):
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CookieUtil.h:
2018-11-12 Devin Rousso <drousso@apple.com>
Web Inspector: Network: show secure certificate details per-request
https://bugs.webkit.org/show_bug.cgi?id=191447
<rdar://problem/30019476>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/network/resource-response-security.html
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added.
Always save certificate information when WebInspector is open.
* platform/network/CertificateInfoBase.h: Added.
(WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const):
(WebCore::CertificateInfoBase::summaryInfo const):
(WebCore::CertificateInfoBase::isEmpty const):
* platform/network/cf/CertificateInfo.h:
(WebCore::CertificateInfo::summaryInfo const): Added.
* platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
(WebCore::CertificateInfo::summaryInfo const): Added.
* platform/network/curl/CertificateInfo.h:
(WebCore::CertificateInfo::summaryInfo const): Added.
(WebCore::CertificateInfo::isEmpty const): Added.
* platform/network/soup/CertificateInfo.h:
(WebCore::CertificateInfo::summaryInfo const): Added.
(WebCore::CertificateInfo::isEmpty const): Added.
Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have
platform-specific code in its implementation.
* platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm.
* platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp.
* platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp.
* inspector/NetworkResourcesData.h:
(WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added.
(WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added.
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::responseReceived):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
* PlatformAppleWin.cmake:
* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/Curl.cmake:
* platform/SourcesSoup.txt:
2018-11-12 Zalan Bujtas <zalan@apple.com>
Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer.
https://bugs.webkit.org/show_bug.cgi?id=191554
<rdar://problem/45825265>
Reviewed by Antti Koivisto.
While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block.
Moving a renderer is a 2 step process:
1. Detach the renderer from its current parent
2. Attach it to its new parent.
During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling
is not needed anymore (except we use it as the new parent).
Test: fast/inline/marker-list-item-move-should-not-crash.html
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::detach):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::detach):
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
2018-11-12 Javier Fernandez <jfernandez@igalia.com>
[css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic
https://bugs.webkit.org/show_bug.cgi?id=191358
Reviewed by Manuel Rego Casasnovas.
These changes are just a refactoring to ease the integration of the new Baseline Alignment
logic in a follow up patch.
We need to properly estimate the grid area size of orthogonal items so that we can perform
an accurate pre-layout. This is important because orthogonal items will synthesize their baseline
if they participate in any baseline alignment context.
No new tests, since no behavior change has been introduced in this patch.
* rendering/Grid.cpp:
(WebCore::Grid::setNeedsItemsPlacement):
* rendering/Grid.h:
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
(WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const):
(WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const):
(WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
(WebCore::GridTrackSizingAlgorithm::run):
(WebCore::GridTrackSizingAlgorithm::reset):
* rendering/GridTrackSizingAlgorithm.h:
(WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::computeIntrinsicLogicalWidths const):
(WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const):
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::performGridItemsPreLayout const):
(WebCore::overrideSizeChanged):
(WebCore::hasRelativeBlockAxisSize):
(WebCore::RenderGrid::updateGridAreaLogicalSize const):
(WebCore::RenderGrid::layoutGridItems):
* rendering/RenderGrid.h:
2018-11-12 Sihui Liu <sihui_liu@apple.com>
imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device
https://bugs.webkit.org/show_bug.cgi?id=191500
Reviewed by Dean Jackson.
When double value is bigger than maximum unsigned int, converting double to unsigned int has
different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be
maximum unsigned int.
Covered by existing test.
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
(WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
2018-11-12 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl] Add API Test for Curl cookie backend.
https://bugs.webkit.org/show_bug.cgi?id=191493
Reviewed by Youenn Fablet.
Refactoring for cookie backend interface.
Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp
* platform/FileSystem.h:
* platform/network/curl/CookieJarCurlDatabase.cpp:
(WebCore::cookiesForSession):
(WebCore::CookieJarCurlDatabase::setCookiesFromDOM const):
(WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const):
(WebCore::CookieJarCurlDatabase::getRawCookies const):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::checkSQLiteReturnCode):
(WebCore::CookieJarDB::isEnabled const):
(WebCore::CookieJarDB::searchCookies):
(WebCore::CookieJarDB::setCookie):
(WebCore::CookieJarDB::deleteCookie):
(WebCore::CookieJarDB::deleteCookieInternal):
(WebCore::CookieJarDB::deleteCookies):
(WebCore::CookieJarDB::deleteAllCookies):
(WebCore::CookieJarDB::executeSimpleSql):
(WebCore::CookieJarDB::isEnabled): Deleted.
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/CookieUtil.cpp:
(WebCore::CookieUtil::parseCookieHeader):
* platform/network/curl/CookieUtil.h:
* platform/win/FileSystemWin.cpp:
(WebCore::FileSystem::generateTemporaryPath):
(WebCore::FileSystem::openTemporaryFile):
(WebCore::FileSystem::createTemporaryDirectory):
(WebCore::FileSystem::deleteNonEmptyDirectory):
2018-11-12 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
<rdar://problem/30107985>
Reviewed by Dean Jackson.
Tests: editing/images/basic-editable-image.html
editing/images/reparent-editable-image-maintains-strokes.html
Add the beginnings of a mechanism to replace images with a special attribute
with a native drawing view in the UI process.
* page/Settings.yaml:
Add a setting to control whether images become natively editable when they
have the x-apple-editable-image attribute.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::editableImageViewID const):
Lazily generate an EmbeddedViewID and persist it on the <img> element.
* html/HTMLImageElement.h:
Rearrange the service controls methods to sit before the members.
Add m_editableImageViewID and editableImageViewID().
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::nextEmbeddedViewID):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setContentsToEmbeddedView):
Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
on Cocoa platforms and when using RemoteLayerTree.
Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
and an EmbeddedViewID to uniquely identify and communicate about the
embedded view (which may move between layers, since it is tied to an element).
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
(WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
When setting GraphicsLayer's contents to an embedded view, we use
a special PlatformCALayer factory that takes the EmbeddedViewID and type.
GraphicsLayerCARemote will override this and make a correctly-initialized
PlatformCALayerRemote that keeps track of the EmbeddedViewID.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
(WebCore::PlatformCALayerCocoa::embeddedViewID const):
Add stubs and logging for EmbeddedViewID on PlatformCALayer.
These will be overridden by PlatformCALayerRemote to do more interesting things.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isEditableImage const):
Add a getter that return true if the setting is enabled and
x-apple-editable-image is empty or true.
(WebCore::RenderImage::requiresLayer const):
RenderImage requires a layer either if RenderReplaced does, or we are an
editable image.
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
* rendering/RenderLayerCompositor.h:
Make editable images require compositing implicitly.
2018-11-12 Don Olmstead <don.olmstead@sony.com>
Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile
https://bugs.webkit.org/show_bug.cgi?id=189230
<rdar://problem/44050379>
Reviewed by Joseph Pecoraro.
Runs all png images through zopflipng. This results in a smaller file
size and takes care of this issue as a byproduct.
* Modules/modern-media-controls/images/iOS/airplay-placard@1x.png:
* Modules/modern-media-controls/images/iOS/airplay-placard@2x.png:
* Modules/modern-media-controls/images/iOS/airplay-placard@3x.png:
* Modules/modern-media-controls/images/iOS/invalid-placard@1x.png:
* Modules/modern-media-controls/images/iOS/invalid-placard@2x.png:
* Modules/modern-media-controls/images/iOS/invalid-placard@3x.png:
* Modules/modern-media-controls/images/iOS/pip-placard@1x.png:
* Modules/modern-media-controls/images/iOS/pip-placard@2x.png:
* Modules/modern-media-controls/images/iOS/pip-placard@3x.png:
* Modules/modern-media-controls/images/macOS/airplay-placard@1x.png:
* Modules/modern-media-controls/images/macOS/airplay-placard@2x.png:
* Modules/modern-media-controls/images/macOS/invalid-placard@1x.png:
* Modules/modern-media-controls/images/macOS/invalid-placard@2x.png:
* Modules/modern-media-controls/images/macOS/pip-placard@1x.png:
* Modules/modern-media-controls/images/macOS/pip-placard@2x.png:
* Resources/AttachmentPlaceholder.png:
* Resources/AttachmentPlaceholder@2x.png:
* Resources/ListButtonArrow.png:
* Resources/ListButtonArrow@2x.png:
* Resources/missingImage.png:
* Resources/missingImage@2x.png:
* Resources/missingImage@3x.png:
* Resources/moveCursor.png:
* Resources/northEastSouthWestResizeCursor.png:
* Resources/northSouthResizeCursor.png:
* Resources/northWestSouthEastResizeCursor.png:
* Resources/nullPlugin.png:
* Resources/nullPlugin@2x.png:
* Resources/panIcon.png:
* Resources/textAreaResizeCorner.png:
* Resources/textAreaResizeCorner@2x.png:
* Resources/urlIcon.png:
2018-11-12 Youenn Fablet <youenn@apple.com>
RealtimeOutgoing A/V sources should observe their sources only if having a sink
https://bugs.webkit.org/show_bug.cgi?id=191490
Reviewed by Eric Carlson.
Observe the source that generates media based on the sinks:
- Do not observe at creation time
- For first sink, start observing
- When no more sink, stop observing
Apply this principle for both outgoing audio and video sources.
Add locks for the sinks to ensure thread-safety.
Make sinks HashSet which is more robust.
Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations.
Covered by existing tests and updated webrtc/remove-track.html.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::stop):
(WebCore::RealtimeOutgoingAudioSource::AddSink):
(WebCore::RealtimeOutgoingAudioSource::RemoveSink):
(WebCore::RealtimeOutgoingAudioSource::sendAudioFrames):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource):
(WebCore::RealtimeOutgoingVideoSource::observeSource):
(WebCore::RealtimeOutgoingVideoSource::setSource):
(WebCore::RealtimeOutgoingVideoSource::stop):
(WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
(WebCore::RealtimeOutgoingVideoSource::RemoveSink):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
(WebCore::RealtimeOutgoingVideoSource::isSilenced const):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
(WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable):
(WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
2018-11-12 Youenn Fablet <youenn@apple.com>
Support setting stream ids when adding a transceiver
https://bugs.webkit.org/show_bug.cgi?id=191307
Reviewed by Eric Carlson.
Add support for streams in RTCTransceiverInit.
Add plumbing down to libwebrtc.
Covered by rebased tests.
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::fromRtpTransceiverInit):
2018-11-12 Antti Koivisto <antti@apple.com>
Support dynamic pseudo-classes on elements with display: contents
https://bugs.webkit.org/show_bug.cgi?id=181640
<rdar://problem/36605415>
Reviewed by Dean Jackson.
The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation.
This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but
includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited
text properties).
Test: fast/css/display-contents-hover-active.html
* dom/Document.cpp:
(WebCore::Document::updateHoverActiveState):
Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree
but also includes display:content elements. This also allows removing the special display:none case.
* dom/Element.cpp:
(WebCore::Element::setActive):
(WebCore::Element::setHovered):
Also look into display:contents style for invalidation checks.
(WebCore::Element::renderOrDisplayContentsStyle const):
Make this helper an Element member.
* dom/Element.h:
* dom/Node.cpp:
(WebCore::Node::parentElementInComposedTree const):
Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator.
* rendering/updating/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::nextSiblingRenderer const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::shouldResolveElement):
(WebCore::Style::TreeResolver::resolveComposedTree):
(WebCore::Style::renderOrDisplayContentsStyle): Deleted.
Use the Element::renderOrDisplayContentsStyle() instead.
2018-11-12 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations experimental
https://bugs.webkit.org/show_bug.cgi?id=191543
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2018-11-12 Simon Fraser <simon.fraser@apple.com>
feFlood with alpha color doesn't work correctly
https://bugs.webkit.org/show_bug.cgi?id=163666
Reviewed by Zalan Bujtas.
FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha()
rather than multiplying the flood color with the flood opacity as other browsers do.
Test: svg/filters/feFlood-with-alpha-color.html
* platform/graphics/Color.cpp:
(WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere,
and it triggered a behavior change, so add a comment.
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):
2018-11-12 Eric Carlson <eric.carlson@apple.com>
Require <iframe allow="display"> for an iframe to use getDisplayMedia
https://bugs.webkit.org/show_bug.cgi?id=191505
<rdar://problem/45968811>
Reviewed by Jer Noble.
Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start):
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isAllowedToUse):
(WebCore::UserMediaController::canCallGetUserMedia):
(WebCore::UserMediaController::logGetUserMediaDenial):
* Modules/mediastream/UserMediaController.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start):
2018-11-12 Simon Fraser <simon.fraser@apple.com>
Make compositing updates incremental
https://bugs.webkit.org/show_bug.cgi?id=90342
Reviewed by Antti Koivisto.
Previously, updating compositing layers required two full RenderLayer tree traversals,
and all the work was done for every RenderLayer on each composting update. This could be expensive
on pages with lots of RenderLayers.
These changes make compositing updates more incremental. Compositing updates still require
two tree traversals. The first determines which RenderLayers need to be composited (of those which
weren't already made composited at style-change time), because of reasons that can only be determined
post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry
and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make
it hard to fold these two traversals together.
In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers,
and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first
"compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal.
When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need
to be visited.
Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have
to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize
work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can
be skipped if no change has triggered the need for that traversal.
These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes
more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates
triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by
excluding composited filters from the composited bounds (but still taking them into account for overlap).
Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html).
Code to set the dirty bits is added in various places that change properties that compositing depends on.
These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the
style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy"
traversal, which is always a pre-order traversal.
Tests: compositing/geometry/stacking-context-change-layer-reparent.html
compositing/layer-creation/change-to-overlap.html
compositing/updates/no-updates-in-non-composited-iframe.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited
for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value.
* page/FrameView.cpp:
(WebCore::FrameView::setViewportConstrainedObjectsNeedLayout):
* page/Page.cpp:
(WebCore::Page::setPageScaleFactor):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleWillChange):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::~RenderLayer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::shouldBeStackingContext const):
(WebCore::RenderLayer::stackingContext const):
(WebCore::RenderLayer::dirtyZOrderLists):
(WebCore::RenderLayer::dirtyNormalFlowList):
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag):
(WebCore::RenderLayer::contentChanged):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::RenderLayer::updateTransform):
(WebCore::RenderLayer::updateLayerPosition):
(WebCore::RenderLayer::enclosingCompositingLayer const):
(WebCore::RenderLayer::enclosingCompositingLayerForRepaint const):
(WebCore::RenderLayer::clippingRootForPainting const):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::hitTest):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::compositingContainer): Deleted.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::clearZOrderLists):
(WebCore::RenderLayer::paintOrderParent const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateAfterWidgetResize):
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::paintsContent const):
(WebCore::RenderLayerBacking::contentChanged):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::startAnimation):
(WebCore::RenderLayerBacking::animationFinished):
(WebCore::RenderLayerBacking::startTransition):
(WebCore::RenderLayerBacking::transitionFinished):
(WebCore::RenderLayerBacking::setCompositedBounds):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::CompositingState::CompositingState):
(WebCore::RenderLayerCompositor::enableCompositingMode):
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout):
(WebCore::RenderLayerCompositor::willRecalcStyle):
(WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::layerBecameNonComposited):
(WebCore::RenderLayerCompositor::logLayerInfo):
(WebCore::clippingChanged):
(WebCore::styleAffectsLayerGeometry):
(WebCore::RenderLayerCompositor::layerStyleChanged):
(WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const):
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::updateLayerCompositingState):
(WebCore::RenderLayerCompositor::layerWasAdded):
(WebCore::RenderLayerCompositor::layerWillBeRemoved):
(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
(WebCore::RenderLayerCompositor::computeExtent const):
(WebCore::RenderLayerCompositor::addToOverlapMap):
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::rootLayerConfigurationChanged):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateRootLayerPosition):
(WebCore::RenderLayerCompositor::needsToBeComposited const):
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::clippedByAncestor const):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
(WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
(WebCore::RenderLayerCompositor::requiresCompositingForFilters const):
(WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
(WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
(WebCore::RenderLayerCompositor::requiresCompositingForFrame const):
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons):
(WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
(WebCore::operator<<):
(WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted.
(WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted.
(WebCore::isScrollableOverflow): Deleted.
(WebCore::styleHasTouchScrolling): Deleted.
(WebCore::styleChangeRequiresLayerRebuild): Deleted.
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted.
(WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted.
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted.
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted.
* rendering/RenderLayerCompositor.h:
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
2018-11-12 Rob Buis <rbuis@igalia.com>
CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com
https://bugs.webkit.org/show_bug.cgi?id=190839
Reviewed by Frédéric Wang.
The CSSCalcOperation ctor that takes a leftSide and rightSide parameter
wastes memory since it will always have size 2 but claims the
default Vector size. So make sure to reserve an initial capacity of 2.
* css/CSSCalculationValue.cpp:
2018-11-12 Yusuke Suzuki <yusukesuzuki@slowstart.org>
WTFMove(xxx) is used in arguments while other arguments touch xxx
https://bugs.webkit.org/show_bug.cgi?id=191544
Reviewed by Alex Christensen.
The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx),
xxx should not be touched in the other arguments. This patch fixes such uses in
IDB code.
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::deleteIndex):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::scheduleOperation):
* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore):
* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::registerIndex):
2018-11-12 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Construct dedicated runs when the inline element requires it.
https://bugs.webkit.org/show_bug.cgi?id=191509
Reviewed by Antti Koivisto.
In certain cases, a run can overlap multiple inline elements like this:
<span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span>
The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking.
However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::contentRequiresSeparateRun):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::inlineFormattingState const):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet.
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::overlapsMultipleInlineItems const):
* layout/inlineformatting/InlineRunProvider.cpp:
(WebCore::Layout::InlineRunProvider::processInlineTextItem):
* layout/inlineformatting/InlineRunProvider.h:
(WebCore::Layout::InlineRunProvider::Run::TextContext::expand):
(WebCore::Layout::InlineRunProvider::Run::textContext):
(WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted.
(WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted.
2018-11-12 Jer Noble <jer.noble@apple.com>
[MSE] Frame re-ordering can cause iframes to never be enqueued
https://bugs.webkit.org/show_bug.cgi?id=191485
Reviewed by Eric Carlson.
Test: media/media-source/media-source-dropped-iframe.html
Some frame re-ordering techniques result in files where the first frame has a
decode timestamp < 0, but a presentation timestamp >= 0. When appending these
samples to existing content, we can fail to enqueue the first frame because its
DTS overlaps an existing sample, but the presentation timestamp does not.
Rather than try to only enqueue samples whose decode timestamps are > than the
greatest decode end timestamp (minus some fudge factor), allow all frames to be
added to the decode queue if they are strictly ordered greater than the last
enqueued frame.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
(WebCore::SourceBuffer::provideMediaData):
(WebCore::SourceBuffer::reenqueueMediaForTime):
2018-11-12 Yusuke Suzuki <yusukesuzuki@slowstart.org>
IDBTransaction does not use "RefPtr<IDBTransaction> self"
https://bugs.webkit.org/show_bug.cgi?id=190436
Reviewed by Alex Christensen.
It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything.
Use `protectedThis = makeRef(*this)` instead.
No behavior change.
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::IDBTransaction):
2018-11-12 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Introduce AbortableTaskQueue
https://bugs.webkit.org/show_bug.cgi?id=190902
Reviewed by Xabier Rodriguez-Calvar.
A new synchronization primitive is introduced: AbortableTaskQueue,
which allows to send work to the main thread from a background thread
with the option to perform two-phase cancellation (startAborting() and
finishAborting()).
This new primitive has been used to overhaul GstBus messaging in
AppendPipeline. A lot of code made redundant has been deleted in the
process and lots of internal functions were now able to be made
private. As part of the refactor all glib signals in AppendPipeline
now use lambdas. All usages of WTF::isMainThread() in AppendPipeline
have been replaced by isMainThread() for consistency with the rest of
WebKit.
Two-phase cancellation is still not used in AppendPipeline as of this
patch, but it will be used in a future patch that makes use of
GStreamer flushes to implement correct MSE abort semantics. There are
unit tests to ensure it works correctly, even if it's still not used.
* WebCore.xcodeproj/project.pbxproj:
* platform/AbortableTaskQueue.h: Added.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::dumpAppendState):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
(WebCore::AppendPipeline::sourceBufferPrivate):
(WebCore::AppendPipeline::appsinkCaps):
(WebCore::AppendPipeline::track):
(WebCore::AppendPipeline::demuxerSrcPadCaps):
(WebCore::AppendPipeline::playerPrivate):
2018-11-12 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] waitingforkey event should consider decryptors' waiting status
https://bugs.webkit.org/show_bug.cgi?id=191459
Reviewed by Carlos Garcia Campos.
The new cross platform architecture to report waitingforkey and
recover from it requires a more accurate knowledge of what is
going on with the decryptors because events are reported only once
(per key exchange run) and crossplatform only continues if we are
actually ready to continue, meaning that no decryptors are
waiting.
* platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added
GstIterator deleter.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail
out if we are requested to not wait anymore but there are still
waiting decryptors.
(WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
Query the pipeline, just a query after pipeline is built and
manual inspection during build. The query is optimal but sometimes
we can get this request when the pipeline is under construction so
queries do not arrive at the decryptors and we have to deliver it
by ourselves.
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey:
Deleted because it is now inlined.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkit_media_common_encryption_decrypt_class_init): Override
query method.
(webkitMediaCommonEncryptionDecryptTransformInPlace): When the
decryptor is going to block to wait, report before. When the
decryptor receives the key, report it got it.
(webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not
handle waitingforkey here.
(webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the
decryptor is waiting.
2018-11-12 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Silence ATK_XY_PARENT warnings
https://bugs.webkit.org/show_bug.cgi?id=191504
Reviewed by Carlos Garcia Campos.
* accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
(atkToContents):
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(textExtents):
* accessibility/atk/WebKitAccessibleUtil.cpp:
(contentsRelativeToAtkCoordinateType):
2018-11-11 Wenson Hsieh <wenson_hsieh@apple.com>
Implement a new edit command to change the enclosing list type
https://bugs.webkit.org/show_bug.cgi?id=191487
<rdar://problem/45955922>
Reviewed by Ryosuke Niwa.
Add support for a new edit command that changes the type of the enclosing list element around the selection from
unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via
SPI on WKWebView (`-_changeListType:`).
This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As
such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently
implemented entirely by Mail). See below for more details.
Test: editing/execCommand/change-list-type.html
WKWebViewEditActions.ChangeListType
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/ChangeListTypeCommand.cpp: Added.
(WebCore::listConversionTypeForSelection):
(WebCore::ChangeListTypeCommand::listConversionType):
Helper that returns a potential list conversion command that may be executed at the given document's selection,
if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the
DOM from the lowest common ancestor container of the current selection until we hit the first list element.
(WebCore::ChangeListTypeCommand::createNewList):
Helper method to create a new list element to replace the given list, and then clone element data from the given
list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list
which contains inline style properties drops the inline styles, because existing logic in Mail that implements
this editing command only copies the `class` attribute of the old list to the new list.
(WebCore::ChangeListTypeCommand::doApply):
Apply the edit command by running the following steps:
- Find the enclosing list element, if any (see above).
- Create a new list element of the opposite type as the enclosing list, and clone over element data from the
list element being replaced.
- Insert the new list next to the original list.
- Move all children of the original list to the new list.
- Remove the original list.
- Set the selection to the end of the new list.
* editing/ChangeListTypeCommand.h: Added.
* editing/EditAction.h:
Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa.
* editing/Editor.cpp:
(WebCore::Editor::changeSelectionListType):
Implement this by creating and applying a new ChangeListTypeCommand.
(WebCore::Editor::canChangeSelectionListType): Deleted.
Remove this for now, since there's no need for it until full support for edit command validation is implemented.
* editing/Editor.h:
* testing/Internals.cpp:
(WebCore::Internals::changeSelectionListType):
* testing/Internals.h:
* testing/Internals.idl:
Add internal hooks to change list type from layout tests.
2018-11-11 Daniel Bates <dabates@apple.com>
[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>
Reviewed by Dean Jackson.
Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
fields on iOS more closely match the behavior of password fields on Mac.
The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
web views listen for keyboard availability changes so as to update the the caps lock state when
a hardware keyboard is detached or attached.
* WebCore.xcodeproj/project.pbxproj:
* page/EventHandler.cpp:
(WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
(WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
* page/EventHandler.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]): Added.
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
shared by both Mac and iOS.
2018-11-11 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] In-flow positioned logic is really formatting context dependent.
https://bugs.webkit.org/show_bug.cgi?id=191512
Reviewed by Simon Fraser.
Move block formatting context specific code from FormattingContext to BlockFormattingContext.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted.
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-11-11 Myles C. Maxfield <mmaxfield@apple.com>
Address post-review comments after r237955
https://bugs.webkit.org/show_bug.cgi?id=191496
Reviewed by Darin Adler.
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
* style/InlineTextBoxStyle.h:
2018-11-11 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
Rename file.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* page/mac/EventHandlerMac.mm:
* platform/mac/URLMac.mm:
* platform/mac/WebCoreNSURLExtras.mm:
* platform/mac/WebCoreObjCExtras.mm:
* rendering/RenderThemeMac.mm:
2018-11-10 Benjamin Poulain <benjamin@webkit.org>
Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend
https://bugs.webkit.org/show_bug.cgi?id=191492
Reviewed by Alex Christensen.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
* page/mac/EventHandlerMac.mm:
* platform/mac/URLMac.mm:
* platform/mac/WebCoreNSURLExtras.mm:
* platform/mac/WebCoreObjCExtras.mm:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):
2018-11-10 Megan Gardner <megan_gardner@apple.com>
Fix build for 32bit Mac
https://bugs.webkit.org/show_bug.cgi?id=191511
Unreviewed Build Fix.
Build fix, not tests needed.
Make the apporiate delecrations for 32-bit mac support.
* editing/mac/DictionaryLookup.mm:
2018-11-10 Simon Fraser <simon.fraser@apple.com>
Remove support for -webkit-svg-shadow
https://bugs.webkit.org/show_bug.cgi?id=187429
<rdar://problem/41920735>
Reviewed by Dean Jackson.
-webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it,
so remove it. No other browser supports it, and chromestatus say it's used on less than
0.000001% of pages.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted.
(WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted.
(WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::didAttachChild):
* rendering/svg/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::layout):
* rendering/svg/RenderSVGImage.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::RenderSVGModelObject):
* rendering/svg/RenderSVGModelObject.h:
(WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted.
(WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted.
(WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted.
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::RenderSVGRoot):
(WebCore::RenderSVGRoot::updateCachedBoundaries):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGShape.cpp:
(WebCore::RenderSVGShape::updateRepaintBoundingBox):
* rendering/svg/RenderSVGShape.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
(WebCore::SVGRenderSupport::layoutChildren):
(WebCore::SVGRenderSupport::styleChanged):
(WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted.
(WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted.
(WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted.
(WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted.
(WebCore::SVGRenderSupport::childAdded): Deleted.
* rendering/svg/SVGRenderSupport.h:
2018-11-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238065.
Breaks internal builds.
Reverted changeset:
"Make it possible to edit images inline"
https://bugs.webkit.org/show_bug.cgi?id=191352
https://trac.webkit.org/changeset/238065
2018-11-10 Tim Horton <timothy_horton@apple.com>
Make it possible to edit images inline
https://bugs.webkit.org/show_bug.cgi?id=191352
<rdar://problem/30107985>
Reviewed by Dean Jackson.
Tests: editing/images/basic-editable-image.html
editing/images/reparent-editable-image-maintains-strokes.html
Add the beginnings of a mechanism to replace images with a special attribute
with a native drawing view in the UI process.
* page/Settings.yaml:
Add a setting to control whether images become natively editable when they
have the x-apple-editable-image attribute.
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::editableImageViewID const):
Lazily generate an EmbeddedViewID and persist it on the <img> element.
* html/HTMLImageElement.h:
Rearrange the service controls methods to sit before the members.
Add m_editableImageViewID and editableImageViewID().
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::nextEmbeddedViewID):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setContentsToEmbeddedView):
Add a new ContentsLayerPurpose, EmbeddedView, which is only supported
on Cocoa platforms and when using RemoteLayerTree.
Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type.
Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType
and an EmbeddedViewID to uniquely identify and communicate about the
embedded view (which may move between layers, since it is tied to an element).
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView):
(WebCore::GraphicsLayerCA::setContentsToEmbeddedView):
When setting GraphicsLayer's contents to an embedded view, we use
a special PlatformCALayer factory that takes the EmbeddedViewID and type.
GraphicsLayerCARemote will override this and make a correctly-initialized
PlatformCALayerRemote that keeps track of the EmbeddedViewID.
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::operator<<):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
(WebCore::PlatformCALayerCocoa::embeddedViewID const):
Add stubs and logging for EmbeddedViewID on PlatformCALayer.
These will be overridden by PlatformCALayerRemote to do more interesting things.
* rendering/RenderImage.cpp:
(WebCore::RenderImage::isEditableImage const):
Add a getter that return true if the setting is enabled and
x-apple-editable-image is empty or true.
(WebCore::RenderImage::requiresLayer const):
RenderImage requires a layer either if RenderReplaced does, or we are an
editable image.
* rendering/RenderImage.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::shouldBeNormalFlowOnly const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
Push the EmbeddedViewID and type down to GraphicsLayer for editable images.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const):
* rendering/RenderLayerCompositor.h:
Make editable images require compositing implicitly.
2018-11-09 Zalan Bujtas <zalan@apple.com>
[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
https://bugs.webkit.org/show_bug.cgi?id=191078
<rdar://problem/45736178>
Reviewed by Antti Koivisto.
1. Improve visuallyNonEmpty milestone confidence level.
Ignore whitespace and non visible text content.
Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
Check if the html/body is actually visible.
2. Issue initial paint soon after the milestone fires.
Use a 0ms timer to flush the initial paint.
Throttle additional flushes for 500ms and 1.5s (original behaviour).
3. Suspend optional style recalcs and layouts while painting is being throttled.
When parsing yields we initiate a 0ms style recalc/layout timer.
These optional layouts produce content that we have no intention to paint.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::shouldScheduleLayout):
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
(WebCore::FrameView::updateIsVisuallyNonEmpty):
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
* platform/graphics/FontCascade.h:
* rendering/RenderText.cpp: Check whether the text is actually visible at this point.
(WebCore::RenderText::RenderText):
2018-11-09 John Wilander <wilander@apple.com>
Add ability to configure document.cookie lifetime cap through user defaults
https://bugs.webkit.org/show_bug.cgi?id=191480
<rdar://problem/45240871>
Reviewed by Chris Dumez.
No new tests. Existing test makes sure we don't regress.
This change makes the capped lifetime in seconds configurable through
user defaults.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setAgeCapForClientSideCookies):
(WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted.
Renamed setAgeCapForClientSideCookies().
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
2018-11-09 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r238047.
Introduced layout test failures on iOS simulator.
Reverted changeset:
"[iOS] Draw caps lock indicator in password fields"
https://bugs.webkit.org/show_bug.cgi?id=190565
https://trac.webkit.org/changeset/238047
2018-11-09 Tim Horton <timothy_horton@apple.com>
Normal-flow-only flex items don't correctly respect z-index
https://bugs.webkit.org/show_bug.cgi?id=191486
Reviewed by Simon Fraser.
Test: css3/flexbox/z-index-with-normal-flow-only.html
* rendering/RenderLayer.cpp:
(WebCore::canCreateStackingContext):
r125693 did not ensure that flex items which would otherwise be
normal-flow-only would be put into the z-order tree when necessary.
Fix by respecting the same trigger we use to make layers for flex items;
namely, not having auto z-index.
2018-11-09 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Implement SPI on WKWebView to increase and decrease list levels
https://bugs.webkit.org/show_bug.cgi?id=191471
<rdar://problem/45952472>
Reviewed by Tim Horton.
Add new method stubs for changing the list type for the current selection (to be implemented in a future patch).
* editing/Editor.cpp:
(WebCore::Editor::canChangeSelectionListType):
(WebCore::Editor::changeSelectionListType):
* editing/Editor.h:
2018-11-09 Keith Rollin <krollin@apple.com>
Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324
Remove the use of .xcfilelists until their side-effects are better
understood.
* WebCore.xcodeproj/project.pbxproj:
2018-11-09 Jer Noble <jer.noble@apple.com>
SourceBuffer throws an error when appending a second init segment after changeType().
https://bugs.webkit.org/show_bug.cgi?id=191474
Reviewed by Eric Carlson.
Test: media/media-source/media-source-changetype-second-init.html
When encountering an initialization segment after changeType(), add the parsed codec types
to the list of allowed codecs.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::validateInitializationSegment):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::supportsType):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::canSwitchToType):
* platform/mock/mediasource/MockSourceBufferPrivate.h:
2018-11-09 Eric Carlson <eric.carlson@apple.com>
[MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled
https://bugs.webkit.org/show_bug.cgi?id=191479
<rdar://problem/45952201>
Reviewed by Jer Noble.
No new tests, tested manually.
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard
video frame sizes, correct a typo.
(WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider
rescaled sized when we already have an exact or aspect ratio match because it won't be used.
* platform/mediastream/mac/AVVideoCaptureSource.h:
(WebCore::AVVideoCaptureSource::width const): Deleted.
(WebCore::AVVideoCaptureSource::height const): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize.
(WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height.
(WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size,
the frame may be resized before deliver.
2018-11-09 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed MSVC build fix after r238039 (and r238046).
* bindings/js/JSWorkerGlobalScopeBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.h:
2018-11-09 Basuke Suzuki <basuke.suzuki@sony.com>
[Curl][WebKit] Implement Proxy configuration API.
https://bugs.webkit.org/show_bug.cgi?id=189053
Reviewed by Youenn Fablet.
Added API to set proxy from the app.
No new tests because there's no behaviour change in WebCore.
* platform/network/NetworkStorageSession.h:
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::setProxySettings):
* platform/network/curl/CurlProxySettings.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::NetworkStorageSession::setProxySettings const):
2018-11-09 Antti Koivisto <antti@apple.com>
Use OptionSet for layout milestones
https://bugs.webkit.org/show_bug.cgi?id=191470
Reviewed by Dean Jackson.
* WebCore.xcodeproj/project.pbxproj:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didReachLayoutMilestone):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::addPaintPendingMilestones):
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
* page/FrameView.h:
* page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h.
Renamed to appease WK2 IPC code generation.
* page/LayoutMilestones.h: Removed.
* page/Page.cpp:
(WebCore::Page::addLayoutMilestones):
(WebCore::Page::removeLayoutMilestones):
(WebCore::Page::isCountingRelevantRepaintedObjects const):
* page/Page.h:
(WebCore::Page::requestedLayoutMilestones const):
2018-11-09 Daniel Bates <dabates@apple.com>
[iOS] Draw caps lock indicator in password fields
https://bugs.webkit.org/show_bug.cgi?id=190565
<rdar://problem/45262343>
Reviewed by Dean Jackson.
Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password
fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the
indicator when caps locks is enabled via the hardware keyboard. We will look to support the software
keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>).
The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS.
In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In
Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the
WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult
the store in the WebProcess. A smaller part of this patch is having both the legacy and modern
web views listen for keyboard availability changes so as to update the the caps lock state when
a hardware keyboard is detached or attached.
* WebCore.xcodeproj/project.pbxproj:
* page/EventHandler.cpp:
(WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent()
so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code.
(WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged().
* page/EventHandler.h:
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state.
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(+[WebEvent modifierFlags]): Added.
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
(WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared
by both Mac and iOS.
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be
shared by both Mac and iOS.
2018-11-09 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix WinCairo build after r238039.
* bindings/js/JSWorkerGlobalScopeBase.h:
2018-11-09 Fujii Hironori <Hironori.Fujii@sony.com>
Extensions3DOpenGLES.h: warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
https://bugs.webkit.org/show_bug.cgi?id=191451
Reviewed by Dean Jackson.
No new tests because there is no behavior change.
* platform/graphics/opengl/Extensions3DOpenGLES.cpp:
(WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method.
* platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'.
2018-11-09 Andy Estes <aestes@apple.com>
[Payment Request] canMakePayment() should not consider serialized payment method data
https://bugs.webkit.org/show_bug.cgi?id=191432
Reviewed by Dean Jackson.
In https://github.com/w3c/payment-request/pull/806, we're changing the specification of
canMakePayment() to not consider serialized payment method data when deciding if a payment
method is supported. For Apple Pay, this means we resolve to true for
"https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required
fields.
Added test cases to
http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and
http/tests/paymentrequest/payment-request-show-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::canMakePayment):
2018-11-09 Andy Estes <aestes@apple.com>
[Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment
https://bugs.webkit.org/show_bug.cgi?id=191440
Reviewed by Dean Jackson.
PaymentResponse.details was being initialized in the PaymentResponse constructor and never
updated when the user accepts a retried payment. We need to update it.
Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::accept):
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::setDetailsFunction):
* Modules/paymentrequest/PaymentResponse.h:
2018-11-09 Fujii Hironori <Hironori.Fujii@sony.com>
MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
https://bugs.webkit.org/show_bug.cgi?id=191453
Reviewed by Per Arne Vollan.
No new tests because there is no behavior change.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'.
2018-11-09 Chris Dumez <cdumez@apple.com>
Unreviewed attempt to fix internal build on macOS.
'Export' is defined in several headers.
* bindings/js/JSDOMGlobalObject.cpp:
* bindings/js/JSDOMGlobalObject.h:
* bridge/jsc/BridgeJSC.cpp:
* bridge/jsc/BridgeJSC.h:
2018-11-09 Chris Dumez <cdumez@apple.com>
HTML form validation bubble disappears
https://bugs.webkit.org/show_bug.cgi?id=191418
Reviewed by Simon Fraser.
If we validate a form and find an invalid form control, we'll scroll it into view and show
the validation bubble. However, scrolling the element into view may be an asynchronous
operation, in which case it would discard the validation bubble prematurely because scrolling
hides the validation bubble. To address the issue, we now show the validation message
asynchronously after focusing the element (and potentially scrolling it into view).
Test: fast/forms/scroll-into-view-and-show-validation-message.html
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::focusAndShowValidationMessage):
2018-11-09 Brent Fulgham <bfulgham@apple.com>
[Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations.
https://bugs.webkit.org/show_bug.cgi?id=191452
<rdar://problem/45933964>
Reviewed by Zalan Bujtas.
Do a better job of balancing the BeginFigure/EndFigure calls in
the PathDirect2D implementation. Failure to do so puts the Geometry sink
into an error state that prevents it from producing drawing output.
* platform/graphics/Path.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawPath): Flush is needed here.
(WebCore::GraphicsContext::fillPath): Ditto.
(WebCore::GraphicsContext::strokePath): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::drawDidComplete):
(WebCore::Path::closeAnyOpenGeometries):
(WebCore::Path::transform):
(WebCore::Path::openFigureAtCurrentPointIfNecessary):
(WebCore::Path::moveTo):
(WebCore::Path::closeSubpath):
2018-11-09 Jer Noble <jer.noble@apple.com>
[Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test
https://bugs.webkit.org/show_bug.cgi?id=191396
Reviewed by Eric Carlson.
When changeType() is called, exempt video and text tracks (in addition to just audio tracks)
from "same codec" requirements.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::validateInitializationSegment):
2018-11-09 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r236365): [GTK] Many form-related tests are failing
https://bugs.webkit.org/show_bug.cgi?id=189993
Reviewed by Michael Catanzaro.
Only the first form data element is added to the message body due to a return added by mistake in r236365.
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::updateSoupMessageBody const): Remove return.
2018-11-09 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry
https://bugs.webkit.org/show_bug.cgi?id=191445
Reviewed by Antti Koivisto.
The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments.
(The line class would eventually turn into a collection of random things).
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::closeLine const):
(WebCore::Layout::InlineFormattingContext::appendContentToLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::Line::lastRunType const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::adjustedLineLogicalLeft): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted.
(WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted.
2018-11-09 Philippe Normand <pnormand@igalia.com>
Unreviewed, GStreamer build warning fix
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp()
returns a uint32_t, fix format string accordingly.
2018-11-08 Said Abou-Hallawa <sabouhallawa@apple.com>
Add an SPI to allow WebView clients to add additional supported image formats
https://bugs.webkit.org/show_bug.cgi?id=190454
Reviewed by Simon Fraser.
Add an SPI to allow additional supported image formats in WebView. These
additional formats can be set in the WKWebViewConfiguration as an NSArray
of NStrings. Each string represents an image source type aka UTI.
The ImageSourceType in the functions' names will be replaced by ImageType.
ImageType in this context is the image UTI (Uniform Type Identifier).
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):
(WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes):
(WebCore::supportedImageMIMETypesForEncoding):
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
* platform/MIMETypeRegistry.h:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::filenameExtension const):
(WebCore::ImageDecoderCG::encodedDataStatus const):
* platform/graphics/cg/ImageSourceCG.h:
* platform/graphics/cg/ImageSourceCGMac.mm:
(WebCore::MIMETypeForImageType):
(WebCore::preferredExtensionForImageType):
(WebCore::MIMETypeForImageSourceType): Deleted.
(WebCore::preferredExtensionForImageSourceType): Deleted.
* platform/graphics/cg/ImageSourceCGWin.cpp:
(WebCore::MIMETypeForImageType):
(WebCore::preferredExtensionForImageType):
(WebCore::MIMETypeForImageSourceType): Deleted.
(WebCore::preferredExtensionForImageSourceType): Deleted.
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::defaultSupportedImageTypes):
(WebCore::additionalSupportedImageTypes):
(WebCore::setAdditionalSupportedImageTypes):
(WebCore::isSupportedImageType):
(WebCore::supportedDefaultImageSourceTypes): Deleted.
(WebCore::isSupportImageSourceType): Deleted.
* platform/graphics/cg/UTIRegistry.h:
2018-11-08 Megan Gardner <megan_gardner@apple.com>
Adopt Reveal Framework to replace Lookup
https://bugs.webkit.org/show_bug.cgi?id=191097
Reviewed by Tim Horton.
Reveal is not currently testable.
The Reveal framework does the same job as Lookup and DataDectors.
In this patch we switch from using Lookup to determine what text
to select and define to using Reveal and RVItems. Since this
code needs to work on older systems, and Reveal is newer, we also need
to keep around the old code for old systems so that they can also
continue to work. Eventually we will remove this code and also likly switch
to passing RVItems across from the web process rather than making them
on each side.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/mac/DictionaryLookup.h:
* editing/mac/DictionaryLookup.mm:
Create a delegate to respond to Reveal and help draw the string or highlight.
(-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]):
(-[WebRevealHighlight setClearTextIndicator:]):
(-[WebRevealHighlight revealContext:rectsForItem:]):
(-[WebRevealHighlight revealContext:drawRectsForItem:]):
(-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]):
(-[WebRevealHighlight revealContext:stopHighlightingItem:]):
(WebCore::showPopupOrCreateAnimationController):
Unify the code paths and utalize the Reveal framework to create and/or display the popovers.
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
Pipe the new callback through.
(WebCore::tokenRange): Deleted.
Only used with Lookup
(WebCore::selectionContainsPosition): Deleted.
Only used with Lookup.
* editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm.
Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older
system.
(WebCore::tokenRange):
(WebCore::selectionContainsPosition):
(WebCore::expandSelectionByCharacters):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::showPopup):
(WebCore::DictionaryLookup::hidePopup):
(WebCore::DictionaryLookup::animationControllerForPopup):
2018-11-08 Keith Rollin <krollin@apple.com>
Create .xcfilelist files
https://bugs.webkit.org/show_bug.cgi?id=191324
<rdar://problem/45852819>
Reviewed by Alex Christensen.
As part of preparing for enabling XCBuild, create and use .xcfilelist
files. These files are using during Run Script build phases in an
Xcode project. If a Run Script build phase produces new files that are
used later as inputs to subsequent build phases, XCBuild needs to know
about these files. These files can be either specified in an "output
files" section of the Run Script phase editor, or in .xcfilelist files
that are associated with the Run Script build phase.
This patch takes the second approach. It consists of three sets of changes:
- Modify the DerivedSources.make files to have a
'print_all_generated_files" target that produces a list of the files
they create.
- Create a shell script that produces .xcfilelist files from the
output of the previous step, as well as for the files created in the
Generate Unified Sources build steps.
- Add the new .xcfilelist files to the associated projects.
Note that, with these changes, the Xcode workspace and projects can no
longer be fully loaded into Xcode 9. Xcode will attempt to load the
projects that have .xcfilelist files associated with them, but will
fail and display a placeholder for those projects instead. It's
expected that all developers are using Xcode 10 by now and that not
being able to load into Xcode 9 is not a practical issue. Keep in mind
that this is strictly an IDE issue, and that the projects can still be
built with `xcodebuild`.
Also note that the shell script that creates the .xcfilelist files can
also be used to verify that the set of files that's currently checked
in is up-to-date. This checking can be used as part of a check-in hook
or part of check-webkit-style to sooner catch cases where the
.xcfilelist files need to be regenerated.
No new tests -- no changed functionality.
* DerivedSources.make:
* DerivedSources.xcfilelist: Added.
* UnifiedSources.xcfilelist: Added.
* WebCore.xcodeproj/project.pbxproj:
2018-11-08 Don Olmstead <don.olmstead@sony.com>
Provide generic implementation of SSLKeyGenerator functions
https://bugs.webkit.org/show_bug.cgi?id=191428
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub
implementations. Since <keygen> is deprecated it looks unlikely that
an implementation is actually needed, however an implementation is
needed until support is reomved.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/SSLKeyGenerator.cpp: Added.
(WebCore::getSupportedKeySizes):
(WebCore::signedPublicKeyAndChallengeString):
* platform/SourcesGLib.txt:
* platform/glib/SSLKeyGeneratorGLib.cpp: Removed.
* platform/ios/SSLKeyGeneratorIOS.cpp: Removed.
2018-11-07 Myles C. Maxfield <mmaxfield@apple.com>
Unprefix text-decoration CSS3 properties
https://bugs.webkit.org/show_bug.cgi?id=127193
Reviewed by Dean Jackson.
The properties are stable, and there is interop.
Test: fast/css3-text/css3-text-decoration/unprefix.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleResolver.cpp:
(WebCore::shouldApplyPropertyInParseOrder):
(WebCore::isValidVisitedLinkProperty):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::isColorPropertyID):
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange):
* rendering/TextDecorationPainter.cpp:
(WebCore::decorationColor):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::colorIncludingFallback const):
(WebCore::RenderStyle::visitedDependentColor const):
2018-11-08 Timothy Hatcher <timothy@apple.com>
Add experimental support for a `supported-color-schemes` CSS property.
https://bugs.webkit.org/show_bug.cgi?id=191319
rdar://problem/45852261
Reviewed by Dean Jackson.
Tests: css-dark-mode/parse-supported-color-schemes.html
css-dark-mode/supported-color-schemes-css.html
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::updateSupportedColorSchemes):
(WebCore::StyleBuilderConverter::convertSupportedColorSchemes):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::colorFromPrimitiveValue const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSupportedColorSchemes):
(WebCore::CSSPropertyParser::parseSingleValue):
* dom/Document.cpp:
(WebCore::Document::resetLinkColor):
(WebCore::Document::resetVisitedLinkColor):
(WebCore::Document::resetActiveLinkColor):
(WebCore::Document::processSupportedColorSchemes):
(WebCore::Document::useDarkAppearance const):
(WebCore::Document::styleColorOptions const):
* dom/Document.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment):
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint):
* page/FrameView.cpp:
(WebCore::FrameView::useDarkAppearance const):
(WebCore::FrameView::paintScrollCorner):
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintBoxDecorations):
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
(WebCore::RenderBox::paintBackground):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionColor const):
(WebCore::RenderElement::selectionBackgroundColor const):
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents):
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::paintItemForeground):
(WebCore::RenderListBox::paintItemBackground):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::useDarkAppearance const):
(WebCore::RenderObject::styleColorOptions const):
* rendering/RenderObject.h:
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::usingDarkAppearance const): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const):
(WebCore::RenderThemeMac::adjustMenuListStyle const):
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
(WebCore::RenderThemeMac::paintSliderThumb):
(WebCore::RenderThemeMac::usingDarkAppearance const): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::supportedColorSchemes const):
(WebCore::RenderStyle::setSupportedColorSchemes):
(WebCore::RenderStyle::initialSupportedColorSchemes):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleSupportedColorSchemes.h: Added.
(WebCore::StyleSupportedColorSchemes::StyleSupportedColorSchemes):
(WebCore::StyleSupportedColorSchemes::operator== const):
(WebCore::StyleSupportedColorSchemes::operator!= const):
(WebCore::StyleSupportedColorSchemes::isAuto const):
(WebCore::StyleSupportedColorSchemes::isOnly const):
(WebCore::StyleSupportedColorSchemes::colorSchemes const):
(WebCore::StyleSupportedColorSchemes::add):
(WebCore::StyleSupportedColorSchemes::contains const):
(WebCore::StyleSupportedColorSchemes::setAllowsTransformations):
(WebCore::StyleSupportedColorSchemes::allowsTransformations const):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw):
2018-11-08 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Restrict domains at the target level instead of only at the window level
https://bugs.webkit.org/show_bug.cgi?id=191344
Reviewed by Devin Rousso.
* inspector/WorkerInspectorController.cpp:
(WebCore::WorkerInspectorController::WorkerInspectorController):
Remove Inspector domain from workers. It was unused anyways.
2018-11-08 Dean Jackson <dino@apple.com>
Add a String literal that returns a String
https://bugs.webkit.org/show_bug.cgi?id=191425
<rdar://problem/45914556>
Reviewed by Sam Weinig.
Use _str where possible.
API Test in WPT.
* Modules/fetch/FetchRequest.cpp:
(WebCore::computeReferrer):
* Modules/indexeddb/IDBKeyPath.cpp:
(WebCore::loggingString):
* Modules/webdatabase/OriginLock.cpp:
(WebCore::OriginLock::lockFileNameForPath):
* css/CSSBasicShapes.cpp:
(WebCore::updateCornerRadiusWidthAndHeight):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* loader/LinkHeader.cpp:
(WebCore::parseParameterValue):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::platform):
* platform/DateComponents.cpp:
(WebCore::DateComponents::toString const):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::keyIdentifierForKeyEvent):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::suffix const):
* rendering/RenderMenuList.cpp:
(RenderMenuList::setText):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::userInterfaceDirectionPolicy):
(WebCore::InternalSettings::systemLayoutDirection):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType const):
(WebCore::Internals::getCurrentCursorInfo):
2018-11-08 Jonathan Hammer <jonathan@e3software.com>
Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove
https://bugs.webkit.org/show_bug.cgi?id=191228
<rdar://problem/45786830>
Reviewed by Wenson Hsieh.
DragController::beginDrag should not call cleanupAfterSystemDrag because
the drag is still in progress even after the call to m_client.beginDrag()
returns. This is in contrast to DragController::doSystemDrag, where the
call to cleanupAfterSystemDrag is appropriate because the drag has
concluded by the time m_client.startDrag() returns.
Test: fast/events/drag-and-drop-move-not-copy.html
* page/DragController.cpp:
(WebCore::DragController::beginDrag):
2018-11-08 Zalan Bujtas <zalan@apple.com>
[BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments.
https://bugs.webkit.org/show_bug.cgi?id=191414
Reviewed by Antti Koivisto.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-11-08 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import CTAP device request/response converters from Chromium
https://bugs.webkit.org/show_bug.cgi?id=190784
<rdar://problem/45460333>
Reviewed by Brent Fulgham.
This patch imports Chromium's CTAP device request/response converters:
https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding
1. It directly imports the following files and suit them to WebKit's coding style:
https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45
2. It gathers the following methods into DeviceRequestConverter:
CtapGetAssertionRequest::EncodeAsCBOR()
CtapMakeCredentialRequest::EncodeAsCBOR()
PublicKeyCredentialDescriptor::ConvertToCBOR()
PublicKeyCredentialParams::ConvertToCBOR()
PublicKeyCredentialRpEntity::ConvertToCBOR()
PublicKeyCredentialUserEntity::ConvertToCBOR()
3. It also apply a patch from Chromium to CBORValue:
https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/
Besides importing things from Chromium, it also implements UserVerificationRequirement for both
PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options
can specify more dimensions of a desired authenticator.
Covered by API tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const):
(WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
* Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl.
* Modules/webauthn/cbor/CBORValue.cpp:
(cbor::CBORValue::CBORValue):
(cbor::CBORValue::getBool const):
* Modules/webauthn/cbor/CBORValue.h:
* Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added.
(fido::toArrayValue):
(fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse):
(fido::AuthenticatorGetInfoResponse::setMaxMsgSize):
(fido::AuthenticatorGetInfoResponse::setPinProtocols):
(fido::AuthenticatorGetInfoResponse::setExtensions):
(fido::AuthenticatorGetInfoResponse::setOptions):
(fido::encodeAsCBOR):
* Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added.
* Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added.
(fido::AuthenticatorSupportedOptions::setSupportsResidentKey):
(fido::AuthenticatorSupportedOptions::setUserVerificationAvailability):
(fido::AuthenticatorSupportedOptions::setUserPresenceRequired):
(fido::AuthenticatorSupportedOptions::setClientPinAvailability):
(fido::AuthenticatorSupportedOptions::setIsPlatformDevice):
(fido::convertToCBOR):
* Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added.
* Modules/webauthn/fido/DeviceRequestConverter.cpp: Added.
(fido::convertRpEntityToCBOR):
(fido::convertUserEntityToCBOR):
(fido::convertParametersToCBOR):
(fido::convertDescriptorToCBOR):
(fido::encodeMakeCredenitalRequestAsCBOR):
(fido::encodeGetAssertionRequestAsCBOR):
(fido::encodeEmptyAuthenticatorRequest):
* Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h.
* Modules/webauthn/fido/DeviceResponseConverter.cpp: Added.
(fido::convertStringToProtocolVersion):
(fido::getResponseCode):
(fido::getCredentialId):
(fido::readCTAPMakeCredentialResponse):
(fido::readCTAPGetAssertionResponse):
(fido::readCTAPGetInfoResponse):
* Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp.
* Modules/webauthn/fido/FidoConstants.cpp:
(fido::isCtapDeviceResponseCode):
(fido::publicKeyCredentialTypeToString):
* Modules/webauthn/fido/FidoConstants.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-11-07 Justin Michaud <justin_michaud@apple.com>
CSS Painting API should pass size, arguments and input properties to paint callback
https://bugs.webkit.org/show_bug.cgi?id=191309
Reviewed by Chris Dumez.
Call paint() callback with input properties and arguments. This patch adds a stub for
the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without
any syntax checking to the paint callback.
Test: fast/css-custom-paint/properties.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/CSSPaintImageValue.h:
* css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::CSSPaintSize::create):
(WebCore::CSSPaintSize::width const):
(WebCore::CSSPaintSize::height const):
(WebCore::CSSPaintSize::CSSPaintSize):
* css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
* css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::CSSStyleValue::isUnitValue):
(WebCore::CSSStyleValue::isUnparsedValue):
* css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::StylePropertyMapReadOnly::create):
(WebCore::StylePropertyMapReadOnly::get):
(WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly):
* css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
2018-11-07 Brent Fulgham <bfulgham@apple.com>
Provide better Font fallbacks for DirectX backend
https://bugs.webkit.org/show_bug.cgi?id=191412
<rdar://problem/45899207>
Reviewed by Zalan Bujtas.
Registration of custom fonts through GDI are not always visible
through the DirectWrite/GDI bridging layer. If a font is not located,
locate the closest matching avialable font rather than failing.
* platform/graphics/FontPlatformData.h:
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData): Use new font
fallback logic.
* platform/graphics/win/FontPlatformDataDirect2D.cpp:
(WebCore::FontPlatformData::platformDataInit):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::createFallbackFont): Added.
2018-11-07 Zalan Bujtas <zalan@apple.com>
Click and touch event listeners on the body don't work
https://bugs.webkit.org/show_bug.cgi?id=191392
<rdar://problem/5844416>
Reviewed by Simon Fraser.
Remove the old quirk of ignoring onclick handlers on the body and beyond.
Test: fast/events/click-handler-on-body-simple.html
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToClickEvents):
2018-11-07 Brent Fulgham <bfulgham@apple.com>
[Windows][DirectX] Update canvas code to pass more tests
https://bugs.webkit.org/show_bug.cgi?id=191337
<rdar://problem/45878801>
Reviewed by Dean Jackson.
Update the Direct2D code paths to comply with our canvas tests, improving the
the test results scores to 579/770.
PathDirect2D was updated with an implementation of 'addArcTo' based on work by
Dirk Schulze <vbs85@gmx.de> (see https://hg.mozilla.org/mozilla-central/rev/b116b49459f8).
Tests: canvas/philip/tests
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer): Direct2D needs access to the graphics
context to create the buffer.
* platform/graphics/ImageBuffer.h:
* platform/graphics/Path.h:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawPattern): Flush needed.
(WebCore::GraphicsContext::drawRect): Ditto.
(WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Correct for Direct2D definition of miter limit.
(WebCore::GraphicsContextPlatformPrivate::strokeStyleProperties const): Added helper function.
(WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Update for new helper.
(WebCore::GraphicsContext::drawLine): Ditto.
(WebCore::drawWithShadowHelper): Ditto.
(WebCore::GraphicsContext::fillRect): Add flush.
(WebCore::GraphicsContext::platformFillRoundedRect): Update for helper.
(WebCore::GraphicsContext::clipPath): Add flush.
(WebCore::GraphicsContext::strokeRect): Ditto.
(WebCore::GraphicsContext::drawLineForText): Update for upstream changes.
(WebCore::GraphicsContext::drawLinesForText): Ditto.
* platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::createCroppedImageIfNecessary): Add missing implementations.
(WebCore::createBitmapImageAfterScalingIfNeeded): Ditto.
(WebCore::ImageBuffer::copyImage const): Ditto.
(WebCore::ImageBuffer::sinkIntoImage): Ditto.
(WebCore::ImageBuffer::fastCopyImageMode): Ditto.
(WebCore::ImageBuffer::sinkIntoNativeImage): Ditto.
(WebCore::ImageBuffer::copyNativeImage const): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::operator=):
(WebCore::Path::drawDidComplete): This should never have been const.
It manipulates the path!
(WebCore::Path::transform): Properly transform existing geometries.
(WebCore::Path::openFigureAtCurrentPointIfNecessary): Added.
(WebCore::Path::moveTo):
(WebCore::Path::addLineTo): Make sure figure starts at a valid point.
(WebCore::Path::addQuadCurveTo): Ditto.
(WebCore::Path::addBezierCurveTo): Ditto.
(WebCore::Path::addArcTo): Add implementation.
(WebCore::Path::closeSubpath):
(WebCore::drawArcSection):
(WebCore::Path::addArc): Update to build large arcs out of small arc segments. If the
arc is effectively a complete circle, use the ellipse drawing routines.
(WebCore::Path::addRect): Make sure we start at a valid starting point.
(WebCore::Path::addEllipse): Correct for definition of D2D ellipse.
(WebCore::Path::drawDidComplete const): Deleted.
* platform/graphics/win/SimpleFontDataDirect2D.cpp:
(WebCore::Font::platformWidthForGlyph const):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::applyClippingToContext):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* rendering/svg/RenderSVGResourceMasker.cpp:
(WebCore::RenderSVGResourceMasker::applyResource):
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::createImageBuffer):
* rendering/svg/SVGRenderingContext.h:
2018-11-07 Wenson Hsieh <wenson_hsieh@apple.com>
Add an editing command for creating and inserting child lists
https://bugs.webkit.org/show_bug.cgi?id=191335
<rdar://problem/45814050>
Reviewed by Ryosuke Niwa.
Currently, insertOrderedList and insertUnorderedList only toggle or change list state (i.e. if the selection is
in an ordered or unordered list, reinserting the same list type removes the current list, and inserting a
different list type changes the enclosing list).
However, for certain internal clients (e.g. Mail), if the start of the selection is enclosed by a list item, we
instead create a new list item and insert it after the enclosing list item, and then create a new list within
that list item. Currently, this logic is implemented in Mail for legacy-WebKit-based Mail compose. This patch
brings this logic into WebKit in the form of a new editing command.
Tests: editing/execCommand/insert-nested-lists-in-table.html
editing/execCommand/insert-nested-lists-with-pre.html
editing/execCommand/insert-nested-lists.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::insertOrderedList):
(WebCore::Editor::insertUnorderedList):
* editing/EditorCommand.cpp:
(WebCore::executeInsertOrderedList):
(WebCore::executeInsertUnorderedList):
(WebCore::executeInsertNestedUnorderedList):
(WebCore::executeInsertNestedOrderedList):
(WebCore::createCommandMap):
* editing/IndentOutdentCommand.cpp:
(WebCore::IndentOutdentCommand::outdentParagraph):
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
(WebCore::InsertListCommand::editingAction const):
* editing/InsertListCommand.h:
Change a couple of `enum`s into `enum class`es.
* editing/InsertNestedListCommand.cpp: Added.
(WebCore::InsertNestedListCommand::insertUnorderedList):
(WebCore::InsertNestedListCommand::insertOrderedList):
(WebCore::InsertNestedListCommand::doApply):
* editing/InsertNestedListCommand.h: Added.
Add a new edit command to insert a new list (as a child of any containing list). If the start of the selection
is in a list item, we create a new list item, move the selection into the list item, and increment its list
level; otherwise, simply fall back to inserting a list.
* editing/ModifySelectionListLevel.cpp:
(WebCore::IncreaseSelectionListLevelCommand::doApply):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered):
(WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered):
* editing/ModifySelectionListLevel.h:
Expose this constructor, allowing other edit commands to change selection list level as a composite edit
command. Also, change an `enum` into an `enum class`.
(WebCore::IncreaseSelectionListLevelCommand::create):
2018-11-07 Chris Dumez <cdumez@apple.com>
ASSERT(renderer()) under HTMLTextAreaElement::updateValue()
https://bugs.webkit.org/show_bug.cgi?id=191391
<rdar://problem/34219633>
Reviewed by Geoffrey Garen.
Update HTMLTextFormControlElement::didEditInnerTextValue() to not call subtreeHasChanged()
if the element has no renderer, similarly to what is already done in
HTMLTextFormControlElement::setRangeText() and HTMLInputElement::setEditingValue().
Test: editing/inserting/inset-html-textarea-without-renderer.html
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
2018-11-07 Youenn Fablet <youenn@apple.com>
Allow setting RTCRtpTransceiver.direction
https://bugs.webkit.org/show_bug.cgi?id=191346
Reviewed by Eric Carlson.
Remove readonly from the direction attribute.
Keep setDirection for now as it is in use, with an intent to remove it.
Driven-by fix as in some cases, the rtc source track might be changed
and current implementation is not expecting that.
In such a case, stop observing the old track (which should no longer call us)
before observing the new one.
Covered by rebased tests.
* Modules/mediastream/RTCRtpTransceiver.idl:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::setSourceTrack):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::setSourceTrack):
2018-11-07 Sihui Liu <sihui_liu@apple.com>
RELEASE_ASSERT(!m_hardClosedForUserDelete) fails in WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer
https://bugs.webkit.org/show_bug.cgi?id=191326
<rdar://problem/45769269>
Reviewed by Geoffrey Garen.
UniqueIDBDatabase should ignore incoming requests or operations when it is already marked as
hardClosedForUserDelete.
Test: IndexedDB.IndexedDBUserDelete.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
(WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransaction):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
2018-11-07 Myles C. Maxfield <mmaxfield@apple.com>
Positioned text underline can look like a strike-through
https://bugs.webkit.org/show_bug.cgi?id=191341
Reviewed by Simon Fraser.
We should just clamp the value so it can't go above the baseline.
We shouldn't do this at parse time because it's totally reasonable for text-underline-position: under to want
a negative text-underline-offset. Instead, we just do it at used value time.
Test: fast/css3-text/css3-text-decoration/text-underline-negative.html
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
2018-11-07 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
2018-11-07 Chris Dumez <cdumez@apple.com>
Unreviewed, fix iOS build with recent SDKs.
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
2018-11-07 Myles C. Maxfield <mmaxfield@apple.com>
Dotted underlines that skip descenders are invisible
https://bugs.webkit.org/show_bug.cgi?id=191403
Reviewed by Simon Fraser.
Turns out our underline bounding boxes had negative width. When drawing the full
underline that was fine because it was handled by the 2D graphics engine, but when
we try to split up the box into dots, our "for" loop was taking 0 iterations (because
the end was before the start).
Test: fast/css3-text/css3-text-decoration/text-underline-style.html
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawLineForText):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText):
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawLineForText):
2018-11-07 Andy Estes <aestes@apple.com>
Crash in WebCore::PaymentRequest::canMakePayment when Apple Pay payment method data is missing
https://bugs.webkit.org/show_bug.cgi?id=191331
Reviewed by Alexey Proskuryakov.
Apple Pay requires merchants specify an ApplePayRequest (which contains several required
fields) as payment method data when constructing a new PaymentRequest. If the
ApplePayRequest is missing required fields, or is missing entirely, canMakePayment() should
resolve to false.
We would properly resolve to false when an ApplePayRequest was specified with missing
required fields, but we would crash when the ApplePayRequest was missing entirely.
This patch fixes the crash by checking for an empty JSValue before trying to convert it to
an ApplePayRequest struct. Because we stringify ApplePayRequests in the PaymentRequest
constructor then parse them again in canMakePayments, an undefined or null payment method
data stringifies to a null String, which then parses to an empty JSValue.
Added test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::convertData):
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::canMakePayment):
2018-11-07 Simon Fraser <simon.fraser@apple.com>
Revert 237849: it breaks MotionMark
https://bugs.webkit.org/show_bug.cgi?id=191398
Reviewed by Simon Fraser.
This change broke painting while the test is running.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
2018-11-07 Don Olmstead <don.olmstead@sony.com>
Simplify macros in platform
https://bugs.webkit.org/show_bug.cgi?id=191378
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Modifies a few cases where a platform macro could be simplified.
* page/EventHandler.cpp:
* platform/network/DNS.h:
* platform/network/NetworkStateNotifier.h:
2018-11-07 Simon Fraser <simon.fraser@apple.com>
Some WK1 repaint tests are flakey
https://bugs.webkit.org/show_bug.cgi?id=190627
Reviewed by Zalan Bujtas.
Repaint tracking in GraphicsLayerCA was sensitive to whether there were already dirty
rects on the layer, since tracking happened after checks against existing dirty rects.
This caused some WK1 repaint tests to be flakey, since there's no guarantee that
no repaints happen between the last layer flush and a test calling startTrackingRepaints().
Fix by moving the repaint tracking to before the checks against existing dirty rects.
This is more similar to how repaint tracking on FrameView works.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setNeedsDisplayInRect):
2018-11-07 Dean Jackson <dino@apple.com>
[iOS] WebGL leaks exact GPU type
https://bugs.webkit.org/show_bug.cgi?id=191393
Reviewed by Tim Horton.
The fully exposed renderer info shouldn't be necessary
on iOS, where the GPUs and drivers are consistent
enough that people shouldn't need to write code specifically
for them. Reduce the ability to fingerprint by simply
returning "Apple GPU".
The other option would have been to disable the extension,
but I think it might still be useful to know you're on
an iOS device.
Test: fast/canvas/webgl/hide-some-renderer-info.html
* html/canvas/WebGL2RenderingContext.cpp: Return "Apple GPU"
on iOS.
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore::WebGLRenderingContext::getParameter):
2018-11-07 Daniel Bates <dabates@apple.com>
Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
https://bugs.webkit.org/show_bug.cgi?id=190141
Reviewed by Darin Adler.
Remove the runtime application check for WebKitTestRunner as we no longer need this
now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode].
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isWebKitTestRunner): Deleted.
2018-11-07 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects
https://bugs.webkit.org/show_bug.cgi?id=191340
Reviewed by Devin Rousso.
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::collectSample):
Use new enum name.
2018-11-07 Dan Bernstein <mitz@apple.com>
Add a pseudoclass that matches img elements that are backed by an attachment
https://bugs.webkit.org/show_bug.cgi?id=191286
<rdar://problem/45823554>
Reviewed by Dean Jackson.
Test: fast/css/has-attachment.html
Added a :has-attachment pseudoclass, enabled only when the attachment element is enabled at
runtime, that matches elements (currently only img elements qualify) that have an attachment
element in their shadow DOM.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const): Handle the new PseudoClassHasAttachment value.
* css/CSSSelector.h: Added a new value to the PseudoClassType enum.
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const): Check the new PseudoClassHasAttachment value
using the new hasAttachment test function.
* css/SelectorCheckerTestFunctions.h:
(WebCore::hasAttachment): Added. Tests if the element is an img element that has an
attachment.
* css/SelectorPseudoClassAndCompatibilityElementMap.in: Added has-attachment.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext): Initialize new attachmentEnabled member based
on RuntimeEnabledFeatures.
(WebCore::operator==): Compare new attachmentEnabled member.
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash): Include new attachmentEnabled member.
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo): Reject :has-attachment if the attachment
element is not enabled.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType): Handle PseudoClassHasAttachment.
2018-11-07 Don Olmstead <don.olmstead@sony.com>
Make generic MainThreadSharedTimer implementation
https://bugs.webkit.org/show_bug.cgi?id=191327
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Moves generic implementation for MainThreadSharedTimerGlib.cpp into
MainThreadSharedTimer.cpp.
* platform/MainThreadSharedTimer.cpp:
(WebCore::MainThreadSharedTimer::MainThreadSharedTimer):
(WebCore::MainThreadSharedTimer::setFireInterval):
(WebCore::MainThreadSharedTimer::stop):
(WebCore::MainThreadSharedTimer::invalidate):
* platform/MainThreadSharedTimer.h:
* platform/SourcesGLib.txt:
* platform/glib/MainThreadSharedTimerGLib.cpp: Removed.
2018-11-07 Ali Juma <ajuma@chromium.org>
IntersectionObserverEntry doesn't keep JS wrappers of rects alive
https://bugs.webkit.org/show_bug.cgi?id=191330
Reviewed by Chris Dumez.
Retain wrappers of each rect in an IntersectionObserverEntry as long as the entry's wrapper
is alive, by adding these wrappers as opaque roots.
Test: intersection-observer/intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html
* bindings/js/JSIntersectionObserverEntryCustom.cpp:
(WebCore::JSIntersectionObserverEntry::visitAdditionalChildren):
* dom/DOMRectReadOnly.idl:
* page/IntersectionObserverEntry.h:
(WebCore::IntersectionObserverEntry::rootBounds const): Make this return a raw pointer instead of a RefPtr so that it
can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which can be called from non-main threads.
(WebCore::IntersectionObserverEntry::boundingClientRect const): Ditto.
(WebCore::IntersectionObserverEntry::intersectionRect const): Ditto.
2018-11-07 Simon Fraser <simon.fraser@apple.com>
TileController::tileSize() should not have side effects
https://bugs.webkit.org/show_bug.cgi?id=191349
Reviewed by Zalan Bujtas.
Calling TileController::tileSize() would recompute a new tile size and set m_tileSizeLocked,
which caused test failures if logging was enabled when running tests.
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::tileSize const):
(WebCore::TileController::computeTileSize):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
2018-11-07 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] Ensure key id buffers are present and simplify lifetime management of ClearKey class.
https://bugs.webkit.org/show_bug.cgi?id=191157
Reviewed by Xabier Rodriguez-Calvar.
This is in preparation for moving the clearkey decryptor behind a
new decrypt API in CDMInstance, which will be sent into the
pipeline to handle key management and decryption. This is for a
later patch.
Covered by existing clear key tests in media/encrypted-media.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::data const): Add a const data accessor,
since we are now providing operator=='s on const objects of this
class that need const access to the data pointer.
(WebCore::GstMappedBuffer::operator==): Add a swap of the new
equality operator so you don't have to remember to have the
GstBuffer on the RHS of the equality all the time.
(WebCore::operator==): Define an equality operator between Gst
buffers and WebCore's mapped buffers. Gst creates a ref and a
separate read view under the covers in the memcmp call, so we do
not need to map the buffer ourselves.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webkit_media_clear_key_decrypt_class_init): Remove setup/release
bindings.
(webkit_media_clear_key_decrypt_init): Initialize gcrypt cipher
here once instead of for every buffer to be decrypted.
(webKitMediaClearKeyDecryptorFinalize): And destroy the cipher
context when the decryptor is destroyed.
(webKitMediaClearKeyDecryptorFindAndSetKey): Factor out the key
retrieval and context setting in this method, call it for each
sample.
(webKitMediaClearKeyDecryptorDecrypt): Base key id buffer into
this function, and remove cipher creation / destroy methods.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkit_media_common_encryption_decrypt_class_init): Remove
setup/release bindings.
(webkitMediaCommonEncryptionDecryptTransformInPlace): Ensure a key
id is present and pass it to the decrypt class method.
(webKitMediaCommonEncryptionDecryptDefaultSetupCipher): Deleted.
(webKitMediaCommonEncryptionDecryptDefaultReleaseCipher): Deleted.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h:
2018-11-07 Frederic Wang <fwang@igalia.com>
[Cairo] Move state change operations from GraphicsContextCairo to CairoOperations
https://bugs.webkit.org/show_bug.cgi?id=179610
Unreviewed build fix.
* platform/graphics/cairo/GraphicsContextCairo.cpp: Add missing include.
2018-11-06 Joseph Pecoraro <pecoraro@apple.com>
ServiceWorker Inspector: Uncaught Exception: null is not an object (evaluating 'resource.target.addResource')
https://bugs.webkit.org/show_bug.cgi?id=191339
Reviewed by Matt Baker.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::fetchScriptWithContext):
Use the Service Worker's identifier, not this static but otherwise unknown identifier.
2018-11-06 Youenn Fablet <youenn@apple.com>
sender.replaceTrack() fails with InvalidStateError if the transceiver.direction is "inactive"
https://bugs.webkit.org/show_bug.cgi?id=191202
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::removeTrack):
Update as per spec, in particular make sure to not stop the sender when removing the track.
2018-11-06 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain
https://bugs.webkit.org/show_bug.cgi?id=191291
Reviewed by Myles Maxfield.
Test: webgpu/render-pipelines.html
Also update test webgpu/webgpu-basics.html to create a WebGPURenderPipeline.
Begin implementation of WebGPURenderPipeline and WebGPUSwapChain. A WebGPURenderPipeline is backed by a
GPURenderPipeline, created lazily using the properties of the passed-in WebGPURenderPipelineDescriptor.
On Metal-supported systems, GPURenderPipeline is an interface to a MTLRenderPipelineState.
The MTLRenderPipelineState is created with the WebGPUDevice currently configured on the WebGPURenderingContext.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Modules/webgpu/GPUDevice.cpp:
(WebCore::GPUDevice::createRenderPipeline const):
* Modules/webgpu/GPUDevice.h:
* Modules/webgpu/GPUPipelineDescriptorBase.h:
* Modules/webgpu/GPUPipelineStageDescriptor.h:
* Modules/webgpu/GPURenderPipelineDescriptor.h:
(WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
(WebCore::GPURenderPipelineDescriptor::primitiveTopology):
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::createRenderPipeline const):
* Modules/webgpu/WebGPUDevice.h:
(WebCore::WebGPUDevice::adapter const):
(WebCore::WebGPUDevice::device const):
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUPipelineDescriptorBase.h:
* Modules/webgpu/WebGPUPipelineDescriptorBase.idl:
* Modules/webgpu/WebGPUPipelineStageDescriptor.h:
* Modules/webgpu/WebGPUPipelineStageDescriptor.idl:
* Modules/webgpu/WebGPURenderPipeline.cpp:
(WebCore::WebGPURenderPipeline::create):
(WebCore::WebGPURenderPipeline::WebGPURenderPipeline):
* Modules/webgpu/WebGPURenderPipeline.h:
* Modules/webgpu/WebGPURenderPipeline.idl:
* Modules/webgpu/WebGPURenderPipelineDescriptor.h:
* Modules/webgpu/WebGPURenderPipelineDescriptor.idl:
* Modules/webgpu/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create):
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* Modules/webgpu/WebGPURenderingContext.h:
* Modules/webgpu/WebGPUShaderModule.h:
(WebCore::WebGPUShaderModule::module const):
* Modules/webgpu/WebGPUShaderStage.h:
* Modules/webgpu/WebGPUShaderStage.idl:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure):
(WebCore::WebGPUSwapChain::reshape):
(WebCore::WebGPUSwapChain::markLayerComposited):
* Modules/webgpu/WebGPUSwapChain.h:
(WebCore::WebGPUSwapChain::WebGPUSwapChain):
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/cocoa/GPURenderPipeline.h:
(WebCore::GPURenderPipeline::platformRenderPipeline const):
* Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: Added.
(WebCore::setFunctionsForPipelineDescriptor):
(WebCore::GPURenderPipeline::create):
(WebCore::GPURenderPipeline::GPURenderPipeline):
* Modules/webgpu/cocoa/GPUSwapChain.h:
(WebCore::GPUSwapChain::platformLayer const):
* Modules/webgpu/cocoa/GPUSwapChainMetal.mm:
(WebCore::GPUSwapChain::create):
(WebCore::GPUSwapChain::GPUSwapChain):
(WebCore::GPUSwapChain::setDevice):
(WebCore::GPUSwapChain::reshape):
(WebCore::GPUSwapChain::present):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-11-06 Youenn Fablet <youenn@apple.com>
Add support for sender/receiver getCapabilities
https://bugs.webkit.org/show_bug.cgi?id=191192
Reviewed by Eric Carlson.
Expose sender/receiver RTCRtpCapabilities to JS.
Add corresponding IDL and plumbing down to libwebrtc peer connection factory.
Covered by rebased tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::receiverCapabilities):
(WebCore::PeerConnectionBackend::senderCapabilities):
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCRtpCapabilities.idl: Added.
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::getCapabilities):
* Modules/mediastream/RTCRtpReceiver.h:
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::getCapabilities):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::receiverCapabilities):
(WebCore::PeerConnectionBackend::senderCapabilities):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RTCPMuxPolicy.h:
* platform/mediastream/RTCRtpCapabilities.h: Added.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::typeFromKind):
(WebCore::fromStdString):
(WebCore::toChannels):
(WebCore::toRTCRtpCapabilities):
(WebCore::LibWebRTCProvider::receiverCapabilities):
(WebCore::LibWebRTCProvider::senderCapabilities):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2018-11-06 Youenn Fablet <youenn@apple.com>
Calling sender.replaceTrack() twice produces a new transceiver and its corresponding m= section
https://bugs.webkit.org/show_bug.cgi?id=191261
Reviewed by Eric Carlson.
Handle the case of replacing a track in a sender that has no track.
In particular, do not create a new m-section as was implied by plan B implementation.
Instead, set the track directly on the rtc sender.
Covered by webrtc/video-addTransceiver.html.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack):
(WebCore::LibWebRTCMediaEndpoint::addTransceiver):
(WebCore::LibWebRTCMediaEndpoint::setSenderSourceFromTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::setSenderSourceFromTrack):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
2018-11-06 Chris Dumez <cdumez@apple.com>
Post too much text to iFrame could crash webkit
https://bugs.webkit.org/show_bug.cgi?id=190947
<rdar://problem/45678231>
Reviewed by Geoffrey Garen.
Optimize SuffixTree (Which is used by XSSAuditor) to stop storing each Node's
children as a static array of 128 pointers and use a dynamic array (vector)
instead. This uses way less memory. Also make SuffixTree and SuffixTree::Node
as fast allocated for performance. This part of the change is based on the
following Blink change:
- https://chromium.googlesource.com/chromium/src.git/+/6ca590e1c7edaa7c56cac9e3e3c39cf398ca8d4d
Also update the XSSAuditor to construct the SuffixTree lazily since there are
many cases (including the one in this bug) where we were spending a significant
amount of time building the SuffixTree and then never querying it.
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::init):
(WebCore::XSSAuditor::decodedHTTPBodySuffixTree):
(WebCore::XSSAuditor::isContainedInRequest):
* html/parser/XSSAuditor.h:
* platform/text/SuffixTree.h:
(WebCore::SuffixTree::mightContain):
(WebCore::SuffixTree::Node::Node):
(WebCore::SuffixTree::Node::~Node):
(WebCore::SuffixTree::Node::find):
(WebCore::SuffixTree::Node::end):
(WebCore::SuffixTree::build):
(WebCore::SuffixTree<Codebook>::Node::childAt):
(WebCore::SuffixTree::Node::at): Deleted.
2018-11-06 Youenn Fablet <youenn@apple.com>
Support onremovetrack for RTCPeerConnection removed tracks
https://bugs.webkit.org/show_bug.cgi?id=191299
Reviewed by Eric Carlson.
When applying SDP, LibWebRTCMediaEndpoint gets notified of a removed track.
In that case, make sure to remove it from its remote stream(s) so as
to notify the application of the changes.
Work around the receiver missing the list of streams by storing in a map
the list of the remote streams for a given remote track.
Covered by rebased test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
(WebCore::LibWebRTCMediaEndpoint::stop):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2018-11-06 Timothy Hatcher <timothy@apple.com>
REGRESSION (r237878): css-dark-mode/supported-color-schemes.html is failing on Mojave
https://bugs.webkit.org/show_bug.cgi?id=191338
Reviewed by Dean Jackson.
* page/Page.cpp:
(WebCore::Page::appearanceDidChange): Add back call to didChangeStyleSheetEnvironment().
It was dropped by mistake when I moved code to appearanceDidChange(). This is needed to
update styles for semantic colors and from controls when the media prefers-color-scheme
media query is not used on the page.
2018-11-06 Youenn Fablet <youenn@apple.com>
Make mDNS ICE Candidate an experimental flag again
https://bugs.webkit.org/show_bug.cgi?id=191262
Reviewed by Dean Jackson.
Rename mdnsICECandidatesEnabled to webRTCICECandidatesEnabled.
This allows grouping the WebRTC runtime flags.
No change of behavior.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::newICECandidate):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCMDNSICECandidatesEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCMDNSICECandidatesEnabled):
(WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const): Deleted.
(WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled): Deleted.
2018-11-06 Myles C. Maxfield <mmaxfield@apple.com>
Implement text-underline-offset and text-decoration-thickness
https://bugs.webkit.org/show_bug.cgi?id=190774
Reviewed by Dean Jackson.
Because of our existing infrastructure for text decorations, adding support for these
is fairly simple. This patch updates our existing functions to handle thick & placed
underlines, as well as updating our repaint code to correcly handle repainting them.
It also handles animations.
Tests: animations/text-decoration-thickness.html
animations/text-underline-offset.html
fast/css3-text/css3-text-decoration/text-decoration-offset-2.html
fast/css3-text/css3-text-decoration/text-decoration-offset-3.html
fast/css3-text/css3-text-decoration/text-decoration-offset-auto-length.html
fast/css3-text/css3-text-decoration/text-decoration-offset-baseline.html
fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-auto.html
fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-length.html
fast/css3-text/css3-text-decoration/text-decoration-offset-repaint.html
fast/css3-text/css3-text-decoration/text-decoration-offset-under-auto.html
fast/css3-text/css3-text-decoration/text-decoration-offset-under-length.html
fast/css3-text/css3-text-decoration/text-decoration-offset.html
fast/css3-text/css3-text-decoration/text-decoration-thickness-length.html
fast/css3-text/css3-text-decoration/text-decoration-thickness-repaint.html
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* platform/graphics/FontMetrics.h:
(WebCore::FontMetrics::underlinePosition const):
(WebCore::FontMetrics::setUnderlinePosition):
(WebCore::FontMetrics::underlineThickness const):
(WebCore::FontMetrics::setUnderlineThickness):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
* rendering/TextDecorationPainter.cpp:
(WebCore::TextDecorationPainter::paintTextDecoration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeAffectsVisualOverflow const):
* rendering/style/TextDecorationThickness.h:
(WebCore::TextDecorationThickness::resolve const):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
(WebCore::visualOverflowForDecorations):
* style/InlineTextBoxStyle.h:
(WebCore::textDecorationStrokeThickness): Deleted.
2018-11-06 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only)
https://bugs.webkit.org/show_bug.cgi?id=189760
<rdar://problem/44612242>
Reviewed by Youenn Fablet and Antti Koivisto.
No new tests. Existing test fleshed out.
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::isRedirection const):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::isRedirection const): Deleted.
Moved to the implementation file so that I can export it without warning.
2018-11-06 Myles C. Maxfield <mmaxfield@apple.com>
Spelling dots are drawn in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=190764
Reviewed by Dean Jackson.
- Dots should not be clipped.
- Dots should be horizontally centered.
- Dots should be drawn behind the text.
- Distance from the baseline to the top of the dot should be 11.035% of font size.
- Dot diameter should be 13.247% of the font size.
- Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
- The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
Tests: editing/spelling/spelling-dots-position-2.html
editing/spelling/spelling-dots-position-3.html
editing/spelling/spelling-dots-position.html
editing/spelling/spelling-dots-repaint.html
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
(WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
because there is no guarantee the spelling dots will lie inside the layout rect of the element.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
* rendering/InlineFlowBox.h: Comments should explain why, not say what.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Draw the dots behind the text.
(WebCore::InlineTextBox::hasMarkers const): Convenience.
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
(WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
(WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
(WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
* rendering/InlineTextBox.h: Declare the helper methods.
* rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
spelling dots opt us out of SLL.
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
2018-11-06 Per Arne Vollan <pvollan@apple.com>
REGRESSION (r230523): Caps lock indicator not shown in password field
https://bugs.webkit.org/show_bug.cgi?id=190056
Reviewed by Ryosuke Niwa.
When WindowServer access is blocked, GetCurrentModifiers() always returns 0. Instead of calling
GetCurrentModifiers(), store the current modifiers from the key event argument in the method
WebKit::WebPage::keyEvent, and use the stored value to detect if Caps lock is on. Additionally,
the modifiers needs to be updated when the window becomes active.
Test: fast/events/detect-caps-lock.html
* Sources.txt:
* platform/PlatformKeyboardEvent.h:
* platform/graphics/FontTaggedSettings.cpp:
* platform/mac/KeyEventMac.mm:
(WebCore::PlatformKeyboardEvent::currentCapsLockState):
(WebCore::PlatformKeyboardEvent::getCurrentModifierState):
* testing/Internals.cpp:
(WebCore::Internals::capsLockIsOn):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-06 Javier Fernandez <jfernandez@igalia.com>
CSS grid elements with justify-content: space-around have extra whitespace, sometimes a lot
https://bugs.webkit.org/show_bug.cgi?id=191308
Reviewed by Dean Jackson.
The CSS WG resolved [1] that Content Alignment should account to the
track sizing algorithm.
The sizing algorithm has been modified so that two new steps (1.5
and 2.5) were added to compute the Content Alignment offsets after
resolving the columns' and rows' sizes respectively.
This change decouples the Content Alignment logic from the tracks
position, so that we can use it as part of the track sizing algorithm.
I also had to store the whole ContentAlignmentData structure in two
class attributes. We need both, position and distribution offsets, to
be used in different parts of the layout logic.
[1] https://github.com/w3c/csswg-drafts/issues/2557
Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-002.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-003.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-004.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-filled-shrinkwrap-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-spanned-shrinkwrap-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-filled-shrinkwrap-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-spanned-shrinkwrap-001.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::repeatTracksSizingIfNeeded):
(WebCore::RenderGrid::layoutBlock):
(WebCore::RenderGrid::gridItemOffset const):
(WebCore::RenderGrid::trackSizesForComputedStyle const):
(WebCore::RenderGrid::populateGridPositionsForDirection):
(WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
(WebCore::contentDistributionOffset):
(WebCore::RenderGrid::computeContentPositionAndDistributionOffset):
(WebCore::RenderGrid::nonCollapsedTracks const):
* rendering/RenderGrid.h:
(WebCore::ContentAlignmentData::isValid):
(WebCore::ContentAlignmentData::defaultOffsets):
2018-11-06 Sihui Liu <sihui_liu@apple.com>
IndexedDB: WAL file keeps growing
https://bugs.webkit.org/show_bug.cgi?id=191294
<rdar://problem/41333493>
Reviewed by Chris Dumez.
When we quit apps, the database connection may not be shut down properly, and WAL file will be retained on disk.
On the next open of database connection, new logs will be appended to the original WAL file, which keeps
increasing size of the WAL file. We should do a manual checkpoint when we open a IndexedDB to make sure previous
log is written to database and truncate WAL file.
Test: IndexedDB.IndexedDBTempFileSize
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
2018-11-06 Ali Juma <ajuma@chromium.org>
IntersectionObserver doesn't keep target's JS wrapper alive
https://bugs.webkit.org/show_bug.cgi?id=190235
Reviewed by Ryosuke Niwa.
Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by
IntersectionObserver, which gets cleared after the entries have been delivered.
Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs
for targets and the vector of intersection observer entries, so that the GCReachableRefs survive
until the creation of JS wrappers for the entries.
Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has
entries to deliver.
Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html
intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html
intersection-observer/target-deleted.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSIntersectionObserverEntryCustom.cpp:
(WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the
IntersectionObserverEntry's wrapper is alive.
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that
each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry.
(WebCore::IntersectionObserver::appendQueuedEntry):
(WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records.
(WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered.
(WebCore::IntersectionObserver::stop):
* page/IntersectionObserver.h:
* page/IntersectionObserver.idl:
* page/IntersectionObserverEntry.h:
(WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it
can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node
on a non-main thread).
* page/IntersectionObserverEntry.idl:
2018-11-06 Timothy Hatcher <timothy@apple.com>
<picture> container doesn't update when prefers-color-scheme media query changes
https://bugs.webkit.org/show_bug.cgi?id=190913
rdar://problem/45608456
Reviewed by Dean Jackson.
Test: css-dark-mode/prefers-color-scheme-picture-element.html
* css/MediaQueryEvaluator.cpp:
(WebCore::isAppearanceDependent): Added.
(WebCore::MediaQueryEvaluator::evaluate const): Keep track of appearanceDependentResults.
* css/MediaQueryEvaluator.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::addAppearanceDependentMediaQueryResult): Added.
(WebCore::StyleResolver::hasMediaQueriesAffectedByAppearanceChange const): Added.
* css/StyleResolver.h:
(WebCore::StyleResolver::hasAppearanceDependentMediaQueries const): Added.
* dom/Document.cpp:
(WebCore::Document::evaluateMediaQueryList): Call checkAppearanceDependentPictures.
(WebCore::Document::checkAppearanceDependentPictures): Added.
(WebCore::Document::addAppearanceDependentPicture): Added.
(WebCore::Document::removeAppearanceDependentPicture): Added.
* dom/Document.h:
* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call addAppearanceDependentPicture.
* html/HTMLPictureElement.cpp:
(WebCore::HTMLPictureElement::~HTMLPictureElement): Call removeAppearanceDependentPicture.
(WebCore::HTMLPictureElement::didMoveToNewDocument): Ditto.
(WebCore::HTMLPictureElement::appearanceChangeAffectedPicture const): Added.
* html/HTMLPictureElement.h:
* page/Page.cpp:
(WebCore::Page::appearanceDidChange): Added.
(WebCore::Page::setUseSystemAppearance): Call appearanceDidChange.
(WebCore::Page::setUseDarkAppearance): Call appearanceDidChange.
* page/Page.h:
* style/StyleScope.cpp:
(WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange): Added.
* style/StyleScope.h:
2018-11-06 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237834.
Tests for this change crash on iOS Simulator
Reverted changeset:
"Spelling dots are drawn in the wrong place"
https://bugs.webkit.org/show_bug.cgi?id=190764
https://trac.webkit.org/changeset/237834
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] transitions/remove-transition-style.html crashes with GuardMalloc on
https://bugs.webkit.org/show_bug.cgi?id=191304
<rdar://problem/45819476>
Reviewed by Dean Jackson.
Ensure we remove animations from the m_allAnimations ListHashSet upon destruction.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::forgetAnimation):
(WebCore::AnimationTimeline::cancelDeclarativeAnimation):
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::~WebAnimation):
2018-11-06 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSourceCocoa should unobserve its source at destruction time
https://bugs.webkit.org/show_bug.cgi?id=191295
Reviewed by Eric Carlson.
Make RealtimeOutgoingAudioSource subclasses unobserve their source
inside their destructor instead of RealtimeOutgoingAudioSource.
This is consistent with how starting to observe works.
Covered by existing tests.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::unobserveSource):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
(WebCore::RealtimeOutgoingAudioSourceCocoa::~RealtimeOutgoingAudioSourceCocoa):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
2018-11-06 Youenn Fablet <youenn@apple.com>
Make sure RTCIceCandidateStats address is undefined for host and peer reflexive case
https://bugs.webkit.org/show_bug.cgi?id=191263
Reviewed by Eric Carlson.
Test: webrtc/datachannel/getStats-no-prflx-remote-candidate.html
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillRTCIceCandidateStats):
2018-11-06 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Handle setting max number of frame between keyframes
https://bugs.webkit.org/show_bug.cgi?id=190682
Reviewed by Philippe Normand.
That has been manually checked.
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
(gst_webrtc_video_encoder_get_property):
(gst_webrtc_video_encoder_set_property):
(register_known_encoder):
(gst_webrtc_video_encoder_class_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2018-11-03 Alex Christensen <achristensen@webkit.org>
[Mac] Implement safe browsing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=188871
Reviewed by Tim Horton.
* en.lproj/Localizable.strings:
2018-11-06 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Account for CSS zoom when computing client rects
https://bugs.webkit.org/show_bug.cgi?id=191282
Reviewed by Simon Fraser.
When computing rects for an IntersectionObserverEntry, account for the effective zoom when
converting from absolute to client coordinates.
Test: web-platform-tests/intersection-observer/bounding-box.html
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
2018-11-06 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Implement black frame generation
https://bugs.webkit.org/show_bug.cgi?id=190684
Reviewed by Xabier Rodriguez-Calvar.
Avoiding webrtc/video-mute-vp8.html to crash but it still fails because
we are missing the canvas bridging code.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame):
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
2018-11-06 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Do not try to handle framerate modulation in the encoder
https://bugs.webkit.org/show_bug.cgi?id=190683
Reviewed by Philippe Normand.
This has to already be handled in capturing pipeline or in libwebrtc itself.
No other encoder implementation do that, and libwebrtc is not happy with encoder that do not output the exact number of frames that have been passed in.
No regressions detected and libwebrtc is happier this way, less warning output and no more frame corruption in H264 streams found.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2018-11-06 Frederic Wang <fwang@igalia.com>
Unreviewed, follow-up of previous commit.
Actually move OptionSet in the header since it's used there too.
* page/WindowFeatures.cpp:
* page/WindowFeatures.h:
2018-11-06 Frederic Wang <fwang@igalia.com>
Unreviewed build fix.
* page/WindowFeatures.cpp: Add missing header for OptionSet.
* platform/graphics/FontTaggedSettings.cpp: Add missing header for IntegerHash.
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Don't reset pending tasks when setting a null effect
https://bugs.webkit.org/show_bug.cgi?id=191301
<rdar://problem/45838422>
Reviewed by Dean Jackson.
The issue https://github.com/w3c/csswg-drafts/issues/2077 has changed the Web Animations API such that
we no longer reset pending tasks when setting a null effect on an animation.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Update the API to allow the "auto" composite value
https://bugs.webkit.org/show_bug.cgi?id=191300
<rdar://problem/45838373>
Reviewed by Dean Jackson.
The Web Animations API has been changed such that the various "composite" properties are no longer optional and instead
allow an "auto" value in their enumeration.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/CompositeOperationOrAuto.h: Copied from Source/WebCore/animation/KeyframeEffect.idl.
* animation/CompositeOperationOrAuto.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl.
* animation/KeyframeEffect.cpp:
(WebCore::processKeyframeLikeObject):
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffect::getKeyframes):
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Update the API to implement Animation.updatePlaybackRate()
https://bugs.webkit.org/show_bug.cgi?id=186510
<rdar://problem/41000641>
Reviewed by Dean Jackson.
The Web Animations API has been changed to allow for changes to an animation's playback rate both synchronously,
with the existing "playbackRate" property, and asynchronously, with the new updatePlaybackRate() method. In this
patch we update the various procedures to account for pending playback rate changes and the notion of an "effective
playback rate".
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::effectivePlaybackRate const):
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::updatePlaybackRate):
(WebCore::WebAnimation::applyPendingPlaybackRate):
(WebCore::WebAnimation::playState const):
(WebCore::WebAnimation::resetPendingTasks):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::reverse):
(WebCore::WebAnimation::runPendingPauseTask):
* animation/WebAnimation.h:
(WebCore::WebAnimation::playbackRate const):
* animation/WebAnimation.idl:
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Implement getTiming() and updateTiming()
https://bugs.webkit.org/show_bug.cgi?id=186511
<rdar://problem/41000677>
Reviewed by Dean Jackson.
The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly
interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This
does not change the features of the API but simply how they are exposed.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::transformedProgress const):
(WebCore::AnimationEffect::getTiming):
(WebCore::AnimationEffect::getComputedTiming):
(WebCore::AnimationEffect::updateTiming):
(WebCore::AnimationEffect::setIterationStart):
(WebCore::AnimationEffect::setIterations):
(WebCore::AnimationEffect::endTime const):
(WebCore::AnimationEffect::setDelay):
(WebCore::AnimationEffect::setEndDelay):
(WebCore::AnimationEffect::setFill):
(WebCore::AnimationEffect::setIterationDuration):
(WebCore::AnimationEffect::setDirection):
(WebCore::AnimationEffect::setTimingFunction):
(WebCore::AnimationEffect::activeDuration const):
* animation/AnimationEffect.h:
(WebCore::AnimationEffect::delay const):
(WebCore::AnimationEffect::endDelay const):
(WebCore::AnimationEffect::fill const):
(WebCore::AnimationEffect::iterationStart const):
(WebCore::AnimationEffect::iterations const):
(WebCore::AnimationEffect::iterationDuration const):
(WebCore::AnimationEffect::direction const):
(WebCore::AnimationEffect::timingFunction const):
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.idl: Removed.
* animation/AnimationEffectTimingReadOnly.cpp: Removed.
* animation/AnimationEffectTimingReadOnly.h: Removed.
* animation/AnimationEffectTimingReadOnly.idl: Removed.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::setTimingProperties):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DocumentTimeline.cpp:
* animation/EffectTiming.idl:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
* animation/KeyframeEffect.h:
* animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h.
* animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::effectTimingDidChange):
(WebCore::WebAnimation::updatePlaybackRate):
* animation/WebAnimation.h:
(WebCore::WebAnimation::isRelevant const):
* bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed.
* bindings/js/WebCoreBuiltinNames.h:
2018-11-06 Antoine Quint <graouts@apple.com>
[Web Animations] Update the Web Animations API to remove all the ReadOnly interfaces
https://bugs.webkit.org/show_bug.cgi?id=186512
<rdar://problem/41000691>
Reviewed by Dean Jackson.
The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch,
we make the following changes, not adding code but merely merging and renaming files:
- AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface
- KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface
- ComputedTimingProperties is now named ComputedEffectTiming
- AnimationEffectTimingProperties is now named EffectTiming
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp.
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::timingDidChange):
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::directedProgress const):
(WebCore::AnimationEffect::transformedProgress const):
(WebCore::AnimationEffect::iterationProgress const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h.
(WebCore::AnimationEffect::isKeyframeEffect const):
* animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl.
* animation/AnimationEffectTimingReadOnly.cpp:
* animation/AnimationEffectTimingReadOnly.h:
(WebCore::AnimationEffectTimingReadOnly::setEffect):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimation):
(WebCore::AnimationTimeline::cssAnimationForElementAndProperty):
* animation/CSSTransition.cpp:
* animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h.
* animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize):
(WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
(WebCore::DeclarativeAnimation::phaseWithoutEffect const):
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
* animation/DeclarativeAnimation.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
(WebCore::DocumentTimeline::transitionDidComplete):
(WebCore::DocumentTimeline::computeExtentOfAnimation const):
(WebCore::DocumentTimeline::isRunningAnimationOnRenderer const):
(WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const):
(WebCore::DocumentTimeline::animatedStyleForRenderer):
(WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
(WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
(WebCore::DocumentTimeline::resolveAnimationsForElement):
* animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h.
* animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl.
* animation/KeyframeEffect.cpp:
(WebCore::invalidateElement):
(WebCore::CSSPropertyIDToIDLAttributeName):
(WebCore::IDLAttributeNameToAnimationPropertyName):
(WebCore::computeMissingKeyframeOffsets):
(WebCore::processKeyframeLikeObject):
(WebCore::processIterableKeyframes):
(WebCore::processPropertyIndexedKeyframes):
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::processKeyframes):
(WebCore::KeyframeEffect::updateBlendingKeyframes):
(WebCore::KeyframeEffect::forceLayoutIfNeeded):
(WebCore::KeyframeEffect::setBlendingKeyframes):
(WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists):
(WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const):
(WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists):
(WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists):
(WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists):
(WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
(WebCore::KeyframeEffect::computedNeedsForcedLayout):
(WebCore::KeyframeEffect::computeStackingContextImpact):
(WebCore::KeyframeEffect::setTarget):
(WebCore::KeyframeEffect::apply):
(WebCore::KeyframeEffect::invalidate):
(WebCore::KeyframeEffect::computeShouldRunAccelerated):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle):
(WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex):
(WebCore::KeyframeEffect::updateAcceleratedAnimationState):
(WebCore::KeyframeEffect::addPendingAcceleratedAction):
(WebCore::KeyframeEffect::animationDidSeek):
(WebCore::KeyframeEffect::animationSuspensionStateDidChange):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const):
(WebCore::KeyframeEffect::renderer const):
(WebCore::KeyframeEffect::currentStyle const):
(WebCore::KeyframeEffect::computeExtentOfTransformAnimation const):
(WebCore::containsRotation):
(WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const):
(WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const):
* animation/KeyframeEffect.h:
(WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe):
(WebCore::KeyframeEffect::target const):
(WebCore::KeyframeEffect::iterationComposite const):
(WebCore::KeyframeEffect::composite const):
(WebCore::KeyframeEffect::isRunningAccelerated const):
(WebCore::KeyframeEffect::hasPendingAcceleratedAction const):
(WebCore::KeyframeEffect::hasBlendingKeyframes const):
(WebCore::KeyframeEffect::animatedProperties const):
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectOptions.h:
* animation/KeyframeEffectOptions.idl:
* animation/KeyframeEffectReadOnly.cpp: Removed.
* animation/KeyframeEffectReadOnly.h: Removed.
* animation/KeyframeEffectReadOnly.idl: Removed.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::applyPendingAcceleratedActions):
(WebCore::WebAnimation::computeRelevance):
* animation/WebAnimation.h:
(WebCore::WebAnimation::effect const):
* animation/WebAnimation.idl:
* bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSWebAnimationCustom.cpp:
(WebCore::constructJSWebAnimation):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
2018-11-06 Rob Buis <rbuis@igalia.com>
Some minor X-Content-Type-Options parsing issues
https://bugs.webkit.org/show_bug.cgi?id=191107
Reviewed by Darin Adler.
Implement new parsing rules for X-Content-Type-Options [1]:
https://github.com/whatwg/fetch/pull/818
[1] https://fetch.spec.whatwg.org/#x-content-type-options-header
Test: web-platform-tests/fetch/nosniff/parsing-nosniff.html
* platform/network/HTTPParsers.cpp:
(WebCore::isHTTPTabOrSpace):
(WebCore::parseContentTypeOptionsHeader):
2018-11-06 Frederic Wang <fwang@igalia.com>
Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller
https://bugs.webkit.org/show_bug.cgi?id=158342
Reviewed by Simon Fraser.
Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it
scrollable. However, the RenderLayerBacking's scrolling layer is not properly created
when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess
receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the
associated update. In debug mode this hits an ASSERT and in release mode the overflow node
remains unscrollable from the user's point of view. This patch fixes this issue by ensuring
the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus.
Test: fast/scrolling/ios/update-scroll-coordinated-status.html
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration()
to ensure the scrolling layer is present and indicate whether a rebuild is necessary.
2018-11-05 Zan Dobersek <zdobersek@igalia.com>
Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
https://bugs.webkit.org/show_bug.cgi?id=191267
Reviewed by Michael Catanzaro.
Move the Fontconfig-specific RefPtr specialization declarations from
RefPtrCairo.h to RefPtrFontconfig.h, with definitions moved to the new
RefPtrFontconfig.cpp implementation file. These specializations are
not tied to Cairo in any way.
* platform/FreeType.cmake:
* platform/graphics/FontPlatformData.h:
* platform/graphics/cairo/RefPtrCairo.cpp:
* platform/graphics/cairo/RefPtrCairo.h:
* platform/graphics/freetype/FontCacheFreeType.cpp:
* platform/graphics/freetype/RefPtrFontconfig.cpp: Added.
(WTF::refIfNotNull):
(WTF::derefIfNotNull):
* platform/graphics/freetype/RefPtrFontconfig.h: Copied from Source/WebCore/platform/graphics/cairo/RefPtrCairo.h.
2018-11-05 Don Olmstead <don.olmstead@sony.com>
[CMake] Fix WebCore/Modules includes
https://bugs.webkit.org/show_bug.cgi?id=191287
Reviewed by Fujii Hironori.
No new tests. No change in behavior.
Add in applicationmanifest to the list of includes and sort the
modules directory.
* CMakeLists.txt:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Cache glyph paths and share underline skipping code between all the ports
https://bugs.webkit.org/show_bug.cgi?id=191239
Reviewed by Alex Christensen.
I was hoping that caching the glyph paths was going to be a performance progression,
but it turns out that the additional overhead of WebCore::Path compensated for it.
In total, the performance is the same (my testing says that this patch is a 1%
progression, but that's within the noise).
Because the ink skipping logic is now shared among all ports, Windows now gets it for
free.
Test: PerformanceTests/Layout/underline.html
* platform/graphics/Font.cpp:
(WebCore::Font::pathForGlyph const):
* platform/graphics/Font.h:
* platform/graphics/FontCascade.cpp:
(WebCore::computeUnderlineType):
(WebCore::GlyphIterationState::GlyphIterationState):
(WebCore::findIntersectionPoint):
(WebCore::updateX):
(WebCore::findPathIntersections):
(WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
(WebCore::GlyphToPathTranslator::containsMorePaths):
(WebCore::GlyphToPathTranslator::path):
(WebCore::GlyphToPathTranslator::extents):
(WebCore::GlyphToPathTranslator::underlineType):
(WebCore::GlyphToPathTranslator::advance):
(WebCore::FontCascade::dashesForIntersectionsWithRect const):
* platform/graphics/FontCascade.h:
* platform/graphics/GlyphMetricsMap.h:
(WebCore::GlyphMetricsMap::existingMetricsForGlyph):
(WebCore::GlyphMetricsMap::GlyphMetricsPage::existingMetricsForGlyph const):
(WebCore::GlyphMetricsMap<std::optional<Path>>::unknownMetrics):
* platform/graphics/TextRun.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::Font::platformPathForGlyph const):
(WebCore::GlyphIterationState::GlyphIterationState): Deleted.
(WebCore::findIntersectionPoint): Deleted.
(WebCore::updateX): Deleted.
(WebCore::findPathIntersections): Deleted.
(): Deleted.
(WebCore::CairoGlyphToPathTranslator::path): Deleted.
(WebCore::CairoGlyphToPathTranslator::extents): Deleted.
(WebCore::CairoGlyphToPathTranslator::underlineType): Deleted.
(WebCore::CairoGlyphToPathTranslator::advance): Deleted.
(WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::GlyphIterationState::GlyphIterationState): Deleted.
(WebCore::findIntersectionPoint): Deleted.
(WebCore::updateX): Deleted.
(WebCore::findPathIntersections): Deleted.
(): Deleted.
(WebCore::MacGlyphToPathTranslator::path): Deleted.
(WebCore::MacGlyphToPathTranslator::extents): Deleted.
(WebCore::MacGlyphToPathTranslator::underlineType): Deleted.
(WebCore::MacGlyphToPathTranslator::advance): Deleted.
(WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformPathForGlyph const):
* rendering/TextDecorationPainter.cpp:
(WebCore::drawSkipInkUnderline):
(WebCore::TextDecorationPainter::paintTextDecoration):
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Clean up text decoration drawing code
https://bugs.webkit.org/show_bug.cgi?id=191245
Reviewed by Zalan Bujtas.
This is some general clean up of the text decorations code. There is no behavior change.
This patch modifies GraphicsContext::drawLineForText() & friends to accept a FloatRect instead of a FloatPoint + float width.
This is helpful because it allows for easier bounding box calculations.
This patch also removes some redundant computations that the skip:ink codepath was performing.
This patch also refactors the wavy decoration parameters to not use out params.
No new tests because there is no behavior change.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::computeUnderlineBoundsForText):
(WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::drawLineForText):
(WebCore::GraphicsContext::drawLinesForText):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawLinesForText::apply const):
(WebCore::DisplayList::DrawLinesForText::localBounds const):
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawLinesForText::create):
(WebCore::DisplayList::DrawLinesForText::thickness const):
(WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawLinesForText):
* platform/graphics/displaylists/DisplayListRecorder.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintMarkedTextDecoration):
(WebCore::InlineTextBox::paintCompositionUnderline const):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextDecorationPainter.cpp:
(WebCore::strokeWavyTextDecoration):
(WebCore::translateIntersectionPointsToSkipInkBoundaries):
(WebCore::TextDecorationPainter::TextDecorationPainter):
(WebCore::TextDecorationPainter::paintTextDecoration):
(WebCore::drawSkipInkUnderline): Deleted.
* rendering/TextDecorationPainter.h:
(WebCore::TextDecorationPainter::setInlineTextBox):
(WebCore::TextDecorationPainter::setWidth):
(WebCore::TextDecorationPainter::setFont): Deleted.
(WebCore::TextDecorationPainter::setBaseline): Deleted.
* style/InlineTextBoxStyle.cpp:
(WebCore::getWavyStrokeParameters):
(WebCore::visualOverflowForDecorations):
* style/InlineTextBoxStyle.h:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Fix the Windows build after r237835
https://bugs.webkit.org/show_bug.cgi?id=191242
Reviewed by Simon Fraser.
* rendering/style/TextDecorationThickness.h:
(WebCore::TextDecorationThickness::operator== const):
2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Swatch appears squished and off-center in inputs of type color
https://bugs.webkit.org/show_bug.cgi?id=191279
<rdar://problem/45816319>
Reviewed by Tim Horton.
This patch makes some small adjustments to color inputs on iOS to bring them closer to the intended design.
See comments below for more details.
Tests: fast/forms/color/color-input-uses-color-well-appearance.html
fast/forms/color/input-appearance-color.html
* css/html.css:
Adjust the UA stylesheet for color inputs on iOS.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintDecorations):
When painting decorations for `ColorWellPart`, treat it as a standard button instead of the square button
appearance.
(WebCore::RenderTheme::colorInputStyleSheet const):
Add `-webkit-appearance: color-well;` to the stylesheet for color inputs. Previously, this was special-cased on
iOS, where color input elements had appearances of `textfield`; however, this patch makes some adjustments to
RenderThemeIOS, allowing us to use `color-well` on iOS.
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformUsesColorWellAppearance const): Deleted.
Remove this from RenderTheme. This is no longer necessary, since all platforms now use
`-webkit-appearance: color-well;`.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::adjustButtonStyle const):
When painting buttons for color inputs, don't add rounded corners that are present by default for regular
buttons.
2018-11-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] An audio track should be muted when capture is interrupted by the OS.
https://bugs.webkit.org/show_bug.cgi?id= 191283
<rdar://problem/45773103>
Reviewed by Jon Lee.
Test: fast/mediastream/media-stream-track-interrupted.html
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::setInterruptedForTesting):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::beginInterruption):
(WebCore::CoreAudioCaptureSource::endInterruption):
* testing/Internals.cpp:
(WebCore::Internals::setMediaStreamSourceInterrupted):
* testing/Internals.h:
* testing/Internals.idl:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Parsing support for text-underline-offset and text-decoration-thickness
https://bugs.webkit.org/show_bug.cgi?id=191242
Reviewed by Simon Fraser.
Before we can implement the properties properly, we have to parse them.
https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-432297480 describes the grammar:
text-underline-position: auto | [ [ under | from-font] || [ left | right ] ]
text-underline-offset: auto | <length>
text-decoration-thickness: auto | from-font | <length>
This patch also takes the opportunity to update the grammar of text-underline-position to match the spec,
and to add an alias to the unprefixed version.
We still don't support the left and right values on text-underline-position. We should add those eventually.
Tests: fast/css3-text/css3-text-decoration/text-decoration-thickness-parse.html
fast/css3-text/css3-text-decoration/text-underline-offset-parse.html
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::textUnderlineOffsetToCSSValue):
(WebCore::textDecorationThicknessToCSSValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
(WebCore::CSSPrimitiveValue::operator OptionSet<TextUnderlinePosition> const): Deleted.
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
(WebCore::StyleBuilderConverter::convertTextUnderlineOffset):
(WebCore::StyleBuilderConverter::convertTextDecorationThickness):
* css/StyleResolver.cpp:
(WebCore::shouldApplyPropertyInParseOrder):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeTextUnderlineOffset):
(WebCore::consumeTextDecorationThickness):
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::textUnderlinePosition const):
(WebCore::RenderStyle::textUnderlineOffset const):
(WebCore::RenderStyle::textDecorationThickness const):
(WebCore::RenderStyle::setTextUnderlinePosition):
(WebCore::RenderStyle::setTextUnderlineOffset):
(WebCore::RenderStyle::setTextDecorationThickness):
(WebCore::RenderStyle::initialTextUnderlinePosition):
(WebCore::RenderStyle::initialTextUnderlineOffset):
(WebCore::RenderStyle::initialTextDecorationThickness):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/style/TextDecorationThickness.h: Added.
(WebCore::TextDecorationThickness::createWithAuto):
(WebCore::TextDecorationThickness::createFromFont):
(WebCore::TextDecorationThickness::createWithLength):
(WebCore::TextDecorationThickness::isAuto const):
(WebCore::TextDecorationThickness::isFromFont const):
(WebCore::TextDecorationThickness::isLength const):
(WebCore::TextDecorationThickness::setLengthValue):
(WebCore::TextDecorationThickness::lengthValue const):
(WebCore::TextDecorationThickness::operator== const):
(WebCore::TextDecorationThickness::operator!= const):
(WebCore::TextDecorationThickness::TextDecorationThickness):
(WebCore::operator<<):
* rendering/style/TextUnderlineOffset.h: Added.
(WebCore::TextUnderlineOffset::createWithAuto):
(WebCore::TextUnderlineOffset::createWithLength):
(WebCore::TextUnderlineOffset::isAuto const):
(WebCore::TextUnderlineOffset::isLength const):
(WebCore::TextUnderlineOffset::setLengthValue):
(WebCore::TextUnderlineOffset::lengthValue const):
(WebCore::TextUnderlineOffset::lengthOr const):
(WebCore::TextUnderlineOffset::operator== const):
(WebCore::TextUnderlineOffset::operator!= const):
(WebCore::TextUnderlineOffset::TextUnderlineOffset):
(WebCore::operator<<):
* style/InlineTextBoxStyle.cpp:
(WebCore::computeUnderlineOffset):
* style/InlineTextBoxStyle.h:
2018-11-05 Myles C. Maxfield <mmaxfield@apple.com>
Spelling dots are drawn in the wrong place
https://bugs.webkit.org/show_bug.cgi?id=190764
Reviewed by Dean Jackson.
- Dots should not be clipped.
- Dots should be horizontally centered.
- Dots should be drawn behind the text.
- Distance from the baseline to the top of the dot should be 11.035% of font size.
- Dot diameter should be 13.247% of the font size.
- Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
- The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
Tests: editing/spelling/spelling-dots-position-2.html
editing/spelling/spelling-dots-position-3.html
editing/spelling/spelling-dots-position.html
editing/spelling/spelling-dots-repaint.html
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
(WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
because there is no guarantee the spelling dots will lie inside the layout rect of the element.
(WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
* rendering/InlineFlowBox.h: Comments should explain why, not say what.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint): Draw the dots behind the text.
(WebCore::InlineTextBox::hasMarkers const): Convenience.
(WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
(WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
(WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
(WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
* rendering/InlineTextBox.h: Declare the helper methods.
* rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
spelling dots opt us out of SLL.
(WebCore::SimpleLineLayout::canUseForWithReason):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
2018-11-05 Dean Jackson <dino@apple.com>
Attempted build fix.
* dom/messageports/MessagePortChannelRegistry.cpp:
2018-11-05 Chris Dumez <cdumez@apple.com>
Crash under DOMWindow::postMessageTimerFired()
https://bugs.webkit.org/show_bug.cgi?id=191217
<rdar://problem/40888466>
Reviewed by Geoffrey Garen.
Protect the frame in DOMWindow::postMessageTimerFired() before calling dispatchEvent() as dispatching the
event may cause JS to run and this JS may cause the frame to be destroyed, in which case we will crash
when trying to use the frame on the next line.
Test: fast/dom/Window/remove-frame-in-message-event-handler.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessageTimerFired):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix EncodedImage timestamps to match what libWebRTC expects
https://bugs.webkit.org/show_bug.cgi?id=190035
Reviewed by Philippe Normand.
We can't rely on GStreamer timestamps to pass to EncodedImages after encoding
because libWebRTC doesn't use the timestamp we fed it but does
some computation on the input timestamp in the images we pass in before it passes
them back to the encoder. Then internally LibWebRTC relies on those exact timestamps
passed into the encoder to do checks and compute RTP timestamps so we need to carefully
pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in
all the GStreamer processing pipelines as the WebRTC object basically wraps the "same"
`GstSample` all around, but we are not synced on the clock anyway).
* platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
(WebCore::LibWebRTCVideoFrameFromGStreamerSample):
* platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::newSampleCallback):
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Changing view scale sometimes does not zoom the page to the new initial scale when the page is zoomed in when ignoring meta viewport
https://bugs.webkit.org/show_bug.cgi?id=191226
<rdar://problem/45781765>
Reviewed by Tim Horton.
When `_setViewScale:` SPI is used to adjust the layout scale factor of the page, we multiply minimum, initial
and maximum scales by the given layout scale factor to adjust for a larger or smaller minimum layout size.
However, in the case where the layout size scale factor is greater than 1 and we're also forcing the viewport to
be scalable, we override the default minimum scale with 1 (i.e. `forceAlwaysUserScalableMinimumScale`). This
means that the might be off by a small margin due to rounding error when computing the content width and view
width (see: r237743).
This means that in the case where (1) the viewport is forced to be user-scalable, and (2) we're ignoring meta
viewport parameters, and (3) `_viewScale` exceeds 1, we may end up computing a slightly different minimum scale
than the default minimum scale multiplied by the layout size scale factor; subsequently, the page scale factor
will be slightly different from initial scale, such that we'll no longer zoom to the new initial scale when
changing view scale.
This patch adjusts `forceAlwaysUserScalableMinimumScale` and `forceAlwaysUserScalableMaximumScale` to take the
current layout scale factor into account when computing min and max scales when the viewport is forced to be
always scalable.
Test: fast/viewport/ios/minimum-scale-after-changing-view-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::minimumScale const):
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::maximumScale const):
(WebCore::ViewportConfiguration::forceAlwaysUserScalableMaximumScale const):
(WebCore::ViewportConfiguration::forceAlwaysUserScalableMinimumScale const):
Turn these from constant values to const functions on ViewportConfiguration, which factor in the current
viewport layout size scale factor.
2018-11-05 Dean Jackson <dino@apple.com>
Expose a constructor for PointerEvent from PlatformTouchEvent
https://bugs.webkit.org/show_bug.cgi?id=191238
<rdar://problem/45795682>
Reviewed by Antoine Quint.
Implement a constructor that takes a PlatformTouchEvent to
create a PointerEvent. At the moment the code to call this
constructor will live in WebKitAdditions, so no new tests
yet.
* SourcesCocoa.txt: Add PointerEventIOS.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* dom/EventNames.h: Add macros for pointerdown, pointermove,
pointerup, pointercancel.
* dom/PointerEvent.cpp: Remove JSC namespace.
* dom/PointerEvent.h: Add create and constructor that takes
a PlatformTouchEvent.
* dom/ios/PointerEventIOS.cpp: Added.
2018-11-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237785.
Introduced layout test and API test failures on macOS and iOS.
Reverted changeset:
"[iOS] Issue initial paint soon after the visuallyNonEmpty
milestone is fired."
https://bugs.webkit.org/show_bug.cgi?id=191078
https://trac.webkit.org/changeset/237785
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Error out when simulcast is activated
https://bugs.webkit.org/show_bug.cgi?id=190678
Reviewed by Philippe Normand.
Implementing it is not for now yet.
Tests for simulcast have been disabled as they now fail (instead of crashing).
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
2018-11-05 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
https://bugs.webkit.org/show_bug.cgi?id=191241
Reviewed by Eric Carlson.
Moving the logic to observe the audio source to the point where the
RealtimeOutgoingAudioSource subclass is fully initialized.
Covered by existing tests.
* platform/mediastream/RealtimeOutgoingAudioSource.cpp:
(WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
(WebCore::RealtimeOutgoingAudioSource::observeSource):
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
* platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
(WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
https://bugs.webkit.org/show_bug.cgi?id=190674
Reviewed by Philippe Normand.
webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
it can use to implement encoding for different formats exposing a trimmed down unified API.
It also adds proper handling of H264 profiles.
The added files follow GStreamer coding style as we aim at upstreaming the element
in the future.
This is a refactoring so current tests already cover it.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
(gst_webrtc_video_encoder_get_property):
(gst_webrtc_video_encoder_set_bitrate):
(gst_webrtc_video_encoder_set_format):
(gst_webrtc_video_encoder_set_property):
(register_known_encoder):
(setup_x264enc):
(setup_vp8enc):
(setup_openh264enc):
(set_bitrate_kbit_per_sec):
(set_bitrate_bit_per_sec):
(gst_webrtc_video_encoder_class_init):
(gst_webrtc_video_encoder_init):
* platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::createEncoder):
(WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
(WebCore::GStreamerVideoEncoder::ImplementationName const):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer][WebRTC] properly mark H.264 stream type in the "decoder"
https://bugs.webkit.org/show_bug.cgi?id=190676
Reviewed by Philippe Normand.
Avoiding to have h264parse make assumption (which might be wrong at some
point).
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::GetCapsForFrame):
2018-11-05 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Do not sync libwerbtc stream on the clock
https://bugs.webkit.org/show_bug.cgi?id=190677
The approach here is basically to let libwebrtc do all the
synchronisation for us, and the same way as it is done in apple ports,
we basically try to display what libwebrtc outputs as fast as possible.
Reviewed by Philippe Normand.
Manually tested
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::setSyncOnSink):
(WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::load):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2018-11-05 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
https://bugs.webkit.org/show_bug.cgi?id=191210
Reviewed by Simon Fraser.
isIntersecting should be false if the intersection ratio is smaller than the
smallest threshold value. Update the computation of isIntersecting to depend on
the current thresholdIndex.
Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
2018-11-05 Rob Buis <rbuis@igalia.com>
Remove some virtual methods in CachedRawResource
https://bugs.webkit.org/show_bug.cgi?id=191251
Reviewed by Frédéric Wang.
Since CachedRawResource is final no need to introduce new virtual
methods in CachedRawResource. This patch also removes an outdated
comment and forward declaration.
No new tests since no change in functionality.
* loader/cache/CachedRawResource.h:
2018-11-05 Philippe Normand <pnormand@igalia.com>
[GStreamer] Move elements registration to GStreamerCommon
https://bugs.webkit.org/show_bug.cgi?id=191189
Reviewed by Xabier Rodriguez-Calvar.
It was a bit odd to have this in the base player class and to have
sub-classes calling a static function of the super-class.
Covered by existing tests.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::initializeGStreamerAndRegisterWebKitElements):
* platform/graphics/gstreamer/GStreamerCommon.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::isAvailable):
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2018-11-04 Rob Buis <rbuis@igalia.com>
Remove ENABLE_OPENCL fully
https://bugs.webkit.org/show_bug.cgi?id=191172
Reviewed by Yusuke Suzuki.
Forgot to simplify this, no need for applyAll anymore
since it just calls apply.
No new tests since no change in functionality.
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::applyAll): Deleted.
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::postApplyResource):
2018-11-04 Zalan Bujtas <zalan@apple.com>
[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
https://bugs.webkit.org/show_bug.cgi?id=191078
<rdar://problem/45736178>
Reviewed by Antti Koivisto.
1. Improve visuallyNonEmpty milestone confidence level.
Ignore whitespace and non visible text content.
Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
Check if the html/body is actually visible.
2. Issue initial paint soon after the milestone fires.
Use a 0ms timer to flush the initial paint.
Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
3. Suspend optional style recalcs and layouts while painting is being throttled.
When parsing yields we initiate a 0ms style recalc/layout timer.
These optional layouts produce content that we have no intention to paint.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
(WebCore::Document::shouldScheduleLayout):
* page/ChromeClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::resetLayoutMilestones):
(WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
(WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
(WebCore::FrameView::updateIsVisuallyNonEmpty):
* page/FrameView.h:
(WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
* platform/graphics/FontCascade.h:
* rendering/RenderText.cpp: Check whether the text is actually visible at this point.
(WebCore::RenderText::RenderText):
2018-11-04 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Add support for percentage height in quirks mode.
https://bugs.webkit.org/show_bug.cgi?id=191232
Reviewed by Antti Koivisto.
In quirks mode, we go and travers the containing block chain to find a block level
box with fixed height value to resolve the percentage value.
Test: fast/block/basic/quirk-mode-percent-height.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
* layout/Verification.cpp:
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2018-11-04 Zalan Bujtas <zalan@apple.com>
[LFC][BCF] Add support for block level non-replaced inflow height percentage
https://bugs.webkit.org/show_bug.cgi?id=191229
Reviewed by Antti Koivisto.
Test: fast/block/basic/child-block-level-box-with-height-percent.html
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
(WebCore::Layout::computedHeightValue): Deleted.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2018-11-04 Youenn Fablet <youenn@apple.com>
RealtimeOutgoingAudioSource should use DestructionThread::Main
https://bugs.webkit.org/show_bug.cgi?id=191230
Reviewed by Eric Carlson.
Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
that should no longer crash in debug.
* platform/mediastream/RealtimeOutgoingAudioSource.h:
2018-11-04 Youenn Fablet <youenn@apple.com>
IDB should allow storing RTCCertificate
https://bugs.webkit.org/show_bug.cgi?id=191077
Reviewed by Chris Dumez.
Add support for serialization/deserialization of RTCCertificate.
Store the origin in RTCCertificate and make sure that a certificate
with a different origin cannot be used to create a RTCPeerConnection.
Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::generateCertificate):
* Modules/mediastream/RTCCertificate.cpp:
(WebCore::RTCCertificate::create):
(WebCore::RTCCertificate::RTCCertificate):
* Modules/mediastream/RTCCertificate.h:
(WebCore::RTCCertificate::origin const):
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::certificatesFromConfiguration):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
(WebCore::LibWebRTCCertificateGenerator::generateCertificate):
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::CachedString::takeString):
(WebCore::CloneDeserializer::readRTCCertificate):
(WebCore::CloneDeserializer::readTerminal):
2018-11-04 Youenn Fablet <youenn@apple.com>
Add support for RTCMuxPolicy
https://bugs.webkit.org/show_bug.cgi?id=191188
Reviewed by Eric Carlson.
Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
Make sure setConfiguration throws if trying to change this policy.
Pipe this parameter up to libwebrtc.
Covered by rebased test.
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::iceServersFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::rtcpMuxPolicyfromConfiguration):
(WebCore::configurationFromMediaEndpointConfiguration):
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
* platform/mediastream/RTCPMuxPolicy.h: Added.
2018-11-03 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
https://bugs.webkit.org/show_bug.cgi?id=190854
Reviewed by Matt Baker.
Updated existing tests: inspector/canvas/recording-2d.html
inspector/canvas/recording-bitmaprenderer.html
inspector/canvas/recording-webgl.html
* html/HTMLCanvasElement.idl:
Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
that they are recorded through the same path as `CanvasRenderingContext`.
* html/CanvasBase.h:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::callTracingActive const): Added.
* bindings/js/CallTracer.h:
* bindings/js/CallTracer.cpp:
(WebCore::CallTracer::recordCanvasAction):
2018-11-03 Andy Estes <aestes@apple.com>
[Payment Request] PaymentResponse.retry()'s errorFields should be optional
https://bugs.webkit.org/show_bug.cgi?id=191212
Reviewed by Youenn Fablet.
Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
<https://github.com/w3c/payment-request/issues/804> for details.
Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
* Modules/paymentrequest/PaymentResponse.idl:
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] Resolve percentage height values.
https://bugs.webkit.org/show_bug.cgi?id=191224
Reviewed by Antti Koivisto.
10.5 Content height: the 'height' property
The percentage is calculated with respect to the height of the generated box's containing block.
If the height of the containing block is not specified explicitly (i.e., it depends on content height),
and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
https://www.w3.org/TR/CSS22/visudet.html#propdef-height
Test: fast/block/basic/height-percentage-simple.html
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::isHeightAuto):
(WebCore::Layout::computedHeightValue):
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2018-11-03 Eric Carlson <eric.carlson@apple.com>
[MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
https://bugs.webkit.org/show_bug.cgi?id=191177
<rdar://problem/45747873>
Reviewed by Jer Noble.
Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
* Modules/mediastream/UserMediaController.cpp:
(WebCore::isSecure): Moved from UserMediaRequest.cpp.
(WebCore::isAllowedToUse): Ditto.
(WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
(WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
* Modules/mediastream/UserMediaController.h:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
(WebCore::isSecure): Deleted.
(WebCore::isAllowedToUse): Deleted.
(WebCore::canCallGetUserMedia): Deleted.
2018-11-02 Justin Michaud <justin_michaud@apple.com>
Add new global object and preliminary Worklets support for CSS painting api
https://bugs.webkit.org/show_bug.cgi?id=190979
Reviewed by Chris Dumez.
Test: fast/css-custom-paint/worklet.html
Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
left as ASSERT_NOT_REACHED().
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::scriptExecutionContext const):
* bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
(WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
(WebCore::JSPaintWorkletGlobalScope::registerPaint):
* bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
(WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
(WebCore::JSWorkletGlobalScopeBase::finishCreation):
(WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
(WebCore::JSWorkletGlobalScopeBase::visitChildren):
(WebCore::JSWorkletGlobalScopeBase::destroy):
(WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
(WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
(WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
(WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
(WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
(WebCore::toJS):
(WebCore::toJSWorkletGlobalScope):
* bindings/js/JSWorkletGlobalScopeBase.h: Added.
(WebCore::JSWorkletGlobalScopeBase::wrapped const):
(WebCore::JSWorkletGlobalScopeBase::proxy const):
(WebCore::JSWorkletGlobalScopeBase::createStructure):
(WebCore::toJS):
* bindings/js/ScriptState.cpp:
(WebCore::execStateFromWorkerGlobalScope):
(WebCore::execStateFromWorkletGlobalScope):
* bindings/js/ScriptState.h:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/scripts/CodeGeneratorJS.pm:
(IsDOMGlobalObject):
(ShouldUseGlobalObjectPrototype):
(GenerateHeader):
(GenerateRuntimeEnableConditionalStringForExposed):
(GenerateImplementation):
* bindings/scripts/preprocess-idls.pl:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/DOMCSSPaintWorklet.cpp:
(WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
(WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
* css/DOMCSSPaintWorklet.h:
* css/DOMCSSPaintWorklet.idl:
* dom/Document.cpp:
(WebCore::Document::ensureCSSPaintWorklet):
(WebCore::Document::setCSSPaintWorkletGlobalScope):
(WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
* dom/Document.h:
(WebCore::Document::getCSSPaintWorkletGlobalScope):
* dom/EventTargetFactory.in:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::vm):
(WebCore::ScriptExecutionContext::execState):
* dom/ScriptExecutionContext.h:
(WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
* inspector/agents/worker/WorkerDebuggerAgent.cpp:
(WebCore::WorkerDebuggerAgent::injectedScriptForEval):
* inspector/agents/worker/WorkerRuntimeAgent.cpp:
(WebCore::WorkerRuntimeAgent::injectedScriptForEval):
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
* platform/graphics/CustomPaintImage.h:
* worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
(WebCore::PaintWorkletGlobalScope::create):
(WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
(WebCore::PaintWorkletGlobalScope::devicePixelRatio):
(WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
* worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
* worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
* worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
(WebCore::Worklet::create):
(WebCore::Worklet::Worklet):
(WebCore::Worklet::addModule):
* worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
* worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
* worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
(WebCore::WorkletConsoleClient::WorkletConsoleClient):
(WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
(WebCore::WorkletConsoleClient::count):
(WebCore::WorkletConsoleClient::time):
(WebCore::WorkletConsoleClient::timeEnd):
(WebCore::WorkletConsoleClient::profile):
(WebCore::WorkletConsoleClient::profileEnd):
(WebCore::WorkletConsoleClient::takeHeapSnapshot):
(WebCore::WorkletConsoleClient::timeStamp):
(WebCore::WorkletConsoleClient::record):
(WebCore::WorkletConsoleClient::recordEnd):
* worklets/WorkletConsoleClient.h: Added.
* worklets/WorkletGlobalScope.cpp: Added.
(WebCore::WorkletGlobalScope::WorkletGlobalScope):
(WebCore::WorkletGlobalScope::~WorkletGlobalScope):
(WebCore::WorkletGlobalScope::evaluate):
(WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
(WebCore::WorkletGlobalScope::disableEval):
(WebCore::WorkletGlobalScope::disableWebAssembly):
(WebCore::WorkletGlobalScope::completeURL const):
(WebCore::WorkletGlobalScope::logExceptionToConsole):
(WebCore::WorkletGlobalScope::addConsoleMessage):
(WebCore::WorkletGlobalScope::addMessage):
* worklets/WorkletGlobalScope.h: Added.
(WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
(WebCore::WorkletGlobalScope::identifier const):
(WebCore::WorkletGlobalScope::script):
(WebCore::WorkletGlobalScope::jsRuntimeFlags const):
(isType):
* worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
* worklets/WorkletScriptController.cpp: Added.
(WebCore::WorkletScriptController::WorkletScriptController):
(WebCore::WorkletScriptController::~WorkletScriptController):
(WebCore::WorkletScriptController::forbidExecution):
(WebCore::WorkletScriptController::isExecutionForbidden const):
(WebCore::WorkletScriptController::disableEval):
(WebCore::WorkletScriptController::disableWebAssembly):
(WebCore::WorkletScriptController::initScriptWithSubclass):
(WebCore::WorkletScriptController::initScript):
(WebCore::WorkletScriptController::evaluate):
(WebCore::WorkletScriptController::setException):
* worklets/WorkletScriptController.h: Added.
(WebCore::WorkletScriptController::workletGlobalScopeWrapper):
(WebCore::WorkletScriptController::vm):
(WebCore::WorkletScriptController::initScriptIfNeeded):
2018-11-02 Myles C. Maxfield <mmaxfield@apple.com>
Clean up drawLineForDocumentMarker()
https://bugs.webkit.org/show_bug.cgi?id=191215
Reviewed by Zalan Bujtas.
In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
This patch has no behavior change; it just does the following:
1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
2. Moves our implementation back into GraphicsContext, because it's simpler and GraphicsContext is already platform-
specific.
3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
No new tests because there is no behavior change.
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawDotsForDocumentMarker):
(WebCore::Cairo::drawLineForDocumentMarker): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
(WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cocoa/FontCascadeCocoa.mm:
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::colorForMarkerLineStyle):
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::Item::sizeInBytes):
(WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
(WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
(WebCore::DisplayList::operator<<):
(WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
* platform/graphics/displaylists/DisplayListItems.h:
(WebCore::DisplayList::DrawDotsForDocumentMarker::create):
(WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
(WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
(WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
(WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
(WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
* platform/graphics/displaylists/DisplayListRecorder.h:
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
(Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
(Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
* platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::drawDotsForDocumentMarker):
(WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
* rendering/RenderTheme.h:
* rendering/RenderThemeCocoa.h:
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
2018-11-02 Ali Juma <ajuma@chromium.org>
requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
https://bugs.webkit.org/show_bug.cgi?id=176243
Reviewed by Simon Fraser.
When a new layer tree is committed to the UIProcess, the positions of layers for fixed
or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
leads to a recursive traversal of the ScrollingTree to update each such layer. However,
since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
this traversal never descended into scrolling nodes within an iframe, so the layers for
these nodes were left with stale positions.
Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
fixed and sticky layers within an iframe do get their positions updated when a new layer
tree is committed.
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
(WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
2018-11-02 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
https://bugs.webkit.org/show_bug.cgi?id=191180
<rdar://problem/45744786>
Reviewed by Simon Fraser.
When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
width or height.
Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so
slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
in `ViewportConfiguration::minimumScale` returning 0.94158.
With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
`_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
should, since the page scale factor and the initial scale are different enough such that
`areEssentiallyEqualAsFloat` returns false.
This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::minimumScale const):
2018-11-02 Philippe Normand <pnormand@igalia.com>
[GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::addEventListenersToNode):
2018-11-02 Daniel Bates <dabates@apple.com>
[iOS] Normalize character string based on key code
https://bugs.webkit.org/show_bug.cgi?id=191120
Reviewed by Tim Horton.
Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
for a special key (e.g. page up) and can simplify the character string normalization code.
No functionality changed. So, no new tests.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
in terms of it.
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
2018-11-02 Daniel Bates <dabates@apple.com>
[iOS] WebKit should dispatch DOM events when a modifier key is pressed
https://bugs.webkit.org/show_bug.cgi?id=190487
Reviewed by Tim Horton.
Add support for modifier flags change events.
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
participate in key repeat.
(WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
the modifier key is unidentified. This matches the behavior on Mac.
(WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
key is unidentified. This matches the behavior on Mac.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Modifier keys do not have an associated character and do not participate in key repeat.
(-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
that represents a modifier flags change.
(-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
invariant as it is a programming error. On Mac, the same operation would result in a
NSInternalInconsistencyException exception being raised.
(-[WebEvent charactersIgnoringModifiers]): Ditto.
2018-11-02 Ali Juma <ajuma@chromium.org>
Allow cross-document intersection observing
https://bugs.webkit.org/show_bug.cgi?id=165746
Reviewed by Simon Fraser.
Add logic to compute the intersection between the viewport and an element in a
subframe.
Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
of the methods it calls.
Test: http/tests/intersection-observer/intermediate-frame-changes.html
Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
* dom/Document.cpp:
(WebCore::computeClippedRectInRootContentsSpace):
(WebCore::computeIntersectionState):
(WebCore::Document::updateIntersectionObservations):
* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged):
(WebCore::FrameView::convertFromContainingViewToRenderer const):
(WebCore::FrameView::convertFromContainingView const):
* page/FrameView.h:
* platform/ScrollView.cpp:
(WebCore::ScrollView::viewToContents const):
(WebCore::ScrollView::contentsToView const):
(WebCore::ScrollView::rootViewToContents const):
* platform/ScrollView.h:
* platform/Widget.cpp:
(WebCore::Widget::convertFromRootView const):
(WebCore::Widget::convertFromContainingView const):
* platform/Widget.h:
2018-11-02 Rob Buis <rbuis@igalia.com>
Remove ENABLE_OPENCL fully
https://bugs.webkit.org/show_bug.cgi?id=191172
Reviewed by Yusuke Suzuki.
No new tests since no change in functionality.
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::hasResult const):
(WebCore::FilterEffect::applyAll):
(WebCore::FilterEffect::openCLImage): Deleted.
(WebCore::FilterEffect::setOpenCLImage): Deleted.
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for intrinsic width calculation
https://bugs.webkit.org/show_bug.cgi?id=191144
Reviewed by Antti Koivisto.
This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
Test: fast/inline/simple-shrink-to-fit-inline-block.html
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
(WebCore::Layout::InlineFormattingContext::collectInlineContent const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
https://bugs.webkit.org/show_bug.cgi?id=191181
Reviewed by Antti Koivisto.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2018-11-02 Zalan Bujtas <zalan@apple.com>
[LFC] Align shrink-to-fit width computation with the layout implementation.
https://bugs.webkit.org/show_bug.cgi?id=191179
Reviewed by Antti Koivisto.
There are many similarities between layout and shrink-to-fit.
They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
the algoritm depends on what type of formatting context the element establishes.
This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2018-11-01 Antoine Quint <graouts@apple.com>
[Web Animations] Make document.getAnimations() return declarative animations in the correct order
https://bugs.webkit.org/show_bug.cgi?id=191153
Reviewed by Dean Jackson.
The Web Animations spec has the notion of "composite order" which determines the order in which animations should
be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
determine the composite order of their respective animation classes, as well as the notion of "owning element",
the element that was the animation target when specified through style, prior to any manipulation via the Web
Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
declarative animations.
It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
declarative animation has been modified.
In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
may be canceled if overridden with a new animation, correctly removing their "owning element".
Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
in order as the final criterion for sorting.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
created for this timeline in the order in which they were created, which is needed to sort animations correctly when
document.getAnimations() is called.
(WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
to determine which map we should add an animation to based on its class and instead have code that accounts for not just
the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
a CSS Transition or CSS Animation, regardless of the animation's original class.
(WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
that animationWasRemovedFromElement() can call this with all of the various animation maps.
(WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
(WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
well as completed CSS Transitions was factored out. This allowed us to also call this function from
DeclarativeAnimation::disassociateFromOwningElement().
(WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
(WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
transitions for a given element as it can be cleared by a prior cancelation.
(WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it
were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
declarative animation with an owning element.
(WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
animations and send events" procedure.
(WebCore::AnimationTimeline::animations const): Deleted.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
DeclarativeAnimation constructor.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
DeclarativeAnimation constructor.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::DeclarativeAnimation):
(WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
"update animations and send events" procedure is run.
(WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
Web Animations created via the Web Animations API.
(WebCore::DeclarativeAnimation::initialize):
(WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
cancels the animation but also disassociates it from its owning element.
(WebCore::DeclarativeAnimation::invalidateDOMEvents):
(WebCore::DeclarativeAnimation::enqueueDOMEvent):
* animation/DeclarativeAnimation.h:
(WebCore::DeclarativeAnimation::owningElement const):
(WebCore::DeclarativeAnimation::target const): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
(WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
(WebCore::DocumentTimeline::transitionDidComplete):
* animation/DocumentTimeline.h:
2018-11-02 Zan Dobersek <zdobersek@igalia.com>
PNGImageDecoder: report no repetition for non-animated images
https://bugs.webkit.org/show_bug.cgi?id=191068
Reviewed by Michael Catanzaro.
When building with APNG support enabled, the
PNGImageDecoder::repetitionCount() method until now reported infinite
repetition count for all PNG images, even the ones that were not
animated. This is now changed so that no repetition is reported for
non-animated images.
* platform/image-decoders/png/PNGImageDecoder.cpp:
(WebCore::PNGImageDecoder::repetitionCount const):
2018-11-02 Justin Fan <justin_fan@apple.com>
[WebGPU] Experimental prototype for MSL shaders
https://bugs.webkit.org/show_bug.cgi?id=191084
Reviewed by Dean Jackson.
Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
Test: webgpu/webgpu-basics.html
Test: webgpu/shader-modules.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/GPUDevice.cpp:
(WebCore::GPUDevice::createShaderModule const):
* Modules/webgpu/GPUDevice.h:
(WebCore::GPUDevice::platformDevice const):
* Modules/webgpu/GPUShaderModule.h:
(WebCore::GPUShaderModule::platformShaderModule const):
* Modules/webgpu/GPUShaderModuleDescriptor.h:
* Modules/webgpu/WebGPU.cpp:
(WebCore::WebGPU::requestAdapter const):
* Modules/webgpu/WebGPUAdapter.cpp:
(WebCore::WebGPUAdapter::create):
(WebCore::WebGPUAdapter::createDevice):
* Modules/webgpu/WebGPUAdapter.h:
* Modules/webgpu/WebGPUAdapter.idl:
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
(WebCore::WebGPUDevice::createShaderModule const):
* Modules/webgpu/WebGPUDevice.h:
* Modules/webgpu/WebGPUDevice.idl:
* Modules/webgpu/WebGPUShaderModule.cpp:
(WebCore::WebGPUShaderModule::create):
(WebCore::WebGPUShaderModule::WebGPUShaderModule):
* Modules/webgpu/WebGPUShaderModule.h:
* Modules/webgpu/WebGPUShaderModule.idl:
* Modules/webgpu/WebGPUShaderModuleDescriptor.h:
* Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
* Modules/webgpu/WebGPUSwapChain.cpp:
(WebCore::WebGPUSwapChain::configure):
* Modules/webgpu/WebGPUSwapChain.h:
* Modules/webgpu/WebGPUSwapChain.idl:
* Modules/webgpu/cocoa/GPUDeviceMetal.mm:
(WebCore::GPUDevice::create):
(WebCore::GPUDevice::GPUDevice):
* Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
(WebCore::GPUShaderModule::create):
(WebCore::GPUShaderModule::GPUShaderModule):
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/Logging.h:
2018-11-01 Jiewen Tan <jiewen_tan@apple.com>
Replace CommonRandom SPI with API
https://bugs.webkit.org/show_bug.cgi?id=191178
<rdar://problem/45722391>
Reviewed by Brent Fulgham.
The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
all SPI usages with API.
No change of behaviors.
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoKeyMac.cpp:
(WebCore::CryptoKey::randomData):
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey):
(WebCore::wrapSerializedCryptoKey):
* page/Crypto.cpp:
(WebCore::Crypto::getRandomValues):
2018-11-01 Chris Dumez <cdumez@apple.com>
[WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
https://bugs.webkit.org/show_bug.cgi?id=191162
Reviewed by Alex Christensen.
Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
in modern WebKit. The implementation is actually passed an ExecState nowadays.
* Modules/applepay/ApplePaySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/fetch/FetchBody.idl:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/mediastream/RTCPeerConnection.idl:
* animation/Animatable.idl:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectReadOnly.idl:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateCallWith):
(GenerateConstructorDefinition):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjWithExecStateAttributeGetter):
(WebCore::jsTestObjWithExecStateAttribute):
(WebCore::setJSTestObjWithExecStateAttributeSetter):
(WebCore::setJSTestObjWithExecStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
(WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
(WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
(WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
(WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptStateAttribute): Deleted.
(WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
(WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
(WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
(WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/TestPromiseRejectionEvent.idl:
* crypto/SubtleCrypto.idl:
* dom/Element.idl:
* dom/ErrorEvent.idl:
* dom/MessagePort.idl:
* dom/MouseEvent.idl:
* html/HTMLCanvasElement.idl:
* html/HTMLFrameElement.idl:
* html/OffscreenCanvas.idl:
* html/track/DataCue.idl:
* inspector/CommandLineAPIHost.idl:
* page/DOMWindow.idl:
* page/RemoteDOMWindow.idl:
* page/WindowOrWorkerGlobalScope.idl:
* testing/Internals.idl:
* workers/DedicatedWorkerGlobalScope.idl:
* workers/Worker.idl:
2018-11-01 Fujii Hironori <Hironori.Fujii@sony.com>
Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
https://bugs.webkit.org/show_bug.cgi?id=189693
Reviewed by Yusuke Suzuki.
No new tests because there's no behaviro changes.
* platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
* xml/XSLTProcessorLibxslt.cpp: Ditto.
* xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
2018-11-01 John Wilander <wilander@apple.com>
In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
https://bugs.webkit.org/show_bug.cgi?id=191119
<rdar://problem/44176965>
Reviewed by Chris Dumez.
New API test added.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2018-11-01 Devin Rousso <drousso@apple.com>
Web Inspector: Network: remove unnecessary media event tracking
https://bugs.webkit.org/show_bug.cgi?id=191174
Reviewed by Joseph Pecoraro.
No new tests, as this simply removes some event listeners for the WebInspector frontend.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::addEventListenersToNode):
2018-11-01 Chris Dumez <cdumez@apple.com>
Location object sans browsing context
https://bugs.webkit.org/show_bug.cgi?id=191060
Reviewed by Geoffrey Garen.
As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
it does not have a browsing context (Frame), not "".
No new tests, rebaselined existing tests.
* page/Location.cpp:
(WebCore::Location::url const):
(WebCore::Location::href const):
(WebCore::Location::protocol const):
(WebCore::Location::host const):
(WebCore::Location::hostname const):
(WebCore::Location::port const):
(WebCore::Location::pathname const):
(WebCore::Location::search const):
(WebCore::Location::origin const):
(WebCore::Location::hash const):
2018-11-01 Sihui Liu <sihui_liu@apple.com>
Add a storage limit for IndexedDB
https://bugs.webkit.org/show_bug.cgi?id=190598
<rdar://problem/44654715>
Reviewed by Chris Dumez.
Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin.
IndexedDB will return a QuotaExceededError if limit is reached.
If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is
half the free disk space.
Test: storage/indexeddb/storage-limit.html
* Modules/indexeddb/server/IDBBackingStore.h:
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::createBackingStore):
(WebCore::IDBServer::IDBServer::setPerOriginQuota):
* Modules/indexeddb/server/IDBServer.h:
(WebCore::IDBServer::IDBServer::perOriginQuota const):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
(WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
(WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
(WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::setQuota):
* Modules/indexeddb/server/UniqueIDBDatabase.h:
2018-11-01 Justin Michaud <justin_michaud@apple.com>
CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
https://bugs.webkit.org/show_bug.cgi?id=191042
Reviewed by Antti Koivisto.
Refactor code so that:
- All properties applied in StyleResolver::applyMatchedProperties are only applied once.
- Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
every time they were referenced, and again in RenderStyle.
- The font-size property is applied after its variable references, but before custom properties that depend on it.
- Cycles are detected at the same time as resolution.
- MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
This behaviour matches chrome, but is not documented in the spec.
- Custom property values have more explicit resolved/unresolved state.
- RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
Tests: css-custom-properties-api/crash.html
css-custom-properties-api/cycles.html
css-custom-properties-api/inline.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp:
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
* css/CSSRegisteredCustomProperty.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
(WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
(WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
(WebCore::CSSVariableData::resolveVariableReference const): Deleted.
(WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
(WebCore::CSSVariableData::resolveTokenRange const): Deleted.
* css/CSSVariableData.h:
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved): Deleted.
(WebCore::CSSVariableData::needsVariableResolution const): Deleted.
(WebCore::CSSVariableData::CSSVariableData): Deleted.
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableFallback):
(WebCore::resolveVariableReference):
(WebCore::resolveTokenRange):
(WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
* css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::equals const):
(WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setCustomProperty):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::applyPropertyToCurrentStyle):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
(WebCore::StyleResolver::applyCascadedCustomProperty):
(WebCore::StyleResolver::applyCascadedProperties):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::setValueForProperty):
(WebCore::variableDataForPositivePixelLength):
(WebCore::variableDataForPositiveDuration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator== const):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
(): Deleted.
2018-11-01 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155
Reviewed by Simon Fraser.
Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):
2018-11-01 Youenn Fablet <youenn@apple.com>
RTCTrackEvent.streams should be SameObject
https://bugs.webkit.org/show_bug.cgi?id=191130
Reviewed by Eric Carlson.
Mimick SameObject using CachedAttribute.
Covered by rebased test.
* Modules/mediastream/RTCTrackEvent.idl:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for inline-block elements.
https://bugs.webkit.org/show_bug.cgi?id=191143
Reviewed by Antti Koivisto.
This patch add support for laying out non-shrink-to-width inline-block elements.
Test: fast/inline/simple-inline-block.html
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
* layout/layouttree/LayoutInlineContainer.cpp:
(WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
* layout/layouttree/LayoutInlineContainer.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-11-01 Claudio Saavedra <csaavedra@igalia.com>
Fix build with VIDEO and WEB_AUDIO disabled
https://bugs.webkit.org/show_bug.cgi?id=191147
Reviewed by Philippe Normand.
Supported or not, there were a few build fixes needed
to be able to build WebKit with media disabled. Mostly
low-hanging fruits.
* Modules/mediasource/VideoPlaybackQuality.cpp:
* Modules/mediasource/VideoPlaybackQuality.h:
* Modules/mediasource/VideoPlaybackQuality.idl:
* dom/Document.cpp:
(WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
* inspector/agents/InspectorDOMAgent.h:
* rendering/RenderThemeGtk.cpp:
2018-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: create a setting for auto-recording newly created contexts
https://bugs.webkit.org/show_bug.cgi?id=190856
Reviewed by Brian Burg.
Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
* inspector/agents/InspectorCanvasAgent.h:
(WebCore::InspectorCanvasAgent::RecordingOptions): Added.
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::disable):
(WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
(WebCore::InspectorCanvasAgent::startRecording): Added.
Unify the different functions that are able to start a recording to use a single path.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::setFrameCount): Added.
(WebCore::InspectorCanvas::overFrameCount const): Added.
2018-10-31 Devin Rousso <drousso@apple.com>
Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
https://bugs.webkit.org/show_bug.cgi?id=190641
<rdar://problem/45319049>
Reviewed by Joseph Pecoraro.
No new tests, as low power mode is indeterminate. Should not affect functionality.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::InspectorDOMAgent):
(WebCore::InspectorDOMAgent::addEventListenersToNode):
(WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
2018-10-31 Alicia Boya García <aboya@igalia.com>
[MSE] Use tolerance when growing the coded frame group
https://bugs.webkit.org/show_bug.cgi?id=190085
Reviewed by Jer Noble.
Test: media/media-source/media-source-append-acb-tolerance.html
This patch introduces a millisecond tolerance in the range of
potential frames that should be erased frame from the track buffer
when the coded frame group is growing.
This is necessary because some files have imprecise overlapping
timestamps (especially WebM files).
This fixes a stall when seeking back and forth in YouTube with WebM
video.
A test case simulating the problem with video/mock using timestamps
similar to those of a typical 30 fps WebM video is also added.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-10-31 Jer Noble <jer.noble@apple.com>
MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
https://bugs.webkit.org/show_bug.cgi?id=191129
Reviewed by Eric Carlson.
Test: media/media-source/media-source-istypesupported-case-sensitive.html
According to RFC 2045: "All media type values, subtype values, and parameter names as
defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
specified for the specific parameter." So rather than fold the entire ContentType into lower-
case, leave the original string intact and require clients to enforce case-insensitivity.
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::isTypeSupported):
2018-10-31 Jer Noble <jer.noble@apple.com>
Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
access of m_cdmInstance.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2018-10-31 YUHAN WU <yuhan_wu@apple.com>
MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
https://bugs.webkit.org/show_bug.cgi?id=190778
<rdar://problem/45703574>
Reviewed by Youenn Fablet.
Add a include to fix the unified build error.
No tests since no new functionality.
* Modules/webgpu/WebGPUDevice.cpp:
2018-10-26 Jer Noble <jer.noble@apple.com>
[EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
https://bugs.webkit.org/show_bug.cgi?id=190946
Reviewed by Eric Carlson.
Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
CDMInstance).
- Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
requiring MediaKeySession to send a callback first.
- Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
CDMInstanceSessionFairPlayStreamingAVFObjC.
- Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
- Support key renewal through a "renew" message.
- Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
- Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::sendMessage):
* Modules/encryptedmedia/MediaKeySession.h:
* platform/encryptedmedia/CDMInstanceSession.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::keyIDsForRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
(WebCore::requestStatusToCDMStatus):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
(WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
(WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
(WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::destroyParser):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
(WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2018-10-31 Zach Li <zacharyli323@gmail.com>
Add credit card autofill button
https://bugs.webkit.org/show_bug.cgi?id=191051
<rdar://problem/45657011>
Reviewed by Wenson Hsieh.
Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* css/html.css:
(input::-webkit-credit-card-auto-fill-button):
Add credit card autofill button.
(input::-webkit-credit-card-auto-fill-button:hover):
(input::-webkit-credit-card-auto-fill-button:active):
* html/HTMLTextFormControlElement.h:
* html/TextFieldInputType.cpp:
(WebCore::autoFillButtonTypeToAccessibilityLabel):
(WebCore::autoFillButtonTypeToAutoFillButtonText):
(WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
(WebCore::isAutoFillButtonTypeChanged):
* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillCreditCardLabel):
* platform/LocalizedStrings.h:
* testing/Internals.cpp:
(WebCore::toAutoFillButtonType):
(WebCore::toInternalsAutoFillButtonType):
* testing/Internals.h:
* testing/Internals.idl:
2018-10-31 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Don't reveal device IDs until the user has granted permission to capture
https://bugs.webkit.org/show_bug.cgi?id=191112
<rdar://problem/45699932>
Reviewed by Youenn Fablet.
No new tests, existing tests updated.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user
has granted permssion to capture.
2018-10-31 YUHAN WU <yuhan_wu@apple.com>
MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
https://bugs.webkit.org/show_bug.cgi?id=190778
Reviewed by Youenn Fablet.
Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
Implement a mock string as the output buffer of MediaRecorder.
Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate.
Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
* CMakeLists.txt:
* Modules/mediarecorder/BlobEvent.cpp: Added.
(WebCore::BlobEvent::create):
(WebCore::BlobEvent::BlobEvent):
(WebCore::BlobEvent::eventInterface const):
* Modules/mediarecorder/BlobEvent.h:
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::stop):
(WebCore::MediaRecorder::startRecording):
(WebCore::MediaRecorder::stopRecording):
(WebCore::MediaRecorder::stopRecordingInternal):
(WebCore::MediaRecorder::didAddOrRemoveTrack):
(WebCore::MediaRecorder::trackEnded):
(WebCore::MediaRecorder::sampleBufferUpdated):
(WebCore::MediaRecorder::audioSamplesAvailable):
(WebCore::MediaRecorder::scheduleDeferredTask):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
* platform/mediarecorder/MediaRecorderPrivate.h: Added.
* platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
(WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
(WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
(WebCore::MediaRecorderPrivateMock::generateMockString):
(WebCore::MediaRecorderPrivateMock::fetchData):
* platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
2018-10-31 Claudio Saavedra <csaavedra@igalia.com>
[GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
https://bugs.webkit.org/show_bug.cgi?id=191110
Reviewed by Michael Catanzaro.
Covered by existing tests.
Turns out that this method is expected to reject domains that
are not registrable. Also sync with the Mac implementation in
that given domains that are not all ASCII should be returned
back as is. This fixes the remaining Public Suffix API tests.
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::topPrivatelyControlledDomain):
2018-10-31 Antti Koivisto <antti@apple.com>
Remove LayerFlushScheduler
https://bugs.webkit.org/show_bug.cgi?id=191103
Reviewed by Anders Carlsson.
It is only used in WK1.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
* platform/graphics/ca/LayerFlushScheduler.h: Removed.
* platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
2018-10-31 Zalan Bujtas <zalan@apple.com>
Missing from r237634
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::formattingContext):
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] Do not pass LayoutState& to compute* and layout* functions
https://bugs.webkit.org/show_bug.cgi?id=191100
Reviewed by Antti Koivisto.
Reduce noise by removing LayoutState& parameter where possible.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] FormattingContext class should take FormattingState&
https://bugs.webkit.org/show_bug.cgi?id=191099
Reviewed by Antti Koivisto.
This is in preparation for not passing LayoutState& into every layout functions.
FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
LayoutState <- FormattingState <- FormattingContext
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::formattingState const):
(WebCore::Layout::FormattingContext::layoutState const):
* layout/FormattingContext.h:
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::layoutState const):
* layout/LayoutFormattingState.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
(WebCore::Layout::BlockFormattingState::formattingContext):
(WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
(WebCore::Layout::InlineFormattingState::formattingContext):
(WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
* layout/inlineformatting/InlineFormattingState.h:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] The *FormattingState class should provide the *FormattingContext.
https://bugs.webkit.org/show_bug.cgi?id=191089
Reviewed by Antti Koivisto.
BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingState.h:
* layout/LayoutFormattingState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::formattingContext const): Deleted.
* layout/LayoutFormattingState.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::formattingContext const):
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::formattingContext const):
* layout/inlineformatting/InlineFormattingState.h:
2018-10-31 Zalan Bujtas <zalan@apple.com>
[LFC] Rename LayoutContext to LayoutState
https://bugs.webkit.org/show_bug.cgi?id=191080
Reviewed by Antti Koivisto.
LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
(LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
Now the current state is as follows:
LayoutState has
1. Layout tree
2. State content for each formatting subtrees
3. Display tree
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
(WebCore::Layout::FormattingContext::computeBorderAndPadding const):
(WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
(WebCore::Layout::FormattingContext::mapBoxToAncestor):
(WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
(WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
(WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::contentHeightForFormattingContextRoot):
(WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
(WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::complicatedCases):
(WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
(WebCore::Layout::FormattingContext::Geometry::computedBorder):
(WebCore::Layout::FormattingContext::Geometry::computedPadding):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
(WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
* layout/FormattingState.cpp:
(WebCore::Layout::FormattingState::FormattingState):
* layout/FormattingState.h:
(WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
(WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
* layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
(WebCore::Layout::LayoutState::LayoutState):
(WebCore::Layout::LayoutState::initializeRoot):
(WebCore::Layout::LayoutState::updateLayout):
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
(WebCore::Layout::LayoutState::styleChanged):
(WebCore::Layout::LayoutState::markNeedsUpdate):
(WebCore::Layout::LayoutState::formattingStateForBox const):
(WebCore::Layout::LayoutState::establishedFormattingState const):
(WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
(WebCore::Layout::LayoutState::formattingContext const):
* layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
(WebCore::Layout::LayoutState::setInQuirksMode):
(WebCore::Layout::LayoutState::hasDisplayBox const):
(WebCore::Layout::LayoutState::inQuirksMode const):
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
(WebCore::Layout::verifyAndOutputSubtree):
(WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layout const):
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginTop):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::isStretchedToInitialContainingBlock):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
(WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::BlockFormattingState):
* layout/blockformatting/BlockFormattingState.h:
* layout/blockformatting/BlockInvalidation.cpp:
(WebCore::Layout::computeUpdateType):
(WebCore::Layout::computeUpdateTypeForAncestor):
(WebCore::Layout::BlockInvalidation::invalidate):
* layout/blockformatting/BlockInvalidation.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::isMarginTopCollapsedWithParent):
(WebCore::Layout::isMarginBottomCollapsedThrough):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
(WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
* layout/displaytree/DisplayBox.h:
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider):
* layout/floats/FloatAvoider.h:
* layout/floats/FloatBox.cpp:
(WebCore::Layout::FloatBox::FloatBox):
* layout/floats/FloatBox.h:
* layout/floats/FloatingContext.cpp:
(WebCore::Layout::FloatingContext::positionForFloat const):
(WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
(WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
* layout/floats/FloatingContext.h:
(WebCore::Layout::FloatingContext::layoutState const):
(WebCore::Layout::FloatingContext::layoutContext const): Deleted.
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::FloatItem::FloatItem):
(WebCore::Layout::FloatingState::FloatingState):
(WebCore::Layout::FloatingState::constraints const):
* layout/floats/FloatingState.h:
(WebCore::Layout::FloatingState::create):
(WebCore::Layout::FloatingState::layoutState const):
(WebCore::Layout::FloatingState::layoutContext const): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
(WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
(WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp:
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::InlineFormattingState):
* layout/inlineformatting/InlineFormattingState.h:
* layout/inlineformatting/InlineInvalidation.cpp:
(WebCore::Layout::InlineInvalidation::invalidate):
* layout/inlineformatting/InlineInvalidation.h:
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::runWidth const):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutTree):
(WebCore::Layout::showLayoutTree):
* layout/layouttree/LayoutTreeBuilder.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):
2018-10-30 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] Attachment dropped from one web view to another is missing its file wrapper
https://bugs.webkit.org/show_bug.cgi?id=190530
<rdar://problem/45232149>
Reviewed by Tim Horton.
Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
and creating NSFileWrappers upon reading web content.
Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::registerAttachments):
* editing/Editor.h:
Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
about just a single attachment.
* editing/SerializedAttachmentData.h:
Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
data upon paste.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments):
Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::archiveResourceURL):
* html/HTMLAttachmentElement.h:
Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
use in a web archive resource.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::addSubresourcesForAttachmentElementsIfNecessary):
Add a helper function to create and append ArchiveResources representing attachment element data when writing
attachments to the pasteboard via web archive data.
(WebCore::LegacyWebArchive::create):
* page/EditorClient.h:
(WebCore::EditorClient::registerAttachments):
(WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
2018-10-30 David Kilzer <ddkilzer@apple.com>
XSLTProcessor should limit max transform depth
<https://webkit.org/b/191075>
<rdar://problem/45531453>
Reviewed by Alex Christensen.
Test: fast/xsl/xslt-max-depth.html
* xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
* xml/SoftLinkLibxslt.h: Ditto.
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
to 1000. Default in libxslt.dylib is 3000.
2018-10-30 Jim Mason <jmason@ibinx.com>
[GTK] Scrollbars not following gtk-primary-button-warps-slider setting
https://bugs.webkit.org/show_bug.cgi?id=191067
Reviewed by Michael Catanzaro.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2018-10-30 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete MAX_ALLOWED macros
https://bugs.webkit.org/show_bug.cgi?id=190916
Reviewed by Tim Horton.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPointForEvent):
(WebCore::pointForEvent):
(WebCore::mouseButtonForEvent):
(WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2018-10-30 Ali Juma <ajuma@chromium.org>
Calling window.open("", "_self") allows working around restrictions on window.close()
https://bugs.webkit.org/show_bug.cgi?id=191073
Reviewed by Chris Dumez.
Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
Test: fast/dom/Window/window-open-self-disallow-close.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
2018-10-30 Andy Estes <aestes@apple.com>
[Payment Request] Implement PaymentResponse.retry()
https://bugs.webkit.org/show_bug.cgi?id=190985
Reviewed by Daniel Bates.
Implemented the retry() method on PaymentResponse as specified in the Payment Request API
W3C Editor's Draft of 24 October 2018.
See https://w3c.github.io/payment-request/#retry-method for details.
Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
http/tests/paymentrequest/payment-response-retry-method.https.html
* Modules/applepay/PaymentCoordinator.h:
(WebCore::PaymentCoordinator::client): Added. Returns m_client.
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
a PaymentCoordinatorClient to a MockPaymentCoordinator.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
(WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
(WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
(WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
(WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
(WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
final result.
(WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
and called PaymentCoordinator::completePaymentSession.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show): Changed to call settleShowPromise.
(WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
promise, if present, instead of PaymentResponse's show promise.
(WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
std::nullopt.
(WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
handler then sets it to std::nullopt.
(WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
will settle its own promise in its implementation of stop.
(WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
pending retry promise and to call abortWithException instead of stop.
(WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
instead of stop.
(WebCore::PaymentRequest::settleDetailsPromise): Ditto.
(WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
rather than the show promise.
(WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
active payment handler.
(WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
active payment handler, and to call PaymentHandler::retry if there is.
(WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
to |this|, so they cannot be created in constructors without relaxing adoption requirements.
Added this function so that the pending activity can be created after the PaymentResponse is
created and adopted.
(WebCore::PaymentResponse::~PaymentResponse):
(WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
when necessary.
(WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
m_retryPromise.
(WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
|exception|, clears the pending activity, and sets m_state to Completed.
(WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
to std::nullopt.
(WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
there is no pending activity.
(WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
the pending activity, and sets m_state to Stopped.
* Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
* testing/Internals.cpp:
(WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
(WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
downcasting the page's payment coordinator client.
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
hideCount for final results.
* testing/MockPaymentCoordinator.h:
(isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
2018-10-30 Zalan Bujtas <zalan@apple.com>
[iOS] Use the mainframe view size to compute window.outerWidth/height.
https://bugs.webkit.org/show_bug.cgi?id=191070
<rdar://problem/42368377>
Reviewed by Tim Horton.
Use a more reasonable value for window.outerWidth and height.
(WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
* page/DOMWindow.cpp:
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):
2018-10-30 Andy Estes <aestes@apple.com>
[Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
https://bugs.webkit.org/show_bug.cgi?id=191039
Reviewed by Megan Gardner.
During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
whenever the user agent supports one or more of the specified payment methods, even if those
payment methods do not have active instruments.
Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::canMakePayment):
(WebCore::shouldDiscloseApplePayCapability): Deleted.
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::canMakePayments):
(WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2018-10-30 Sihui Liu <sihui_liu@apple.com>
Add a deprecation warning to console for Web SQL
https://bugs.webkit.org/show_bug.cgi?id=190936
Reviewed by Ryosuke Niwa.
No new tests. Just adding a console message.
* Modules/webdatabase/DOMWindowWebDatabase.cpp:
(WebCore::DOMWindowWebDatabase::openDatabase):
2018-10-30 Sihui Liu <sihui_liu@apple.com>
IndexedDB: iteration of cursors skip records if updated or deleted
https://bugs.webkit.org/show_bug.cgi?id=190917
<rdar://problem/35250410>
Reviewed by Chris Dumez.
When object store has changes, we cleared cached records and reset the SQLite statement,
updating the boundary to the next key in cursor's direction. Therefore, the cursor could
jump to the next key after update or deletion.
We should cache those records before changing the statement.
Test: storage/indexeddb/cursor-update-while-iterating.html
* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
(WebCore::IDBServer::SQLiteIDBCursor::fetch):
* Modules/indexeddb/server/SQLiteIDBCursor.h:
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Introduce InlineFormattingContextGeometry class
https://bugs.webkit.org/show_bug.cgi?id=191054
Reviewed by Antti Koivisto.
This is in preparation for inline-block support.
Move float and inline-block elements layout to layoutFormattingContextRoot().
computeWidthAndHeightForInlineBox takes care of replaced elements.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
(WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2018-10-28 Antoine Quint <graouts@apple.com>
[Web Animations] Implement the update animations and send events procedure
https://bugs.webkit.org/show_bug.cgi?id=191013
<rdar://problem/45620495>
Reviewed by Dean Jackson.
While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
"relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
Implementing this procedure allowed us to make several enhancements:
1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS.
Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
to dispatch as they could otherwise be destroyed before they can fully dispatch them.
2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which
we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for
them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it.
3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant"
animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's
timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0.
To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS
Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display
refresh monitor udpates when only accelerated animations are running.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
added to the m_animations list unless its timeline is no longer this timeline.
(WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
animation lists if this animation has an effect with a target.
(WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
(WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
code now cause regressions in the Web Platform Tests.
(WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
(WebCore::AnimationTimeline::elementWasRemoved):
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
(WebCore::AnimationTimeline::addAnimation): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
(WebCore::AnimationTimeline:: const): Deleted.
(WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
(WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
(WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::canBeListed const): Deleted.
* animation/CSSTransition.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
(WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
(WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
(WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
(WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
(WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
* animation/DeclarativeAnimation.h:
* animation/DocumentAnimationScheduler.cpp:
(WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
document's animation timeline. This is called when m_animations becomes empty.
* animation/DocumentAnimationScheduler.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
(WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
(WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
in the next run loop (provided all pending JS execution has also completed).
(WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
(WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
(WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
(WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
(WebCore::DocumentTimeline::animationResolutionTimerFired):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no
longer relevant following the call to tick().
(WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
(WebCore::DocumentTimeline::timingModelDidChange): Deleted.
(WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
(WebCore::DocumentTimeline::performInvalidationTask): Deleted.
(WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
(WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
(WebCore::DocumentTimeline::updateAnimations): Deleted.
(WebCore::compareAnimationPlaybackEvents): Deleted.
(WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
* animation/DocumentTimeline.h:
* animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model
is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance
variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the
start time and can stop requiring a custom IDL binding for the "startTime" property.
(WebCore::WebAnimation::effectTimingPropertiesDidChange):
(WebCore::WebAnimation::setEffect):
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::setTimelineInternal):
(WebCore::WebAnimation::startTime const):
(WebCore::WebAnimation::setStartTime):
(WebCore::WebAnimation::silentlySetCurrentTime):
(WebCore::WebAnimation::setCurrentTime):
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::cancel):
(WebCore::WebAnimation::resetPendingTasks):
(WebCore::WebAnimation::finish):
(WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
(WebCore::WebAnimation::invalidateEffect):
(WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
(WebCore::WebAnimation::play):
(WebCore::WebAnimation::runPendingPlayTask):
(WebCore::WebAnimation::pause):
(WebCore::WebAnimation::runPendingPauseTask):
(WebCore::WebAnimation::needsTick const):
(WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run
the pending play and pause tasks.
(WebCore::WebAnimation::resolve):
(WebCore::WebAnimation::updateRelevance):
(WebCore::WebAnimation::computeRelevance):
(WebCore::WebAnimation::timingModelDidChange): Deleted.
(WebCore::WebAnimation::setHoldTime): Deleted.
(WebCore::WebAnimation::bindingsStartTime const): Deleted.
(WebCore::WebAnimation::setBindingsStartTime): Deleted.
(WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
(WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
(WebCore::WebAnimation::updatePendingTasks): Deleted.
(WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
(WebCore::WebAnimation::runPendingTasks): Deleted.
(WebCore::WebAnimation::canBeListed const): Deleted.
* animation/WebAnimation.h:
(WebCore::WebAnimation::isRelevant const):
(WebCore::WebAnimation::hasPendingPlayTask const):
(WebCore::WebAnimation::isEffectInvalidationSuspended):
* animation/WebAnimation.idl:
* dom/Element.cpp:
(WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
2018-10-30 Youenn Fablet <youenn@apple.com>
LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
https://bugs.webkit.org/show_bug.cgi?id=191026
Reviewed by Eric Carlson.
Covered by updated test.
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
2018-10-30 Claudio Saavedra <csaavedra@igalia.com>
[GTK][WPE] Fixes to the PublicSuffix implementation
https://bugs.webkit.org/show_bug.cgi?id=191031
Reviewed by Michael Catanzaro.
Covered by existing tests.
Downcase hostnames before passing it on to the underlying
libsoup API. Special case localhost and fix a mixed-up
libsoup GError checks. This fixes most of the failures.
* platform/soup/PublicSuffixSoup.cpp:
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomain):
2018-10-29 Zalan Bujtas <zalan@apple.com>
Missing from r237549
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::hasPrecomputedMarginTop):
2018-10-29 Ross Kirsling <ross.kirsling@sony.com>
Unreviewed speculative build fix for AppleWin after r237559.
* PlatformAppleWin.cmake:
2018-10-29 Justin Michaud <justin_michaud@apple.com>
Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
https://bugs.webkit.org/show_bug.cgi?id=190919
Reviewed by Michael Saboff.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
(WebCore::CSSCustomPropertyValue::equals const): Deleted.
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp:
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
* css/CSSRegisteredCustomProperty.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::consumeAndUpdateTokens):
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::checkVariablesForCycles const):
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
(WebCore::CSSVariableData::resolveVariableFallback const):
(WebCore::CSSVariableData::resolveVariableReference const):
(WebCore::CSSVariableData::resolveVariableReferences const):
(WebCore::CSSVariableData::resolveTokenRange const):
* css/CSSVariableData.h:
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved):
(WebCore::CSSVariableData::needsVariableResolution const):
(WebCore::CSSVariableData::CSSVariableData):
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
(WebCore::resolveVariableFallback): Deleted.
(WebCore::resolveVariableReference): Deleted.
(WebCore::resolveTokenRange): Deleted.
(WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
* css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::variableDataValue const):
(WebCore::CSSVariableReferenceValue::equals const):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setCustomProperty):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::applyPropertyToCurrentStyle):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
(WebCore::StyleResolver::applyCascadedProperties):
(WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
* css/parser/CSSPropertyParser.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::setValueForProperty):
(WebCore::variableDataForPositivePixelLength):
(WebCore::variableDataForPositiveDuration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator== const):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2018-10-29 Youenn Fablet <youenn@apple.com>
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681
Reviewed by Eric Carlson.
Remove the previous MDNS resolution mechanism.
Instead, add support for the AsyncResolver mechanism added to libwebrtc.
Covered by current mdns webrtc test that is unflaked.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:
2018-10-29 Devin Rousso <drousso@apple.com>
Web Inspector: increase size limits for NetworkResourceData
https://bugs.webkit.org/show_bug.cgi?id=191034
<rdar://problem/45529852>
Reviewed by Joseph Pecoraro.
No tests since no new functionality.
* inspector/NetworkResourcesData.cpp:
All resources: 100MB => 200MB
Each resource: 10MB => 50MB
2018-10-29 Tim Horton <timothy_horton@apple.com>
Modernize WebKit nibs and lprojs for localization's sake
https://bugs.webkit.org/show_bug.cgi?id=190911
<rdar://problem/45349466>
Reviewed by Dan Bernstein.
* PlatformGTK.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* WebCore.xcodeproj/project.pbxproj:
* en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
* en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
* en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
* en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
English->en
2018-10-29 Tim Horton <timothy_horton@apple.com>
Make FindOptionsShowOverlay work on iOS
https://bugs.webkit.org/show_bug.cgi?id=190551
Reviewed by Andy Estes.
* platform/graphics/GraphicsContext.h:
Export some more GraphicsContext methods.
2018-10-29 Youenn Fablet <youenn@apple.com>
Invalid ssrc value in the stats of type 'inbound-rtp'
https://bugs.webkit.org/show_bug.cgi?id=190826
<rdar://problem/45487435>
Reviewed by Eric Carlson.
Value was not initialized in WebCore if missing from libwebrtc.
Change value to an optional so that it will not appear if libwebrtc does not expose it.
Move integer/boolean values from being initialized to be optional so
that we do not expose them to JS if not exposed by libwebrtc.
Covered by updated tests.
* Modules/mediastream/RTCStatsReport.h:
2018-10-29 Jer Noble <jer.noble@apple.com>
CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
https://bugs.webkit.org/show_bug.cgi?id=190954
Reviewed by Simon Fraser.
Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
which attempts to fetch the last byte in the image buffer in order to verify that the entire
buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
CGDataProvider created by WebKit is responsible (if any), we will add our own version of
ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
generate a crash within the responsible stack frame.
(This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
that the buffer itself is reclaimed between creation time and access.)
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/cg/GraphicsContext3DCG.cpp:
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::ImageBuffer):
(WebCore::ImageBuffer::toCFData const):
(WebCore::cfData):
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
* platform/graphics/cg/ImageUtilitiesCG.h: Added.
(WebCore::verifyImageBufferIsBigEnough):
2018-10-29 David Kilzer <ddkilzer@apple.com>
Fix clang static analyzer warning in StyleBuilderConverter.h
<https://webkit.org/b/190907>
Reviewed by Antti Koivisto.
Fix the following clang static warning in StyleBuilderConverter.h:
Value stored to 'autoFlow' during its initialization is never read
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
assignment of RenderStyle::initialGridAutoFlow() to `default`
case. Make `CSSValueDense` consistent with other cases by
assigning value to `autoFlow` instead of returning early.
2018-10-29 Youenn Fablet <youenn@apple.com>
Guard H264 simulcast with a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=191025
Reviewed by Eric Carlson.
Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
Covered by existing test.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
https://bugs.webkit.org/show_bug.cgi?id=191018
Reviewed by Antti Koivisto.
<div><img style="float: left"></div>
This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
need to precompute the ancestor's margin top (stop at the block formatting root boundary).
Test: fast/inline/simple-intruding-floats3.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
https://bugs.webkit.org/show_bug.cgi?id=191011
Reviewed by Antti Koivisto.
// 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
// Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
This is temporary until after inline runs transition to the display tree.
Test: fast/inline/simple-intruding-floats2.html
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::logicalLeft const):
(WebCore::Layout::InlineRun::logicalRight const):
(WebCore::Layout::InlineRun::logicalTop const):
(WebCore::Layout::InlineRun::logicalBottom const):
(WebCore::Layout::InlineRun::width const):
(WebCore::Layout::InlineRun::height const):
(WebCore::Layout::InlineRun::setWidth):
(WebCore::Layout::InlineRun::setLogicalLeft):
(WebCore::Layout::InlineRun::setLogicalRight):
(WebCore::Layout::InlineRun::moveHorizontally):
(WebCore::Layout::InlineRun::InlineRun):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add support for simple intruding floats.
https://bugs.webkit.org/show_bug.cgi?id=190998
Reviewed by Antti Koivisto.
In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position.
This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
it is the parent block formatting root's coordinate system (that's where the float lives.)
Test: fast/inline/simple-intruding-float1.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
(WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
2018-10-29 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Inline layout produces separate runs when float is present.
https://bugs.webkit.org/show_bug.cgi?id=190980
Reviewed by Antti Koivisto.
<div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
while it is really just one continuous run (foobar) -> LFC
Adjust verification code to check for such runs.
* layout/Verification.cpp:
(WebCore::Layout::checkForMatchingNonTextRuns):
(WebCore::Layout::checkForMatchingTextRuns):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::textContext const):
2018-10-29 Youenn Fablet <youenn@apple.com>
[WebRTC] Enable VP8 by default
https://bugs.webkit.org/show_bug.cgi?id=190672
<rdar://problem/43663785>
Reviewed by Eric Carlson.
No change of behavior.
* page/RuntimeEnabledFeatures.h: Set default value to true.
2018-10-28 Andy Estes <aestes@apple.com>
[Payment Request] Implement MerchantValidationEvent.methodName
https://bugs.webkit.org/show_bug.cgi?id=190058
Reviewed by Darin Adler.
Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
methodName property as specified in the Payment Request API W3C Editor's Draft of
27 September 2018.
Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
(as a string) to MerchantValidationEvent::create()
* Modules/paymentrequest/MerchantValidationEvent.cpp:
(WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
event, throwing a RangeError on failure.
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
* Modules/paymentrequest/MerchantValidationEvent.h:
* Modules/paymentrequest/MerchantValidationEvent.idl:
2018-10-27 Antoine Quint <graouts@apple.com>
[Web Animations] Remove WebAnimation::description()
https://bugs.webkit.org/show_bug.cgi?id=190995
Reviewed by Dean Jackson.
This method is never used.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::description): Deleted.
* animation/WebAnimation.h:
2018-10-27 Antoine Quint <graouts@apple.com>
[Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
https://bugs.webkit.org/show_bug.cgi?id=190994
Reviewed by Dean Jackson.
It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::getAnimations const):
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::getAnimations):
2018-10-27 Antoine Quint <graouts@apple.com>
[Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
https://bugs.webkit.org/show_bug.cgi?id=190996
Reviewed by Dean Jackson.
Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::bindingsPlay):
(WebCore::CSSAnimation::bindingsPause):
(WebCore::CSSAnimation::bindingsStartTime const): Deleted.
(WebCore::CSSAnimation::setBindingsStartTime): Deleted.
(WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
(WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
(WebCore::CSSAnimation::bindingsPlayState const): Deleted.
(WebCore::CSSAnimation::bindingsPending const): Deleted.
(WebCore::CSSAnimation::bindingsReady): Deleted.
(WebCore::CSSAnimation::bindingsFinished): Deleted.
(WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
* animation/CSSAnimation.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::bindingsStartTime const):
(WebCore::DeclarativeAnimation::setBindingsStartTime):
(WebCore::DeclarativeAnimation::bindingsCurrentTime const):
(WebCore::DeclarativeAnimation::setBindingsCurrentTime):
(WebCore::DeclarativeAnimation::bindingsPlayState const):
(WebCore::DeclarativeAnimation::bindingsPending const):
(WebCore::DeclarativeAnimation::bindingsReady):
(WebCore::DeclarativeAnimation::bindingsFinished):
(WebCore::DeclarativeAnimation::bindingsPlay):
(WebCore::DeclarativeAnimation::bindingsPause):
(WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
* animation/DeclarativeAnimation.h:
2018-10-27 Charlie Turner <cturner@igalia.com>
[EME] Add a logging macro
https://bugs.webkit.org/show_bug.cgi?id=190984
Reviewed by Xabier Rodriguez-Calvar.
No tests since no new functionality.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::close):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::sessionClosed):
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
* platform/Logging.h:
2018-10-27 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] Post key received to bus should be done before waking up other threads
https://bugs.webkit.org/show_bug.cgi?id=190822
Reviewed by Philippe Normand.
Notify after posting message to bus.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
2018-10-27 Charlie Turner <cturner@igalia.com>
Fix release build with -DLOG_DISABLED=0
https://bugs.webkit.org/show_bug.cgi?id=190866
Reviewed by Xabier Rodriguez-Calvar.
No new tests since no functionality changed.
* platform/graphics/Font.cpp:
* platform/graphics/Font.h:
* platform/graphics/FontPlatformData.h:
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
* platform/graphics/win/FontPlatformDataWin.cpp:
2018-10-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237458.
https://bugs.webkit.org/show_bug.cgi?id=190973
broke internal iOS builds (Requested by zalan on #webkit).
Reverted changeset:
"Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
https://bugs.webkit.org/show_bug.cgi?id=190951
https://trac.webkit.org/changeset/237458
2018-10-26 Antoine Quint <graouts@apple.com>
[Web Animations] Remove useless internals methods
https://bugs.webkit.org/show_bug.cgi?id=190968
Reviewed by Dean Jackson.
We had a few internals methods added early on in the Web Animations implementation that are no longer
relevant now that the full API is implemented. We can safely remove them now.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::setCurrentTime): Deleted.
(WebCore::AnimationTimeline::description): Deleted.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::currentTime):
(WebCore::AnimationTimeline::pause): Deleted.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::pause): Deleted.
* animation/DocumentTimeline.h:
* testing/Internals.cpp:
(WebCore::Internals::timelineDescription): Deleted.
(WebCore::Internals::pauseTimeline): Deleted.
(WebCore::Internals::setTimelineCurrentTime): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-10-26 Antoine Quint <graouts@apple.com>
Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
https://bugs.webkit.org/show_bug.cgi?id=190955
Reviewed by Dean Jackson.
We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
and the CSSAnimationController.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
2018-10-26 Timothy Hatcher <timothy@apple.com>
Use dark appearance scrollbar when page background is dark or document supports dark mode.
https://bugs.webkit.org/show_bug.cgi?id=190937
rdar://problem/41225839
Reviewed by Beth Dakin.
* page/FrameView.cpp:
(WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
(WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
on the scrollbar overlay style too.
* page/FrameView.h:
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
* platform/mac/ScrollAnimatorMac.mm:
(-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
Ask the ScrollableArea if a dark appearance is desired.
2018-10-26 Antti Koivisto <antti@apple.com>
Use random() instead of begin() to limit cache sizes
https://bugs.webkit.org/show_bug.cgi?id=190957
Reviewed by Chris Dumez.
We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
keys get permanently stuck in the table.
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createColorValue):
(WebCore::CSSValuePool::createFontFamilyValue):
(WebCore::CSSValuePool::createFontFaceValue):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/SelectorQuery.cpp:
* platform/graphics/FontCascade.cpp:
(WebCore::retrieveOrAddCachedFonts):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::shouldAutoActivateFontIfNeeded):
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain):
2018-10-26 Jer Noble <jer.noble@apple.com>
Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
https://bugs.webkit.org/show_bug.cgi?id=190951
<rdar://problem/45213065>
Reviewed by Alex Christensen.
Request the correct route policy and context from the VideoFullscreenModel.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
(VideoFullscreenInterfaceAVKit::doSetup):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add more inline information to outputLayoutTree
https://bugs.webkit.org/show_bug.cgi?id=190945
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutBox):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Layout floats as part of the inline content
https://bugs.webkit.org/show_bug.cgi?id=190942
Reviewed by Antti Koivisto.
Add float handling to InlineFormattingContext::layoutInlineContent.
Note that floats don't actually generate inline runs.
Test: fast/block/basic/inline-content-with-floating-image.html
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
* layout/floats/FloatAvoider.cpp:
(WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::isTrimmableContent):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::trimLeadingRun): Deleted.
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::isClosed const):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Adjust current line with float constraints.
https://bugs.webkit.org/show_bug.cgi?id=190940
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::moveHorizontally):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Compute float box size and position
https://bugs.webkit.org/show_bug.cgi?id=190938
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
(WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
* layout/inlineformatting/InlineFormattingContext.h:
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add line logical top and bottom
https://bugs.webkit.org/show_bug.cgi?id=190934
Reviewed by Antti Koivisto.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::initializeNewLine const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
(WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
(WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Find floating constraints for a given vertical position
https://bugs.webkit.org/show_bug.cgi?id=190928
Reviewed by Antti Koivisto.
https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
"In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block.
However, floating boxes may come between the containing block edge and the line box edge.
Thus, although line boxes in the same inline formatting context generally have the same width
(that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
This patch adds support for retrieving left/right constraints for a given line (vertical position).
* layout/floats/FloatingState.cpp:
(WebCore::Layout::FloatingState::constraints const):
* layout/floats/FloatingState.h:
2018-10-26 Zalan Bujtas <zalan@apple.com>
[LFC] Inline formatting context has higher priority than block
https://bugs.webkit.org/show_bug.cgi?id=190924
Reviewed by Antti Koivisto.
When an element establishes both inline and block formatting contexts, we need to pick one to
create (and we choose the content driven formatting type (inline)). See example below:
<div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::formattingContext const):
2018-10-26 Ali Juma <ajuma@chromium.org>
REGRESSION (r237255): Text selection is broken in form fields
https://bugs.webkit.org/show_bug.cgi?id=190899
Reviewed by Ryosuke Niwa.
Fix missing negation when checking for a fully-clipped-out rect. This was causing
RenderObject::computeVisibleRectInContainer to incorrectly early-out.
Test: fast/repaint/text-selection-overflow-hidden.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computeVisibleRectInContainer const):
2018-10-25 Chris Dumez <cdumez@apple.com>
[PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
https://bugs.webkit.org/show_bug.cgi?id=190915
<rdar://problem/45059069>
Reviewed by Geoffrey Garen.
* history/PageCache.cpp:
(WebCore::canCacheFrame):
Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
process has a HistoryItem and is initially showing the initial empty document before continuing
the load from the previous process. Note that saving the initial empty document in PageCache would
lead to crashes later on previous the initial empty document's Window is taken and reused for the
next load.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::load):
Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
lockBackForwardList that is actually Yes when we're doing a client-side redirect.
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and
use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would
not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No.
2018-10-25 Devin Rousso <drousso@apple.com>
Fix build after r237431 for platforms that don't support FULLSCREEN_API
Reviewed by Joseph Pecoraro.
No new tests. No change in behavior.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::addEventListenersToNode):
2018-10-25 Devin Rousso <drousso@apple.com>
Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
https://bugs.webkit.org/show_bug.cgi?id=189874
<rdar://problem/44700000>
Reviewed by Joseph Pecoraro.
Updated existing test: http/tests/inspector/dom/didFireEvent.html
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::EventFiredCallback::handleEvent):
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::addEventListenersToNode):
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added.
Prevent the same event from being sent to the frontend more than once.
* dom/Event.cpp:
(WebCore::Event::resetAfterDispatch):
* dom/Document.cpp:
(WebCore::Document::Document):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added.
2018-10-25 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence a -Wreturn-type warning
When every return is supposed to be covered by a switch statement, a release assert or CRASH
is required by GCC.
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
(WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
2018-10-25 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations CSS Integration off by default
https://bugs.webkit.org/show_bug.cgi?id=190901
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2018-10-25 Jon Davis <jond@apple.com>
Changed "Under Development" status to use "In Development" instead
https://bugs.webkit.org/show_bug.cgi?id=187615
Reviewed by Joseph Pecoraro.
* features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1.
2018-10-25 Chris Dumez <cdumez@apple.com>
REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image
https://bugs.webkit.org/show_bug.cgi?id=190891
<rdar://problem/45296796>
Reviewed by Antti Koivisto.
When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state
of the radio element has changed.
Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html
* html/RadioInputType.cpp:
(WebCore::RadioInputType::didDispatchClick):
2018-10-25 Joseph Pecoraro <pecoraro@apple.com>
InspectorCanvas is not getting cleared properly for OffscreenCanvas
https://bugs.webkit.org/show_bug.cgi?id=190894
<rdar://problem/45498435>
Reviewed by Simon Fraser.
Covered by existing tests not crashing with guard malloc.
InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to
remove its reference when the containing CanvasBase goes away. It does
this by registering as a notification observer, but if it can't map
from the CanvasBase back to the rendering context we were failing to
remove our reference. Enforce CanvasBase classes to notify observers
of destruction while they still have their CanvasRenderingContext.
* html/CanvasBase.cpp:
(WebCore::CanvasBase::~CanvasBase):
(WebCore::CanvasBase::notifyObserversCanvasDestroyed):
* html/CanvasBase.h:
Assert that subclasses notify observers of the canvas being destroyed,
since they will need to do this before m_context is cleared.
* html/CustomPaintCanvas.cpp:
(WebCore::CustomPaintCanvas::~CustomPaintCanvas):
* html/OffscreenCanvas.cpp:
(WebCore::OffscreenCanvas::~OffscreenCanvas):
Follow the new expected pattern of notifying observers before clearing
the context. HTMLCanvasElement already followed this pattern.
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::canvasDestroyed):
Add an assertion that would catch this earlier.
2018-10-24 Alexey Proskuryakov <ap@apple.com>
Clean up some obsolete macOS version guards
https://bugs.webkit.org/show_bug.cgi?id=190887
Reviewed by Dan Bernstein.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
2018-10-24 Tim Horton <timothy_horton@apple.com>
Attachment filenames with RTL characters should format similar to Finder
https://bugs.webkit.org/show_bug.cgi?id=190736
<rdar://problem/44735946>
Reviewed by Dan Bernstein.
Test: fast/attachment/attachment-title-with-rtl.html
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
* html/HTMLAttachmentElement.h:
Add attachmentTitleForDisplay(), which wraps the non-extension part of
attachmentTitle in BiDi isolates, matching Finder's behavior.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderAttachmentInfo::buildWrappedLines):
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
* rendering/RenderThemeMac.mm:
(WebCore::AttachmentLayout::layOutTitle):
Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of
the original string for the last line, instead of splitting the string
ourselves. This ensures that BiDi control characters are respected
even in the last line of the string.
2018-10-24 Megan Gardner <megan_gardner@apple.com>
Turn on Conic Gradients
https://bugs.webkit.org/show_bug.cgi?id=190810
Reviewed by Tim Horton.
Added tests previously, only switching feature from experimental to always avaiable.
* Configurations/FeatureDefines.xcconfig:
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
(WebCore::operator==):
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeConicGradient):
* page/Settings.yaml:
2018-10-11 Jiewen Tan <jiewen_tan@apple.com>
Only report resource timing to parent frame for the first iframe load
https://bugs.webkit.org/show_bug.cgi?id=190498
<rdar://problem/44347398>
Reviewed by Youenn Fablet.
Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadWithDocumentLoader):
* loader/FrameLoader.h:
(WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
(WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
2018-10-24 Brent Fulgham <bfulgham@apple.com>
Cure Windows Direct2D Backend of a nasty case of bitrot
https://bugs.webkit.org/show_bug.cgi?id=190875
<rdar://problem/45523268>
Reviewed by Zalan Bujtas.
The Direct2D backend has drifted out of date with the rest of WebKit.
This patch updates things so we can get a runnable build.
* platform/graphics/FontPlatformData.h:
* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
* platform/graphics/ImageBuffer.h:
* platform/graphics/ImageDecoder.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::setTargetContext):
* platform/graphics/opentype/OpenTypeMathData.cpp:
(WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual
Studio happy.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient):
* platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation.
(WebCore::GraphicsContextPlatformPrivate::setAlpha):
(WebCore::GraphicsContext::savePlatformState):
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
(WebCore::GraphicsContext::drawPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
(WebCore::GraphicsContext::clip):
(WebCore::GraphicsContext::clipOut):
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::beginPlatformTransparencyLayer):
(WebCore::GraphicsContext::endPlatformTransparencyLayer):
(WebCore::GraphicsContext::setMiterLimit):
(WebCore::GraphicsContext::clearRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::setLineCap):
(WebCore::GraphicsContext::setLineDash):
(WebCore::GraphicsContext::setLineJoin):
(WebCore::GraphicsContext::scale):
(WebCore::GraphicsContext::rotate):
(WebCore::GraphicsContext::translate):
(WebCore::GraphicsContext::concatCTM):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::drawLinesForText):
(WebCore::GraphicsContext::setURLForRect):
(WebCore::GraphicsContext::setIsCALayerContext):
(WebCore::GraphicsContext::isCALayerContext const):
(WebCore::GraphicsContext::setIsAcceleratedContext):
(WebCore::GraphicsContext::isAcceleratedContext const):
(WebCore::GraphicsContext::setPlatformShouldAntialias):
(WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
(WebCore::GraphicsContext::setPlatformCompositeOperation):
(WebCore::GraphicsContext::platformFillEllipse):
(WebCore::GraphicsContext::platformStrokeEllipse):
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(): Deleted.
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::putData):
* platform/graphics/win/ImageBufferDataDirect2D.h:
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::createCompatibleBuffer):
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/win/ImageDecoderDirect2D.cpp:
(WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const):
(WebCore::ImageDecoderDirect2D::encodedDataStatus const):
(WebCore::ImageDecoderDirect2D::repetitionCount const):
(WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
(WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
(WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
(WebCore::ImageDecoderDirect2D::setData):
(WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted.
(WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted.
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/graphics/win/ImageDirect2D.cpp:
(WebCore::BitmapImage::drawFrameMatchingSourceSize):
* platform/graphics/win/PatternDirect2D.cpp:
(WebCore::Pattern::createPlatformPattern const):
2018-10-24 Said Abou-Hallawa <sabouhallawa@apple.com>
Cleanup: MIMETypeRegistry functions
https://bugs.webkit.org/show_bug.cgi?id=190838
Reviewed by Simon Fraser.
Modernize the initialization of the lists in MIMETypeRegistry. Make the
functions that return these list be self-contained. Use NeverDestroy<> to
allocate the local static variable. Use std::initializer_list() and
makeNeverDestroyed() to initialize NeverDestroy<> variables only once.
supportedImageResourceMIMETypes will be deleted and all the calls to it
will be replaced by supportedImageMIMETypes because they are identical.
* loader/archive/ArchiveFactory.cpp:
(WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function
is called while initializing the supportedNonImageMIMETypes(). So it
should not have a direct call to it. Instead, supportedNonImageMIMETypes
is passed to it.
* loader/archive/ArchiveFactory.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::supportedImageMIMETypes):
(WebCore::supportedImageMIMETypesForEncoding):
(WebCore::supportedJavaScriptMIMETypes):
(WebCore::MIMETypeRegistry::supportedNonImageMIMETypes):
(WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
(WebCore::pdfMIMETypes):
(WebCore::MIMETypeRegistry::unsupportedTextMIMETypes):
(WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
(WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
(WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
(WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
(WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
(WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
(WebCore::MIMETypeRegistry::isPDFMIMEType):
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
(WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
(WebCore::initializeSupportedImageMIMETypes): Deleted.
(WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted.
(WebCore::initializeSupportedJavaScriptMIMETypes): Deleted.
(WebCore::initializePDFMIMETypes): Deleted.
(WebCore::initializeSupportedNonImageMimeTypes): Deleted.
(WebCore::initializeSupportedMediaMIMETypes): Deleted.
(WebCore::initializeUnsupportedTextMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted.
(WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted.
(WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted.
* platform/MIMETypeRegistry.h:
* platform/graphics/Image.cpp:
(WebCore::Image::supportsType):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::encodedDataStatus const):
* platform/graphics/cg/UTIRegistry.cpp:
(WebCore::supportedDefaultImageSourceTypes):
(WebCore::isSupportImageSourceType):
(WebCore::allowedImageUTIs): Deleted.
(WebCore::isAllowedImageUTI): Deleted.
* platform/graphics/cg/UTIRegistry.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::write):
2018-10-24 Chris Dumez <cdumez@apple.com>
[PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list
https://bugs.webkit.org/show_bug.cgi?id=190846
<rdar://problem/45058938>
Reviewed by Antti Koivisto.
When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation
policy handler, by overriding the request URL. This normally works fine because we usually process-swap
on standard navigation. However, when we would process-swap on a back/forward navigation, we would end
up using the back/forward navigation load type to do the about:blank load. This would have repercussions
because history navigations update the current history item with the new URL (in this case 'about:blank').
To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load
'about:blank' as a result.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2018-10-24 Andy Estes <aestes@apple.com>
[macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=190650
<rdar://problem/45341914>
Reviewed by Alex Christensen.
In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
weren't clearing exceptions generated from calling convert(), so they would end up being
logged as unhandled promise rejections.
Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
decoding paymentMethodErrors.
Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
rejections from calling PaymentRequest.abort().
Covered by existing test.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeErrors const):
2018-10-22 Antti Koivisto <antti@apple.com>
topPrivatelyControlledDomain is slow
https://bugs.webkit.org/show_bug.cgi?id=190792
Reviewed by Alex Christensen and Chris Dumez.
It calls into some slowish CFNetwork code and ends up showing up in profiles.
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain):
Add a cache that avoids calls into frameworks.
2018-10-22 Jer Noble <jer.noble@apple.com>
Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=190790
Reviewed by Alex Christensen.
Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make
GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making
incrementing the pending task count atomic.
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::sharedLock):
(WebCore::TaskDispatcher<Timer>::sharedTimerFired):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
(WebCore::TaskDispatcher<Timer>::pendingDispatchers):
* platform/GenericTaskQueue.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(-[WebCoreAVFMovieObserver initWithPlayer:]):
(-[WebCoreAVFMovieObserver disconnect]):
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFLoaderDelegate initWithPlayer:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
(-[WebCoreAVFPullDelegate initWithPlayer:]):
(-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
(-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
(-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2018-10-23 Jer Noble <jer.noble@apple.com>
TextTrack cues should be updated more often than every 250ms.
https://bugs.webkit.org/show_bug.cgi?id=190827
Reviewed by Eric Carlson.
Test: media/track/track-cue-timing.html
TextTracks cues are recalculated on the playback timer, which fires at least every 250ms.
In addition to this timer, add a method to MediaPlayer to provide a task which will be
performed at a particular media time, and use this new method to request cues be updated
at the next interesting media time. The next interesting time would be either when the
soonest current cue will end, or when the next non-current cue will start, whichever is
earlier.
(Determining the "next non-current cue" requires new API on PODIntervalTree, as that class
does not have iterators per-se.)
* html/HTMLMediaElement.cpp:
(WebCore::compareCueIntervalEndTime):
(WebCore::HTMLMediaElement::updateActiveTextTrackCues):
* platform/PODIntervalTree.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::performTaskAtMediaTime):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2018-10-23 Fujii Hironori <Hironori.Fujii@sony.com>
[Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont
https://bugs.webkit.org/show_bug.cgi?id=190748
Reviewed by Myles C. Maxfield.
FontCache::lastResortFallbackFont had local static AtomicString
variables which are not capsuled by NeverDestroyed. Hence, those
variables are destructed on IPC thread when WebProcess exits.
Changed those AtomicString to NeverDestroyed<AtomicString> not to
be destructed on exit.
This change can't be tested automatically because WebKitTestRunner
doesn't support Windows port yet.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont): Changed
fallbackFonts's type from AtomicString array to
NeverDestroyed<AtomicString> array.
2018-10-23 Justin Fan <justin_fan@apple.com>
[WebGPU] Rename old GPU* implementation files to GPULegacy* for WebMetal
https://bugs.webkit.org/show_bug.cgi?id=190817
Reviewed by Dean Jackson.
No new tests. No change in behavior.
* [Large list of refactored classes and renamed files]: GPU* is now GPULegacy*
2018-10-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237261.
The layout test for this change crashes under GuardMalloc.
Reverted changeset:
"Handle MDNS resolution of candidates through libwebrtc
directly"
https://bugs.webkit.org/show_bug.cgi?id=190681
https://trac.webkit.org/changeset/237261
2018-10-23 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237357.
API test is now failing on all platforms.
Reverted changeset:
"topPrivatelyControlledDomain is slow"
https://bugs.webkit.org/show_bug.cgi?id=190792
https://trac.webkit.org/changeset/237357
2018-10-23 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237350.
Caused several Crashes cross multiple tests and platforms.
Reverted changeset:
"Use WeakPtr and GenericTaskQueue within ObjC classes used by
MediaPlayerPrivateAVFoundationObjC"
https://bugs.webkit.org/show_bug.cgi?id=190790
https://trac.webkit.org/changeset/237350
2018-10-23 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237280.
Causes fast/box-shadow/box-shadow-with-zero-radius.html to
fail on iOS Simulator.
Reverted changeset:
"[CG] Adopt CG SPI for non-even cornered rounded rects"
https://bugs.webkit.org/show_bug.cgi?id=190155
https://trac.webkit.org/changeset/237280
2018-10-23 Antti Koivisto <antti@apple.com>
topPrivatelyControlledDomain is slow
https://bugs.webkit.org/show_bug.cgi?id=190792
Reviewed by Alex Christensen.
It calls into some slowish CFNetwork code and ends up showing up in profiles.
* platform/mac/PublicSuffixMac.mm:
(WebCore::topPrivatelyControlledDomain):
Add a cache that avoids calls into frameworks.
2018-10-23 Chris Dumez <cdumez@apple.com>
[PSON] Add support for cross-site client-side redirects
https://bugs.webkit.org/show_bug.cgi?id=190806
<rdar://problem/45047344>
Reviewed by Geoffrey Garen.
Add support for cross-site client-side redirects so that it swaps process and so that the back
forward list looks as expected. To support this, the following changes had to be done:
- The NavigationAction now provides additional information so that the WebProcess can communicate
things about the client-side redirect to the UIProcess: lockHistory / lockBackForwardList and
clientRedirectSourceForHistory.
- If the UIProcess decides to process-swap on a client-side redirect, we pass the client-side
redirect information to the new WebContent process via LoadRequest struct. WebCore then takes
care of setting things up using this information so that it recognizes that it is continuing
a load that is a client side redirect.
- We also need to pass the current BackForwardListItem / HistoryItem to the new WebContent
process so that the new process can truly lock history and keep updating the *current*
HistoryItem, instead of creating a new HistoryItem.
- After a process swap, when we re-construct the WebFrameProxy for the main frame in the new
process, we now set the frame's URL in the UIProcess to the URL it had before we swapped.
Clients such as Safari, rely on the main frame's URL being the expected value (the last
committed load URL) until the next load is committed when receiving didPerformRedirect
calls. Because we are destroying the main frame on process-swapping, we were losing the
last committed URL and Safari would hit assertions.
With this model, the willPerformClientRedirect IPC is still sent from the previous WebProcess
and the didPerformClientRedirect IPC is now sent by the new WebProcess. No change should be
observable from the client's point of view.
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::setLockHistory):
(WebCore::FrameLoadRequest::setlockBackForwardList):
(WebCore::FrameLoadRequest::clientRedirectSourceForHistory const):
(WebCore::FrameLoadRequest::setClientRedirectSourceForHistory):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
* loader/HistoryController.cpp:
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
* loader/HistoryController.h:
* loader/NavigationAction.h:
(WebCore::NavigationAction::lockHistory const):
(WebCore::NavigationAction::setLockHistory):
(WebCore::NavigationAction::lockBackForwardList const):
(WebCore::NavigationAction::setLockBackForwardList):
2018-10-23 Jer Noble <jer.noble@apple.com>
Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
https://bugs.webkit.org/show_bug.cgi?id=190790
Reviewed by Alex Christensen.
Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make
GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making
incrementing the pending task count atomic.
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::postTask):
(WebCore::TaskDispatcher<Timer>::sharedLock):
(WebCore::TaskDispatcher<Timer>::sharedTimerFired):
(WebCore::TaskDispatcher<Timer>::dispatchOneTask):
(WebCore::TaskDispatcher<Timer>::pendingDispatchers):
* platform/GenericTaskQueue.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(-[WebCoreAVFMovieObserver initWithPlayer:]):
(-[WebCoreAVFMovieObserver disconnect]):
(-[WebCoreAVFMovieObserver metadataLoaded]):
(-[WebCoreAVFMovieObserver didEnd:]):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
(-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
(-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
(-[WebCoreAVFLoaderDelegate initWithPlayer:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
(-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
(-[WebCoreAVFPullDelegate initWithPlayer:]):
(-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
(-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
(-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
(-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2018-10-22 Justin Michaud <justin_michaud@apple.com>
Registered custom properties should support syntax parameter for <length> and *
https://bugs.webkit.org/show_bug.cgi?id=190039
Reviewed by Antti Koivisto.
Refactor code so that:
- All properties applied in StyleResolver::applyMatchedProperties are only applied once.
- Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
every time they were referenced, and again in RenderStyle.
- The font-size property is applied after its variable references, but before custom properties that depend on it.
- Cycles are detected at the same time as resolution.
- MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
This behaviour matches chrome, but is not documented in the spec.
- Custom property values have more explicit resolved/unresolved state.
- RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
Tests: css-custom-properties-api/crash.html
css-custom-properties-api/cycles.html
css-custom-properties-api/inline.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::equals const):
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp:
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
* css/CSSRegisteredCustomProperty.h:
* css/CSSStyleSheet.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
(WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
(WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
(WebCore::CSSVariableData::resolveVariableReference const): Deleted.
(WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
(WebCore::CSSVariableData::resolveTokenRange const): Deleted.
* css/CSSVariableData.h:
(WebCore::CSSVariableData::create):
(WebCore::CSSVariableData::createResolved): Deleted.
(WebCore::CSSVariableData::needsVariableResolution const): Deleted.
(WebCore::CSSVariableData::CSSVariableData): Deleted.
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableFallback):
(WebCore::resolveVariableReference):
(WebCore::resolveTokenRange):
(WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
* css/CSSVariableReferenceValue.h:
(WebCore::CSSVariableReferenceValue::create):
(WebCore::CSSVariableReferenceValue::equals const):
(WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::setProperty):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::setCustomProperty):
* css/StyleProperties.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::State::setStyle):
(WebCore::StyleResolver::styleForKeyframe):
(WebCore::StyleResolver::styleForPage):
(WebCore::StyleResolver::applyMatchedProperties):
(WebCore::StyleResolver::applyPropertyToCurrentStyle):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
(WebCore::StyleResolver::CascadedProperties::Property::apply):
(WebCore::StyleResolver::applyCascadedCustomProperty):
(WebCore::StyleResolver::applyCascadedProperties):
* css/StyleResolver.h:
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
(WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
(WebCore::CSSPropertyParser::parseValueStart):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
* css/parser/CSSVariableParser.cpp:
(WebCore::CSSVariableParser::parseDeclarationValue):
* dom/ConstantPropertyMap.cpp:
(WebCore::ConstantPropertyMap::setValueForProperty):
(WebCore::variableDataForPositivePixelLength):
(WebCore::variableDataForPositiveDuration):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
* rendering/style/StyleCustomPropertyData.h:
(WebCore::StyleCustomPropertyData::operator== const):
(WebCore::StyleCustomPropertyData::setCustomPropertyValue):
(WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
(): Deleted.
2018-10-22 Justin Michaud <justin_michaud@apple.com>
CSS Paint API should give a 2d rendering context
https://bugs.webkit.org/show_bug.cgi?id=190762
Reviewed by Dean Jackson.
Add a new type of canvas and 2d rendering context to support the CSS Painting API.
Make many of the methods from HTMLCanvasElement virtual functions on CanvasBase, and
remove many of the downcasts in CanvasRenderingContext2DBase as a result.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPaintRenderingContext2DCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::root):
(WebCore::JSPaintRenderingContext2DOwner::isReachableFromOpaqueRoots):
(WebCore::JSPaintRenderingContext2D::visitAdditionalChildren):
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::~CanvasBase):
* html/CanvasBase.h:
(WebCore::CanvasBase::isCustomPaintCanvas const):
* html/CustomPaintCanvas.cpp: Added.
(WebCore::CustomPaintCanvas::create):
(WebCore::CustomPaintCanvas::CustomPaintCanvas):
(WebCore::CustomPaintCanvas::~CustomPaintCanvas):
(WebCore::CustomPaintCanvas::width const):
(WebCore::CustomPaintCanvas::setWidth):
(WebCore::CustomPaintCanvas::height const):
(WebCore::CustomPaintCanvas::setHeight):
(WebCore::CustomPaintCanvas::size const):
(WebCore::CustomPaintCanvas::setSize):
(WebCore::CustomPaintCanvas::getContext):
(WebCore::CustomPaintCanvas::copiedImage const):
(WebCore::CustomPaintCanvas::drawingContext const):
(WebCore::CustomPaintCanvas::existingDrawingContext const):
(WebCore::CustomPaintCanvas::makeRenderingResultsAvailable):
* html/CustomPaintCanvas.h: Copied from Source/WebCore/html/OffscreenCanvas.h.
* html/HTMLCanvasElement.h:
* html/OffscreenCanvas.h:
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isPaint const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
(WebCore::CanvasRenderingContext2DBase::unwindStateStack):
(WebCore::CanvasRenderingContext2DBase::isAccelerated const):
(WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
(WebCore::CanvasRenderingContext2DBase::setFillStyle):
(WebCore::CanvasRenderingContext2DBase::resetTransform):
(WebCore::CanvasRenderingContext2DBase::clearCanvas):
(WebCore::CanvasRenderingContext2DBase::transformAreaToDevice const):
(WebCore::CanvasRenderingContext2DBase::rectContainsCanvas const):
(WebCore::CanvasRenderingContext2DBase::calculateCompositingBufferRect):
(WebCore::CanvasRenderingContext2DBase::compositeBuffer):
(WebCore::CanvasRenderingContext2DBase::createPattern):
(WebCore::CanvasRenderingContext2DBase::didDrawEntireCanvas):
(WebCore::CanvasRenderingContext2DBase::didDraw):
(WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas):
(WebCore::CanvasRenderingContext2DBase::drawingContext const):
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/PaintRenderingContext2D.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
(WebCore::PaintRenderingContext2D::create):
(WebCore::PaintRenderingContext2D::PaintRenderingContext2D):
* html/canvas/PaintRenderingContext2D.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* html/canvas/PaintRenderingContext2D.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.h:
* platform/graphics/CustomPaintImage.cpp:
(WebCore::CustomPaintImage::doCustomPaint):
2018-10-22 Keith Rollin <krollin@apple.com>
Use Location = "Relative to Build Products" rather than "Relative to Group"
https://bugs.webkit.org/show_bug.cgi?id=190781
Reviewed by Alexey Proskuryakov.
Almost all Derived Files are included in Xcode projects with the
Location attribute set to "Relative to Group". While this currently
works, the Derived Files can no longer be found when enabling XCBuild
(which has stricter requirements). Fix this by setting the Location
attribute to "Relative to Build Products".
No new tests -- no changed functionality.
* WebCore.xcodeproj/project.pbxproj:
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add justify text-align support.
https://bugs.webkit.org/show_bug.cgi?id=190779
Reviewed by Antti Koivisto.
Collect expansion opportunities and adjust runs accordingly.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::expansionOpportunity):
(WebCore::Layout::InlineRun::TextContext::setStart):
(WebCore::Layout::InlineRun::TextContext::setLength):
(WebCore::Layout::InlineRun::setTextContext):
(WebCore::Layout::InlineRun::createRun): Deleted.
(WebCore::Layout::InlineRun::createTextRun): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::justifyRuns):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::isNonCollapsedText): Deleted.
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add (right, center)text-align support.
https://bugs.webkit.org/show_bug.cgi?id=190745
Reviewed by Antti Koivisto.
Adjust the logical left of each run while closing the line.
* layout/Verification.cpp:
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::trimLeadingRun):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun):
(WebCore::Layout::InlineLineBreaker::splitRun):
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineRun.h:
(WebCore::Layout::InlineRun::setLogicalLeft):
(WebCore::Layout::InlineRun::TextContext::start const):
(WebCore::Layout::InlineRun::createRun):
(WebCore::Layout::InlineRun::createTextRun):
(WebCore::Layout::InlineRun::InlineRun):
(WebCore::Layout::InlineRun::TextContext::TextContext):
(WebCore::Layout::InlineRun::TextContext::position const): Deleted.
* layout/inlineformatting/Line.cpp:
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::init):
(WebCore::Layout::adjustedLineLogicalLeft):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
(WebCore::Layout::InlineFormattingContext::Line::setConstraints): Deleted.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Implement Replaced helper class.
https://bugs.webkit.org/show_bug.cgi?id=190719
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::Box):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::replaced const):
* layout/layouttree/LayoutReplaced.cpp:
(WebCore::Layout::Replaced::Replaced):
(WebCore::Layout::Replaced::hasIntrinsicWidth const):
(WebCore::Layout::Replaced::hasIntrinsicHeight const):
(WebCore::Layout::Replaced::hasIntrinsicRatio const):
(WebCore::Layout::Replaced::intrinsicWidth const):
(WebCore::Layout::Replaced::intrinsicHeight const):
(WebCore::Layout::Replaced::intrinsicRatio const):
* layout/layouttree/LayoutReplaced.h:
(WebCore::Layout::Replaced::hasIntrinsicWidth const): Deleted.
(WebCore::Layout::Replaced::hasIntrinsicHeight const): Deleted.
(WebCore::Layout::Replaced::hasIntrinsicRatio const): Deleted.
(WebCore::Layout::Replaced::intrinsicWidth const): Deleted.
(WebCore::Layout::Replaced::intrinsicHeight const): Deleted.
(WebCore::Layout::Replaced::intrinsicRatio const): Deleted.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-10-22 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Block formatting context roots avoid floats.
https://bugs.webkit.org/show_bug.cgi?id=190723
Reviewed by Antti Koivisto.
Inline formatting context roots don't avoid floats (unless they also establish block formatting context).
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2018-10-20 YUHAN WU <yuhan_wu@apple.com>
MediaRecorder should fire a stop event when all tracks are ended
https://bugs.webkit.org/show_bug.cgi?id=190642
Reviewed by Youenn Fablet.
This patch only implements to fire the stop event when all tracks are ended.
We will need to fire a dataavailable event when all tracks are ended.
Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::trackEnded):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
2018-10-19 Stephan Szabo <stephan.szabo@sony.com>
[WinCairo] Search terms are not saved for <input type="search">
https://bugs.webkit.org/show_bug.cgi?id=188174
Reviewed by Fujii Hironori.
No new tests, should be covered by existing tests of search
inputs.
Add support for saving the search terms for <input
type="search"> to a SQLite database, replacing the
CF-based implementation for Windows and adding support
for non-legacy WebKit.
* PlatformWin.cmake:
* platform/win/SearchPopupMenuDB.cpp: Added.
(WebCore::SearchPopupMenuDB::singleton):
(WebCore::SearchPopupMenuDB::SearchPopupMenuDB):
(WebCore::SearchPopupMenuDB::~SearchPopupMenuDB):
(WebCore::SearchPopupMenuDB::saveRecentSearches):
(WebCore::SearchPopupMenuDB::loadRecentSearches):
(WebCore::SearchPopupMenuDB::checkDatabaseValidity): Use
quick_check pragma to test database status.
(WebCore::SearchPopupMenuDB::deleteAllDatabaseFiles):
(WebCore::SearchPopupMenuDB::openDatabase):
(WebCore::SearchPopupMenuDB::closeDatabase):
(WebCore::SearchPopupMenuDB::verifySchemaVersion): Check
schema version and update for schema changes.
(WebCore::SearchPopupMenuDB::checkSQLiteReturnCode): Check
for error codes that indicate database errors and remove and
recreate the database.
(WebCore::SearchPopupMenuDB::executeSimpleSql):
(WebCore::SearchPopupMenuDB::createPreparedStatement):
* platform/win/SearchPopupMenuDB.h: Added.
* platform/win/SearchPopupMenuWin.cpp:
(WebCore::SearchPopupMenuWin::enabled): Always enable support
for search term popup
(WebCore::SearchPopupMenuWin::saveRecentSearches): Switch from
CF implementation to SQLite database implementation
(WebCore::SearchPopupMenuWin::loadRecentSearches): Switch from
CF implementation to SQLite database implementation
(WebCore::autosaveKey): Deleted.
2018-10-19 Justin Fan <justin_fan@apple.com>
[WebGPU] Add stubs for WebGPUSwapChain and WebGPURenderingContext
https://bugs.webkit.org/show_bug.cgi?id=190742
Reviewed by Dean Jackson.
Test: updated webgpu-enabled.html to check for WebGPURenderingContext.
Implement support for creating a "webgpu" context from an HTML canvas.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPURenderingContext.cpp: Added.
(WebCore::WebGPURenderingContext::create):
(WebCore::WebGPURenderingContext::WebGPURenderingContext):
* Modules/webgpu/WebGPURenderingContext.h: Added.
* Modules/webgpu/WebGPURenderingContext.idl: Added.
* Modules/webgpu/WebGPUSwapChain.cpp: Added.
(WebCore::WebGPUSwapChain::configure):
(WebCore::WebGPUSwapChain::present):
(WebCore::WebGPUSwapChain::reshape):
(WebCore::WebGPUSwapChain::markLayerComposited):
* Modules/webgpu/WebGPUSwapChain.h: Added.
(WebCore::WebGPUSwapChain::WebGPUSwapChain):
* Modules/webgpu/WebGPUSwapChain.idl: Added.
* Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
* Modules/webgpu/WebGPUSwapChainDescriptor.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebGPUType):
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::getContextWebGPU):
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebGPU const):
2018-10-19 John Wilander <wilander@apple.com>
Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
https://bugs.webkit.org/show_bug.cgi?id=190687
<rdar://problem/45349024>
Reviewed by Alex Christensen.
Test: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html
NetworkStorageSession::setCookiesFromDOM() now consults the new
m_shouldCapLifetimeForClientSideCookies member variable before
capping the lifetime of cookies.
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
Removal of the isMarkedForCookieBlocking member.
* loader/ResourceLoadStatistics.h:
Removal of the isMarkedForCookieBlocking member.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies):
(WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
No longer takes the boolean clearFirst parameter and now always clears first.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] RenderReplaced renderer should create InlineBox
https://bugs.webkit.org/show_bug.cgi?id=190720
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::TreeBuilder::createSubTree):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Inline replaced width should default to 300px only if width is auto.
https://bugs.webkit.org/show_bug.cgi?id=190722
Reviewed by Antti Koivisto.
See #5
// 5. Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px.
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add inline runs to showLayoutTree
https://bugs.webkit.org/show_bug.cgi?id=190718
Reviewed by Antti Koivisto.
* layout/layouttree/LayoutTreeBuilder.cpp:
(WebCore::Layout::outputInlineRuns):
(WebCore::Layout::outputLayoutBox):
(WebCore::Layout::outputLayoutTree):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Remove the previous version of inline content handling.
https://bugs.webkit.org/show_bug.cgi?id=190716
Reviewed by Antti Koivisto.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
(WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
(WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineContent):
(WebCore::Layout::InlineFormattingState::addLayoutRuns): Deleted.
(WebCore::Layout::InlineFormattingState::layoutRuns const): Deleted.
* layout/inlineformatting/text/TextUtil.cpp: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.cpp.
(WebCore::Layout::TextUtil::TextUtil):
(WebCore::Layout::TextUtil::width const):
(WebCore::Layout::TextUtil::hyphenPositionBefore const):
(WebCore::Layout::TextUtil::textWidth const):
(WebCore::Layout::TextUtil::fixedPitchWidth const):
* layout/inlineformatting/text/TextUtil.h: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.h.
* layout/inlineformatting/textlayout/Runs.h: Removed.
* layout/inlineformatting/textlayout/TextContentProvider.cpp: Removed.
* layout/inlineformatting/textlayout/TextContentProvider.h: Removed.
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Removed.
* layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Removed.
* layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.cpp: Removed.
* layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.h: Removed.
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add generic inline content handling.
https://bugs.webkit.org/show_bug.cgi?id=190713
Reviewed by Antti Koivisto.
layoutInlineContent turns InlineLineBreaker::Run objects into final inline runs by
resolving heading/trailing whitespace, aligment, expansion opportunities etc.
These inline runs are input to the display tree construction.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/displaytree/DisplayBox.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
(WebCore::Layout::trimLeadingRun):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::Line::hasContent const):
(WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
(WebCore::Layout::InlineFormattingContext::Line::availableWidth const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineRuns):
(WebCore::Layout::InlineFormattingState::appendInlineRun):
* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::InlineLineBreaker::nextRun):
(WebCore::Layout::InlineLineBreaker::nextLayoutRun): Deleted.
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/InlineRun.h: Added.
(WebCore::Layout::InlineRun::logicalLeft const):
(WebCore::Layout::InlineRun::logicalRight const):
(WebCore::Layout::InlineRun::width const):
(WebCore::Layout::InlineRun::setWidth):
(WebCore::Layout::InlineRun::setLogicalRight):
(WebCore::Layout::InlineRun::TextContext::position const):
(WebCore::Layout::InlineRun::TextContext::length const):
(WebCore::Layout::InlineRun::TextContext::setLength):
(WebCore::Layout::InlineRun::textContext):
(WebCore::Layout::InlineRun::inlineItem const):
(WebCore::Layout::InlineRun::InlineRun):
(WebCore::Layout::InlineRun::TextContext::TextContext):
* layout/inlineformatting/Line.cpp: Added.
(WebCore::Layout::InlineFormattingContext::Line::Line):
(WebCore::Layout::InlineFormattingContext::Line::setConstraints):
(WebCore::Layout::isNonCollapsedText):
(WebCore::Layout::isTrimmableContent):
(WebCore::Layout::InlineFormattingContext::Line::appendContent):
(WebCore::Layout::InlineFormattingContext::Line::close):
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add generic inline line breaker
https://bugs.webkit.org/show_bug.cgi?id=190698
Reviewed by Antti Koivisto.
InlineLineBreaker takes the inline runs and applies the appropriate line breaking rules on them.
InlineRunProvider::Run objects ->
<foobar><image box><hello>< ><world>
InlineLineBreaker::Run ->
<foobar><image box><hello world>
InlineLineBreaker::Run also contains information whether the run is at the beginning or at the end of the line.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/LayoutContext.h:
(WebCore::Layout::LayoutContext::hasDisplayBox const):
* layout/inlineformatting/InlineLineBreaker.cpp: Added.
(WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
(WebCore::Layout::InlineLineBreaker::nextLayoutRun):
(WebCore::Layout::InlineLineBreaker::isAtContentEnd const):
(WebCore::Layout::InlineLineBreaker::lineBreakingBehavior):
(WebCore::Layout::InlineLineBreaker::runWidth const):
(WebCore::Layout::InlineLineBreaker::splitRun):
(WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const):
* layout/inlineformatting/InlineLineBreaker.h: Added.
* layout/inlineformatting/textlayout/TextUtil.cpp: Added.
(WebCore::Layout::TextUtil::TextUtil):
(WebCore::Layout::TextUtil::width const):
(WebCore::Layout::TextUtil::hyphenPositionBefore const):
(WebCore::Layout::TextUtil::textWidth const):
(WebCore::Layout::TextUtil::fixedPitchWidth const):
* layout/inlineformatting/textlayout/TextUtil.h: Added.
* layout/layouttree/LayoutBox.cpp:
2018-10-19 Zalan Bujtas <zalan@apple.com>
[LFC][IFC] Add generic inline run generator.
https://bugs.webkit.org/show_bug.cgi?id=190696
Reviewed by Antti Koivisto.
InlineRunProvider turns the following inline content ->
<span>foo<span>bar</span></span>
<img src="broken.jpg"><span>hello world</span>
into a set of runs ->
<foobar><image box><hello>< ><world>
Note that a text run can overlap multiple inline elements. InlineRunProvider::Run only stores a reference to
the first inline element (continuous content can be accessed by iterating through the InlineContent ListHashSet).
These runs are the input to the line breaking algoritm.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout const):
* layout/inlineformatting/InlineFormattingState.h:
(WebCore::Layout::InlineFormattingState::inlineContent):
* layout/inlineformatting/InlineItem.h: Added.
(WebCore::Layout::InlineItem::layoutBox const):
(WebCore::Layout::InlineItem::style const):
(WebCore::Layout::InlineItemHashFunctions::hash):
(WebCore::Layout::InlineItemHashFunctions::equal):
(WebCore::Layout::InlineItemHashTranslator::hash):
(WebCore::Layout::InlineItemHashTranslator::equal):
(WebCore::Layout::InlineItem::InlineItem):
(WebCore::Layout::InlineItem::type const):
(WebCore::Layout::InlineItem::textContent const):
* layout/inlineformatting/InlineRunProvider.cpp: Added.
(WebCore::Layout::InlineRunProvider::InlineRunProvider):
(WebCore::Layout::InlineRunProvider::append):
(WebCore::Layout::InlineRunProvider::insertBefore):
(WebCore::Layout::InlineRunProvider::remove):
(WebCore::Layout::isWhitespace):
(WebCore::Layout::isSoftLineBreak):
(WebCore::Layout::InlineRunProvider::isContinousContent):
(WebCore::Layout::InlineRunProvider::processInlineTextItem):
(WebCore::Layout::InlineRunProvider::moveToNextNonWhitespacePosition):
(WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
* layout/inlineformatting/InlineRunProvider.h: Added.
(WebCore::Layout::InlineRunProvider::Run::type const):
(WebCore::Layout::InlineRunProvider::Run::isText const):
(WebCore::Layout::InlineRunProvider::Run::isWhitespace const):
(WebCore::Layout::InlineRunProvider::Run::isNonWhitespace const):
(WebCore::Layout::InlineRunProvider::Run::isLineBreak const):
(WebCore::Layout::InlineRunProvider::Run::isBox const):
(WebCore::Layout::InlineRunProvider::Run::isFloat const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::start const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::length const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::isCollapsed const):
(WebCore::Layout::InlineRunProvider::Run::TextContext::setStart):
(WebCore::Layout::InlineRunProvider::Run::TextContext::setLength):
(WebCore::Layout::InlineRunProvider::Run::textContext const):
(WebCore::Layout::InlineRunProvider::Run::style const):
(WebCore::Layout::InlineRunProvider::Run::inlineItem const):
(WebCore::Layout::InlineRunProvider::runs const):
(WebCore::Layout::InlineRunProvider::Run::createBoxRun):
(WebCore::Layout::InlineRunProvider::Run::createFloatRun):
(WebCore::Layout::InlineRunProvider::Run::createSoftLineBreakRun):
(WebCore::Layout::InlineRunProvider::Run::createHardLineBreakRun):
(WebCore::Layout::InlineRunProvider::Run::createWhitespaceRun):
(WebCore::Layout::InlineRunProvider::Run::createNonWhitespaceRun):
(WebCore::Layout::InlineRunProvider::Run::Run):
(WebCore::Layout::InlineRunProvider::Run::TextContext::TextContext):
* layout/layouttree/LayoutBox.h:
(WebCore::Layout::Box::isLineBreakBox const):
* layout/layouttree/LayoutInlineBox.cpp:
(WebCore::Layout::InlineBox::InlineBox):
* layout/layouttree/LayoutInlineBox.h:
(WebCore::Layout::InlineBox::hasTextContent const):
(WebCore::Layout::InlineBox::textContent const):
* layout/layouttree/LayoutLineBreakBox.cpp: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp.
(WebCore::Layout::LineBreakBox::LineBreakBox):
* layout/layouttree/LayoutLineBreakBox.h: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp.
2018-10-19 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Handle zero-area intersections
https://bugs.webkit.org/show_bug.cgi?id=189624
Reviewed by Simon Fraser.
Use edge-inclusive intersection when applying clips and intersecting with the
root, so that two rects that touch each other are considered intersecting even
if the area of their intersection is 0.
Covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
* dom/Document.cpp:
(WebCore::computeIntersectionState):
(WebCore::Document::updateIntersectionObservations):
(WebCore::computeIntersectionRects): Deleted.
2018-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Allow ports to optionally do screen capture in the UI process
https://bugs.webkit.org/show_bug.cgi?id=190728
<rdar://problem/45376824>
Reviewed by Jer Noble and Tim Horton.
No new tests, covered by existing tests.
* Sources.txt: Add RemoteVideoSample.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/MediaSample.h:
(WebCore::MediaSample::videoPixelFormat const):
* platform/graphics/RemoteVideoSample.cpp: Added.
(WebCore::RemoteVideoSample::~RemoteVideoSample):
(WebCore::RemoteVideoSample::create):
(WebCore::RemoteVideoSample::RemoteVideoSample):
(WebCore::RemoteVideoSample::surface):
* platform/graphics/RemoteVideoSample.h: Added.
(WebCore::RemoteVideoSample::time const):
(WebCore::RemoteVideoSample::videoFormat const):
(WebCore::RemoteVideoSample::size const):
(WebCore::RemoteVideoSample::encode const):
(WebCore::RemoteVideoSample::decode):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without
resizing, resize local samples if necessary.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize
samples, it will be done in the base class if necessary.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI
process, it will be done in the web process.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include.
2018-10-18 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155
Reviewed by Simon Fraser.
Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):
2018-10-18 Justin Michaud <justin_michaud@apple.com>
Add new image type for CSS painting API
https://bugs.webkit.org/show_bug.cgi?id=190697
Reviewed by Dean Jackson.
Add a new image type for the CSS painting API, and hook it up so it can be drawn.
For now, it uses a WebGL rendering context from OfflineCanvas because that was
easy to hook up. The spec actually calls for a RenderingContext2D, which can be
handled in another patch.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize const):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending const):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSPaintCallback.h:
* css/CSSPaintCallback.idl:
* css/CSSPaintImageValue.cpp:
(WebCore::CSSPaintImageValue::image):
* css/CSSPaintImageValue.h:
* platform/graphics/CustomPaintImage.cpp: Added.
(WebCore::CustomPaintImage::CustomPaintImage):
(WebCore::CustomPaintImage::doCustomPaint):
(WebCore::CustomPaintImage::draw):
(WebCore::CustomPaintImage::drawPattern):
* platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
* platform/graphics/Image.h:
(WebCore::Image::isCustomPaintImage const):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/CairoOperations.cpp:
2018-10-18 Truitt Savell <tsavell@apple.com>
Unreviewed, rolling out r237272.
Broke on device iOS builds and Windows builds
Reverted changeset:
"[MediaStream] Allow ports to optionally do screen capture in
the UI process"
https://bugs.webkit.org/show_bug.cgi?id=190728
https://trac.webkit.org/changeset/237272
2018-10-18 Jer Noble <jer.noble@apple.com>
[MSE] timestampOffset can introduce floating-point rounding errors to incoming samples
https://bugs.webkit.org/show_bug.cgi?id=190590
<rdar://problem/45275626>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-timestampoffset-rounding-error.html
SourceBuffer.timestampOffset is a double property, which, when added to a MediaTime will
result in a double-backed MediaTime as PTS & DTS. This can introduce rounding errors when
these samples are appended as overlapping existing samples. Rather than converting a MediaTime
to double-backed when adding the timestampOffset, convert the offset to a multiple of the
sample's timeBase.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::setTimestampOffset):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-10-18 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Allow ports to optionally do screen capture in the UI process
https://bugs.webkit.org/show_bug.cgi?id=190728
<rdar://problem/45376824>
Reviewed by Jer Noble and Tim Horton.
No new tests, covered by existing tests.
* Sources.txt: Add RemoteVideoSample.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/MediaSample.h:
(WebCore::MediaSample::videoPixelFormat const):
* platform/graphics/RemoteVideoSample.cpp: Added.
(WebCore::RemoteVideoSample::~RemoteVideoSample):
(WebCore::RemoteVideoSample::create):
(WebCore::RemoteVideoSample::RemoteVideoSample):
(WebCore::RemoteVideoSample::surface):
* platform/graphics/RemoteVideoSample.h: Added.
(WebCore::RemoteVideoSample::time const):
(WebCore::RemoteVideoSample::videoFormat const):
(WebCore::RemoteVideoSample::size const):
(WebCore::RemoteVideoSample::encode const):
(WebCore::RemoteVideoSample::decode):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without
resizing, resize local samples if necessary.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize
samples, it will be done in the base class if necessary.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI
process, it will be done in the web process.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include.
2018-10-18 Jer Noble <jer.noble@apple.com>
Safari is not able to adapt between H264 streams with EditList and without EditList
https://bugs.webkit.org/show_bug.cgi?id=190638
<rdar://problem/45342208>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-append-overlapping-dts.html
The MSE frame replacement algorithm does not take decode timestamps into account; this can
lead to situations where the replacement algorithm may leave in place frames where the
presentationTimestamp is less than the replacement frame, but whose decodeTimestamp is
after the replacement frame. When re-enqueuing these frames, they may cause a decode error
if they break the group-of-pictures sequence of the replaced range.
* Modules/mediasource/SampleMap.cpp:
(WebCore::DecodeOrderSampleMap::findSamplesBetweenDecodeKeys):
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-10-18 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Region parameter and value should be separated by ':'
https://bugs.webkit.org/show_bug.cgi?id=190735
Reviewed by Eric Carlson.
This is specified in https://w3c.github.io/webvtt/#region-settings.
No new tests. Modified existing tests.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setRegionSettings):
2018-10-18 Jer Noble <jer.noble@apple.com>
Add support for MediaKeyEncryptionScheme
https://bugs.webkit.org/show_bug.cgi?id=190173
Reviewed by Eric Carlson.
Added sub-tests to: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html
Add support for the MediaKeyEncryptionScheme extension to EME, as detailed here:
<https://github.com/WICG/encrypted-media-encryption-scheme/blob/master/explainer.md>
As the strings "cenc" and "cbcs" are explicitly lower-case, add support to the bindings generator to keep
those strings as lower-case when converting from IDL.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/encryptedmedia/MediaKeyEncryptionScheme.h:
* Modules/encryptedmedia/MediaKeyEncryptionScheme.idl:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(WK_ucfirst):
* platform/encryptedmedia/CDMEncryptionScheme.h: Copied from Source/WebCore/testing/MockCDMFactory.idl.
* platform/encryptedmedia/CDMMediaCapability.h:
* platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
(WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
* testing/MockCDMFactory.cpp:
(WebCore::m_supportedEncryptionSchemes):
(WebCore::MockCDM::supportsConfiguration const):
* testing/MockCDMFactory.h:
(WebCore::MockCDMFactory::supportedEncryptionSchemes const):
(WebCore::MockCDMFactory::setSupportedEncryptionSchemes):
* testing/MockCDMFactory.idl:
2018-10-18 Alexey Proskuryakov <ap@apple.com>
Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
https://bugs.webkit.org/show_bug.cgi?id=190729
Reviewed by Tim Horton.
* DerivedSources.make:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::subLocality):
(WebCore::setSubLocality):
(WebCore::subAdministrativeArea):
(WebCore::setSubAdministrativeArea):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
* Modules/geolocation/Geolocation.cpp:
(WebCore::isRequestFromIBooks):
* Modules/geolocation/GeolocationPosition.h:
* Modules/geolocation/NavigatorGeolocation.cpp:
* Modules/geolocation/NavigatorGeolocation.h:
* Modules/geolocation/ios/GeolocationPositionIOS.mm:
* Modules/mediasession/WebMediaSessionManager.cpp:
* Modules/mediasession/WebMediaSessionManager.h:
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::filterDeviceList):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::JSQuickTimePluginReplacement::timedMetaData const):
(WebCore::JSQuickTimePluginReplacement::accessLog const):
(WebCore::JSQuickTimePluginReplacement::errorLog const):
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::SpeechSynthesis):
(WebCore::SpeechSynthesis::speak):
* Modules/speech/SpeechSynthesis.h:
* Modules/webaudio/AudioContext.cpp:
* Modules/webaudio/AudioScheduledSourceNode.cpp:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::performOpenAndVerify):
* Modules/webdatabase/DatabaseContext.h:
* Modules/webdatabase/DatabaseManagerClient.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabaseFile):
* Modules/webdatabase/DatabaseTracker.h:
* WebCorePrefix.h:
* accessibility/AXObjectCache.cpp:
(WebCore::createFromRenderer):
* accessibility/AccessibilityMediaObject.cpp:
* accessibility/AccessibilityMediaObject.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::press):
(WebCore::AccessibilityMenuList::isCollapsed const):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::actionVerb const):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::stringValue const):
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
(WebCore::AccessibilityRenderObject::actionVerb const):
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
* accessibility/ios/AXObjectCacheIOS.mm:
* accessibility/ios/AccessibilityObjectIOS.mm:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
* bindings/js/CommonVM.cpp:
(WebCore::commonVMSlow):
* bindings/js/JSCallbackData.h:
(WebCore::JSCallbackData::~JSCallbackData):
* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::initializeThreading):
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::fieldNamed const):
* crypto/CommonCryptoUtilities.h:
* crypto/mac/CryptoKeyRSAMac.cpp:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::masterKeyAccountNameForCurrentApplication):
(WebCore::createAndStoreMasterKey):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/CSSStyleDeclaration.cpp:
* css/CSSValueKeywords.in:
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
* css/StyleBuilderConverter.h:
* css/html.css:
(video):
(input, textarea, keygen, select, button):
(#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
(#if defined(ENABLE_INPUT_TYPE_DATE) && ENABLE_INPUT_TYPE_DATE):
(#endif):
(#if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT):
(textarea):
(input:matches([type="radio"], [type="checkbox"])):
(input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
(input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-media-slider-thumb):
(#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)):
(input[type="checkbox"]):
(#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR):
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted.
(#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)): Deleted.
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
(WebCore::CSSPropertyParser::parseSingleValue):
* css/parser/CSSPropertyParser.h:
* css/svg.css:
(#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
(#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted.
* dom/DeviceMotionController.cpp:
* dom/DeviceMotionController.h:
* dom/DeviceOrientationController.cpp:
(WebCore::DeviceOrientationController::DeviceOrientationController):
* dom/DeviceOrientationController.h:
* dom/DeviceOrientationData.cpp:
* dom/DeviceOrientationData.h:
* dom/DeviceOrientationEvent.cpp:
* dom/DeviceOrientationEvent.h:
* dom/DeviceOrientationEvent.idl:
* dom/Document.cpp:
(WebCore::Document::~Document):
(WebCore::Document::suspendDeviceMotionAndOrientationUpdates):
(WebCore::Document::resumeDeviceMotionAndOrientationUpdates):
(WebCore::Document::platformSuspendOrStopActiveDOMObjects):
* dom/Document.h:
* dom/DocumentMarker.h:
(WebCore::DocumentMarker::allMarkers):
* dom/DocumentMarkerController.cpp:
(WebCore::shouldInsertAsSeparateMarker):
(WebCore::DocumentMarkerController::shiftMarkers):
* dom/DocumentMarkerController.h:
* dom/Element.cpp:
(WebCore::Element::focus):
* dom/Node.cpp:
(WebCore::Node::~Node):
(WebCore::Node::willBeDeletedFrom):
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
(WebCore::Node::willRespondToMouseMoveEvents):
(WebCore::Node::willRespondToMouseClickEvents):
* dom/Range.cpp:
* dom/Range.h:
* dom/TreeScope.cpp:
(WebCore::absolutePointIfNotClipped):
* dom/ViewportArguments.cpp:
(WebCore::setViewportFeature):
* dom/ViewportArguments.h:
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/Editor.cpp:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::Editor::handleTextEvent):
(WebCore::Editor::Editor):
(WebCore::Editor::clear):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::setComposition):
(WebCore::Editor::showSpellingGuessPanel):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::markMisspellingsOrBadGrammar):
(WebCore::Editor::changeBackToReplacedString):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::revealSelectionAfterEditingOperation):
(WebCore::Editor::setIgnoreSelectionChanges):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::Editor::shouldChangeSelection const):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::editorUIUpdateTimerFired):
(WebCore::Editor::resolveTextCheckingTypeMask):
* editing/Editor.h:
* editing/FontAttributes.h:
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::updateDataDetectorsForSelection):
(WebCore::FrameSelection::setSelectedRange):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::shouldDeleteSelection const):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection::setSelectionFromNone):
(WebCore::FrameSelection::shouldChangeSelection const):
* editing/FrameSelection.h:
* editing/InsertIntoTextNodeCommand.cpp:
* editing/InsertIntoTextNodeCommand.h:
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
* editing/TypingCommand.h:
* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
(WebCore::FontShadow::createShadow const):
* editing/cocoa/HTMLConverter.h:
* editing/cocoa/HTMLConverter.mm:
(_fontForNameAndSize):
(_shadowForShadowStyle):
(HTMLConverter::computedAttributesForElement):
(HTMLConverter::_addAttachmentForElement):
(HTMLConverter::_processMetaElementWithName):
(HTMLConverter::_processElement):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::attributesForAttributedStringConversion):
(WebCore::WebContentReader::readURL):
* editing/ios/DictationCommandIOS.cpp:
* editing/ios/DictationCommandIOS.h:
* editing/ios/EditorIOS.mm:
* editing/mac/FrameSelectionMac.mm:
(WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
* fileapi/FileCocoa.mm:
* history/CachedFrame.cpp:
(WebCore::CachedFrameBase::restore):
(WebCore::CachedFrame::CachedFrame):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
* history/HistoryItem.h:
* history/PageCache.cpp:
(WebCore::canCachePage):
* html/BaseDateAndTimeInputType.cpp:
* html/BaseDateAndTimeInputType.h:
* html/ColorInputType.cpp:
(WebCore::ColorInputType::isKeyboardFocusable const):
* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::updateWidget):
* html/HTMLAttachmentElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::maxActivePixelMemory):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::collectStyleForPresentationAttribute):
* html/HTMLIFrameElement.h:
* html/HTMLImageElement.cpp:
* html/HTMLImageElement.h:
* html/HTMLInputElement.cpp:
* html/HTMLInputElement.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::finishInitialization):
(WebCore::HTMLMediaElement::registerWithDocument):
(WebCore::HTMLMediaElement::unregisterWithDocument):
(WebCore::HTMLMediaElement::setVolume):
(WebCore::HTMLMediaElement::nextScanRate):
(WebCore::HTMLMediaElement::sourceWasAdded):
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::updateVolume):
(WebCore::HTMLMediaElement::userCancelledLoad):
(WebCore::HTMLMediaElement::mediaSessionTitle const):
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
* html/HTMLMediaElement.h:
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process):
* html/HTMLObjectElement.cpp:
* html/HTMLPlugInElement.h:
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::usesMenuList const):
(WebCore::HTMLSelectElement::createElementRenderer):
(WebCore::HTMLSelectElement::childShouldCreateRenderer const):
(WebCore::HTMLSelectElement::willRespondToMouseClickEvents):
(WebCore::HTMLSelectElement::updateListBoxSelection):
(WebCore::HTMLSelectElement::scrollToSelection):
(WebCore::HTMLSelectElement::setOptionsChangedOnRenderer):
(WebCore::HTMLSelectElement::menuListDefaultEventHandler):
(WebCore::HTMLSelectElement::defaultEventHandler):
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
* html/HTMLTextFormControlElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::parseAttribute):
(WebCore::HTMLVideoElement::supportsFullscreen const):
* html/HTMLVideoElement.h:
* html/ImageDocument.cpp:
(WebCore::ImageDocument::ImageDocument):
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::imageUpdated):
* html/ImageDocument.h:
* html/InputType.cpp:
* html/InputType.h:
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::clientDataBufferingTimerFired):
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
(WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
(WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget const):
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
* html/MediaElementSession.h:
* html/PluginDocument.cpp:
(WebCore::PluginDocumentParser::createDocumentStructure):
* html/RangeInputType.cpp:
(WebCore::RangeInputType::handleTouchEvent):
* html/RangeInputType.h:
* html/SearchInputType.cpp:
(WebCore::SearchInputType::addSearchResult):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::isKeyboardFocusable const):
(WebCore::TextFieldInputType::handleFocusEvent):
(WebCore::TextFieldInputType::handleBlurEvent):
(WebCore::TextFieldInputType::didSetValueByUserEdit):
(WebCore::TextFieldInputType::listAttributeTargetChanged):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
* html/parser/HTMLTreeBuilder.cpp:
(WebCore::HTMLTreeBuilder::processCharacterBufferForInBody):
* html/parser/HTMLTreeBuilder.h:
* html/shadow/MediaControlElements.cpp:
* html/shadow/MediaControlElements.h:
* html/shadow/MediaControls.h:
* html/shadow/SliderThumbElement.cpp:
(WebCore::SliderThumbElement::dragFrom):
* html/shadow/SliderThumbElement.h:
* html/shadow/TextControlInnerElements.cpp:
(WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
(WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement):
* html/shadow/TextControlInnerElements.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::setIndicating):
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::platform):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::currentRunLoop):
* loader/DocumentLoader.cpp:
* loader/DocumentLoader.h:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
* loader/DocumentWriter.cpp:
(WebCore::DocumentWriter::createDocument):
* loader/EmptyClients.cpp:
* loader/EmptyClients.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkCompleted):
(WebCore::FrameLoader::willLoadMediaElementURL):
(WebCore::FrameLoader::stopForUserCancel):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::didFirstLayout):
(WebCore::createWindow):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
(WebCore::HistoryController::restoreScrollPositionAndViewState):
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::init):
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/ResourceLoader.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadPlugin):
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::create):
(WebCore::SubresourceLoader::willCancel):
(WebCore::SubresourceLoader::notifyDone):
(WebCore::SubresourceLoader::releaseResources):
* loader/SubresourceLoader.h:
* loader/cache/CachedImage.cpp:
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::userCaptionPreferencesChangedNotificationCallback):
* page/Chrome.cpp:
(WebCore::Chrome::createColorChooser):
(WebCore::Chrome::dispatchViewportPropertiesDidChange const):
(WebCore::Chrome::didReceiveDocType):
* page/Chrome.h:
* page/ChromeClient.h:
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
(WebCore::DOMTimer::fired):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):
(WebCore::DOMWindow::clearTimeout):
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::resetAllGeolocationPermission):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.h:
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::globalConstRedeclarationShouldThrow):
* page/DeprecatedGlobalSettings.h:
* page/DragController.cpp:
* page/EditorClient.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMousePressEventSingleClick):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::startPanScrolling):
(WebCore::EventHandler::handleMouseMoveEvent):
* page/EventHandler.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::willDetachPage):
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::clear):
(WebCore::FrameView::effectiveFrameFlattening const):
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::scrollPositionRespectingCustomFixedPosition const):
(WebCore::FrameView::viewportConstrainedVisibleContentRect const):
(WebCore::FrameView::updateContentsSize):
(WebCore::FrameView::computeScrollability const):
(WebCore::FrameView::adjustTiledBackingCoverage):
(WebCore::FrameView::calculateExtendedBackgroundMode const):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::sizeForResizeEvent const):
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/FrameView.h:
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
(WebCore::releaseMemory):
* page/Navigator.cpp:
* page/Navigator.h:
* page/NavigatorBase.cpp:
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::showPlaybackTargetPicker):
* page/Page.h:
* page/PerformanceMonitor.cpp:
(WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
* page/ResourceUsageOverlay.cpp:
(WebCore::ResourceUsageOverlay::initialize):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::canDisplay const):
* page/SettingsBase.cpp:
* page/SettingsBase.h:
* page/SettingsDefaultValues.h:
(WebCore::editingBehaviorTypeForPlatform):
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
(WebCore::initializeIndicator):
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::textDocumentParameters):
* page/cocoa/MemoryReleaseCocoa.mm:
(WebCore::platformReleaseMemory):
(WebCore::jettisonExpensiveObjectsOnTopLevelNavigation):
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::showText):
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::vmPageSize):
* page/cocoa/SettingsBaseCocoa.mm:
* page/ios/EventHandlerIOS.mm:
* page/ios/FrameIOS.mm:
* page/mac/ChromeMac.mm:
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* page/mac/WebCoreFrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp:
* page/scrolling/ScrollingTreeScrollingNodeDelegate.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.h:
* page/scrolling/ios/ScrollingCoordinatorIOS.mm:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
* page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
* page/scrolling/ios/ScrollingTreeIOS.cpp:
* page/scrolling/ios/ScrollingTreeIOS.h:
* platform/ContentFilterUnblockHandler.h:
* platform/Cursor.cpp:
* platform/Cursor.h:
* platform/DragImage.cpp:
* platform/DragImage.h:
* platform/FileChooser.cpp:
* platform/FileChooser.h:
* platform/HostWindow.h:
* platform/LocalizedStrings.cpp:
* platform/LocalizedStrings.h:
* platform/LowPowerModeNotifier.cpp:
* platform/LowPowerModeNotifier.h:
* platform/MIMETypeRegistry.cpp:
(WebCore::initializeSupportedImageMIMETypes):
(WebCore::initializeSupportedNonImageMimeTypes):
(WebCore::initializeUnsupportedTextMIMETypes):
* platform/Pasteboard.h:
* platform/PasteboardStrategy.h:
* platform/PlatformKeyboardEvent.h:
* platform/PlatformPasteboard.h:
* platform/PlatformScreen.h:
* platform/RemoteCommandListener.cpp:
* platform/RuntimeApplicationChecks.h:
* platform/ScrollAnimator.cpp:
* platform/ScrollView.cpp:
(WebCore::ScrollView::contentsScrollPosition const):
(WebCore::ScrollView::setContentsScrollPosition):
(WebCore::ScrollView::visibleContentRectInternal const):
* platform/ScrollView.h:
* platform/ScrollableArea.cpp:
* platform/ScrollableArea.h:
* platform/Scrollbar.cpp:
* platform/Scrollbar.h:
* platform/ThreadTimers.cpp:
* platform/Timer.cpp:
(WebCore::shouldSuppressThreadSafetyCheck):
* platform/Timer.h:
(WebCore::TimerBase::isActive const):
* platform/ValidationBubble.h:
* platform/Widget.h:
* platform/audio/AudioHardwareListener.cpp:
(WebCore::AudioHardwareListener::AudioHardwareListener):
* platform/audio/PlatformMediaSession.h:
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/ios/AudioDestinationIOS.cpp:
* platform/audio/ios/AudioDestinationIOS.h:
* platform/audio/ios/AudioFileReaderIOS.cpp:
* platform/audio/ios/AudioFileReaderIOS.h:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routingContextUID const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
* platform/cf/MainThreadSharedTimerCF.cpp:
(WebCore::setupPowerObserver):
(WebCore::MainThreadSharedTimer::setFireInterval):
* platform/cf/URLCF.cpp:
* platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
(WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler):
(WebCore::ContentFilterUnblockHandler::needsUIProcess const):
(WebCore::ContentFilterUnblockHandler::encode const):
(WebCore::ContentFilterUnblockHandler::decode):
(WebCore::ContentFilterUnblockHandler::canHandleRequest const):
(WebCore::dispatchToMainThread):
(WebCore::ContentFilterUnblockHandler::requestUnblockAsync const):
* platform/cocoa/DataDetectorsCoreSoftLink.h:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/cocoa/KeyEventCocoa.mm:
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::localizedNSString):
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
* platform/cocoa/ParentalControlsContentFilter.mm:
(WebCore::ParentalControlsContentFilter::unblockHandler const):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::fileContentState):
* platform/cocoa/PlatformView.h:
* platform/cocoa/PlaybackSessionInterface.h:
* platform/cocoa/PlaybackSessionModel.h:
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
* platform/cocoa/SystemVersion.mm:
(WebCore::createSystemMarketingVersion):
* platform/cocoa/VideoFullscreenChangeObserver.h:
* platform/cocoa/VideoFullscreenModel.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
* platform/gamepad/cocoa/GameControllerGamepad.h:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/gamepad/cocoa/GameControllerGamepadProvider.h:
* platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
* platform/graphics/BitmapImage.h:
* platform/graphics/Color.h:
* platform/graphics/ComplexTextController.cpp:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
* platform/graphics/FloatSize.h:
* platform/graphics/Font.cpp:
(WebCore::Font::Font):
(WebCore::createAndFillGlyphPage):
* platform/graphics/Font.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForPlatformData):
(WebCore::FontCache::purgeInactiveFontData):
(WebCore::FontCache::inactiveFontCount):
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::FontCascade):
* platform/graphics/FontCascadeFonts.h:
* platform/graphics/FontDescription.h:
* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::isEmoji const):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/GraphicsLayer.h:
* platform/graphics/Icon.h:
* platform/graphics/Image.cpp:
(WebCore::Image::drawTiled):
(WebCore::Image::computeIntrinsicDimensions):
* platform/graphics/Image.h:
* platform/graphics/IntPoint.h:
* platform/graphics/IntRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::isAvailable):
(WebCore::MediaPlayer::volumeChanged):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/graphics/NamedImageGeneratedImage.cpp:
(WebCore::NamedImageGeneratedImage::draw):
* platform/graphics/StringTruncator.cpp:
(WebCore::centerTruncateToBuffer):
(WebCore::rightTruncateToBuffer):
(WebCore::rightClipToWordBuffer):
* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
* platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h:
* platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const):
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
* platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp:
* platform/graphics/avfoundation/WebMediaSessionManagerMac.h:
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
* platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys):
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h:
* platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsPictureInPicture const):
* platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::~TileController):
(WebCore::TileController::adjustTileCoverageRect const):
* platform/graphics/ca/TileController.h:
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::startedNewCohort):
(WebCore::TileGrid::platformCALayerPaintContents):
* platform/graphics/ca/TileGrid.h:
* platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp:
(WebCore::currentRunLoop):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(-[WebAnimationDelegate animationDidStart:]):
(-[WebAnimationDelegate animationDidStop:finished:]):
(WebCore::PlatformCALayerCocoa::setContentsScale):
(WebCore::layerContentsFormat):
(WebCore::PlatformCALayer::drawLayerContents):
(WebCore::PlatformCALayerCocoa::backingStoreBytesPerPixel const):
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::displayP3ColorSpaceRef):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::drawPatternCallback):
(WebCore::GraphicsContext::drawPattern):
(WebCore::GraphicsContext::drawLine):
(WebCore::applyShadowOffsetWorkaroundIfNeeded):
(WebCore::GraphicsContext::setURLForRect):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::jpegUTI):
* platform/graphics/cg/ImageBufferDataCG.cpp:
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::createFrameImageAtIndex):
* platform/graphics/cg/ImageSourceCGMac.mm:
* platform/graphics/cg/PDFDocumentImage.cpp:
* platform/graphics/cocoa/ColorCocoa.h:
* platform/graphics/cocoa/ColorCocoa.mm:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::similarFont):
(WebCore::computeNecessarySynthesis):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::variationCapabilitiesForFontDescriptor):
(WebCore::lookupFallbackFont):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
(WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
(WebCore::Font::determinePitch):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::cascadeToLastResortAndVariationsFontDescriptor):
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::texImageIOSurface2D):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::optionsForBiplanarSurface):
(WebCore::optionsFor32BitSurface):
(WebCore::IOSurface::maximumSize):
(WebCore::IOSurface::surfaceID const):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::cascadeList):
* platform/graphics/cocoa/TextTrackRepresentationCocoa.h:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
(-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
* platform/graphics/cocoa/WebMetalLayer.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
(WebCore::cvPixelFormatOpenGLKey):
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
* platform/graphics/cv/VideoTextureCopierCV.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.h:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/ios/FontAntialiasingStateSaver.h:
(WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
(WebCore::FontAntialiasingStateSaver::setup):
(WebCore::FontAntialiasingStateSaver::restore):
* platform/graphics/ios/FontCacheIOS.mm:
* platform/graphics/ios/IconIOS.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FloatPointMac.mm:
* platform/graphics/mac/FloatRectMac.mm:
* platform/graphics/mac/FloatSizeMac.mm:
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/ImageMac.mm:
* platform/graphics/mac/IntPointMac.mm:
* platform/graphics/mac/IntRectMac.mm:
* platform/graphics/mac/IntSizeMac.mm:
* platform/graphics/mac/WebKitNSImageExtras.h:
* platform/graphics/mac/WebKitNSImageExtras.mm:
* platform/graphics/mac/WebLayer.mm:
(-[WebSimpleLayer display]):
(-[WebSimpleLayer drawInContext:]):
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::supportsExtension):
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
* platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::multiply):
* platform/graphics/transforms/TransformationMatrix.h:
* platform/ios/CursorIOS.cpp:
* platform/ios/Device.cpp:
* platform/ios/Device.h:
* platform/ios/DeviceMotionClientIOS.h:
* platform/ios/DeviceMotionClientIOS.mm:
(WebCore::DeviceMotionClientIOS::motionChanged):
* platform/ios/DeviceOrientationClientIOS.h:
* platform/ios/DeviceOrientationClientIOS.mm:
(WebCore::DeviceOrientationClientIOS::orientationChanged):
* platform/ios/DragImageIOS.mm:
* platform/ios/EventLoopIOS.mm:
* platform/ios/KeyEventIOS.mm:
* platform/ios/LegacyTileCache.h:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileGrid.h:
* platform/ios/LegacyTileGrid.mm:
* platform/ios/LegacyTileGridTile.h:
* platform/ios/LegacyTileGridTile.mm:
* platform/ios/LegacyTileLayer.h:
* platform/ios/LegacyTileLayer.mm:
* platform/ios/LegacyTileLayerPool.h:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/LowPowerModeNotifierIOS.mm:
* platform/ios/PasteboardIOS.mm:
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
* platform/ios/PlatformPasteboardIOS.mm:
* platform/ios/PlatformScreenIOS.mm:
* platform/ios/PlatformSpeechSynthesizerIOS.mm:
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
* platform/ios/RemoteCommandListenerIOS.h:
* platform/ios/RemoteCommandListenerIOS.mm:
* platform/ios/SSLKeyGeneratorIOS.cpp:
* platform/ios/ScrollAnimatorIOS.h:
* platform/ios/ScrollAnimatorIOS.mm:
* platform/ios/ScrollViewIOS.mm:
(WebCore::ScrollView::platformSetContentsSize):
* platform/ios/ScrollbarThemeIOS.h:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/SystemMemoryIOS.cpp:
(WebCore::systemMemoryLevel):
* platform/ios/ThemeIOS.h:
* platform/ios/ThemeIOS.mm:
* platform/ios/TileControllerMemoryHandlerIOS.cpp:
* platform/ios/TileControllerMemoryHandlerIOS.h:
* platform/ios/UserAgentIOS.mm:
(WebCore::deviceNameForUserAgent):
* platform/ios/ValidationBubbleIOS.mm:
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(WebCore::supportsPictureInPicture):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
* platform/ios/WebBackgroundTaskController.h:
* platform/ios/WebBackgroundTaskController.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebCoreMotionManager.mm:
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
* platform/ios/WebSQLiteDatabaseTrackerClient.h:
* platform/ios/WebSQLiteDatabaseTrackerClient.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
* platform/ios/WidgetIOS.mm:
* platform/ios/wak/FloatingPointEnvironment.cpp:
* platform/ios/wak/FloatingPointEnvironment.h:
* platform/ios/wak/WAKAppKitStubs.m:
* platform/ios/wak/WAKClipView.m:
* platform/ios/wak/WAKResponder.m:
* platform/ios/wak/WAKScrollView.mm:
* platform/ios/wak/WAKView.mm:
* platform/ios/wak/WAKWindow.mm:
* platform/ios/wak/WKContentObservation.cpp:
* platform/ios/wak/WKGraphics.mm:
* platform/ios/wak/WKUtilities.c:
* platform/ios/wak/WKView.mm:
* platform/ios/wak/WebCoreThread.mm:
* platform/ios/wak/WebCoreThreadRun.cpp:
* platform/ios/wak/WebCoreThreadSystemInterface.cpp:
* platform/mac/DragDataMac.mm:
(WebCore::rtfPasteboardType):
(WebCore::rtfdPasteboardType):
(WebCore::stringPasteboardType):
(WebCore::urlPasteboardType):
(WebCore::htmlPasteboardType):
(WebCore::colorPasteboardType):
(WebCore::pdfPasteboardType):
(WebCore::tiffPasteboardType):
(WebCore::DragData::containsURL const):
* platform/mac/MediaRemoteSoftLink.cpp:
* platform/mac/MediaRemoteSoftLink.h:
* platform/mac/SuddenTermination.mm:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
* platform/mac/WebCoreFullScreenWarningView.h:
* platform/mac/WebCoreFullScreenWarningView.mm:
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreFullScreenWindow.mm:
* platform/mac/WebNSAttributedStringExtras.mm:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::~RealtimeVideoSource):
(WebCore::RealtimeVideoSource::prepareToProduceData):
* platform/mediastream/ios/AVAudioSessionCaptureDevice.h:
* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h:
* platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.h:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/libwebrtc/LibWebRTCMacros.h:
* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::deviceIsAvailable):
* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
(WebCore::AVMediaCaptureSource::stopProducingData):
(-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::stopProducingData):
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::sensorOrientation):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::monitorOrientation):
(-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
(-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioSharedUnit::setupAudioUnit):
(WebCore::CoreAudioCaptureSource::create):
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mock/MediaPlaybackTargetMock.cpp:
* platform/mock/MediaPlaybackTargetMock.h:
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
* platform/mock/MediaPlaybackTargetPickerMock.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
* platform/network/CredentialStorage.cpp:
* platform/network/NetworkStateNotifier.h:
* platform/network/ResourceHandle.cpp:
(WebCore::builtinResourceHandleConstructorMap):
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceRequestBase.cpp:
* platform/network/ResourceRequestBase.h:
* platform/network/cf/DNSResolveQueueCFNet.cpp:
* platform/network/cf/ProxyServerCFNet.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::resourcePrioritiesEnabled):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdateResourceRequest):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::callbacksRunLoop):
(WebCore::copyCONNECTProxyResponse):
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * _Nullable const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::cookiesForURL):
(WebCore::setHTTPCookiesForURL):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* platform/network/ios/NetworkStateNotifierIOS.mm:
* platform/network/ios/WebCoreURLResponseIOS.h:
* platform/network/ios/WebCoreURLResponseIOS.mm:
* platform/network/mac/ResourceErrorMac.mm:
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
* platform/network/mac/UTIUtilities.mm:
* platform/sql/SQLiteDatabase.h:
(WebCore::SQLiteDatabase::sqlite3Handle const):
* platform/sql/SQLiteFileSystem.cpp:
* platform/sql/SQLiteFileSystem.h:
* platform/sql/SQLiteTransaction.cpp:
(WebCore::SQLiteTransaction::begin):
(WebCore::SQLiteTransaction::commit):
(WebCore::SQLiteTransaction::rollback):
(WebCore::SQLiteTransaction::stop):
* platform/text/PlatformLocale.cpp:
* platform/text/PlatformLocale.h:
* platform/text/ios/LocalizedDateCache.h:
* platform/text/ios/LocalizedDateCache.mm:
* platform/text/ios/TextEncodingRegistryIOS.mm:
* platform/text/mac/LocaleMac.h:
* platform/text/mac/LocaleMac.mm:
* plugins/PluginViewBase.h:
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintPlatformDocumentMarker):
(WebCore::InlineTextBox::resolveStyleForMarkedText):
(WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers):
* rendering/MarkedText.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintBoxDecorations):
(WebCore::allowMinMaxPercentagesInAutoHeightBlocksQuirk):
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
* rendering/RenderButton.cpp:
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderEmbeddedObject.cpp:
(WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing const):
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription):
* rendering/RenderFileUploadControl.cpp:
(WebCore::RenderFileUploadControl::maxFilenameWidth const):
(WebCore::RenderFileUploadControl::paintObject):
* rendering/RenderFrameSet.cpp:
(WebCore::RenderFrameSet::positionFrames):
* rendering/RenderIFrame.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderImage.h:
* rendering/RenderInline.cpp:
* rendering/RenderInline.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::canUseAcceleratedTouchScrolling const):
(WebCore::RenderLayer::scrollTo):
(WebCore::RenderLayer::scrollRectToVisible):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::showsOverflowControls const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::shouldClipCompositedBounds const):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::paintsIntoWindow const):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::paintIntoLayer):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const):
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::RenderLayerCompositor::didFlushChangesForLayer):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::setIsInWindow):
(WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const):
(WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::computeStickyViewportConstraints const):
(WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
(WebCore::RenderLayerCompositor::didAddScrollingLayer):
* rendering/RenderLayerCompositor.h:
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
* rendering/RenderLineBreak.cpp:
* rendering/RenderLineBreak.h:
* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::RenderMenuList):
(WebCore::RenderMenuList::willBeDestroyed):
(WebCore::RenderMenuList::adjustInnerStyle):
(RenderMenuList::updateFromElement):
(RenderMenuList::setTextFromOption):
(RenderMenuList::hidePopup):
(RenderMenuList::popupDidHide):
* rendering/RenderMenuList.h:
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint):
(WebCore::RenderObject::destroy):
* rendering/RenderObject.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::itemText const):
* rendering/RenderText.cpp:
(WebCore::RenderText::setRenderedText):
* rendering/RenderText.h:
* rendering/RenderTextControl.cpp:
* rendering/RenderTextControl.h:
* rendering/RenderTextControlMultiLine.cpp:
(WebCore::RenderTextControlMultiLine::getAverageCharWidth):
* rendering/RenderTextControlSingleLine.cpp:
(WebCore::RenderTextControlSingleLine::layout):
(WebCore::RenderTextControlSingleLine::getAverageCharWidth):
(WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth const):
* rendering/RenderTextLineBoxes.cpp:
(WebCore::lineDirectionPointFitsInBox):
(WebCore::RenderTextLineBoxes::positionForPoint const):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintBorderOnly):
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::arKitBundle):
* rendering/RenderView.cpp:
(WebCore::RenderView::availableLogicalHeight const):
(WebCore::RenderView::clientLogicalWidthForFixedPosition const):
(WebCore::RenderView::clientLogicalHeightForFixedPosition const):
(WebCore::RenderView::repaintViewRectangle const):
* rendering/RenderWidget.cpp:
(WebCore::RenderWidget::willBeDestroyed):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::selectionTop const):
(WebCore::RootInlineBox::selectionBottom const):
* rendering/style/RenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
* testing/Internals.cpp:
(WebCore::Internals::getCurrentCursorInfo):
(WebCore::Internals::isSelectPopupVisible):
(WebCore::Internals::setQuickLookPassword):
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion const):
* testing/js/WebCoreTestSupportPrefix.h:
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):
2018-10-18 Per Arne Vollan <pvollan@apple.com>
[WebVTT] The TextTrackLoader parameter in TextTrackLoaderClient virtual methods should be a reference
https://bugs.webkit.org/show_bug.cgi?id=190730
Reviewed by Chris Dumez.
No new tests. No change in behavior.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newCuesAvailable):
(WebCore::LoadableTextTrack::cueLoadingCompleted):
(WebCore::LoadableTextTrack::newRegionsAvailable):
* html/track/LoadableTextTrack.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::cueLoadTimerFired):
(WebCore::TextTrackLoader::newRegionsParsed):
* loader/TextTrackLoader.h:
2018-10-18 Alex Christensen <achristensen@webkit.org>
Clean up FrameLoader two-state enums
https://bugs.webkit.org/show_bug.cgi?id=190731
Reviewed by Chris Dumez.
This patch does three things:
1. Add an overload to EnumTraits so we do not need to list out the valid values of boolean enum classes.
The valid values are always 0 and 1. This is used when decoding from IPC.
2. Add a 2-state enum class for NewLoadInProgress instad of a bool so we can understand the code better.
3. Begin passing LockBackForwardList to the UIProcess. We will need it soon for PSON.
* history/CachedFrame.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::provisionalLoadStarted):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::clientRedirectCancelledOrFinished):
(WebCore::FrameLoader::clientRedirected):
(WebCore::FrameLoader::receivedMainResourceError):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/FrameLoaderTypes.h:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledNavigation::didStopTimer):
(WebCore::NavigationScheduler::cancel):
* loader/NavigationScheduler.h:
* platform/network/StoredCredentialsPolicy.h:
2018-10-18 Wenson Hsieh <wenson_hsieh@apple.com>
[GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425
https://bugs.webkit.org/show_bug.cgi?id=190712
Reviewed by Tim Horton.
Ensure that color inputs are enabled by default on GTK, and that color inputs have a `-webkit-appearance` of
`color-well` by default. Fixes fast/css/pseudo-visited-background-color-on-input.html on GTK.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformUsesColorWellAppearance const):
(WebCore::RenderTheme::platformColorInputStyleSheet const): Deleted.
Replace this with a platform hook that determines whether we want to use `-webkit-appearance: color-well;` by
default for inputs of type color. For now, only iOS overrides this to return false; in the future, we should
support `-webkit-appearance: color-well;` on iOS, and remove this platform hook entirely.
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformColorInputStyleSheet const): Deleted.
2018-10-18 Youenn Fablet <youenn@apple.com>
Handle MDNS resolution of candidates through libwebrtc directly
https://bugs.webkit.org/show_bug.cgi?id=190681
Reviewed by Eric Carlson.
Remove the previous MDNS resolution mechanism.
Instead, add support for the AsyncResolver mechanism added to libwebrtc.
Covered by current mdns webrtc test that is unflaked.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::addIceCandidate):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::createPeerConnection):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
* testing/MockLibWebRTCPeerConnection.h:
2018-10-18 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Factor out rect mapping and clipping logic from computeRectForRepaint
https://bugs.webkit.org/show_bug.cgi?id=189833
Reviewed by Simon Fraser.
Factor out the rect mapping and clipping logic from computeRectForRepaint to a new
computeVisibleRectInContainer method that computeRectForRepaint now calls. Make
computeVisibleRectInContainer take a VisibleRectContext with options to use
edge-inclusive intersection and to apply all clips and scrolls rather than only
the clips and scrolls that are currently applied by the repaint logic. These
options will be used by IntersectionObserver in a future patch.
No new tests, no change in behavior.
* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::edgeInclusiveIntersect):
* platform/graphics/FloatRect.h:
* platform/graphics/LayoutRect.cpp:
(WebCore::LayoutRect::edgeInclusiveIntersect):
* platform/graphics/LayoutRect.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::computeVisibleRectUsingPaintOffset const):
(WebCore::RenderBox::computeVisibleRectInContainer const):
(WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint const): Deleted.
(WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint const): Deleted.
The iOS-specific logic in this method has moved to RenderObject::shouldApplyCompositedContainerScrollsForRepaint.
(WebCore::RenderBox::computeRectForRepaint const): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::computeRectForRepaint): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeVisibleRectUsingPaintOffset const):
(WebCore::RenderInline::computeVisibleRectInContainer const):
(WebCore::RenderInline::computeRectForRepaint const): Deleted.
* rendering/RenderInline.h:
(WebCore::RenderInline::computeRectForRepaint): Deleted.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint):
(WebCore::RenderObject::visibleRectContextForRepaint):
(WebCore::RenderObject::computeRectForRepaint const):
(WebCore::RenderObject::computeFloatRectForRepaint const):
(WebCore::RenderObject::computeVisibleRectInContainer const):
(WebCore::RenderObject::computeFloatVisibleRectInContainer const):
* rendering/RenderObject.h:
(WebCore::RenderObject::computeAbsoluteRepaintRect const):
(WebCore::RenderObject::VisibleRectContext::VisibleRectContext):
(WebCore::RenderObject::RepaintContext::RepaintContext): Deleted.
(WebCore::RenderObject::computeRectForRepaint): Deleted.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeVisibleRectInContainer const):
(WebCore::RenderTableCell::computeRectForRepaint const): Deleted.
* rendering/RenderTableCell.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::computeVisibleRectInContainer const):
(WebCore::RenderView::computeRectForRepaint const): Deleted.
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGForeignObject::computeVisibleRectInContainer const):
(WebCore::RenderSVGForeignObject::computeFloatRectForRepaint const): Deleted.
(WebCore::RenderSVGForeignObject::computeRectForRepaint const): Deleted.
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGInline::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGModelObject::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGRoot::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::computeVisibleRectInContainer const):
(WebCore::RenderSVGText::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGText::computeRectForRepaint const): Deleted.
(WebCore::RenderSVGText::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
(WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer):
(WebCore::SVGRenderSupport::computeFloatRectForRepaint): Deleted.
* rendering/svg/SVGRenderSupport.h:
2018-10-17 Wenson Hsieh <wenson_hsieh@apple.com>
Enable the datalist element by default on iOS and macOS
https://bugs.webkit.org/show_bug.cgi?id=190594
<rdar://problem/45281159>
Reviewed by Ryosuke Niwa and Tim Horton.
Rebaselined existing layout tests.
* Configurations/FeatureDefines.xcconfig:
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSDefaultStyleSheets.cpp:
(WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
* css/CSSDefaultStyleSheets.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectDocumentWrappers):
* css/html.css:
Remove color input and datalist style rules from the default UA stylesheet.
(input[type="color"]::-webkit-color-swatch-wrapper): Deleted.
* html/HTMLDataListElement.idl:
Make HTMLDataListElement runtime-enabled.
* html/HTMLTagNames.in:
* html/RangeInputType.cpp:
Make a slight adjustment here so that inputs of type range respect the list attribute. Fixes a few layout tests
that add a datalist to an input of type range. See <https://bugs.webkit.org/show_bug.cgi?id=190613> for more
details.
(WebCore::RangeInputType::shouldRespectListAttribute):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldRespectListAttribute):
* page/RuntimeEnabledFeatures.h:
Add a runtime-enabled feature for the datalist element. Additionally, make the runtime-enabled feature for input
type color false by default, so that it's off in WebKitLegacy.
(WebCore::RuntimeEnabledFeatures::dataListElementEnabled const):
(WebCore::RuntimeEnabledFeatures::setDataListElementEnabled):
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::colorInputStyleSheet const):
Add new style-sheet hooks for datalist and input type color, so that style rules for color inputs and datalists
can be added at runtime only if the feature is enabled. This ensures that in WebKitLegacy (or other ports where
either or both elements are disabled), we don't still apply rules for datalist and input[type="color"]. Notably,
this allows fallback content inside datalist elements to still work in WebKitLegacy (which would otherwise be
hidden when using the default stylesheet since `display: none` is applied to datalist by default). This also
prevents inputs of type color from having a smaller size, no outline, and the appearance of a color well on
macOS.
(WebCore::RenderTheme::dataListStyleSheet const):
* rendering/RenderTheme.h:
(WebCore::RenderTheme::platformColorInputStyleSheet const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::platformColorInputStyleSheet const):
2018-10-17 Justin Michaud <justin_michaud@apple.com>
Parse paint() and store paint callbacks for CSS Painting API
https://bugs.webkit.org/show_bug.cgi?id=190657
Reviewed by Dean Jackson.
Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp:
(WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren):
(WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
* css/CSSImageGeneratorValue.cpp:
(WebCore::CSSImageGeneratorValue::image):
(WebCore::CSSImageGeneratorValue::isFixedSize const):
(WebCore::CSSImageGeneratorValue::fixedSize):
(WebCore::CSSImageGeneratorValue::isPending const):
(WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
(WebCore::CSSImageGeneratorValue::loadSubimages):
* css/CSSPaintImageValue.cpp: Added.
(WebCore::CSSPaintImageValue::customCSSText const):
* css/CSSPaintImageValue.h: Added.
* css/CSSPaintWorkletGlobalScope.h:
* css/CSSPaintWorkletGlobalScope.idl:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isPaintImageValue const):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeCustomPaint):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
* platform/mediastream/mac/RealtimeVideoUtilities.h:
2018-10-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Consolidate all image conversion and resizing into one class
https://bugs.webkit.org/show_bug.cgi?id=190519
<rdar://problem/45224307>
Try to fix the iOSMac build after r237236.
* platform/graphics/cv/ImageTransferSessionVT.h:
* platform/graphics/cv/ImageTransferSessionVT.mm:
2018-10-17 Justin Fan <justin_fan@apple.com>
[WebGPU] Implement WebGPU bindings up through WebGPUDevice creation
https://bugs.webkit.org/show_bug.cgi?id=190653
Reviewed by Dean Jackson.
Test: webgpu/webgpu-enabled.html
Add WebGPU Sketch bindings for window.webgpu, WebGPUAdapter, WebGPUAdapterDescriptor,
and WebGPUDevice creation. Based off IDL commit version b6c61ee.
https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/DOMWindowWebGPU.cpp: Added.
(WebCore::DOMWindowWebGPU::DOMWindowWebGPU):
(WebCore::DOMWindowWebGPU::supplementName):
(WebCore::DOMWindowWebGPU::from):
(WebCore::DOMWindowWebGPU::webgpu):
(WebCore::DOMWindowWebGPU::webgpu const):
* Modules/webgpu/DOMWindowWebGPU.h: Added.
* Modules/webgpu/DOMWindowWebGPU.idl: Added.
* Modules/webgpu/WebGPU.cpp: Added.
(WebCore::WebGPU::create):
(WebCore::WebGPU::requestAdapter const):
* Modules/webgpu/WebGPU.h: Added.
* Modules/webgpu/WebGPU.idl: Added.
* Modules/webgpu/WebGPUAdapter.cpp: Added.
(WebCore::WebGPUAdapter::create):
(WebCore::WebGPUAdapter::WebGPUAdapter):
(WebCore::WebGPUAdapter::createDevice):
* Modules/webgpu/WebGPUAdapter.h: Added.
* Modules/webgpu/WebGPUAdapter.idl: Added.
* Modules/webgpu/WebGPUAdapterDescriptor.h: Added.
* Modules/webgpu/WebGPUAdapterDescriptor.idl: Added.
* Modules/webgpu/WebGPUDevice.cpp: Added.
(WebCore::WebGPUDevice::create):
(WebCore::WebGPUDevice::WebGPUDevice):
* Modules/webgpu/WebGPUDevice.h: Added.
(WebCore::WebGPUDevice::adapter const):
* Modules/webgpu/WebGPUDevice.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-10-17 Andy Estes <aestes@apple.com>
[Apple Pay] Increment the API version to 5
https://bugs.webkit.org/show_bug.cgi?id=190686
<rdar://problem/45348523>
Reviewed by Simon Fraser.
Test: http/tests/ssl/applepay/ApplePaySessionV5.html
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::supportsVersion):
2018-10-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Consolidate all image conversion and resizing into one class
https://bugs.webkit.org/show_bug.cgi?id=190519
<rdar://problem/45224307>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* SourcesCocoa.txt: Add ImageTransferSessionVT.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/MediaSample.h:
(WebCore::MediaSample::videoPixelFormat const): New.
* platform/cocoa/VideoToolboxSoftLink.cpp: Add new kVTPixelTransferProperty keys.
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
(WebCore::MediaSampleAVFObjC::create): Remove unimplemented variant.
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::videoPixelFormat const): New.
* platform/graphics/cv/ImageTransferSessionVT.h: Added.
(WebCore::ImageTransferSessionVT::create):
* platform/graphics/cv/ImageTransferSessionVT.mm: Added.
(WebCore::ImageTransferSessionVT::ImageTransferSessionVT):
(WebCore::ImageTransferSessionVT::~ImageTransferSessionVT):
(WebCore::ImageTransferSessionVT::setSize):
(WebCore::ImageTransferSessionVT::createPixelBuffer):
(WebCore::ImageTransferSessionVT::createCMSampleBuffer):
(WebCore::roundUpToMacroblockMultiple):
(WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions):
(WebCore::ImageTransferSessionVT::createMediaSample):
* platform/graphics/cv/PixelBufferResizer.h: Removed.
* platform/graphics/cv/PixelBufferResizer.mm: Removed.
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Remove
the resizing logic, it is handled by the base class.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::capabilities):
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
(WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize):
(WebCore::DisplayCaptureSourceCocoa::emitFrame): Remove resizing logic, just use a transfer
session to create an image from the capture source native output format.
(WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Deleted.
(WebCore::roundUpToMacroblockMultiple): Deleted.
(WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Use image transfer session.
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Deleted.
(WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const): Deleted.
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): Deleted.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return the IOSurface directly.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::generateFrame): Return the CGImage directly.
(WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage): Deleted.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::capabilities): Only the camera supports device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
2018-10-17 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up capture source factory management
https://bugs.webkit.org/show_bug.cgi?id=190502
<rdar://problem/45212447>
Reviewed by Youenn Fablet.
No new tests, no functional change.
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
(WebCore::RealtimeMediaSourceCenter::audioFactory):
(WebCore::RealtimeMediaSourceCenter::setVideoFactory):
(WebCore::RealtimeMediaSourceCenter::unsetVideoFactory):
(WebCore::RealtimeMediaSourceCenter::videoFactory):
(WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory):
(WebCore::RealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): Deleted.
(): Deleted.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory): Deleted.
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::audioFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterMac::videoFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactoryPrivate):
(WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::audioFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::videoFactory): Deleted.
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeMediaSourceCenter::audioFactoryPrivate):
(WebCore::MockRealtimeMediaSourceCenter::videoFactoryPrivate):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactoryPrivate):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory): Deleted.
(WebCore::MockRealtimeMediaSourceCenter::videoFactory): Deleted.
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): Deleted.
* platform/mock/MockRealtimeMediaSourceCenter.h:
2018-10-17 Alex Christensen <achristensen@webkit.org>
BackForwardClient needs to be able to support UIProcess-only back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190675
Reviewed by Chris Dumez.
Return a RefPtr<HistoryItem> instead of a HistoryItem so that we will be able to return a
HistoryItem that has been created instead of a pointer to a HistoryItem that is owned by something else.
Also use unsigned for the back and forward list counts because they can never be negative.
* history/BackForwardClient.h:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::backItem):
(WebCore::BackForwardController::currentItem):
(WebCore::BackForwardController::forwardItem):
(WebCore::BackForwardController::canGoBackOrForward const):
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):
(WebCore::BackForwardController::count const):
(WebCore::BackForwardController::backCount const):
(WebCore::BackForwardController::forwardCount const):
(WebCore::BackForwardController::itemAtIndex):
* history/BackForwardController.h:
(WebCore::BackForwardController::backItem): Deleted.
(WebCore::BackForwardController::currentItem): Deleted.
(WebCore::BackForwardController::forwardItem): Deleted.
* loader/EmptyClients.cpp:
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleHistoryNavigation):
2018-10-17 Antoine Quint <graouts@apple.com>
[Web Animations] Do not create a DocumentTimeline to suspend or resume animations
https://bugs.webkit.org/show_bug.cgi?id=190660
Reviewed by Dean Jackson.
We check that there is an existing timeline before trying to suspend or resume its animations, otherwise
we're creating a DocumentTimeline when nothing requires for it to exist. We also have to check that we
suspend animations when a DocumentTimeline is created while the page is not visible.
No new tests as there is no change in behavior here.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
* dom/Document.cpp:
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::resume):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
* page/Page.cpp:
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
2018-10-17 Antti Koivisto <antti@apple.com>
Tiling CSS gradients is slow
https://bugs.webkit.org/show_bug.cgi?id=190615
Reviewed by Tim Horton.
Painting blocks the main thread on CG rendering queue to make a copy of the backing store.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
Also use sinkIntoImage for bitmap image pattern drawing.
* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):
Sink the gradient into an Image after generating it. Unlike ImageBuffer, painting it doesn't involve inefficient copies.
Previous isCompatibleWithContext test is replaced with an equivalent scale factor test.
* platform/graphics/GradientImage.h:
2018-10-17 Chris Dumez <cdumez@apple.com>
Update more DOMWindow getters to return references instead of raw pointers
https://bugs.webkit.org/show_bug.cgi?id=190654
Reviewed by Youenn Fablet.
Update more DOMWindow getters to return references instead of raw pointers, since they
can no longer return null after recent refactoring.
* Modules/gamepad/GamepadManager.cpp:
(WebCore::navigatorGamepadFromDOMWindow):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::heapSnapshot):
* dom/Document.cpp:
(WebCore::Document::location const):
(WebCore::Document::dispatchPopstateEvent):
* dom/Event.cpp:
(WebCore::Event::timeStampForBindings const):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/ResourceTimingInformation.cpp:
(WebCore::ResourceTimingInformation::addResourceTiming):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::screen):
(WebCore::DOMWindow::history):
(WebCore::DOMWindow::crypto const):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
(WebCore::DOMWindow::applicationCache):
(WebCore::DOMWindow::navigator):
(WebCore::DOMWindow::performance const):
(WebCore::DOMWindow::nowTimestamp const):
(WebCore::DOMWindow::location):
(WebCore::DOMWindow::visualViewport):
(WebCore::DOMWindow::styleMedia):
* page/DOMWindow.h:
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
* page/History.cpp:
(WebCore::History::stateObjectAdded):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::createTimestamp const):
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::PerformanceObserver):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode):
2018-10-17 Chris Fleizach <cfleizach@apple.com>
AX: Certain tags should identify their context to iOS API
https://bugs.webkit.org/show_bug.cgi?id=190622
<rdar://problem/45308194>
Reviewed by Zalan Bujtas.
Convey the semantic meaning of <code> tag to the iOS API so VoiceOver can make use of it.
Tests: accessibility/ios-simulator/text-context-attributes.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityTextualContext]):
(AXAttributeStringSetStyle):
2018-10-17 Youenn Fablet <youenn@apple.com>
Remove unused code from RealtimeOutgoingVideoSourceCocoa
https://bugs.webkit.org/show_bug.cgi?id=190666
Reviewed by Eric Carlson.
No change of behavior, removed no longer used code.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(): Deleted.
2018-10-17 Ali Juma <ajuma@chromium.org>
Flaky IntersectionObserver web platform tests involving style updates
https://bugs.webkit.org/show_bug.cgi?id=189091
Reviewed by Simon Fraser.
Update intersection observations when flushing layers from the WebProcess
to the UIProcess to make the timing of these updates more predictable, and
more consistent with the IntersectionObserver spec, since the spec expects
these updates to happen as part of the "Update the rendering" step in the
HTML EventLoop.
Getting a similar approach to work with WK1 seems to add more complexity than it's
worth, since flushes don't happen for scrolls handled by platform widgets, and
flushes for other invalidations only happen when in compositing mode.
The only remaining timer-driven intersection observation update is for handling
the initial observation on a newly added target, which needs to happen even if
there are no changes triggering a flush.
Tested by the following tests no longer being flaky:
imported/w3c/web-platform-tests/intersection-observer/bounding-box.html
imported/w3c/web-platform-tests/intersection-observer/display-none.html
imported/w3c/web-platform-tests/intersection-observer/containing-block.html
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate):
(WebCore::Document::scheduleIntersectionObservationUpdate): Deleted.
* dom/Document.h:
* page/FrameView.cpp:
(WebCore::FrameView::flushCompositingStateForThisFrame):
(WebCore::FrameView::viewportContentsChanged):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::willDisplayPage):
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate):
(WebCore::Page::updateIntersectionObservations):
(WebCore::Page::scheduleForcedIntersectionObservationUpdate):
* page/Page.h:
2018-10-17 Charlie Turner <cturner@igalia.com>
[EME] Sanity check key ID length in the keyids init data format
https://bugs.webkit.org/show_bug.cgi?id=190629
Reviewed by Xabier Rodriguez-Calvar.
Covered by web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids): Ensure the decoded key id length
is at least 1 byte and no more than 512 bytes.
2018-10-16 Chris Dumez <cdumez@apple.com>
Regression(r236795) Check boxes are sometimes checked when they should not be
https://bugs.webkit.org/show_bug.cgi?id=190651
<rdar://problem/45319934>
Reviewed by Ryosuke Niwa.
r236795 mistakenly dropped the statement resetting m_reflectsCheckedAttribute to true
in HTMLInputElement::parseAttribute() because it looked like a no-op given that we
made sure it was true a couple of line above. However, I overlooked that calling
HTMLInputElement::setChecked() sets m_reflectsCheckedAttribute to false.
This patch thus re-introduces the statement. It also renames m_reflectsCheckedAttribute
to m_dirtyCheckednessFlag and reverses its value in order to match the specification
more closely:
- https://html.spec.whatwg.org/#concept-input-checked-dirty-flag
Test: fast/dom/HTMLInputElement/checkbox-dirty-checkedness-flag.html
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
(WebCore::HTMLInputElement::parseAttribute):
(WebCore::HTMLInputElement::finishParsingChildren):
(WebCore::HTMLInputElement::reset):
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement):
* html/HTMLInputElement.h:
2018-10-16 Sihui Liu <sihui_liu@apple.com>
Add a switch for Web SQL
https://bugs.webkit.org/show_bug.cgi?id=190271
Reviewed by Ryosuke Niwa.
Web SQL is still enabled by default.
* Modules/webdatabase/DOMWindowWebDatabase.idl:
* Modules/webdatabase/Database.idl:
* Modules/webdatabase/SQLError.idl:
* Modules/webdatabase/SQLResultSet.idl:
* Modules/webdatabase/SQLResultSetRowList.idl:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebSQLDisabled):
(WebCore::RuntimeEnabledFeatures::webSQLEnabled const):
2018-10-16 Chris Dumez <cdumez@apple.com>
window.performance should not become null after the window loses its browsing context
https://bugs.webkit.org/show_bug.cgi?id=190636
Reviewed by Ryosuke Niwa.
window.performance should not become null after the window loses its browsing context. This
WebKit behavior does not match the HTML specification nor the behavior of other browsers.
Also note that the attribute is not nullable in the specification:
- https://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute
No new tests, updated existing test.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::performance const):
* page/Performance.cpp:
(WebCore::Performance::Performance):
* page/Performance.h:
* platform/GenericTaskQueue.h:
(WebCore::TaskDispatcher::TaskDispatcher):
(WebCore::TaskDispatcher::postTask):
(WebCore::GenericTaskQueue::GenericTaskQueue):
(WebCore::GenericTaskQueue::isClosed const):
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope):
2018-10-16 Jer Noble <jer.noble@apple.com>
Refactoring: Convert HTMLMediaElement::scheduleDelayedAction() to individually schedulable & cancelable tasks
https://bugs.webkit.org/show_bug.cgi?id=188208
Reviewed by Eric Carlson.
Rather than have a single, monolithic, zero-duration-timer based dispatch for
a bunch of methods to be performed in a future run-loop, convert them all to
use a DeferrableTask, which in turn is a kind of GenericTaskQueue which can
enqueue only a single task at a time. Convert some other zero-duration-timer
and GenericTaskQueue dispatches to this new DeferrableTask.
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::finishParsingChildren):
(WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability):
(WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
(WebCore::HTMLMediaElement::prepareForLoad):
(WebCore::HTMLMediaElement::setReadyState):
(WebCore::HTMLMediaElement::seekWithTolerance):
(WebCore::HTMLMediaElement::setMuted):
(WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack):
(WebCore::HTMLMediaElement::didAddTextTrack):
(WebCore::HTMLMediaElement::scheduleConfigureTextTracks):
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated):
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::scheduleUpdatePlayState):
(WebCore::HTMLMediaElement::updatePlayState):
(WebCore::HTMLMediaElement::setPlaying):
(WebCore::HTMLMediaElement::setPausedInternal):
(WebCore::HTMLMediaElement::cancelPendingTasks):
(WebCore::HTMLMediaElement::userCancelledLoad):
(WebCore::HTMLMediaElement::clearMediaPlayer):
(WebCore::HTMLMediaElement::contextDestroyed):
(WebCore::HTMLMediaElement::stop):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
(WebCore::HTMLMediaElement::dispatchEvent):
(WebCore::HTMLMediaElement::removeEventListener):
(WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
(WebCore::HTMLMediaElement::didBecomeFullscreenElement):
(WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured):
(WebCore::HTMLMediaElement::scheduleUpdateMediaState):
(WebCore::HTMLMediaElement::updateMediaState):
(WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
(WebCore::setFlags): Deleted.
(WebCore::clearFlags): Deleted.
(WebCore::actionName): Deleted.
(WebCore::HTMLMediaElement::scheduleDelayedAction): Deleted.
(WebCore::HTMLMediaElement::pendingActionTimerFired): Deleted.
* html/HTMLMediaElement.h:
* html/HTMLMediaElementEnums.h:
* platform/DeferrableTask.h: Added.
(WebCore::DeferrableTask::DeferrableTask):
(WebCore::DeferrableTask::scheduleTask):
(WebCore::DeferrableTask::close):
(WebCore::DeferrableTask::cancelTask):
(WebCore::DeferrableTask::hasPendingTask const):
2018-10-16 Timothy Hatcher <timothy@apple.com>
Add <meta name="supported-color-schemes"> to control what color schemes the page supports
https://bugs.webkit.org/show_bug.cgi?id=190526
rdar://problem/45230140
Reviewed by Dean Jackson.
Test: css-dark-mode/supported-color-schemes.html
* dom/Document.cpp:
(WebCore::isColorSchemeSeparator): Added.
(WebCore::processColorSchemes): Added.
(WebCore::Document::processSupportedColorSchemes): Added.
(WebCore::Document::useDarkAppearance const): Take system appearance and document's
suppoerted color shcemes into account.
* dom/Document.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragment): Update use of LocalDefaultSystemAppearance.
* html/HTMLMetaElement.cpp:
(WebCore::HTMLMetaElement::process): Added supported-color-schemes behind runtime feature check.
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::paint): Update use of LocalDefaultSystemAppearance.
* platform/mac/DragImageMac.mm:
(WebCore::createDragImageForLink): Update use of LocalDefaultSystemAppearance.
* platform/mac/LocalDefaultSystemAppearance.h:
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
Drop the need for useSystemAppearance. This is accounted for in Document::useDarkAppearance.
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::paint): Update use of LocalDefaultSystemAppearance.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents): Update use of LocalDefaultSystemAppearance.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::paintContents): Update use of LocalDefaultSystemAppearance.
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paint): Use document instead of page.
* rendering/RenderThemeCocoa.mm:
(WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Update use of LocalDefaultSystemAppearance.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::documentViewFor const): Update use of LocalDefaultSystemAppearance.
(WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::supportsSelectionForegroundColors const): Ditto.
(WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): Ditto.
(WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Ditto.
(WebCore::RenderThemeMac::colorCache const): Ditto.
(WebCore::RenderThemeMac::systemColor const): Ditto.
(WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): Ditto.
(WebCore::RenderThemeMac::paintSliderThumb): Ditto.
(WebCore::RenderThemeMac::usingDarkAppearance const): No need to limit to macOS here.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::draw): Update use of LocalDefaultSystemAppearance.
2018-10-16 Rob Buis <rbuis@igalia.com>
Remove superfluous VIDEO build guard
https://bugs.webkit.org/show_bug.cgi?id=190624
Reviewed by Michael Catanzaro.
Remove some instances where the VIDEO build guard is included within another VIDEO build guard.
No new tests. No change in behavior.
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
2018-10-16 Youenn Fablet <youenn@apple.com>
Support RTCConfiguration.certificates
https://bugs.webkit.org/show_bug.cgi?id=190603
Reviewed by Eric Carlson.
Update RTCConfiguration to have a certificates member.
Add the conversion from RTCCertificate to libwebrtc certificates.
Add check to ensure that certificates are not expired.
Add check to ensure that certificates passed to setConfiguration were
the same as the ones passed to RTCPeerConnection constructor.
Once these checks are done, we reuse the certificates created at
RCPeerConnection creation time when setting the configuration again.
Covered by rebased WPT test.
* Modules/mediastream/RTCConfiguration.h:
* Modules/mediastream/RTCConfiguration.idl:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::certificatesFromConfiguration):
(WebCore::RTCPeerConnection::initializeConfiguration):
(WebCore::RTCPeerConnection::setConfiguration):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::setConfiguration):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::configurationFromMediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.cpp:
(WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
* platform/mediastream/MediaEndpointConfiguration.h:
2018-10-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r237163.
Introduced layout test failures on iOS Simulator.
Reverted changeset:
"[CG] Adopt CG SPI for non-even cornered rounded rects"
https://bugs.webkit.org/show_bug.cgi?id=190155
https://trac.webkit.org/changeset/237163
2018-10-16 Devin Rousso <drousso@apple.com>
Web Inspector: Canvas: capture previously saved states and add them to the recording payload
https://bugs.webkit.org/show_bug.cgi?id=190473
Reviewed by Joseph Pecoraro.
Updated existing tests: inspector/canvas/recording-2d.html
inspector/model/recording.html
Instead of sending a single object of the current state of the context, send an array of
objects, one for each restore point.
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::stateStack): Added.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::stringIndexForKey): Added.
(WebCore::InspectorCanvas::buildInitialState):
2018-10-16 Justin Michaud <justin_michaud@apple.com>
Implement feature flag and bindings for CSS Painting API
https://bugs.webkit.org/show_bug.cgi?id=190237
Reviewed by Ryosuke Niwa.
Add feature flag and bindings for CSS Painting API. This adds a new property,
CSS.paintWorkletGlobalScope, which will be a temporary way to access the paint
worklet global scope untill CSS.paintWorklet is implemented.
There are a few small changes, mostly adding headers and "using" declarations,
that were required to get this to build. This is probably related to unified sources.
Tests: fast/css-custom-paint/basic.html
fast/css-custom-paint/registerPaintBindings.html
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: Added.
(WebCore::throwInvalidModificationError):
(WebCore::JSCSSPaintWorkletGlobalScope::registerPaint):
* bindings/js/JSEventListener.cpp:
* bindings/js/JSRemoteDOMWindowCustom.cpp:
* bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp:
* bindings/js/WebCoreBuiltinNames.h:
* css/CSSPaintCallback.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintCallback::~CSSPaintCallback):
* css/CSSPaintCallback.idl: Added.
* css/CSSPaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintWorkletGlobalScope::create):
(WebCore::CSSPaintWorkletGlobalScope::CSSPaintWorkletGlobalScope):
(WebCore::CSSPaintWorkletGlobalScope::devicePixelRatio):
(WebCore::CSSPaintWorkletGlobalScope::addRegisteredPaint):
* css/CSSPaintWorkletGlobalScope.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::CSSPaintWorkletGlobalScope::paintDefinitionMap):
* css/CSSPaintWorkletGlobalScope.idl: Added.
* css/DOMCSSPaintWorklet.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
(WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope):
(WebCore::DOMCSSPaintWorklet::from):
(WebCore::DOMCSSPaintWorklet::supplementName):
* css/DOMCSSPaintWorklet.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp.
* css/DOMCSSPaintWorklet.idl: Added.
* css/MediaQueryParserContext.cpp:
* css/StyleBuilder.h:
* dom/Document.cpp:
(WebCore::Document::ensureCSSPaintWorkletGlobalScope):
* dom/Document.h:
* features.json:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSPaintingAPIEnabled):
(WebCore::RuntimeEnabledFeatures::cssPaintingAPIEnabled const):
2018-10-16 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Support inline WebVTT styles
https://bugs.webkit.org/show_bug.cgi?id=190369
Reviewed by Eric Carlson.
Add support for inline WebVTT styles, see https://w3c.github.io/webvtt/#styling. The parsed
style strings from the VTT file are added to an optional vector of style strings in the
TextTrack class. These styles are then added as HTMLStyleElement children to the parent of
the cue span element.
Test: media/track/track-cue-css.html
* html/track/InbandGenericTextTrack.cpp:
(WebCore::InbandGenericTextTrack::newStyleSheetsParsed):
* html/track/InbandGenericTextTrack.h:
* html/track/InbandWebVTTTextTrack.cpp:
(WebCore::InbandWebVTTTextTrack::newStyleSheetsParsed):
* html/track/InbandWebVTTTextTrack.h:
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::newStyleSheetsAvailable):
* html/track/LoadableTextTrack.h:
* html/track/TextTrack.h:
(WebCore::TextTrack::styleSheets const):
* html/track/VTTCue.cpp:
(WebCore::VTTCue::getDisplayTree):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::getNewCues):
(WebCore::WebVTTParser::getStyleSheets):
(WebCore::WebVTTParser::parse):
(WebCore::WebVTTParser::collectWebVTTBlock):
(WebCore::WebVTTParser::collectStyleSheet):
(WebCore::WebVTTParser::checkStyleSheet):
(WebCore::WebVTTParser::checkAndStoreStyleSheet):
* html/track/WebVTTParser.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::newStyleSheetsParsed):
(WebCore::TextTrackLoader::getNewStyleSheets):
* loader/TextTrackLoader.h:
2018-10-16 Chris Dumez <cdumez@apple.com>
window.navigator should not become null after the window loses its browsing context
https://bugs.webkit.org/show_bug.cgi?id=190595
Reviewed by Ryosuke Niwa.
window.navigator should not become null after the window loses its browsing context.
This does not match the HTML specification or the behavior of other browsers.
No new tests, updated existing tests.
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::geolocation const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::navigator):
* page/Navigator.cpp:
(WebCore::Navigator::Navigator):
* page/Navigator.h:
* page/NavigatorBase.cpp:
(WebCore::NavigatorBase::NavigatorBase):
* page/NavigatorBase.h:
* page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::WorkerNavigator):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ServiceWorkerContainer):
* workers/service/ServiceWorkerContainer.h:
2018-10-16 Alex Christensen <achristensen@webkit.org>
Replace HistoryItem* with HistoryItem& where possible
https://bugs.webkit.org/show_bug.cgi?id=190617
Reviewed by Chris Dumez.
* history/BackForwardClient.h:
* history/BackForwardController.cpp:
(WebCore::BackForwardController::setCurrentItem):
* history/BackForwardController.h:
* history/HistoryItem.cpp:
(WebCore::defaultNotifyHistoryItemChanged):
(WebCore::HistoryItem::setAlternateTitle):
(WebCore::HistoryItem::setURLString):
(WebCore::HistoryItem::setOriginalURLString):
(WebCore::HistoryItem::setReferrer):
(WebCore::HistoryItem::setTitle):
(WebCore::HistoryItem::setTarget):
(WebCore::HistoryItem::setShouldRestoreScrollPosition):
(WebCore::HistoryItem::setStateObject):
(WebCore::HistoryItem::notifyChanged):
* history/HistoryItem.h:
* loader/EmptyClients.cpp:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
(WebCore::FrameLoader::loadSameDocumentItem):
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::updateForCommit):
(WebCore::HistoryController::recursiveUpdateForCommit):
(WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation):
(WebCore::HistoryController::setCurrentItem):
(WebCore::HistoryController::createItem):
(WebCore::HistoryController::itemsAreClones const):
(WebCore::HistoryController::currentFramesMatchItem const):
* loader/HistoryController.h:
2018-10-16 Alex Christensen <achristensen@webkit.org>
Remove unused WebHistoryItem._transientPropertyForKey
https://bugs.webkit.org/show_bug.cgi?id=190606
Reviewed by Chris Dumez.
This is unnecessary complexity in HistoryItem.
* history/HistoryItem.h:
* history/mac/HistoryItemMac.mm:
(WebCore::HistoryItem::getTransientProperty const): Deleted.
(WebCore::HistoryItem::setTransientProperty): Deleted.
2018-10-16 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Separate SSL Class for platform dependent way of setup.
https://bugs.webkit.org/show_bug.cgi?id=190597
Reviewed by Alex Christensen.
SSL setup is very platform dependent. This patch separate the class to allow
platform-dependent setup at the SSL handle instantiation.
No new tests because there's no behaviro changes.
* PlatformWinCairo.cmake:
* platform/network/curl/CurlSSLHandle.cpp:
(WebCore::CurlSSLHandle::CurlSSLHandle):
(WebCore::CurlSSLHandle::getCACertPathEnv): Moved.
* platform/network/curl/CurlSSLHandle.h:
* platform/network/win/CurlSSLHandleWin.cpp:
(WebCore::getCACertPathEnv):
(WebCore::CurlSSLHandle::platformInitialize):
2018-10-15 Keith Miller <keith_miller@apple.com>
Support arm64 CPUs with a 32-bit address space
https://bugs.webkit.org/show_bug.cgi?id=190273
Reviewed by Michael Saboff.
Fix missing namespace annotation.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):
2018-10-15 Justin Fan <justin_fan@apple.com>
Add WebGPU 2018 feature flag and experimental feature flag
https://bugs.webkit.org/show_bug.cgi?id=190509
Reviewed by Dean Jackson.
Re-add ENABLE_WEBGPU, an experimental feature flag, and a RuntimeEnabledFeature
for the 2018 WebGPU prototype.
* Configurations/FeatureDefines.xcconfig:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
(WebCore::RuntimeEnabledFeatures::webGPUEnabled const):
2018-10-15 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r237162.
https://bugs.webkit.org/show_bug.cgi?id=190612
Broke Windows build (Requested by dolmstead on #webkit).
Reverted changeset:
"Add stub implementation for accessibility objects"
https://bugs.webkit.org/show_bug.cgi?id=190608
https://trac.webkit.org/changeset/237162
2018-10-15 Said Abou-Hallawa <sabouhallawa@apple.com>
[CG] Adopt CG SPI for non-even cornered rounded rects
https://bugs.webkit.org/show_bug.cgi?id=190155
Reviewed by Simon Fraser.
Instead of creating bezier curves for the non-even corners of the rounded
rects, we should use the optimized SPI provided by CG.
* platform/graphics/cg/PathCG.cpp:
(WebCore::Path::platformAddPathForRoundedRect):
2018-10-15 Don Olmstead <don.olmstead@sony.com>
Add stub implementation for accessibility objects
https://bugs.webkit.org/show_bug.cgi?id=190608
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
Add default implementation to associated cpp file. Removes the WPE
specific stubs.
* SourcesWPE.txt:
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::detachWrapper):
(WebCore::AXObjectCache::attachWrapper):
(WebCore::AXObjectCache::postPlatformNotification):
(WebCore::AXObjectCache::nodeTextChangePlatformNotification):
(WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
(WebCore::AXObjectCache::handleScrolledToAnchor):
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
* accessibility/AccessibilityObject.h:
* accessibility/wpe/AXObjectCacheWPE.cpp: Removed.
* accessibility/wpe/AccessibilityObjectWPE.cpp: Removed.
2018-10-15 Alex Christensen <achristensen@webkit.org>
Modernize BackForwardClient.h
https://bugs.webkit.org/show_bug.cgi?id=190610
Reviewed by Chris Dumez.
* editing/markup.cpp:
(WebCore::createPageForSanitizingWebContent):
* history/BackForwardClient.h:
* history/BackForwardController.h:
(WebCore::BackForwardController::client):
(WebCore::BackForwardController::client const):
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* loader/EmptyClients.cpp:
(WebCore::pageConfigurationWithEmptyClients):
(WebCore::createEmptyFrameNetworkingContext): Deleted.
(WebCore::fillWithEmptyClients): Deleted.
(WebCore::createEmptyEditorClient): Deleted.
* loader/EmptyClients.h:
* page/Page.cpp:
(WebCore::Page::Page):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
2018-10-15 Timothy Hatcher <timothy@apple.com>
Add support for prefers-color-scheme media query
https://bugs.webkit.org/show_bug.cgi?id=190499
rdar://problem/45212025
Reviewed by Dean Jackson.
Test: css-dark-mode/prefers-color-scheme.html
* Configurations/FeatureDefines.xcconfig: Added ENABLE_DARK_MODE_CSS.
* css/CSSValueKeywords.in: Added light and dark.
* css/MediaFeatureNames.h: Added prefers-color-scheme.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersColorSchemeEvaluate): Added.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Added prefers-color-scheme.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Added.
(WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Added.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::resetToConsistentState): Reset setUseDarkAppearance.
(WebCore::InternalSettings::setUseDarkAppearance): Added.
* testing/InternalSettings.h: Added setUseDarkAppearance.
* testing/InternalSettings.idl: Ditto.
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove unused WebView._globalHistoryItem
https://bugs.webkit.org/show_bug.cgi?id=190601
Reviewed by Chris Dumez.
This was a hack to give the client a more reliable current back/forward item, but it hasn't been used for years
and it's adding unnecessary complexity to the history code.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::updateForStandardLoad):
(WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
2018-10-15 Chris Dumez <cdumez@apple.com>
Experiment: target=_blank on anchors should imply rel=noopener
https://bugs.webkit.org/show_bug.cgi?id=190481
Reviewed by Alex Christensen.
As an experiment, try and make it so that target=_blank on anchors implies `rel=noopener` for improved security.
WebContent can then request an opener relationship by using `rel=opener` instead.
This change was discussed at:
- https://github.com/whatwg/html/issues/4078
We want to attempt this change is STP to see if it is Web-compatible. Preliminary testing seems to indicate
that OAuth workflows still work.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAttribute):
(WebCore::HTMLAnchorElement::handleClick):
(WebCore::HTMLAnchorElement::effectiveTarget const):
* html/HTMLAnchorElement.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled):
(WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const):
2018-10-15 Andy Estes <aestes@apple.com>
[Apple Pay] New shipping methods are ignored when updating after the shippingaddresschange event
https://bugs.webkit.org/show_bug.cgi?id=190560
<rdar://problem/44559075>
Reviewed by Youenn Fablet.
When a PaymentDetailsUpdate with shipping options was specified to updateWith() after the
shippingaddresschange event fires, ApplePayPaymentHandler needs to convert the shipping
options to ShippingMethods and add them to the ShippingContactUpdate so that the Apple Pay
UI renders the new options.
Added test cases to http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html.
* Modules/applepay/ApplePayShippingMethod.idl:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::computeShippingMethods):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::convert):
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeShippingContactSelection):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:
2018-10-15 Youenn Fablet <youenn@apple.com>
RTCPeerConnection.generateCertificate is not a function
https://bugs.webkit.org/show_bug.cgi?id=173541
<rdar://problem/32638029>
Reviewed by Eric Carlson.
Add support for RTCCertificate generation through libwebrtc certificate generator.
Make generation in the webrtc network thread.
Support is as per spec (ECDSA and RSASSA_PKCS).
Partially covered by WPT tests.
* css/StyleBuilder.h: Fixing build.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/webauthn/PublicKeyCredential.cpp: Fixing build.
* Modules/mediastream/PeerConnectionBackend.cpp:
(WebCore::PeerConnectionBackend::generateCertificate):
* Modules/mediastream/PeerConnectionBackend.h:
(WebCore::PeerConnectionBackend::CertificateInformation::RSASSA_PKCS1_v1_5):
(WebCore::PeerConnectionBackend::CertificateInformation::ECDSA_P256):
(WebCore::PeerConnectionBackend::CertificateInformation::CertificateInformation):
* Modules/mediastream/RTCCertificate.cpp: Added.
(WebCore::RTCCertificate::create):
(WebCore::RTCCertificate::RTCCertificate):
* Modules/mediastream/RTCCertificate.h: Added.
(WebCore::RTCCertificate::expires const):
(WebCore::RTCCertificate::getFingerprints const):
* Modules/mediastream/RTCCertificate.idl: Added.
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::certificateTypeFromAlgorithmIdentifier):
(WebCore::RTCPeerConnection::generateCertificate):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: Added.
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
(WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::~RTCCertificateGeneratorCallback):
(WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
(WebCore::LibWebRTCCertificateGenerator::generateCertificate):
* Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
(WebCore::LibWebRTCProvider::certificateGenerator):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
Add compact logging for the paint-order RenderLayer tree
https://bugs.webkit.org/show_bug.cgi?id=190592
Reviewed by Zalan Bujtas.
Add a way to dump the RenderLayer tree in paint order, which will be extended in future
to show more dirty bit state.
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputIdent):
(WebCore::outputPaintOrderTreeRecursive):
(WebCore::showPaintOrderTree):
* rendering/RenderLayer.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove unused parameters from FrameLoaderClient::createFrame
https://bugs.webkit.org/show_bug.cgi?id=190587
Reviewed by Chris Dumez.
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::createFrame):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::loadSubframe):
2018-10-15 Andy Estes <aestes@apple.com>
[Apple Pay] Payment authorization results with ApplePayErrors should never be considered final
https://bugs.webkit.org/show_bug.cgi?id=190559
<rdar://problem/37250908>
Reviewed by Anders Carlsson.
When PaymentCoordinator thinks a payment authorization result is final it releases the
active ApplePaySession. The Apple Pay UI is dismissed after a receiving a final result.
However, WebCore::isFinalStateResult had the wrong idea about what was a final state,
in some cases causing PaymentCoordinator to release the active session even when the UI is
still presented. If the user authorizes payment again, the website will not receive another
paymentauthorized event, and the Apple Pay UI will eventually time out waiting for a result.
Specifically, isFinalStateResult thought that:
(1) results with STATUS_SUCCESS were always final, even if they had errors
(2) errors with code "unknown" were final
Both of these assumptions are wrong. PassKit considers any result with errors to be
non-final, even if an error has code "unknown."
Fixed WebCore::isFinalStateResult to agree with what PassKit considers to be final results.
Test: http/tests/ssl/applepay/ApplePaySessionFinalState.https.html
* Modules/applepay/ApplePaySessionPaymentRequest.cpp:
(WebCore::isFinalStateResult):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completePaymentSession):
2018-10-15 Andy Estes <aestes@apple.com>
[Payment Request] PaymentResponse should be a ContextDestructionObserver
https://bugs.webkit.org/show_bug.cgi?id=190558
Reviewed by Alex Christensen.
Make PaymentResponse a ContextDestructionObserver so it has a ScriptExecutionContext to
return for its override of EventTarget::scriptExecutionContext(). Do this instead of
downcasting m_request to an ActiveDOMObject to ask for its context.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::accept):
* Modules/paymentrequest/PaymentResponse.cpp:
(WebCore::PaymentResponse::PaymentResponse):
(WebCore::PaymentResponse::scriptExecutionContext const): Deleted.
* Modules/paymentrequest/PaymentResponse.h:
2018-10-15 Andy Estes <aestes@apple.com>
[Payment Request] Use a PendingActivity token rather than calling (un)setPendingActivity
https://bugs.webkit.org/show_bug.cgi?id=190557
Reviewed by Alex Christensen.
PaymentRequest has pending activity whenever there is an active payment handler, since
user-initiated events can occur whenever the payment UI is displayed.
Rather than manually track the pending activity with setPendingActivity() and
unsetPendingActivity(), use a PendingActivity token tied to the lifetime of the active
payment handler. Also, rewrite canSuspendForDocumentSuspension() in terms of
hasPendingActivity().
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show):
(WebCore::PaymentRequest::abortWithException):
(WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
(WebCore::PaymentRequest::paymentMethodChanged):
(WebCore::PaymentRequest::completeMerchantValidation):
(WebCore::PaymentRequest::settleDetailsPromise):
(WebCore::PaymentRequest::complete):
(WebCore::PaymentRequest::cancel):
* Modules/paymentrequest/PaymentRequest.h:
2018-10-15 Wenson Hsieh <wenson_hsieh@apple.com>
Changing view scale should zoom to initial scale if the page is already at initial scale
https://bugs.webkit.org/show_bug.cgi?id=190570
<rdar://problem/45261877>
Reviewed by Tim Horton.
Add a getter for ViewportConfiguration's layout size scale factor.
See Source/WebKit/ChangeLog for more details.
* page/ViewportConfiguration.h:
(WebCore::ViewportConfiguration::layoutSizeScaleFactor const):
2018-10-15 Charlie Turner <cturner@igalia.com>
Fix build error with !LOG_DISABLED in Release mode
https://bugs.webkit.org/show_bug.cgi?id=190465
Reviewed by Michael Catanzaro.
No tests due to no new functionality.
* workers/service/ServiceWorkerRegistrationKey.cpp:
* workers/service/ServiceWorkerRegistrationKey.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
LayerListMutationDetector should take a reference
https://bugs.webkit.org/show_bug.cgi?id=190586
Reviewed by Zalan Bujtas.
Change LayerListMutationDetector to take a RenderLayer&.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
(WebCore::LayerListMutationDetector::LayerListMutationDetector):
(WebCore::LayerListMutationDetector::~LayerListMutationDetector):
* rendering/RenderLayerBacking.cpp:
(WebCore::traverseVisibleNonCompositedDescendantLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
(WebCore::RenderLayerCompositor::layerHas3DContent const):
2018-10-15 Simon Fraser <simon.fraser@apple.com>
Share some code to dirty z-order and normal flow lists when child layers are added or removed
https://bugs.webkit.org/show_bug.cgi?id=190585
Reviewed by Zalan Bujtas.
Factor code which dirties the normal flow list and child stacking context z-order lists
when a layer is added or removed.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::dirtyPaintOrderListsOnChildChange):
* rendering/RenderLayer.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
Make a helper function to check for reflection layers
https://bugs.webkit.org/show_bug.cgi?id=190584
Reviewed by Zalan Bujtas.
Add RenderLayer::isReflectionLayer() which returns true if the passed layer
is the layer of this layer's reflection. It's used in z-order list building.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::collectLayers):
(WebCore::expandClipRectForDescendantsAndReflection):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
2018-10-15 Simon Fraser <simon.fraser@apple.com>
RenderLayer::addChild() and removeChild() should take references
https://bugs.webkit.org/show_bug.cgi?id=190582
Reviewed by Zalan Bujtas.
Pass the layer to be added or removed as a reference; it's never null.
* rendering/RenderElement.cpp:
(WebCore::addLayers):
(WebCore::RenderElement::removeLayers):
(WebCore::RenderElement::moveLayers):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::insertOnlyThisLayer):
(WebCore::RenderLayer::removeOnlyThisLayer):
* rendering/RenderLayer.h:
2018-10-15 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[Cairo] Incorrect rendering for 135-deg skews
https://bugs.webkit.org/show_bug.cgi?id=190513
Compensation value to zero the the translation components
of the transformation matrix is incorrect if the matrix
has a shear factor.
Reviewed by Žan Doberšek.
Tests: fast/transforms/skew-x-135deg-with-gradient.html
fast/transforms/skew-y-135deg-with-gradient.html
* platform/graphics/cairo/CairoUtilities.cpp:
(WebCore::drawPatternToCairoContext):
2018-10-15 Christopher Reid <chris.reid@sony.com>
[Curl][WinCairo] Add Public Suffix support to WinCairo
https://bugs.webkit.org/show_bug.cgi?id=183060
Reviewed by Alex Christensen.
Add Public Suffix support to WinCairo using LibPSL.
LibPSL has been added to WinCairoRequirements in v2018.10.09.
* platform/Curl.cmake:
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies): Search for cookies using the topPrivatelyControlledDomain
(WebCore::CookieJarDB::setCookie): Prevent cookies from being added under TLDs
* platform/network/curl/PublicSuffixCurl.cpp: Added.
(WebCore::isPublicSuffix):
(WebCore::topPrivatelyControlledDomainInternal):
(WebCore::topPrivatelyControlledDomain):
2018-10-15 Simon Fraser <simon.fraser@apple.com>
RenderLayer tree-related cleanup
https://bugs.webkit.org/show_bug.cgi?id=190572
Reviewed by Zalan Bujtas.
Move code around so that functions related to parent/child and z-order tree structure
are near the top of RenderLayer.cpp, since this is one of the primary functions of layers.
Attempts to use inheritance or composition to separate out tree structure resulted in
unwieldy code and/or performance regressions.
The only behavior change is to store a bit for m_isStackingContext so that we don't have
to consult the old style to know if it changed.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::insertOnlyThisLayer):
(WebCore::RenderLayer::removeOnlyThisLayer):
(WebCore::canCreateStackingContext):
(WebCore::RenderLayer::shouldBeNormalFlowOnly const):
(WebCore::RenderLayer::shouldBeStackingContext const):
(WebCore::RenderLayer::setIsNormalFlowOnly):
(WebCore::RenderLayer::setIsStackingContext):
(WebCore::RenderLayer::setParent):
(WebCore::RenderLayer::dirtyZOrderLists):
(WebCore::RenderLayer::dirtyStackingContextZOrderLists):
(WebCore::RenderLayer::dirtyNormalFlowList):
(WebCore::RenderLayer::updateNormalFlowList):
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::collectLayers):
(WebCore::RenderLayer::updateLayerListsIfNeeded):
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::willBeDestroyed):
(WebCore::RenderLayer::isDescendantOf const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::compareZIndex): Deleted.
* rendering/RenderLayer.h:
2018-10-15 Antti Koivisto <antti@apple.com>
[PSON] Prewarm system fallback fonts
https://bugs.webkit.org/show_bug.cgi?id=190517
Reviewed by Ryosuke Niwa.
This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages
after process swaps.
* page/PrewarmInformation.h:
(WebCore::PrewarmInformation::encode const):
(WebCore::PrewarmInformation::decode):
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::collectPrewarmInformation):
(WebCore::ProcessWarming::prewarmWithInformation):
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::collectPrewarmInformation const):
(WebCore::FontCache::prewarm):
* platform/graphics/FontCache.h:
(WebCore::FontCache::PrewarmInformation::isolatedCopy const):
(WebCore::FontCache::PrewarmInformation::encode const):
(WebCore::FontCache::PrewarmInformation::decode):
Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontCache::systemFallbackForCharacters):
Collect the names of fonts that end up needing character specific system fallbacks.
(WebCore::FontCache::collectPrewarmInformation const):
Include them into prewarm information.
(WebCore::FontCache::prewarm):
Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully
prewarm it for fallbacks (independent of size, locale or other characteristics).
Any future calls to systemFallbackForCharacters are fast.
2018-10-15 Chris Dumez <cdumez@apple.com>
Restrict browsing context lookup by name to frames that are related to one another
https://bugs.webkit.org/show_bug.cgi?id=190475
Reviewed by Alex Christensen.
Update our frame lookup by name logic to take in the active / requesting frame and
only a return a frame that is related to it. By related to it, I mean:
- Ancestor <-> Descendant relationship
- Opener <-> Openee relationship
Being able to look up unrelated frames makes process swapping difficult so we need
to be stricter.
This change is being discussed at:
- https://github.com/whatwg/html/issues/313
Tests: http/tests/dom/new-window-can-target-opener.html
http/tests/dom/noopener-window-cannot-target-opener.html
http/tests/dom/noopener-window-not-targetable.html
http/tests/dom/noopener-window-not-targetable2.html
http/tests/dom/noreferrer-window-not-targetable.html
http/tests/dom/opened-window-not-targetable-after-disowning-opener.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::findFrameForNavigation):
* page/FrameTree.cpp:
(WebCore::isFrameFamiliarWith):
(WebCore::FrameTree::find const):
* page/FrameTree.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::targetFrame const):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Shrink more enum classes
https://bugs.webkit.org/show_bug.cgi?id=190540
Reviewed by Chris Dumez.
* Modules/notifications/NotificationDirection.h:
* dom/Document.h:
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.h:
* loader/ShouldSkipSafeBrowsingCheck.h:
* loader/ShouldTreatAsContinuingLoad.h:
* page/AutoplayEvent.h:
* page/ChromeClient.h:
* page/DiagnosticLoggingClient.h:
* page/Page.h:
* platform/CookiesStrategy.h:
* platform/audio/AudioSession.h:
* platform/network/NetworkStorageSession.h:
* platform/network/StoredCredentialsPolicy.h:
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistrationData.h:
* workers/service/ServiceWorkerRegistrationOptions.h:
* workers/service/ServiceWorkerTypes.h:
* workers/service/ServiceWorkerUpdateViaCache.h:
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.h:
2018-10-15 Patrick Griffis <pgriffis@igalia.com>
[GTK][WPE] Implement subprocess sandboxing
https://bugs.webkit.org/show_bug.cgi?id=188568
Reviewed by Michael Catanzaro.
Link against libseccomp.
* PlatformGTK.cmake:
2018-10-15 YUHAN WU <yuhan_wu@apple.com>
Implement error handler of MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190438
Reviewed by Youenn Fablet.
Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html
Implement error event handler (onerror) for MediaRecorder and basic architecture of start() function.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::stop):
(WebCore::MediaRecorder::start):
(WebCore::MediaRecorder::setNewRecordingState):
(WebCore::MediaRecorder::scheduleDeferredTask):
(WebCore::MediaRecorder::didAddOrRemoveTrack):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediarecorder/MediaRecorder.idl:
* Modules/mediarecorder/MediaRecorderErrorEvent.cpp: Added.
(WebCore::MediaRecorderErrorEvent::create):
(WebCore::MediaRecorderErrorEvent::MediaRecorderErrorEvent):
(WebCore::MediaRecorderErrorEvent::eventInterface const):
* Modules/mediarecorder/MediaRecorderErrorEvent.h: Added.
* Modules/mediarecorder/MediaRecorderErrorEvent.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.in:
* dom/EventTargetFactory.in:
2018-10-15 Chris Dumez <cdumez@apple.com>
Window's properties such as 'location' should not become null when it loses its browsing context
https://bugs.webkit.org/show_bug.cgi?id=190539
Reviewed by Alex Christensen.
Window's properties such as 'location' should not become null when it loses its browsing context.
This Webkit behavior is not standard and does not match other browsers so this patch makes it so
that those properties persist.
Tests: http/tests/dom/cross-origin-detached-window-properties.html
http/tests/dom/same-origin-detached-window-properties.html
* bindings/js/JSDOMBindingSecurity.cpp:
(WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowProperties.cpp:
(WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
(WebCore::JSDOMWindowProperties::getOwnPropertySlot):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::putCommon):
(WebCore::JSLocation::deleteProperty):
(WebCore::JSLocation::deletePropertyByIndex):
(WebCore::JSLocation::getOwnPropertyNames):
(WebCore::JSLocation::defineOwnProperty):
(WebCore::JSLocation::getPrototype):
(WebCore::JSLocation::toStringName):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::jsTestActiveDOMObjectExcitingAttrGetter):
(WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody):
* crypto/SubtleCrypto.cpp:
(WebCore::SubtleCrypto::SubtleCrypto):
* crypto/SubtleCrypto.h:
(WebCore::SubtleCrypto::create):
* dom/Document.cpp:
(WebCore::Document::~Document):
* page/Crypto.cpp:
(WebCore::Crypto::Crypto):
* page/Crypto.h:
(WebCore::Crypto::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::~DOMWindow):
(WebCore::DOMWindow::frameDestroyed):
(WebCore::DOMWindow::screen):
(WebCore::DOMWindow::history):
(WebCore::DOMWindow::crypto):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
(WebCore::DOMWindow::console const):
(WebCore::DOMWindow::applicationCache):
(WebCore::DOMWindow::navigator):
(WebCore::DOMWindow::performance const):
(WebCore::DOMWindow::location):
(WebCore::DOMWindow::visualViewport):
(WebCore::DOMWindow::styleMedia):
* page/DOMWindow.h:
* page/DOMWindow.idl:
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::crypto):
2018-10-15 Alex Christensen <achristensen@webkit.org>
Include EnumTraits.h less
https://bugs.webkit.org/show_bug.cgi?id=190535
Reviewed by Chris Dumez.
* Modules/applepay/ApplePaySessionPaymentRequest.h:
* Modules/applepay/PaymentAuthorizationStatus.h:
* Modules/applicationmanifest/ApplicationManifest.h:
* Modules/fetch/FetchHeaders.h:
* Modules/webauthn/AuthenticatorTransport.h:
* Modules/webauthn/PublicKeyCredentialType.h:
* loader/ShouldSkipSafeBrowsingCheck.h:
* loader/ShouldTreatAsContinuingLoad.h:
* platform/Cookie.h:
* platform/audio/AudioSession.h:
* platform/mediastream/CaptureDevice.h:
* platform/mediastream/MediaStreamRequest.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/network/NetworkLoadInformation.h:
* workers/service/ServiceWorkerClientType.h:
* workers/service/ServiceWorkerTypes.h:
* workers/service/ServiceWorkerUpdateViaCache.h:
2018-10-15 Alex Christensen <achristensen@webkit.org>
Remove InjectedBundle processing of back/forward lists
https://bugs.webkit.org/show_bug.cgi?id=190459
Reviewed by Chris Dumez.
The uses of these functions are dead code I removed in rdar://problem/45180545
Removing these functions is a step towards fixing the PSON history bugs.
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
2018-10-14 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Remove Option::useAsyncIterator
https://bugs.webkit.org/show_bug.cgi?id=190567
Reviewed by Saam Barati.
* Configurations/FeatureDefines.xcconfig:
2018-10-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] Fix EME build for GStreamer 1.14.x
https://bugs.webkit.org/show_bug.cgi?id=190471
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformCaps): The
GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped
until the GStreamer 1.16.0 release, so its use needs to be wrapped
between a version check.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto.
2018-10-12 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view
https://bugs.webkit.org/show_bug.cgi?id=190504
<rdar://problem/45117760>
Reviewed by Tim Horton.
Add support in ViewportConfiguration for applying a layout size scale factor to the viewport. See below for
more details.
Tests: fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html
fast/viewport/ios/device-width-viewport-after-changing-view-scale.html
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::setViewLayoutSize):
The viewport's layout size may now be changed alongside the layout size scale factor. If either of these two
variables change, we recompute our minimum layout size and viewport configuration parameters.
(WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
(WebCore::ViewportConfiguration::nativeWebpageParameters):
(WebCore::ViewportConfiguration::testingParameters):
(WebCore::ViewportConfiguration::updateConfiguration):
Multiply the minimum scale, initial scale, and maximum scale by the layout size scale factor. This allows us to
keep the document well-proportioned within the viewport, while still laying out at a different layout size.
(WebCore::ViewportConfiguration::updateMinimumLayoutSize):
Compute the minimum layout size by scaling the default layout size derived from our view's size.
(WebCore::ViewportConfiguration::layoutWidth const):
(WebCore::ViewportConfiguration::layoutHeight const):
* page/ViewportConfiguration.h:
Maintain the original initial scale, unaffected by the layout size scale factor. This is used when computing
layout width and height to prevent scaling by the layout size scale factor twice when computing layout sizes.
(WebCore::ViewportConfiguration::description const):
Include the layout size scale factor in ViewportConfiguration's description string.
(WebCore::ViewportConfiguration::Parameters::operator== const):
(WebCore::operator<<):
2018-10-12 Youenn Fablet <youenn@apple.com>
Use downcast for use of RealtimeMediaSource in LibWebRTCMediaEndpoint
https://bugs.webkit.org/show_bug.cgi?id=190533
Reviewed by Chris Dumez.
Clean-up work.
No change of behavior.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::setExistingReceiverSourceTrack):
* platform/mediastream/RealtimeIncomingAudioSource.h:
(isType):
* platform/mediastream/RealtimeIncomingVideoSource.h:
(isType):
* platform/mediastream/RealtimeMediaSource.h:
2018-10-12 Jer Noble <jer.noble@apple.com>
WebAVSampleBufferErrorListener's parent should be a WeakPtr.
https://bugs.webkit.org/show_bug.cgi?id=190524
<rdar://problem/44359307>
Reviewed by Eric Carlson.
Once WebAVSampleBufferErrorListener's parent is a WeakPtr, we no longer need to pass
protectedSelf into the callOnMainThread lambdas; we can pass in the parent itself.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener initWithParent:]):
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(-[WebAVSampleBufferErrorListener layerFailedToDecode:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::destroyRenderers):
2018-10-12 Ryosuke Niwa <rniwa@webkit.org>
Address the review comment which was meant to be addressed in r237025.
* editing/MarkupAccumulator.cpp:
(WebCore::elementCannotHaveEndTag):
2018-10-12 Youenn Fablet <youenn@apple.com> and Alejandro G. Castro <alex@igalia.com>
Refresh libwebrtc up to 343f4144be
https://bugs.webkit.org/show_bug.cgi?id=190361
Reviewed by Chris Dumez.
This refresh should not change behavior but will allow us to implement better
mdns candidate support and simulcast activation surfacing through addTransceiver.
Covered by existing tests.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
* testing/MockLibWebRTCPeerConnection.cpp:
(WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
* testing/MockLibWebRTCPeerConnection.h:
(WebCore::MockRtpSender::GetParameters): Deleted.
(WebCore::MockRtpSender::SetParameters): Deleted.
(WebCore::MockRtpSender::GetDtmfSender const): Deleted.
2018-10-12 Alex Christensen <achristensen@webkit.org>
Allow encoding of small enum classes
https://bugs.webkit.org/show_bug.cgi?id=190531
Reviewed by Tim Horton.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* dom/Document.h:
* editing/FontAttributeChanges.h:
* history/CachedFrame.h:
* loader/FrameLoaderTypes.h:
* platform/CookiesStrategy.h:
* platform/PasteboardItemInfo.h:
* platform/ReferrerPolicy.h:
2018-10-12 Rob Buis <rbuis@igalia.com>
Solve the confusion around blankURL() and isBlankURL() in URL
https://bugs.webkit.org/show_bug.cgi?id=158988
Reviewed by Alex Christensen.
The name isBlankURL is not accurate as the function tests the
protocol, not the full URL. Choose protocolIsAbout to align with
exisiting protocolIsData, protocolIsBlob etc.
No tests as no change in functionality.
* WebCore.order:
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::loadApplicationManifest):
(WebCore::DocumentLoader::startIconLoading):
* loader/NavigationAction.cpp:
(WebCore::shouldTreatAsSameOriginNavigation):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendCustomAttributes):
(WebCore::PageSerializer::serializeFrame):
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame const):
(WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource const):
* platform/URL.cpp:
(WebCore::URL::protocolIsAbout const):
(WebCore::URL::isBlankURL const): Deleted.
* platform/URL.h:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
2018-10-12 Youenn Fablet <youenn@apple.com>
DOMCache should dereference itself as soon as stopped
https://bugs.webkit.org/show_bug.cgi?id=190441
Reviewed by Chris Dumez.
Dereference the DOMCache as soon as its context is stopped instead of waiting for garbage collection.
This allows freeing resources sooner in the network process.
No observable change of behavior since the DOMCache becomes no-op when its context is stopped.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::~DOMCache):
(WebCore::DOMCache::stop):
2018-10-12 Jer Noble <jer.noble@apple.com>
CRASH in WebCore::MediaPlayerPrivateAVFoundation::setPreload
https://bugs.webkit.org/show_bug.cgi?id=190485
<rdar://problem/34613350>
Reviewed by Eric Carlson.
Crash analytics show that a pure-virtual function is called by MediaPlayerPrivateAVFoundation::setPreload(), and
the likely cause of that pure-virtual function call is that the MediaPlayerPrivateAVFoundation object itself has
been destroyed, likely as a side effect of calling MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL().
The usual suspect for this kind of crash is due to calling into JS (e.g., from a callback passed up to
HTMLMediaElement). Code inspection hasn't yielded any good hints about why this might be occurring, so we will
add a ScriptDisallowedScope assertion inside HTMLMediaElement::prepareToPlay(), to generate a good crashlog
showing exactly what callback is resulting in a JS call. But just in case the deallocation is not due to JS,
also add an explicit strong-ref inside MediaPlayer::prepareToPlay.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareToPlay):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::prepareToPlay):
2018-10-12 Jer Noble <jer.noble@apple.com>
Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged
https://bugs.webkit.org/show_bug.cgi?id=190490
<rdar://problem/42213807>
Reviewed by Eric Carlson.
Crash analytics show a null dereference occurring, likely because m_mediaSource is null.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2018-10-11 Don Olmstead <don.olmstead@sony.com>
Add Houdini specs to features.json
https://bugs.webkit.org/show_bug.cgi?id=190494
<rdar://problem/45211879>
Unreviewed fix.
Specifications should not reference other specifications. Also
move Worklet into the specifications section.
* features.json:
2018-10-11 Youenn Fablet <youenn@apple.com>
IOS 12 - Service worker cache not shared when added to homescreen
https://bugs.webkit.org/show_bug.cgi?id=190269
<rdar://problem/45009961>
Reviewed by Alex Christensen.
Expose Cache Storage API when Service Worker API is exposed.
This is used for API tests.
* dom/ScriptExecutionContext.h: Make hasServiceWorkerScheme
available outside SERVICE_WORKER compilation flag since used by DOMWindowCaches.
* dom/ScriptExecutionContext.cpp: Ditto.
* Modules/cache/DOMWindowCaches.idl:
2018-10-10 Simon Fraser <simon.fraser@apple.com>
Hide RenderLayer z-order and normal flow lists behind iterators
https://bugs.webkit.org/show_bug.cgi?id=190457
Reviewed by Zalan Bujtas.
Expose the positive z-order, negative z-order and normal flow lists
from RenderLayer as iterators rather than vectors of raw pointers.
This hides the fact that the vectors can be null, and allows for easier casting in future.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::update3DTransformedDescendantStatus):
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintList):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestList):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::traverseVisibleNonCompositedDescendantLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::updateLayerTreeGeometry):
(WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry):
(WebCore::RenderLayerCompositor::recursiveRepaintLayer):
(WebCore::RenderLayerCompositor::needsContentsCompositingLayer const):
(WebCore::RenderLayerCompositor::layerHas3DContent const):
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):
2018-10-11 Don Olmstead <don.olmstead@sony.com>
Add Houdini specs to features.json
https://bugs.webkit.org/show_bug.cgi?id=190494
Reviewed by Simon Fraser.
Add CSS Typed OM Level 1, CSS Layout API Level 1, CSS Animation
Worklet, and group them under a Houdini feature set.
* features.json:
2018-10-11 Ross Kirsling <ross.kirsling@sony.com>
[WTF] Semaphore.h conflicts with POSIX header
https://bugs.webkit.org/show_bug.cgi?id=190486
Reviewed by Yusuke Suzuki.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2018-10-11 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Support arbitrary video resolution in getUserMedia API
https://bugs.webkit.org/show_bug.cgi?id=189734
Reviewed by Xabier Rodriguez-Calvar.
Implement arbitrary video resolution for the getUserMedia API in GStreamer.
Fix the MockRealtimeMediaSource device list to make devices properties match
test expectations.
Reactivate tests that were failling because of that.
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::standardVideoSizes):
(WebCore::standardVideoSizes): Deleted.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/VideoPreset.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoPreset::create):
(WebCore::GStreamerVideoPreset::GStreamerVideoPreset):
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource):
(WebCore::GStreamerVideoCaptureSource::capabilities):
(WebCore::GStreamerVideoCaptureSource::generatePresets):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices):
2018-10-11 Keith Rollin <krollin@apple.com>
CURRENT_ARCH should not be used in Run Script phase.
https://bugs.webkit.org/show_bug.cgi?id=190407
<rdar://problem/45133556>
Reviewed by Alexey Proskuryakov.
CURRENT_ARCH is used in a number of Xcode Run Script phases. However,
CURRENT_ARCH is not well-defined during this phase (and may even have
the value "undefined") since this phase is run just once per build
rather than once per supported architecture. Migrate away from
CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and
performing an operation for each value, or by picking the first entry
in ARCHS and using that as a representative value.
No new tests -- no functional changes.
* DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the
first entry in ARCHS rather than use CURRENT_ARCH.
2018-10-11 Daniel Bates <dabates@apple.com>
Support building WebKit for macOS Mojave using a newer SDK
https://bugs.webkit.org/show_bug.cgi?id=190431
Reviewed by Andy Estes.
* platform/network/cocoa/CookieCocoa.mm:
(WebCore::coreSameSitePolicy):
(WebCore::nsSameSitePolicy):
2018-10-11 Daniel Bates <dabates@apple.com>
[iOS] Add typedef for WebEvent keyboard flags
https://bugs.webkit.org/show_bug.cgi?id=190435
Reviewed by Wenson Hsieh.
Currently WebEvent and UIKit SPI are intertwined when it comes to keyboard flags. It seems sufficient
to have WebEvent defined its own keyboard flags so that callers do not need to be aware of UIKit SPI.
No functionality changed. So, no new tests.
* platform/ios/WebEvent.h:
* platform/ios/WebEvent.mm:
(-[WebEvent keyboardFlags]):
2018-10-11 Antti Koivisto <antti@apple.com>
Use finer grained locking in FontDatabase
https://bugs.webkit.org/show_bug.cgi?id=190467
Reviewed by Alex Christensen.
* platform/graphics/FontCache.h:
Also use ListHashSet for prewarming info so we can prewarm in the same order the fonts were
seen last time.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
Only hold the lock when accessing the hashmap. There is no need to hold it during font construction
which can take a long time.
(WebCore::FontDatabase::fontForPostScriptName):
This is currently not prewarmed from a thread so no need for locking.
(WebCore::FontDatabase::clear):
2018-10-11 Thibault Saunier <tsaunier@igalia.com>
[GStreamer] Fix race condition in GStreamerVideoDecoder
https://bugs.webkit.org/show_bug.cgi?id=190470
The GStreamerVideoDecoder.m_dtsPtsMap filed is accessed from
the main thread and some GStreamer streaming thread, make sure
to protect its access.
And use WTF::StdMap instead of std::map.
Reviewed by Philippe Normand.
Manually tested and a random crash is gone.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
(WebCore::GStreamerVideoDecoder::newSampleCallback):
2018-10-11 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Fix height calculation for streams with source aspect ratio
https://bugs.webkit.org/show_bug.cgi?id=190464
Reviewed by Xabier Rodriguez-Calvar.
This patch is authored by Nikola Veljkovic <Nikola.Veljkovic@zenterio.com>
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::getVideoResolutionFromCaps): Reverse the SAR adjustment to "undo" it
instead of applying it twice.
2018-10-11 Alejandro G. Castro <alex@igalia.com>
[GTK][WPE] Add mediaDevices.enumerateDevices support
https://bugs.webkit.org/show_bug.cgi?id=185761
Reviewed by Youenn Fablet.
We are adopting the same policy COCOA is using when returning the
list of media devices if the user does not have persistent
access. Namely, we just return the first media device for audio
and video capture.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::filterDeviceList): Add support for
other platforms when filtering devices if there is no persistent
access to the origin.
2018-10-10 Chris Dumez <cdumez@apple.com>
Rename a couple of DOMWindowProperty virtual functions
https://bugs.webkit.org/show_bug.cgi?id=190458
Reviewed by Geoffrey Garen.
Rename a couple of DOMWindowProperty virtual functions as the current naming no longer makes
sense after recent refactoring.
disconnectFrameForDocumentSuspension() was renamed to suspendForPageCache(), and
reconnectFrameFromDocumentSuspension(Frame*) was renamed to resumeFromPageCache().
DOMWindowProperty objects no longer need to disconnect / reconnect from their
frame since they now get their frame from their associated Window. However, some
DOMWindowProperty subclasses do have some page cache suspension / resuming logic
implemented of overrides of these functions.
Also drop the disconnectDOMWindowProperties() / reconnectDOMWindowProperties()
methods in DOMWindow. The naming made little sense as it does not really
disconnect those properties in any way. Instead, inline them in
DOMWindow's suspendForPageCache() / resumeFromPageCache() since these are
the only callers.
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::suspendForPageCache):
(WebCore::DOMWindowIndexedDatabase::resumeFromPageCache):
(WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension): Deleted.
* Modules/indexeddb/DOMWindowIndexedDatabase.h:
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::open):
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::suspendForPageCache):
(WebCore::DOMApplicationCache::resumeFromPageCache):
(WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension): Deleted.
* loader/appcache/DOMApplicationCache.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::suspendForPageCache):
(WebCore::DOMWindow::resumeFromPageCache):
(WebCore::DOMWindow::suspendForDocumentSuspension): Deleted.
(WebCore::DOMWindow::resumeFromDocumentSuspension): Deleted.
(WebCore::DOMWindow::disconnectDOMWindowProperties): Deleted.
(WebCore::DOMWindow::reconnectDOMWindowProperties): Deleted.
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::suspendForPageCache):
(WebCore::DOMWindowExtension::resumeFromPageCache):
(WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension): Deleted.
* page/DOMWindowExtension.h:
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::suspendForPageCache):
(WebCore::DOMWindowProperty::resumeFromPageCache):
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): Deleted.
(WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension): Deleted.
* page/DOMWindowProperty.h:
2018-10-10 Devin Rousso <drousso@apple.com>
Web Inspector: create special Network waterfall for media events
https://bugs.webkit.org/show_bug.cgi?id=189773
<rdar://problem/44626605>
Reviewed by Joseph Pecoraro.
Test: http/tests/inspector/dom/didFireEvent.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::addEventListenersToNode): Added.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::addEventListenersToNodeImpl): Added.
* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::EventFiredCallback): Added.
(WebCore::EventFiredCallback::create): Added.
(WebCore::EventFiredCallback::operator==): Added.
(WebCore::EventFiredCallback::handleEvent): Added.
(WebCore::EventFiredCallback::EventFiredCallback): Added.
(WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
(WebCore::InspectorDOMAgent::addEventListenersToNode): Added.
2018-10-10 Daniel Bates <dabates@apple.com>
[iOS] Cleanup -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:]
https://bugs.webkit.org/show_bug.cgi?id=190402
Reviewed by Anders Carlsson.
Unindent case statements. Remove use of default case statements with body ASSERT_NOT_REACHED()
to catch the cases of a missing enumerator. By omitting the default case statement we turn
such a scenario into a compile-time error instead of handling it as a runtime error.
* platform/ios/wak/WAKView.mm:
(-[WAKView _selfHandleEvent:]):
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow sendEventSynchronously:]):
2018-10-05 Ryosuke Niwa <rniwa@webkit.org>
Rename MarkupAccumulator::appendStartTag, appendElement, etc... for clarity
https://bugs.webkit.org/show_bug.cgi?id=190308
Reviewed by Darin Adler.
Renamed appendStartTag and appendEndTag to startAppendingNode and endAppendingNode since serialize any node,
not just elements which produce start and end tags.
Renamed appendElement and appendEndElement to appendStartTag and appendEndTag since that's what they do.
* editing/MarkupAccumulator.cpp:
(WebCore::elementCannotHaveEndTag): Made this a static local function.
(WebCore::shouldSelfClose): Ditto.
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::startAppendingNode): Renamed from appendStartTag.
(WebCore::MarkupAccumulator::endAppendingNode): Renamed from appendEndElement and merged appendEndMarkup here.
(WebCore::MarkupAccumulator::appendTextSubstring): Deleted. This was only used by StyledMarkupAccumulator.
(WebCore::MarkupAccumulator::appendStringView): Added.
(WebCore::MarkupAccumulator::appendStartTag): Renamed from appendElement.
(WebCore::MarkupAccumulator::appendCloseTag):
(WebCore::MarkupAccumulator::appendNonElementNode): Renamed from appendStartMarkup. No longer serializes
an element. StyledMarkupAccumulator had a check before calling this function already so this clarifies
the purpose of this function.
(WebCore::MarkupAccumulator::appendElement): Deleted.
(WebCore::MarkupAccumulator::appendEndMarkup): Deleted. Merged into appendEndTag.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::appendNodeEnd): Renamed from appendEndTag.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::wrapWithNode):
(WebCore::StyledMarkupAccumulator::appendStartTag): Renamed from appendElement.
(WebCore::StyledMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Use String::substring directly instead of
going through appendTextSubstring which has been deleted.
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Renamed from appendElement.
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndTag): Renamed from appendEndElement.
2018-10-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix the build with current SDKs.
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::getPublicKeyComponents):
2018-10-10 Brent Fulgham <bfulgham@apple.com>
Only report the supported WebGL version
https://bugs.webkit.org/show_bug.cgi?id=190434
<rdar://problem/45024677>
Reviewed by Dean Jackson.
Tested by fast/canvas/webgl/gl-getstring.html
Revise getParameter(gl.VERSION) to only return the WebGL version without the hardware and
driver-specific details available through the low-level OpenGL driver interface. These details
are not needed for WebGL use and expose information about the user's system that we do not
need to share.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Unreviewed, add missing headers for inline functions
https://bugs.webkit.org/show_bug.cgi?id=190429
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
2018-10-10 Tim Horton <timothy_horton@apple.com>
Share more WKShareSheet code between macOS and iOS, and fix a few bugs
https://bugs.webkit.org/show_bug.cgi?id=190420
Reviewed by Simon Fraser.
Test: fast/web-share/share-with-no-url.html
* page/Navigator.cpp:
(WebCore::Navigator::share):
* page/ShareData.h:
Make 'url' an optional field on ShareDataWithParsedURL, and don't
reject the share() promise if the URL is totally empty (as opposed to invalid).
2018-10-10 Devin Rousso <drousso@apple.com>
Web Inspector: notify the frontend when a canvas has started recording via console.record
https://bugs.webkit.org/show_bug.cgi?id=190306
Reviewed by Brian Burg.
Updated existing tests: LayoutTests/inspector/canvas/recording-2d.html
LayoutTests/inspector/canvas/recording-bitmaprenderer.html
LayoutTests/inspector/canvas/recording-webgl-snapshots.html
LayoutTests/inspector/canvas/recording-webgl.html
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
* inspector/InspectorCanvas.h:
Default `singleFrame` to false to better match the default behaviour of other `console`
functions (`profile` doesn't stop until `profileEnd` is called, so the same should be true
of `record` and `recordEnd`).
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
[JSC] Rename createXXX to tryCreateXXX if it can return RefPtr
https://bugs.webkit.org/show_bug.cgi?id=190429
Reviewed by Saam Barati.
Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check.
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::cachedKeyForKeyID const):
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext):
* Modules/webaudio/AudioBuffer.cpp:
(WebCore::AudioBuffer::AudioBuffer):
(WebCore::AudioBuffer::getChannelData):
* Modules/webvr/VREyeParameters.cpp:
(WebCore::VREyeParameters::offset const):
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
* Modules/webvr/VRPose.cpp:
(WebCore::optionalFloat3ToJSCArray):
(WebCore::VRPose::position const):
(WebCore::VRPose::orientation const):
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::sittingToStandingTransform const):
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readArrayBufferView):
* crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
(WebCore::CryptoKeyRSA::algorithm const):
* crypto/mac/CryptoKeyRSAMac.cpp:
(WebCore::CryptoKeyRSA::algorithm const):
* css/DOMMatrixReadOnly.cpp:
(WebCore::DOMMatrixReadOnly::toFloat32Array const):
(WebCore::DOMMatrixReadOnly::toFloat64Array const):
* css/FontFace.cpp:
(WebCore::FontFace::create):
* dom/TextEncoder.cpp:
(WebCore::TextEncoder::encode const):
* html/ImageData.cpp:
(WebCore::ImageData::ImageData):
* html/ImageData.h:
(WebCore::ImageData::data const):
(): Deleted.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::getParameter):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getParameter):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter):
(WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
(WebCore::CDMSessionAVFoundationCF::generateKeyRequest):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
(WebCore::CDMSessionAVContentKeySession::releaseKeys):
(WebCore::CDMSessionAVContentKeySession::update):
(WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::generateKeyRequest):
(WebCore::CDMSessionAVStreamSession::releaseKeys):
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::getRGBAImageData const):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::getImageData):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData const):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::unmultipliedResult):
(WebCore::FilterEffect::premultipliedResult):
(WebCore::FilterEffect::copyUnmultipliedResult):
(WebCore::FilterEffect::copyPremultipliedResult):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData const):
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext):
* platform/mock/mediasource/MockBox.cpp:
(WebCore::MockBox::peekType):
(WebCore::MockBox::peekLength):
(WebCore::MockTrackBox::MockTrackBox):
(WebCore::MockInitializationBox::MockInitializationBox):
(WebCore::MockSampleBox::MockSampleBox):
* rendering/shapes/Shape.cpp:
(WebCore::Shape::createRasterShape):
* testing/LegacyMockCDM.cpp:
(WebCore::initDataPrefix):
(WebCore::keyPrefix):
(WebCore::keyRequest):
2018-10-10 Daniel Bates <dabates@apple.com>
[iOS] Compare input string to UIKeyInput constants using string comparison instead of pointer comparison
https://bugs.webkit.org/show_bug.cgi?id=190432
Reviewed by Tim Horton.
Pointer comparision is brittle. We should be more forgiving and perform string comparision
of an input string to a UIKeyInput constant.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping):
2018-10-10 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236802.
Working on getting the HTML spec updated instead
(https://github.com/whatwg/html/pull/4079)
Reverted changeset:
"Passing noopener=NOOPENER to window.open() should cause the
new window to not have an opener"
https://bugs.webkit.org/show_bug.cgi?id=190251
https://trac.webkit.org/changeset/236802
2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org>
XMLHttpRequest should use reportExtraMemoryAllocated/reportExtraMemoryVisited instead of deprecatedReportExtraMemory
https://bugs.webkit.org/show_bug.cgi?id=190279
Reviewed by Ryosuke Niwa.
This patch switches deprecatedReportExtraMemory to reportExtraMemoryAllocated/reportExtraMemoryVisited
in XMLHttpRequest. We report extra memory allocation when the readyState becomes DONE. And memoryCost
function returns the memory cost which is based on the readyState and m_responseBuilder.
We annotate XMLHttpRequest with ReportExtraMemoryCost to use reportExtraMemoryVisited automatically with
memoryCost() function.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::changeState):
(WebCore::XMLHttpRequest::abort):
(WebCore::XMLHttpRequest::internalAbort):
(WebCore::XMLHttpRequest::networkErrorTimerFired):
(WebCore::XMLHttpRequest::memoryCost const):
(WebCore::XMLHttpRequest::didFinishLoading):
(WebCore::XMLHttpRequest::didReachTimeout):
(WebCore::XMLHttpRequest::dropProtection): Deleted.
* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.idl:
2018-10-09 Antoine Quint <graouts@apple.com>
Remove the frames() timing function
https://bugs.webkit.org/show_bug.cgi?id=190034
<rdar://problem/44827544>
Reviewed by Dean Jackson.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSFramesTimingFunctionValue::customCSSText const): Deleted.
(WebCore::CSSFramesTimingFunctionValue::equals const): Deleted.
* css/CSSTimingFunctionValue.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isStepsTimingFunctionValue const):
(WebCore::CSSValue::isFramesTimingFunctionValue const): Deleted.
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationTimingFunction):
(WebCore::consumeFrames): Deleted.
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
(WebCore::TimingFunction::createFromCSSValue):
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::isStepsTimingFunction const):
(WebCore::TimingFunction::isFramesTimingFunction const): Deleted.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
(WebCore::animationHasFramesTimingFunction): Deleted.
2018-10-09 Devin Rousso <drousso@apple.com>
Web Inspector: show redirect requests in Network and Timelines tabs
https://bugs.webkit.org/show_bug.cgi?id=150005
<rdar://problem/5378164>
Reviewed by Joseph Pecoraro.
Updated existing test http/tests/inspector/network/resource-timing.html.
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::didFinishLoading):
Add missing fields for `Network.types.ResourceTiming`.
2018-10-09 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only
https://bugs.webkit.org/show_bug.cgi?id=190411
Reviewed by Simon Fraser.
Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html
When changing the attributes of the SVGLangSpace, we should invalidate
the renderer of the SVGGeometryElement descendant only. Renderer of other
elements, like SVGStopElement, should not be invalidated because they do
not have geometry and they can be used as resources for drawing another
SVGGeometryElement.
* svg/SVGElement.h:
(WebCore::SVGElement::isSVGGeometryElement const):
* svg/SVGGeometryElement.h:
(isType):
* svg/SVGLangSpace.cpp:
(WebCore::SVGLangSpace::svgAttributeChanged):
2018-10-09 Chris Dumez <cdumez@apple.com>
Anchor target should be ignored on activation when the download attribute is set
https://bugs.webkit.org/show_bug.cgi?id=190408
Reviewed by Geoffrey Garen.
Anchor target should be ignored on activation when the download attribute is set:
- https://html.spec.whatwg.org/#the-a-element:downloading-hyperlinks-2
When the download attribute is set, we should use the "download the hyperlink" algorithm [1]
instead of the "follow the hyperlink" [2] algorithm.
Note that the "download the hyperlink" triggers a download and ignores the target attribute
entirely.
This is important as an anchor element with target=_blank and the download attribute set may
fail because of Safari's popup blocker if we do not disregard the anchor target.
[1] https://html.spec.whatwg.org/#downloading-hyperlinks
[2] https://html.spec.whatwg.org/#following-hyperlinks-2
Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-base-target-popup-not-allowed.html
fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-popup-not-allowed.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
2018-10-09 Michael Catanzaro <mcatanzaro@igalia.com>
[WPE][GTK] Complex text crashes with harfbuzz 1.8.8
https://bugs.webkit.org/show_bug.cgi?id=190409
Reviewed by Žan Doberšek.
We discovered that harfbuzz 1.8.8 breaks WebKit by changing the ownership semantics of
hb_icu_get_unicode_funcs() from (transfer full) to (transfer none). Our code was actually
expecting (transfer none), so it's not immediately clear to me why it's crashing now, but
doesn't matter as Behdad recommends removing this line of code because it hasn't been
been needed for many years.
This should be covered by all our complex text tests if the bots were upgraded to the newer
harfbuzz.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-10-09 Daniel Bates <dabates@apple.com>
[iOS] Cleanup EventHandler::passSubframeEventToSubframe()
https://bugs.webkit.org/show_bug.cgi?id=190390
Reviewed by Wenson Hsieh.
Unindent case statements in switch block and use more auto.
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::passSubframeEventToSubframe):
2018-10-09 Daniel Bates <dabates@apple.com>
Cleanup WebEvent.mm
https://bugs.webkit.org/show_bug.cgi?id=190391
Reviewed by Wenson Hsieh.
Unindent case statements in switch blocks.
* platform/ios/WebEvent.mm:
(-[WebEvent _typeDescription]):
(-[WebEvent _modiferFlagsDescription]):
(-[WebEvent _touchPhaseDescription:]):
(-[WebEvent _eventDescription]):
2018-10-09 Oriol Brufau <obrufau@igalia.com>
Resolve inset properties to computed style when there is overconstraintment
https://bugs.webkit.org/show_bug.cgi?id=188711
Reviewed by Manuel Rego Casasnovas.
This patch makes WebKit behave closer to Blink. Specifically,
- In overconstrained relative or absolute positioning, inset properties resolve
to the computed value (absolutizing percentages) instead of to the used value.
- In fixed positioning, the resolved value of non-'auto' values is no longer
increased by the border of the containg block.
This patch can slighlty alter the resolved value if it's a long decimal number.
Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-absolute.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-fixed.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-nobox.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-relative.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-static.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::positionOffsetValue):
* rendering/RenderBox.h:
2018-10-09 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import CTAP HID message and packet structure from Chromium
https://bugs.webkit.org/show_bug.cgi?id=189289
<rdar://problem/44120310>
Reviewed by Brent Fulgham.
This patch imports CTAP HID message and packet structure:
https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-and-packet-structure
from Chromium. With this library, WebKit can now turn binaries into messages that CTAP devices could understand.
This patch contains the following Chromium files and modifies them to fit into WebKit:
https://cs.chromium.org/chromium/src/device/fido/fido_constants.cc?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/fido_constants.h?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.cc?l=1&rcl=387f3725de2842e0e6b7175a9b2ed472b0cf781a
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message_unittest.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75
Covered by API tests.
* Modules/webauthn/fido/FidoConstants.cpp: Added.
(fido::isFidoHidDeviceCommand):
* Modules/webauthn/fido/FidoConstants.h: Added.
* Modules/webauthn/fido/FidoHidMessage.cpp: Added.
(fido::FidoHidMessage::create):
(fido::FidoHidMessage::createFromSerializedData):
(fido::FidoHidMessage::messageComplete const):
(fido::FidoHidMessage::getMessagePayload const):
(fido::FidoHidMessage::popNextPacket):
(fido::FidoHidMessage::addContinuationPacket):
(fido::FidoHidMessage::numPackets const):
(fido::FidoHidMessage::FidoHidMessage):
* Modules/webauthn/fido/FidoHidMessage.h: Added.
* Modules/webauthn/fido/FidoHidPacket.cpp: Added.
(fido::FidoHidPacket::FidoHidPacket):
(fido::FidoHidInitPacket::createFromSerializedData):
(fido::FidoHidInitPacket::FidoHidInitPacket):
(fido::FidoHidInitPacket::getSerializedData const):
(fido::FidoHidContinuationPacket::createFromSerializedData):
(fido::FidoHidContinuationPacket::FidoHidContinuationPacket):
(fido::FidoHidContinuationPacket::getSerializedData const):
* Modules/webauthn/fido/FidoHidPacket.h: Added.
* Modules/webauthn/fido/FidoParsingUtils.cpp: Added.
(fido::getInitPacketData):
(fido::getContinuationPacketData):
* Modules/webauthn/fido/FidoParsingUtils.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-10-09 Carlos Eduardo Ramalho <cadubentzen@gmail.com>
[CoordGraphics] Remove the 'previous backing store' logic
https://bugs.webkit.org/show_bug.cgi?id=188838
Reviewed by Žan Doberšek.
Remove previousBackingStore from LayerState, since it's not needed anymore.
When there is scale adjustment, we now simply discard mainBackingStore and
recreate a new one.
No new tests required.
* platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
(WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
2018-10-09 Antti Koivisto <antti@apple.com>
[PSON] Prewarm system UI font
https://bugs.webkit.org/show_bug.cgi?id=190397
Reviewed by Geoffrey Garen.
Cache system UI font fallbacks. Almost every web process needs these.
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::prewarmGlobally):
2018-10-09 Chris Dumez <cdumez@apple.com>
REGRESSION (Safari 12): Download of Blob URL fails
https://bugs.webkit.org/show_bug.cgi?id=190351
<rdar://problem/45091181>
Reviewed by Geoffrey Garen.
When using both the download attribute and target="_blank" on an anchor element, we would
mistakenly drop the download attribute after the "new window" policy decision has been made.
As a result, we would try to load the blob instead of downloading it.
Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2018-10-09 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] r236735 has some dead ASSERTs that need to be moved
https://bugs.webkit.org/show_bug.cgi?id=190394
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::createOptionalParserForFormat):
2018-10-09 Chris Dumez <cdumez@apple.com>
Have DOMWindow get its frame from its document
https://bugs.webkit.org/show_bug.cgi?id=190389
Reviewed by Geoff Garen.
Have DOMWindow get its frame from its document instead of having its own m_frame which can potentially
be out-of-sync.
* dom/Document.cpp:
(WebCore::Document::frameDestroyed):
(WebCore::Document::willDetachPage):
(WebCore::Document::attachToCachedFrame):
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
(WebCore::ContextDestructionObserver):
(WebCore::DOMWindow::didSecureTransitionTo):
(WebCore::DOMWindow::frameDestroyed):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::reconnectDOMWindowProperties):
(WebCore::DOMWindow::isCurrentlyDisplayedInFrame const):
(WebCore::DOMWindow::collectMatchingElementsInFlatTree):
(WebCore::DOMWindow::matchingElementInFlatTree):
(WebCore::DOMWindow::orientation const):
(WebCore::DOMWindow::console const):
(WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld):
(WebCore::DOMWindow::webkitNamespace):
(WebCore::DOMWindow::postMessage):
(WebCore::DOMWindow::postMessageTimerFired):
(WebCore::DOMWindow::frameElement const):
(WebCore::DOMWindow::focus):
(WebCore::DOMWindow::blur):
(WebCore::DOMWindow::close):
(WebCore::DOMWindow::print):
(WebCore::DOMWindow::stop):
(WebCore::DOMWindow::alert):
(WebCore::DOMWindow::confirm):
(WebCore::DOMWindow::prompt):
(WebCore::DOMWindow::find const):
(WebCore::DOMWindow::outerHeight const):
(WebCore::DOMWindow::outerWidth const):
(WebCore::DOMWindow::innerHeight const):
(WebCore::DOMWindow::innerWidth const):
(WebCore::DOMWindow::screenX const):
(WebCore::DOMWindow::screenY const):
(WebCore::DOMWindow::scrollX const):
(WebCore::DOMWindow::scrollY const):
(WebCore::DOMWindow::closed const):
(WebCore::DOMWindow::length const):
(WebCore::DOMWindow::name const):
(WebCore::DOMWindow::setName):
(WebCore::DOMWindow::setStatus):
(WebCore::DOMWindow::setDefaultStatus):
(WebCore::DOMWindow::self const):
(WebCore::DOMWindow::opener const):
(WebCore::DOMWindow::disownOpener):
(WebCore::DOMWindow::parent const):
(WebCore::DOMWindow::top const):
(WebCore::DOMWindow::getMatchedCSSRules const):
(WebCore::DOMWindow::devicePixelRatio const):
(WebCore::DOMWindow::scrollBy const):
(WebCore::DOMWindow::scrollTo const):
(WebCore::DOMWindow::allowedToChangeWindowGeometry const):
(WebCore::DOMWindow::moveBy const):
(WebCore::DOMWindow::moveTo const):
(WebCore::DOMWindow::resizeBy const):
(WebCore::DOMWindow::resizeTo const):
(WebCore::DOMWindow::clearTimeout):
(WebCore::DOMWindow::isSameSecurityOriginAsMainFrame const):
(WebCore::DOMWindow::finishedLoading):
(WebCore::DOMWindow::setLocation):
(WebCore::DOMWindow::open):
(WebCore::DOMWindow::showModalDialog):
(WebCore::DOMWindow::frame const):
(WebCore::FrameDestructionObserver): Deleted.
(WebCore::DOMWindow::willDetachPage): Deleted.
(WebCore::DOMWindow::detachFromFrame): Deleted.
(WebCore::DOMWindow::attachToFrame): Deleted.
* page/DOMWindow.h:
2018-10-09 Jer Noble <jer.noble@apple.com>
ISOTrackEncryptionBox returns incorrect defaultKeyID
https://bugs.webkit.org/show_bug.cgi?id=190368
Reviewed by Eric Carlson.
Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/iso/ISOBox.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
(WebCore::ISOTrackEncryptionBox::parse):
* platform/graphics/iso/ISOTrackEncryptionBox.h:
2018-10-09 Youenn Fablet <youenn@apple.com>
Add support for IceCandidate stats
https://bugs.webkit.org/show_bug.cgi?id=190329
Reviewed by Eric Carlson.
Convert IceCandidate stats gathered by libwebrtc.
Since networkType might be sensitive information, we currently do not expose it.
We do not expose address either if it is a host or prflx candidate.
Test: webrtc/candidate-stats.html
* Modules/mediastream/RTCStatsReport.h:
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::iceCandidateState):
(WebCore::fillRTCIceCandidateStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
2018-10-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Stealing cross-origin video pixel with HLS
https://bugs.webkit.org/show_bug.cgi?id=190003
Reviewed by Xabier Rodriguez-Calvar.
Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH,
SmoothStreaming) fragments as tainted if their origin differs from
the manifest SecurityOrigin. SecurityOrigins are stored in the
CachedResourceStreamingClient implemented in the internal
GStreamer HTTP(S) source element.
The implementation is not ideal yet because the fragments download
is performed by the WebProcess, until bug 189967 is fixed. When
this bug is fixed, the m_hasTaintedOrigin member variable should
be removed and all checks be done unconditionally to the
webkithttpsrc element which will manage the download of the
manifests and fragments.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the
fragment URL from the adaptivedemux stats message and check if its
origin is tainted.
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const):
Initial implementation by checking the m_hasTaintedOrigin member
variable value.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::responseReceived): Store the
resource origin internally so it can be checked later on by
webKitSrtcWouldTaintOrigin().
(webKitSrcWouldTaintOrigin): Check given origin against cached
origins. This implementation is similar to Cocoa's
WebCoreNSURLSession implementation.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2018-10-09 Antti Koivisto <antti@apple.com>
Prewarm FontDatabase on process swap
https://bugs.webkit.org/show_bug.cgi?id=190312
Reviewed by Chris Dumez.
Implement basic prewarming of FontDatabase. When the domain of the first page load on
a new process is known we pass the list of font families previous used by that domain to the
process. This is used to prewarm CoreText font database. Initialization (which involves lots of
blocking IPC) happens outside the main thread so the fonts are ready to use when needed.
* WebCore.xcodeproj/project.pbxproj:
* page/PrewarmInformation.h: Added.
(WebCore::PrewarmInformation::encode const):
(WebCore::PrewarmInformation::decode):
Add data structure for prewarm information with encode/decode support.
* page/ProcessWarming.cpp:
(WebCore::ProcessWarming::collectPrewarmInformation):
(WebCore::ProcessWarming::prewarmWithInformation):
Prewarming interface to be used from WebKit.
* page/ProcessWarming.h:
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::collectPrewarmInformation const):
(WebCore::FontCache::prewarm):
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::FontDatabase::clear):
Add mutex for thread safe access.
(WebCore::FontCache::createFontPlatformData):
(WebCore::FontCache::collectPrewarmInformation const):
Collect font families seen by this process.
(WebCore::FontCache::prewarm):
Prewarm FontDatabase in a dispatch queue.
2018-10-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Cocoa] [WK2] Add support for text alignment and text lists in font attributes
https://bugs.webkit.org/show_bug.cgi?id=190342
<rdar://problem/44767118>
Reviewed by Tim Horton.
Adds support for computing and encoding information about text alignment and enclosing list elements in the font
attributes dictionary, exposed to the UI delegate on Cocoa platforms. This is exposed through NSParagraphStyle,
which contains properties for both `NSTextAlignment` and an array of enclosing `NSTextList` objects.
Test: FontAttributes.NestedTextListsWithHorizontalAlignment
FontAttributes.FontAttributesAfterChangingSelection
* editing/Editor.cpp:
(WebCore::editableTextListsAtPositionInDescendingOrder):
Add a helper function to ascend the DOM, starting at the given position, in search of enclosing list elements.
For each enclosing list element we find within the scope of the editable root, we create a `TextList`
representing the list element.
(WebCore::Editor::fontAttributesAtSelectionStart const):
Compute and set enclosing text lists and text alignment. For text alignment, we convert the initial text-align
value, `start`, to NSTextAlignmentNatural (the default text alignment type on Cocoa platforms); other values
then map to Left, Right, Center, and Justified as expected (taking direction into account).
* editing/FontAttributes.h:
(WebCore::TextList::encode const):
(WebCore::TextList::decode):
Introduce TextList, a platform-agnostic representation of an unordered or ordered list. On Cocoa, this can be
used to construct a corresponding NSTextList.
* editing/cocoa/FontAttributesCocoa.mm:
(WebCore::cocoaTextListMarkerName):
Attempt to map a WebCore list style type to a `NSTextListMarker*` constant. While most of the Cocoa marker
formats have a corresponding web-exposed list style type, many web-exposed types have no Cocoa equivalent; as
such, fall back to default marker formats: "{disc}" for unordered lists and "{decimal}" for ordered lists.
(WebCore::TextList::createTextList const):
(WebCore::FontAttributes::createDictionary const):
Include an NSParagraphStyle in the dictionary of font attributes that includes information about text alignment
and enclosing text lists (per Cocoa convention, in order from outermost list to innermost list).
2018-10-08 Justin Fan <justin_fan@apple.com>
WebGPU: Rename old WebGPU prototype to WebMetal
https://bugs.webkit.org/show_bug.cgi?id=190325
<rdar://problem/44990443>
Reviewed by Dean Jackson.
Existing WebGPU tests also renamed to reflect WebGPU -> WebMetal change.
Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface.
* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSWebMetalRenderingContextCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderingContextCustom.cpp.
(WebCore::JSWebMetalRenderingContext::visitAdditionalChildren):
* bindings/js/WebCoreBuiltinNames.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasContext):
* dom/Document.h:
* dom/Document.idl:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::getContext):
(WebCore::HTMLCanvasElement::isWebMetalType):
(WebCore::HTMLCanvasElement::createContextWebMetal):
(WebCore::HTMLCanvasElement::getContextWebMetal):
(WebCore::HTMLCanvasElement::isWebGPUType): Deleted.
(WebCore::HTMLCanvasElement::createContextWebGPU): Deleted.
(WebCore::HTMLCanvasElement::getContextWebGPU): Deleted.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.idl:
* html/canvas/CanvasRenderingContext.h:
(WebCore::CanvasRenderingContext::isWebMetal const):
(WebCore::CanvasRenderingContext::isWebGPU const): Deleted.
* html/canvas/WebGPURenderingContext.cpp: Removed.
* html/canvas/WebMetalBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.cpp.
(WebCore::WebMetalBuffer::create):
(WebCore::WebMetalBuffer::WebMetalBuffer):
* html/canvas/WebMetalBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.h.
* html/canvas/WebMetalBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.idl.
* html/canvas/WebMetalCommandBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp.
(WebCore::WebMetalCommandBuffer::create):
(WebCore::WebMetalCommandBuffer::WebMetalCommandBuffer):
(WebCore::WebMetalCommandBuffer::~WebMetalCommandBuffer):
(WebCore::WebMetalCommandBuffer::commit):
(WebCore::WebMetalCommandBuffer::presentDrawable):
(WebCore::WebMetalCommandBuffer::createRenderCommandEncoderWithDescriptor):
(WebCore::WebMetalCommandBuffer::createComputeCommandEncoder):
(WebCore::WebMetalCommandBuffer::completed):
* html/canvas/WebMetalCommandBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.h.
* html/canvas/WebMetalCommandBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl.
* html/canvas/WebMetalCommandQueue.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.cpp.
(WebCore::WebMetalCommandQueue::create):
(WebCore::WebMetalCommandQueue::WebMetalCommandQueue):
(WebCore::WebMetalCommandQueue::createCommandBuffer):
* html/canvas/WebMetalCommandQueue.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.h.
* html/canvas/WebMetalCommandQueue.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.idl.
* html/canvas/WebMetalComputeCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.cpp.
(WebCore::GPUSizeMake):
(WebCore::WebMetalComputeCommandEncoder::create):
(WebCore::WebMetalComputeCommandEncoder::WebMetalComputeCommandEncoder):
(WebCore::WebMetalComputeCommandEncoder::setComputePipelineState):
(WebCore::WebMetalComputeCommandEncoder::setBuffer):
(WebCore::WebMetalComputeCommandEncoder::dispatch):
(WebCore::WebMetalComputeCommandEncoder::endEncoding):
* html/canvas/WebMetalComputeCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.h.
* html/canvas/WebMetalComputeCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.idl.
* html/canvas/WebMetalComputePipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.cpp.
(WebCore::WebMetalComputePipelineState::create):
(WebCore::WebMetalComputePipelineState::WebMetalComputePipelineState):
* html/canvas/WebMetalComputePipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.h.
* html/canvas/WebMetalComputePipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.idl.
* html/canvas/WebMetalDepthStencilDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.cpp.
(WebCore::WebMetalDepthStencilDescriptor::create):
(WebCore::WebMetalDepthStencilDescriptor::depthWriteEnabled const):
(WebCore::WebMetalDepthStencilDescriptor::setDepthWriteEnabled):
(WebCore::WebMetalDepthStencilDescriptor::depthCompareFunction const):
(WebCore::WebMetalDepthStencilDescriptor::setDepthCompareFunction):
* html/canvas/WebMetalDepthStencilDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.h.
* html/canvas/WebMetalDepthStencilDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.idl.
* html/canvas/WebMetalDepthStencilState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.cpp.
(WebCore::WebMetalDepthStencilState::create):
(WebCore::WebMetalDepthStencilState::WebMetalDepthStencilState):
(WebCore::WebMetalDepthStencilState::label const):
(WebCore::WebMetalDepthStencilState::setLabel):
* html/canvas/WebMetalDepthStencilState.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.h.
* html/canvas/WebMetalDepthStencilState.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.idl.
* html/canvas/WebMetalDrawable.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.cpp.
(WebCore::WebMetalDrawable::create):
(WebCore::WebMetalDrawable::WebMetalDrawable):
* html/canvas/WebMetalDrawable.h: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.h.
(WebCore::WebMetalDrawable::texture):
* html/canvas/WebMetalDrawable.idl: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.idl.
* html/canvas/WebMetalEnums.cpp: Renamed from Source/WebCore/html/canvas/WebGPUEnums.cpp.
(WebCore::toWebMetalCompareFunction):
(WebCore::web3DCompareFunctionName):
(WebCore::toGPUCompareFunction):
* html/canvas/WebMetalEnums.h: Renamed from Source/WebCore/html/canvas/WebGPUEnums.h.
* html/canvas/WebMetalEnums.idl: Renamed from Source/WebCore/html/canvas/WebGPUEnums.idl.
* html/canvas/WebMetalFunction.cpp: Renamed from Source/WebCore/html/canvas/WebGPUFunction.cpp.
(WebCore::WebMetalFunction::create):
(WebCore::WebMetalFunction::WebMetalFunction):
* html/canvas/WebMetalFunction.h: Renamed from Source/WebCore/html/canvas/WebGPUFunction.h.
* html/canvas/WebMetalFunction.idl: Renamed from Source/WebCore/html/canvas/WebGPUFunction.idl.
* html/canvas/WebMetalLibrary.cpp: Renamed from Source/WebCore/html/canvas/WebGPULibrary.cpp.
(WebCore::WebMetalLibrary::create):
(WebCore::WebMetalLibrary::WebMetalLibrary):
(WebCore::WebMetalLibrary::functionNames const):
(WebCore::WebMetalLibrary::functionWithName const):
* html/canvas/WebMetalLibrary.h: Renamed from Source/WebCore/html/canvas/WebGPULibrary.h.
* html/canvas/WebMetalLibrary.idl: Renamed from Source/WebCore/html/canvas/WebGPULibrary.idl.
* html/canvas/WebMetalRenderCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.cpp.
(WebCore::WebMetalRenderCommandEncoder::create):
(WebCore::WebMetalRenderCommandEncoder::WebMetalRenderCommandEncoder):
(WebCore::WebMetalRenderCommandEncoder::setRenderPipelineState):
(WebCore::WebMetalRenderCommandEncoder::setDepthStencilState):
(WebCore::WebMetalRenderCommandEncoder::setVertexBuffer):
(WebCore::WebMetalRenderCommandEncoder::setFragmentBuffer):
(WebCore::WebMetalRenderCommandEncoder::drawPrimitives):
(WebCore::WebMetalRenderCommandEncoder::endEncoding):
* html/canvas/WebMetalRenderCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.h.
* html/canvas/WebMetalRenderCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.idl.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPassAttachmentDescriptor::WebMetalRenderPassAttachmentDescriptor):
(WebCore::WebMetalRenderPassAttachmentDescriptor::loadAction const):
(WebCore::WebMetalRenderPassAttachmentDescriptor::setLoadAction):
(WebCore::WebMetalRenderPassAttachmentDescriptor::storeAction const):
(WebCore::WebMetalRenderPassAttachmentDescriptor::setStoreAction):
(WebCore::WebMetalRenderPassAttachmentDescriptor::texture const):
(WebCore::WebMetalRenderPassAttachmentDescriptor::setTexture):
* html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::create):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::WebMetalRenderPassColorAttachmentDescriptor):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::descriptor const):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::clearColor const):
(WebCore::WebMetalRenderPassColorAttachmentDescriptor::setClearColor):
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::create):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::WebMetalRenderPassDepthAttachmentDescriptor):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::clearDepth const):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::setClearDepth):
(WebCore::WebMetalRenderPassDepthAttachmentDescriptor::descriptor const):
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPassDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.cpp.
(WebCore::WebMetalRenderPassDescriptor::create):
(WebCore::WebMetalRenderPassDescriptor::depthAttachment):
(WebCore::WebMetalRenderPassDescriptor::colorAttachments):
* html/canvas/WebMetalRenderPassDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.h.
* html/canvas/WebMetalRenderPassDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.idl.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp.
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::create):
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::WebMetalRenderPipelineColorAttachmentDescriptor):
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::pixelFormat const):
(WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::setPixelFormat):
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h.
* html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl.
* html/canvas/WebMetalRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.cpp.
(WebCore::WebMetalRenderPipelineDescriptor::create):
(WebCore::WebMetalRenderPipelineDescriptor::vertexFunction const):
(WebCore::WebMetalRenderPipelineDescriptor::setVertexFunction):
(WebCore::WebMetalRenderPipelineDescriptor::fragmentFunction const):
(WebCore::WebMetalRenderPipelineDescriptor::setFragmentFunction):
(WebCore::WebMetalRenderPipelineDescriptor::colorAttachments):
(WebCore::WebMetalRenderPipelineDescriptor::depthAttachmentPixelFormat const):
(WebCore::WebMetalRenderPipelineDescriptor::setDepthAttachmentPixelFormat):
(WebCore::WebMetalRenderPipelineDescriptor::reset):
* html/canvas/WebMetalRenderPipelineDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.h.
* html/canvas/WebMetalRenderPipelineDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.idl.
* html/canvas/WebMetalRenderPipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.cpp.
(WebCore::WebMetalRenderPipelineState::create):
(WebCore::WebMetalRenderPipelineState::WebMetalRenderPipelineState):
(WebCore::WebMetalRenderPipelineState::label const):
(WebCore::WebMetalRenderPipelineState::setLabel):
* html/canvas/WebMetalRenderPipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.h.
* html/canvas/WebMetalRenderPipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.idl.
* html/canvas/WebMetalRenderingContext.cpp: Added.
(WebCore::WebMetalRenderingContext::create):
(WebCore::WebMetalRenderingContext::WebMetalRenderingContext):
(WebCore::WebMetalRenderingContext::canvas const):
(WebCore::WebMetalRenderingContext::initializeNewContext):
(WebCore::WebMetalRenderingContext::clampedCanvasSize const):
(WebCore::WebMetalRenderingContext::hasPendingActivity const):
(WebCore::WebMetalRenderingContext::stop):
(WebCore::WebMetalRenderingContext::activeDOMObjectName const):
(WebCore::WebMetalRenderingContext::canSuspendForDocumentSuspension const):
(WebCore::WebMetalRenderingContext::platformLayer const):
(WebCore::WebMetalRenderingContext::markLayerComposited):
(WebCore::WebMetalRenderingContext::reshape):
(WebCore::WebMetalRenderingContext::createLibrary):
(WebCore::WebMetalRenderingContext::createRenderPipelineState):
(WebCore::WebMetalRenderingContext::createDepthStencilState):
(WebCore::WebMetalRenderingContext::createComputePipelineState):
(WebCore::WebMetalRenderingContext::createCommandQueue):
(WebCore::WebMetalRenderingContext::nextDrawable):
(WebCore::WebMetalRenderingContext::createBuffer):
(WebCore::WebMetalRenderingContext::createTexture):
* html/canvas/WebMetalRenderingContext.h: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.h.
* html/canvas/WebMetalRenderingContext.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.idl.
* html/canvas/WebMetalSize.h: Renamed from Source/WebCore/html/canvas/WebGPUSize.h.
* html/canvas/WebMetalSize.idl: Renamed from Source/WebCore/html/canvas/WebGPUSize.idl.
* html/canvas/WebMetalTexture.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTexture.cpp.
(WebCore::WebMetalTexture::create):
(WebCore::WebMetalTexture::WebMetalTexture):
* html/canvas/WebMetalTexture.h: Renamed from Source/WebCore/html/canvas/WebGPUTexture.h.
* html/canvas/WebMetalTexture.idl: Renamed from Source/WebCore/html/canvas/WebGPUTexture.idl.
* html/canvas/WebMetalTextureDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.cpp.
(WebCore::WebMetalTextureDescriptor::create):
(WebCore::WebMetalTextureDescriptor::WebMetalTextureDescriptor):
(WebCore::WebMetalTextureDescriptor::width const):
(WebCore::WebMetalTextureDescriptor::setWidth):
(WebCore::WebMetalTextureDescriptor::height const):
(WebCore::WebMetalTextureDescriptor::setHeight):
(WebCore::WebMetalTextureDescriptor::sampleCount const):
(WebCore::WebMetalTextureDescriptor::setSampleCount):
(WebCore::WebMetalTextureDescriptor::textureType const):
(WebCore::WebMetalTextureDescriptor::setTextureType):
(WebCore::WebMetalTextureDescriptor::storageMode const):
(WebCore::WebMetalTextureDescriptor::setStorageMode):
(WebCore::WebMetalTextureDescriptor::usage const):
(WebCore::WebMetalTextureDescriptor::setUsage):
* html/canvas/WebMetalTextureDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.h.
* html/canvas/WebMetalTextureDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.idl.
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::contextAsScriptValue):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebMetalEnabled):
(WebCore::RuntimeEnabledFeatures::webMetalEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted.
* platform/Logging.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
(WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa):
* platform/graphics/cocoa/WebMetalLayer.h: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.h.
* platform/graphics/cocoa/WebMetalLayer.mm: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm.
(-[WebMetalLayer initWithGPUDevice:]):
* platform/graphics/gpu/GPUBuffer.cpp:
(WebCore::GPUBuffer::~GPUBuffer):
* platform/graphics/gpu/GPUBuffer.h:
* platform/graphics/gpu/GPUCommandBuffer.cpp:
(WebCore::GPUCommandBuffer::~GPUCommandBuffer):
* platform/graphics/gpu/GPUCommandBuffer.h:
* platform/graphics/gpu/GPUCommandQueue.cpp:
(WebCore::GPUCommandQueue::~GPUCommandQueue):
* platform/graphics/gpu/GPUCommandQueue.h:
* platform/graphics/gpu/GPUComputeCommandEncoder.cpp:
(WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder):
* platform/graphics/gpu/GPUComputeCommandEncoder.h:
* platform/graphics/gpu/GPUComputePipelineState.cpp:
(WebCore::GPUComputePipelineState::~GPUComputePipelineState):
* platform/graphics/gpu/GPUComputePipelineState.h:
* platform/graphics/gpu/GPUDepthStencilDescriptor.cpp:
(WebCore::GPUDepthStencilDescriptor::~GPUDepthStencilDescriptor):
* platform/graphics/gpu/GPUDepthStencilDescriptor.h:
* platform/graphics/gpu/GPUDepthStencilState.cpp:
(WebCore::GPUDepthStencilState::~GPUDepthStencilState):
* platform/graphics/gpu/GPUDepthStencilState.h:
* platform/graphics/gpu/GPUDevice.cpp:
(WebCore::GPUDevice::~GPUDevice):
* platform/graphics/gpu/GPUDevice.h:
(WebCore::GPUDevice::layer const):
* platform/graphics/gpu/GPUDrawable.cpp:
(WebCore::GPUDrawable::~GPUDrawable):
* platform/graphics/gpu/GPUDrawable.h:
* platform/graphics/gpu/GPUEnums.h:
* platform/graphics/gpu/GPUFunction.cpp:
(WebCore::GPUFunction::~GPUFunction):
* platform/graphics/gpu/GPUFunction.h:
* platform/graphics/gpu/GPULibrary.cpp:
(WebCore::GPULibrary::~GPULibrary):
* platform/graphics/gpu/GPULibrary.h:
* platform/graphics/gpu/GPURenderCommandEncoder.cpp:
(WebCore::GPURenderCommandEncoder::~GPURenderCommandEncoder):
* platform/graphics/gpu/GPURenderCommandEncoder.h:
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp:
(WebCore::GPURenderPassAttachmentDescriptor::~GPURenderPassAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp:
(WebCore::GPURenderPassColorAttachmentDescriptor::~GPURenderPassColorAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp:
(WebCore::GPURenderPassDepthAttachmentDescriptor::~GPURenderPassDepthAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPassDescriptor.cpp:
(WebCore::GPURenderPassDescriptor::~GPURenderPassDescriptor):
* platform/graphics/gpu/GPURenderPassDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp:
(WebCore::GPURenderPipelineColorAttachmentDescriptor::~GPURenderPipelineColorAttachmentDescriptor):
* platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineDescriptor.cpp:
(WebCore::GPURenderPipelineDescriptor::~GPURenderPipelineDescriptor):
* platform/graphics/gpu/GPURenderPipelineDescriptor.h:
* platform/graphics/gpu/GPURenderPipelineState.cpp:
(WebCore::GPURenderPipelineState::~GPURenderPipelineState):
* platform/graphics/gpu/GPURenderPipelineState.h:
* platform/graphics/gpu/GPUSize.h:
* platform/graphics/gpu/GPUTexture.cpp:
(WebCore::GPUTexture::~GPUTexture):
* platform/graphics/gpu/GPUTexture.h:
* platform/graphics/gpu/GPUTextureDescriptor.cpp:
(WebCore::GPUTextureDescriptor::~GPUTextureDescriptor):
* platform/graphics/gpu/GPUTextureDescriptor.h:
* platform/graphics/metal/GPUBufferMetal.mm:
(WebCore::GPUBuffer::GPUBuffer):
* platform/graphics/metal/GPUCommandBufferMetal.mm:
* platform/graphics/metal/GPUCommandQueueMetal.mm:
* platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
* platform/graphics/metal/GPUComputePipelineStateMetal.mm:
(WebCore::GPUComputePipelineState::GPUComputePipelineState):
* platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
* platform/graphics/metal/GPUDepthStencilStateMetal.mm:
(WebCore::GPUDepthStencilState::setLabel const):
* platform/graphics/metal/GPUDeviceMetal.mm:
(WebCore::GPUDevice::reshape const):
* platform/graphics/metal/GPUDrawableMetal.mm:
(WebCore::GPUDrawable::release):
* platform/graphics/metal/GPUFunctionMetal.mm:
* platform/graphics/metal/GPULibraryMetal.mm:
(WebCore::GPULibrary::GPULibrary):
* platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
(WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder):
* platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
* platform/graphics/metal/GPURenderPipelineStateMetal.mm:
(WebCore::GPURenderPipelineState::setLabel const):
* platform/graphics/metal/GPUTextureDescriptorMetal.mm:
* platform/graphics/metal/GPUTextureMetal.mm:
(WebCore::GPUTexture::GPUTexture):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setWebMetalEnabled):
(WebCore::InternalSettings::setWebGPUEnabled): Deleted.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
2018-10-08 Dean Jackson <dino@apple.com>
CrashTracer: backboardd at Recursion :: QuartzCore: CA::Render::Updater::prepare_sublayer0
https://bugs.webkit.org/show_bug.cgi?id=190376
<rdar://problem/44986520>
Reviewed by Tim Horton.
Very deep CoreAnimation layer trees can cause problems. Reduce our maximum
depth from 256 to 128.
Modified existing test: compositing/layer-creation/deep-tree.html
* platform/graphics/ca/GraphicsLayerCA.cpp: Cap the depth at 128.
2018-10-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236941.
https://bugs.webkit.org/show_bug.cgi?id=190374
Causing API test failures in new test (Requested by jernoble
on #webkit).
Reverted changeset:
"ISOTrackEncryptionBox returns incorrect defaultKeyID"
https://bugs.webkit.org/show_bug.cgi?id=190368
https://trac.webkit.org/changeset/236941
2018-10-08 Aditya Keerthi <akeerthi@apple.com>
Make <input type=color> a runtime enabled (on-by-default) feature
https://bugs.webkit.org/show_bug.cgi?id=189162
Reviewed by Wenson Hsieh and Tim Horton.
Enable the build-time flag INPUT_TYPE_COLOR by default and introduce a runtime-enabled feature for input type
color, also on by default.
Covered by rebaselining existing layout tests.
* Configurations/FeatureDefines.xcconfig:
* html/InputType.cpp:
(WebCore::createInputTypeFactoryMap):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const):
(WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled):
2018-10-08 Jer Noble <jer.noble@apple.com>
ISOTrackEncryptionBox returns incorrect defaultKeyID
https://bugs.webkit.org/show_bug.cgi?id=190368
Reviewed by Eric Carlson.
Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox
ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount.
Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI.
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/iso/ISOBox.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.cpp:
(WebCore::ISOTrackEncryptionBox::parse):
* platform/graphics/iso/ISOTrackEncryptionBox.h:
2018-10-08 Antti Koivisto <antti@apple.com>
Move SystemFontDatabase to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=190347
Reviewed by Chris Dumez.
Also rename it to SystemFontDatabaseCoreText as it is CoreText specific.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* page/MemoryRelease.cpp:
(WebCore::releaseNoncriticalMemory):
* page/cocoa/MemoryReleaseCocoa.mm:
Release SystemFontDatabaseCoreText directly from platform specific cleanup code.
(WebCore::platformReleaseMemory):
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::FontDescription::invalidateCaches):
(WebCore::systemFontCascadeList):
(WebCore::FontCascadeDescription::effectiveFamilyCount const):
(WebCore::FontCascadeDescription::effectiveFamilyAt const):
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue const): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash): Deleted.
(WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal): Deleted.
(): Deleted.
(WebCore::SystemFontDatabase::singleton): Deleted.
(WebCore::SystemFontDatabase::systemFontCascadeList): Deleted.
(WebCore::SystemFontDatabase::clear): Deleted.
(WebCore::SystemFontDatabase::SystemFontDatabase): Deleted.
(WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): Deleted.
(WebCore::SystemFontDatabase::removeCascadeList): Deleted.
(WebCore::SystemFontDatabase::computeCascadeList): Deleted.
(WebCore::systemFontParameters): Deleted.
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Added.
(WebCore::SystemFontDatabaseCoreText::singleton):
(WebCore::SystemFontDatabaseCoreText::SystemFontDatabaseCoreText):
(WebCore::SystemFontDatabaseCoreText::systemFontCascadeList):
(WebCore::SystemFontDatabaseCoreText::clear):
(WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior):
(WebCore::SystemFontDatabaseCoreText::removeCascadeList):
(WebCore::SystemFontDatabaseCoreText::computeCascadeList):
(WebCore::SystemFontDatabaseCoreText::systemFontParameters):
* platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Added.
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParameters):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::isHashTableDeletedValue const):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::hash):
(WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::equal):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Remove dead code: VideoFullscreenModel::isVisible()
https://bugs.webkit.org/show_bug.cgi?id=190356
Reviewed by Jon Lee.
No new tests because there is no behavior change.
Remove isVisible() since it is no longer used.
* platform/cocoa/VideoFullscreenModel.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::isVisible const): Deleted.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::isVisible const): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Remove dead code: resetMediaState.
https://bugs.webkit.org/show_bug.cgi?id=190355
Reviewed by Jon Lee.
No new tests because no behavior change.
Remove resetMediaState since it is no longer used.
* platform/cocoa/PlaybackSessionInterface.h:
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::resetMediaState): Deleted.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController resetMediaState]): Deleted.
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::resetMediaState): Deleted.
2018-10-08 Jeremy Jones <jeremyj@apple.com>
Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel.
https://bugs.webkit.org/show_bug.cgi?id=190357
Reviewed by Jon Lee.
No new tests because no behavior change.
Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel.
* platform/cocoa/VideoFullscreenModel.h:
(): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::setVideoLayerGravity):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
2018-10-08 Devin Rousso <drousso@apple.com>
Web Inspector: group media network entries by the node that triggered the request
https://bugs.webkit.org/show_bug.cgi?id=189606
<rdar://problem/44438527>
Reviewed by Brian Burg.
Test: http/tests/inspector/network/resource-initiatorNode.html
Add extra arguments to functions that create `ResourceRequest` objects for media resources so
that `initiatorNodeIdentifier` can be set for WebInspector frontend to use for grouping.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::setDisplayMode):
* loader/FrameLoader.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willLoadMediaElementURL):
Handles initial (e.g. DNT) resource requests.
* loader/ImageLoader.cpp:
(ImageLoader::updateFromElement):
Handles "poster" requests.
* loader/MediaResourceLoader.cpp:
(MediaResourceLoader::requestResource):
Handles byte-range requests.
* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::loadTimerFired):
* loader/TextTrackLoader.h:
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* html/HTMLTrackElement.h:
Handles <track> (e.g. subtitle) requests.
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::identifierForNode):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::identifierForNode):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::identifierForNodeImpl):
Allows callers to get a `DOM.nodeId` for the given `Node`, which is (in this patch) attached
to the `ResourceRequest` and later used by `InspectorNetworkAgent`.
* inspector/agents/InspectorNetworkAgent.h:
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
(WebCore::InspectorNetworkAgent::buildInitiatorObject):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::initiatorNodeIdentifier const):
(WebCore::ResourceRequestBase::setInitiatorNodeIdentifier):
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setAsIsolatedCopy):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::buildObjectForCanvas):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
Don't try to push the canvas' node to the frontend, as this will create a dangling node in
`InspectorDOMAgent` if the canvas' node is detached from the DOM.
2018-10-08 Andy Estes <aestes@apple.com>
[Payment Request] Requests should be aborted after details settle when the user cancels
https://bugs.webkit.org/show_bug.cgi?id=190333
Reviewed by Alex Christensen.
In Payment Request's "update a PaymentRequest's details" algorithm, user agents are expected
to disable the payment UI when PaymentRequest details are being updated by the merchant.
This is to prevent the user from accepting a payment before updated details are displayed.
Further, Payment Request's "user aborts the payment request" algorithm says that the
algorithm should be terminated prior to throwing an AbortError if the request is currently
being updated, and also that user agents SHOULD ensure this never occurs. This is based on
the assumption that payment UIs are disabled during details updates.
For Apple Pay, while it is true that a payment cannot be accepted by the user while details
are being updated by the merchant, the payment UI is not completely disabled. In particular,
the user is allowed to abort the payment while details are being updated. We need to honor
the user's request to abort without doing so in the middle of a details update.
This patch defers a user-initiated abort until after details are settled, at which point the
promise returned by show() is rejected with an AbortError. This behaves as if the details
update promise were rejected by the merchant.
Added a test case to http/tests/paymentrequest/payment-request-show-method.https.html.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::settleDetailsPromise):
(WebCore::PaymentRequest::whenDetailsSettled):
(WebCore::PaymentRequest::cancel):
* Modules/paymentrequest/PaymentRequest.h:
2018-10-08 Chris Dumez <cdumez@apple.com>
Have DOMWindowProperty get is frame from its associated DOMWindow
https://bugs.webkit.org/show_bug.cgi?id=190341
Reviewed by Alex Christensen.
Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own
m_frame that can potentially get out-of-sync.
* Modules/cache/DOMWindowCaches.cpp:
(WebCore::DOMWindowCaches::DOMWindowCaches):
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::NavigatorGeolocation):
(WebCore::NavigatorGeolocation::from):
* Modules/geolocation/NavigatorGeolocation.h:
* Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
(WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase):
* Modules/mediastream/NavigatorMediaDevices.cpp:
(WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
(WebCore::NavigatorMediaDevices::from):
* Modules/mediastream/NavigatorMediaDevices.h:
* Modules/quota/DOMWindowQuota.cpp:
(WebCore::DOMWindowQuota::DOMWindowQuota):
* Modules/quota/NavigatorStorageQuota.cpp:
(WebCore::NavigatorStorageQuota::NavigatorStorageQuota):
* Modules/quota/NavigatorStorageQuota.h:
* Modules/speech/DOMWindowSpeechSynthesis.cpp:
(WebCore::DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis):
* css/StyleMedia.cpp:
(WebCore::StyleMedia::StyleMedia):
(WebCore::StyleMedia::type const):
(WebCore::StyleMedia::matchMedium const):
* css/StyleMedia.h:
* loader/appcache/DOMApplicationCache.cpp:
(WebCore::DOMApplicationCache::DOMApplicationCache):
(WebCore::DOMApplicationCache::applicationCacheHost const):
(WebCore::DOMApplicationCache::scriptExecutionContext const):
* loader/appcache/DOMApplicationCache.h:
* page/BarProp.cpp:
(WebCore::BarProp::BarProp):
(WebCore::BarProp::visible const):
* page/BarProp.h:
(WebCore::BarProp::create):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::DOMSelection):
(WebCore::DOMSelection::visibleSelection const):
(WebCore::DOMSelection::anchorNode const):
(WebCore::DOMSelection::anchorOffset const):
(WebCore::DOMSelection::focusNode const):
(WebCore::DOMSelection::focusOffset const):
(WebCore::DOMSelection::baseNode const):
(WebCore::DOMSelection::baseOffset const):
(WebCore::DOMSelection::extentNode const):
(WebCore::DOMSelection::extentOffset const):
(WebCore::DOMSelection::isCollapsed const):
(WebCore::DOMSelection::type const):
(WebCore::DOMSelection::rangeCount const):
(WebCore::DOMSelection::collapse):
(WebCore::DOMSelection::collapseToEnd):
(WebCore::DOMSelection::collapseToStart):
(WebCore::DOMSelection::empty):
(WebCore::DOMSelection::setBaseAndExtent):
(WebCore::DOMSelection::setPosition):
(WebCore::DOMSelection::modify):
(WebCore::DOMSelection::extend):
(WebCore::DOMSelection::getRangeAt):
(WebCore::DOMSelection::removeAllRanges):
(WebCore::DOMSelection::addRange):
(WebCore::DOMSelection::deleteFromDocument):
(WebCore::DOMSelection::containsNode const):
(WebCore::DOMSelection::toString):
(WebCore::DOMSelection::shadowAdjustedNode const):
(WebCore::DOMSelection::shadowAdjustedOffset const):
(WebCore::DOMSelection::isValidForPosition const):
* page/DOMSelection.h:
(WebCore::DOMSelection::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::screen):
(WebCore::DOMWindow::history):
(WebCore::DOMWindow::locationbar):
(WebCore::DOMWindow::menubar):
(WebCore::DOMWindow::personalbar):
(WebCore::DOMWindow::scrollbars):
(WebCore::DOMWindow::statusbar):
(WebCore::DOMWindow::toolbar):
(WebCore::DOMWindow::applicationCache):
(WebCore::DOMWindow::navigator):
(WebCore::DOMWindow::location):
(WebCore::DOMWindow::visualViewport):
(WebCore::DOMWindow::webkitNamespace):
(WebCore::DOMWindow::getSelection):
(WebCore::DOMWindow::styleMedia):
* page/DOMWindow.h:
* page/DOMWindowExtension.cpp:
(WebCore::DOMWindowExtension::DOMWindowExtension):
* page/DOMWindowExtension.h:
(WebCore::DOMWindowExtension::create):
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::DOMWindowProperty):
(WebCore::DOMWindowProperty::~DOMWindowProperty):
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
(WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame):
(WebCore::DOMWindowProperty::frame const):
* page/DOMWindowProperty.h:
(WebCore::DOMWindowProperty::window const):
* page/History.cpp:
(WebCore::History::History):
(WebCore::History::length const):
(WebCore::History::scrollRestoration const):
(WebCore::History::setScrollRestoration):
(WebCore::History::stateInternal const):
(WebCore::History::go):
(WebCore::History::urlForState):
(WebCore::History::stateObjectAdded):
* page/History.h:
* page/Location.cpp:
(WebCore::Location::Location):
(WebCore::Location::url const):
(WebCore::Location::href const):
(WebCore::Location::protocol const):
(WebCore::Location::host const):
(WebCore::Location::hostname const):
(WebCore::Location::port const):
(WebCore::Location::pathname const):
(WebCore::Location::search const):
(WebCore::Location::origin const):
(WebCore::Location::ancestorOrigins const):
(WebCore::Location::hash const):
(WebCore::Location::setHref):
(WebCore::Location::setProtocol):
(WebCore::Location::setHost):
(WebCore::Location::setHostname):
(WebCore::Location::setPort):
(WebCore::Location::setPathname):
(WebCore::Location::setSearch):
(WebCore::Location::setHash):
(WebCore::Location::assign):
(WebCore::Location::replace):
(WebCore::Location::reload):
(WebCore::Location::setLocation):
* page/Location.h:
(WebCore::Location::create):
* page/Navigator.cpp:
(WebCore::Navigator::Navigator):
(WebCore::Navigator::appVersion const):
(WebCore::Navigator::userAgent const):
(WebCore::Navigator::share):
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
(WebCore::Navigator::cookieEnabled const):
(WebCore::Navigator::javaEnabled const):
(WebCore::Navigator::standalone const):
* page/Navigator.h:
* page/Performance.cpp:
(WebCore::Performance::navigation):
(WebCore::Performance::timing):
* page/PerformanceNavigation.cpp:
(WebCore::PerformanceNavigation::PerformanceNavigation):
(WebCore::PerformanceNavigation::type const):
(WebCore::PerformanceNavigation::redirectCount const):
* page/PerformanceNavigation.h:
(WebCore::PerformanceNavigation::create):
* page/PerformanceTiming.cpp:
(WebCore::PerformanceTiming::PerformanceTiming):
(WebCore::PerformanceTiming::documentLoader const):
(WebCore::PerformanceTiming::documentTiming const):
* page/PerformanceTiming.h:
(WebCore::PerformanceTiming::create):
* page/Screen.cpp:
(WebCore::Screen::Screen):
(WebCore::Screen::height const):
(WebCore::Screen::width const):
(WebCore::Screen::colorDepth const):
(WebCore::Screen::pixelDepth const):
(WebCore::Screen::availLeft const):
(WebCore::Screen::availTop const):
(WebCore::Screen::availHeight const):
(WebCore::Screen::availWidth const):
* page/Screen.h:
* page/VisualViewport.cpp:
(WebCore::VisualViewport::VisualViewport):
(WebCore::VisualViewport::scriptExecutionContext const):
(WebCore::VisualViewport::addEventListener):
(WebCore::VisualViewport::updateFrameLayout const):
(WebCore::VisualViewport::offsetLeft const):
(WebCore::VisualViewport::offsetTop const):
(WebCore::VisualViewport::pageLeft const):
(WebCore::VisualViewport::pageTop const):
(WebCore::VisualViewport::width const):
(WebCore::VisualViewport::height const):
(WebCore::VisualViewport::scale const):
(WebCore::VisualViewport::update):
(WebCore::VisualViewport::enqueueResizeEvent):
(WebCore::VisualViewport::enqueueScrollEvent):
* page/VisualViewport.h:
* page/WebKitNamespace.cpp:
(WebCore::WebKitNamespace::WebKitNamespace):
* page/WebKitNamespace.h:
(WebCore::WebKitNamespace::create):
* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
(WebCore::DOMMimeTypeArray::item):
(WebCore::DOMMimeTypeArray::namedItem):
(WebCore::DOMMimeTypeArray::getPluginData const):
* plugins/DOMMimeTypeArray.h:
(WebCore::DOMMimeTypeArray::create):
* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::DOMPluginArray):
(WebCore::DOMPluginArray::item):
(WebCore::DOMPluginArray::namedItem):
(WebCore::DOMPluginArray::refresh):
(WebCore::DOMPluginArray::pluginData const):
* plugins/DOMPluginArray.h:
(WebCore::DOMPluginArray::create):
* storage/Storage.cpp:
(WebCore::Storage::create):
(WebCore::Storage::Storage):
(WebCore::Storage::setItem):
(WebCore::Storage::removeItem):
(WebCore::Storage::clear):
* storage/Storage.h:
2018-10-08 Antti Koivisto <antti@apple.com>
Move FontCascadeDescription to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=190348
Reviewed by Chris Dumez.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontCascade.h:
* platform/graphics/FontCascadeDescription.cpp: Copied from Source/WebCore/platform/graphics/FontDescription.cpp.
(WebCore::FontDescription::FontDescription): Deleted.
(WebCore::m_shouldAllowUserInstalledFonts): Deleted.
(WebCore::FontDescription::setLocale): Deleted.
(WebCore::FontDescription::invalidateCaches): Deleted.
* platform/graphics/FontCascadeDescription.h: Copied from Source/WebCore/platform/graphics/FontDescription.h.
(WebCore::FontDescription::operator!= const): Deleted.
(WebCore::FontDescription::computedSize const): Deleted.
(WebCore::FontDescription::computedPixelSize const): Deleted.
(WebCore::FontDescription::italic const): Deleted.
(WebCore::FontDescription::stretch const): Deleted.
(WebCore::FontDescription::weight const): Deleted.
(WebCore::FontDescription::fontSelectionRequest const): Deleted.
(WebCore::FontDescription::renderingMode const): Deleted.
(WebCore::FontDescription::textRenderingMode const): Deleted.
(WebCore::FontDescription::script const): Deleted.
(WebCore::FontDescription::locale const): Deleted.
(WebCore::FontDescription::orientation const): Deleted.
(WebCore::FontDescription::nonCJKGlyphOrientation const): Deleted.
(WebCore::FontDescription::widthVariant const): Deleted.
(WebCore::FontDescription::featureSettings const): Deleted.
(WebCore::FontDescription::variationSettings const): Deleted.
(WebCore::FontDescription::fontSynthesis const): Deleted.
(WebCore::FontDescription::variantCommonLigatures const): Deleted.
(WebCore::FontDescription::variantDiscretionaryLigatures const): Deleted.
(WebCore::FontDescription::variantHistoricalLigatures const): Deleted.
(WebCore::FontDescription::variantContextualAlternates const): Deleted.
(WebCore::FontDescription::variantPosition const): Deleted.
(WebCore::FontDescription::variantCaps const): Deleted.
(WebCore::FontDescription::variantNumericFigure const): Deleted.
(WebCore::FontDescription::variantNumericSpacing const): Deleted.
(WebCore::FontDescription::variantNumericFraction const): Deleted.
(WebCore::FontDescription::variantNumericOrdinal const): Deleted.
(WebCore::FontDescription::variantNumericSlashedZero const): Deleted.
(WebCore::FontDescription::variantAlternates const): Deleted.
(WebCore::FontDescription::variantEastAsianVariant const): Deleted.
(WebCore::FontDescription::variantEastAsianWidth const): Deleted.
(WebCore::FontDescription::variantEastAsianRuby const): Deleted.
(WebCore::FontDescription::variantSettings const): Deleted.
(WebCore::FontDescription::opticalSizing const): Deleted.
(WebCore::FontDescription::fontStyleAxis const): Deleted.
(WebCore::FontDescription::shouldAllowUserInstalledFonts const): Deleted.
(WebCore::FontDescription::setComputedSize): Deleted.
(WebCore::FontDescription::setItalic): Deleted.
(WebCore::FontDescription::setStretch): Deleted.
(WebCore::FontDescription::setIsItalic): Deleted.
(WebCore::FontDescription::setWeight): Deleted.
(WebCore::FontDescription::setRenderingMode): Deleted.
(WebCore::FontDescription::setTextRenderingMode): Deleted.
(WebCore::FontDescription::setOrientation): Deleted.
(WebCore::FontDescription::setNonCJKGlyphOrientation): Deleted.
(WebCore::FontDescription::setWidthVariant): Deleted.
(WebCore::FontDescription::setFeatureSettings): Deleted.
(WebCore::FontDescription::setVariationSettings): Deleted.
(WebCore::FontDescription::setFontSynthesis): Deleted.
(WebCore::FontDescription::setVariantCommonLigatures): Deleted.
(WebCore::FontDescription::setVariantDiscretionaryLigatures): Deleted.
(WebCore::FontDescription::setVariantHistoricalLigatures): Deleted.
(WebCore::FontDescription::setVariantContextualAlternates): Deleted.
(WebCore::FontDescription::setVariantPosition): Deleted.
(WebCore::FontDescription::setVariantCaps): Deleted.
(WebCore::FontDescription::setVariantNumericFigure): Deleted.
(WebCore::FontDescription::setVariantNumericSpacing): Deleted.
(WebCore::FontDescription::setVariantNumericFraction): Deleted.
(WebCore::FontDescription::setVariantNumericOrdinal): Deleted.
(WebCore::FontDescription::setVariantNumericSlashedZero): Deleted.
(WebCore::FontDescription::setVariantAlternates): Deleted.
(WebCore::FontDescription::setVariantEastAsianVariant): Deleted.
(WebCore::FontDescription::setVariantEastAsianWidth): Deleted.
(WebCore::FontDescription::setVariantEastAsianRuby): Deleted.
(WebCore::FontDescription::setOpticalSizing): Deleted.
(WebCore::FontDescription::setFontStyleAxis): Deleted.
(WebCore::FontDescription::setShouldAllowUserInstalledFonts): Deleted.
(WebCore::FontDescription::operator== const): Deleted.
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::invalidateCaches):
(WebCore::FontCascadeDescription::FontCascadeDescription): Deleted.
(WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted.
(WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted.
(WebCore::FontCascadeDescription::lighterWeight): Deleted.
(WebCore::FontCascadeDescription::bolderWeight): Deleted.
(WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing const): Deleted.
(WebCore::FontCascadeDescription::familyNamesAreEqual): Deleted.
(WebCore::FontCascadeDescription::familyNameHash): Deleted.
(WebCore::FontCascadeDescription::foldedFamilyName): Deleted.
* platform/graphics/FontDescription.h:
(WebCore::FontCascadeDescription::operator!= const): Deleted.
(WebCore::FontCascadeDescription::familyCount const): Deleted.
(WebCore::FontCascadeDescription::firstFamily const): Deleted.
(WebCore::FontCascadeDescription::familyAt const): Deleted.
(WebCore::FontCascadeDescription::families const): Deleted.
(WebCore::FontCascadeDescription::specifiedSize const): Deleted.
(WebCore::FontCascadeDescription::isAbsoluteSize const): Deleted.
(WebCore::FontCascadeDescription::lighterWeight const): Deleted.
(WebCore::FontCascadeDescription::bolderWeight const): Deleted.
(WebCore::FontCascadeDescription::useFixedDefaultSize const): Deleted.
(WebCore::FontCascadeDescription::kerning const): Deleted.
(WebCore::FontCascadeDescription::keywordSize const): Deleted.
(WebCore::FontCascadeDescription::keywordSizeAsIdentifier const): Deleted.
(WebCore::FontCascadeDescription::fontSmoothing const): Deleted.
(WebCore::FontCascadeDescription::isSpecifiedFont const): Deleted.
(WebCore::FontCascadeDescription::setOneFamily): Deleted.
(WebCore::FontCascadeDescription::setFamilies): Deleted.
(WebCore::FontCascadeDescription::setSpecifiedSize): Deleted.
(WebCore::FontCascadeDescription::setIsAbsoluteSize): Deleted.
(WebCore::FontCascadeDescription::setKerning): Deleted.
(WebCore::FontCascadeDescription::setKeywordSize): Deleted.
(WebCore::FontCascadeDescription::setKeywordSizeFromIdentifier): Deleted.
(WebCore::FontCascadeDescription::setFontSmoothing): Deleted.
(WebCore::FontCascadeDescription::setIsSpecifiedFont): Deleted.
(WebCore::FontCascadeDescription::equalForTextAutoSizing const): Deleted.
(WebCore::FontCascadeDescription::initialItalic): Deleted.
(WebCore::FontCascadeDescription::initialFontStyleAxis): Deleted.
(WebCore::FontCascadeDescription::initialWeight): Deleted.
(WebCore::FontCascadeDescription::initialStretch): Deleted.
(WebCore::FontCascadeDescription::initialSmallCaps): Deleted.
(WebCore::FontCascadeDescription::initialKerning): Deleted.
(WebCore::FontCascadeDescription::initialFontSmoothing): Deleted.
(WebCore::FontCascadeDescription::initialTextRenderingMode): Deleted.
(WebCore::FontCascadeDescription::initialFontSynthesis): Deleted.
(WebCore::FontCascadeDescription::initialVariantPosition): Deleted.
(WebCore::FontCascadeDescription::initialVariantCaps): Deleted.
(WebCore::FontCascadeDescription::initialVariantAlternates): Deleted.
(WebCore::FontCascadeDescription::initialOpticalSizing): Deleted.
(WebCore::FontCascadeDescription::initialLocale): Deleted.
(WebCore::FontCascadeDescription::operator== const): Deleted.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* rendering/style/RenderStyle.h:
2018-10-08 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc"
https://bugs.webkit.org/show_bug.cgi?id=189239
Reviewed by Xabier Rodriguez-Calvar.
Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon.
The DRM system id field in the encrypted event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID
in case of WebM, for details, see https://bugzilla.gnome.org/attachment.cgi?id=365211.
Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html
media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::capsMediaType):
(WebCore::areEncryptedCaps):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformCaps):
2018-10-07 Dan Bernstein <mitz@apple.com>
Fixed building with the latest macOS SDK
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::ensurePlatformContext): Suppressed deprecation warnings around use of
CGIOSurfaceContextSetDisplayMask.
2018-10-06 Justin Michaud <justin_michaud@apple.com>
Properly determine if css custom property values are computationally independent
https://bugs.webkit.org/show_bug.cgi?id=190303
Reviewed by Antti Koivisto.
Add getDirectComputationalDependencies method to determine if a value is computationally
dependent. Use this method in CSS.registerProperty to replace existing substring checks.
No new tests are needed because the existing tests cover this behaviour.
* css/CSSCalculationValue.cpp:
(WebCore::determineCategory):
* css/CSSCalculationValue.h:
(WebCore::CSSCalcValue::getDirectComputationalDependencies const):
(WebCore::CSSCalcValue::getDirectRootComputationalDependencies const):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::customCSSText const):
(WebCore::CSSCustomPropertyValue::tokens const):
(WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
* css/CSSCustomPropertyValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const):
(WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const):
* css/CSSPrimitiveValue.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::getDirectComputationalDependencies const):
(WebCore::CSSValue::getDirectRootComputationalDependencies const):
* css/CSSValue.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::CSSVariableData):
(WebCore::CSSVariableData::resolveVariableReference const):
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2018-10-05 Chris Dumez <cdumez@apple.com>
Regression(r236862): Crash under DOMWindowExtension::willDetachGlobalObjectFromFrame()
https://bugs.webkit.org/show_bug.cgi?id=190320
<rdar://problem/45044814>
Reviewed by Geoffrey Garen.
r236862 caused DOMWindowProperty::willDetachGlobalObjectFromFrame() to get called several
times. There was no effect for most DOMWindowProperty objects. However, it would cause
crashes for DOMWindowExtension objects, which subclass DOMWindowProperty and override
DOMWindowProperty::willDetachGlobalObjectFromFrame() because they dereference the frame
without null checking it.
To address the issue, we now make sure DOMWindowProperty::willDetachGlobalObjectFromFrame()
is not called several times.
* dom/Document.cpp:
(WebCore::Document::detachFromFrame):
Stop calling DOMWindow::willDetachDocumentFromFrame() here as most call sites already
take care of calling DOMWindow::willDetachDocumentFromFrame() beforehand (e.g.
Document::prepareForDestruction()).
Also, return early if the Document is already detached from its frame.
(WebCore::Document::frameWasDisconnectedFromOwner):
Add new utility function called when a Frame is disconnected from its owner which
calls both Document::detachFromFrame() and DOMWindow::willDetachDocumentFromFrame().
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::willDetachDocumentFromFrame):
Return early if the Window is already detached from its frame.
* page/Frame.cpp:
(WebCore::Frame::disconnectOwnerElement):
2018-10-05 Jer Noble <jer.noble@apple.com>
Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
2018-10-05 Jer Noble <jer.noble@apple.com>
Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
2018-10-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>
Reviewed by Youenn Fablet.
No new tests, covered by existing tests.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
to base class.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
as passed salt.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
(WebCore::MediaStreamTrack::getCapabilities const): Ditto.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
to base class.
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
* platform/mediastream/MediaConstraints.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
(WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
(WebCore::RealtimeMediaSource::hashedId const): New.
(WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
a source.
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Ditto.
(WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create): Ditto.
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
(WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
(WebCore::AVVideoCaptureSource::capabilities): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create): Update parameters.
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Update parameters.
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
* platform/mock/MockRealtimeVideoSource.h:
2018-10-03 Jer Noble <jer.noble@apple.com>
Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
https://bugs.webkit.org/show_bug.cgi?id=190266
Reviewed by Eric Carlson.
Test: TestWebKitAPI.VideoQualityDisplayCompositing
Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
constructor (rather than individual fields). Add a new setting to control visibility
of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create):
(WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
* Modules/mediasource/VideoPlaybackQuality.h:
(WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
* Modules/mediasource/VideoPlaybackQuality.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* page/Settings.yaml:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
2018-10-05 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236866.
Breaks internal builds.
Reverted changeset:
"Add support for reporting "display composited video frames"
through the VideoPlaybackQuality object."
https://bugs.webkit.org/show_bug.cgi?id=190266
https://trac.webkit.org/changeset/236866
2018-10-05 Antoine Quint <graouts@apple.com>
[Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement()
https://bugs.webkit.org/show_bug.cgi?id=190307
<rdar://problem/45009901>
Reviewed by Dean Jackson.
We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already
does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no
animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel()
to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation()
will already have performed this task safely if needed.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement):
2018-10-04 Jer Noble <jer.noble@apple.com>
Add support for reporting "display composited video frames" through the VideoPlaybackQuality object.
https://bugs.webkit.org/show_bug.cgi?id=190266
Reviewed by Eric Carlson.
Test: TestWebKitAPI.VideoQualityDisplayCompositing
Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its
constructor (rather than individual fields). Add a new setting to control visibility
of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support
for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC.
* Modules/mediasource/VideoPlaybackQuality.cpp:
(WebCore::VideoPlaybackQuality::create):
(WebCore::VideoPlaybackQuality::VideoPlaybackQuality):
* Modules/mediasource/VideoPlaybackQuality.h:
(WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const):
* Modules/mediasource/VideoPlaybackQuality.idl:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:
* page/Settings.yaml:
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics):
2018-10-04 Chris Dumez <cdumez@apple.com>
A Document / Window should lose its browsing context as soon as its iframe is removed from the document
https://bugs.webkit.org/show_bug.cgi?id=190282
Reviewed by Ryosuke Niwa.
A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from
the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets
destroyed, which happens later usually after a GC happens.
Specification:
- https://html.spec.whatwg.org/#the-iframe-element
"""
When an iframe element is removed from a document, the user agent must discard the element's nested browsing
context, if it is not null, and then set the element's nested browsing context to null.
"""
This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this
patch is aligning our behavior.
In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead
get its frame from the Document. This should make the code simpler.
No new tests, rebaselined existing tests.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getUserMedia const):
* Modules/mediastream/MediaDevices.h:
Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the
document has been detached, instead of throwing an InvalidStateError. This behavior is as per
specification:
- https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4)
I needed to make this change to keep one of our layout tests passing.
* dom/Document.cpp:
(WebCore::Document::attachToCachedFrame):
(WebCore::Document::detachFromFrame):
* dom/Document.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::didSecureTransitionTo):
(WebCore::DOMWindow::willDetachDocumentFromFrame):
(WebCore::DOMWindow::setStatus):
(WebCore::DOMWindow::detachFromFrame):
(WebCore::DOMWindow::attachToFrame):
* page/DOMWindow.h:
* page/DOMWindowProperty.cpp:
(WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
(WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
* page/Frame.cpp:
(WebCore::Frame::disconnectOwnerElement):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::drawText):
Calling drawText() with a null String hits an assertion in debug. This was triggered by one of
our layout tests so I made sure we only call drawText when the String is not null.
2018-10-04 Jeremy Jones <jeremyj@apple.com>
Unify implementation in VideoFullscreenInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=190091
rdar://problem/44734523
Reviewed by Jer Noble.
No new tests because no behavior change.
Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
any changes that had been made in the old path.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
2018-10-04 Justin Michaud <justin_michaud@apple.com>
Bindings generator should support static attributes that are interfaces with CallWith
https://bugs.webkit.org/show_bug.cgi?id=190292
Reviewed by Chris Dumez.
Add support for static attributes that support callWith to the bindings generator. This
is needed for CSS.paintWorklet.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter):
(WebCore::jsTestObjConstructorTestStaticReadonlyObj):
* bindings/scripts/test/TestObj.idl:
2018-10-04 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r236730.
This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html.
Reverted changeset:
"[MediaStream] RealtimeMediaSource should be able to vend
hashed IDs"
https://bugs.webkit.org/show_bug.cgi?id=190142
https://trac.webkit.org/changeset/236730
2018-10-04 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2
https://bugs.webkit.org/show_bug.cgi?id=190289
<rdar://problem/45020806>
Reviewed by Ryosuke Niwa.
Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail.
Tests: FontManagerTests.AddFontShadowUsingFontOptions
FontManagerTests.AddAndRemoveColorsUsingFontOptions
* editing/FontAttributeChanges.cpp:
(WebCore::cssValueListForShadow):
* editing/cocoa/FontAttributesCocoa.mm:
Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may
have negative dimensions, so a check for `isZero()` should be used instead.
(WebCore::FontAttributes::createDictionary const):
* platform/mac/WebCoreNSFontManagerExtras.mm:
Fall back to a transparent background color; this allows senders to remove the current background color by just
removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the
transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a
background color).
(WebCore::computedFontAttributeChanges):
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive
https://bugs.webkit.org/show_bug.cgi?id=190277
Reviewed by Antti Koivisto.
The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records.
Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of
the root nodes of the target, addedNodes, and removedNodes in each mutation record.
Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSMutationRecordCustom.cpp: Added.
(WebCore::JSMutationRecord::visitAdditionalChildren): Added.
* bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file
where using namespace JSC was defined. Use the fully qualified names to refer to JSC types.
(WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
* dom/MutationRecord.cpp:
(WebCore::ChildListRecord::visitNodesConcurrently): Added.
(WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added.
(WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added.
* dom/MutationRecord.h:
* dom/MutationRecord.idl:
2018-10-04 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Move time out control from WebProcess to UIProcess
https://bugs.webkit.org/show_bug.cgi?id=189642
<rdar://problem/44476765>
Reviewed by Chris Dumez.
Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager,
the time out timer should move to UI Process as well.
Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html
http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html
* Modules/webauthn/AuthenticatorCoordinator.cpp:
(WebCore::AuthenticatorCoordinator::create const):
(WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
(WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted.
(WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(WebCore::PublicKeyCredentialRequestOptions::encode const):
(WebCore::PublicKeyCredentialRequestOptions::decode):
2018-10-04 Chris Dumez <cdumez@apple.com>
Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
https://bugs.webkit.org/show_bug.cgi?id=190252
Reviewed by Alex Christensen.
Add a null check for element() after firing the 'input' event and before firing the 'change' event
in case the input event listener changes the input type.
Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
2018-10-04 Yuhan Wu <yuhan_wu@apple.com>
runtime flag and IDL for MediaRecorder
https://bugs.webkit.org/show_bug.cgi?id=190018
Reviewed by Youenn Fablet and Chris Dumez.
Covered by tests:
imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html
imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html
Add an architecture of the IDL and the class for MediaRecorder and BlobEvent.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediarecorder/BlobEvent.h:
(WebCore::BlobEvent::create):
(WebCore::BlobEvent:::Event):
* Modules/mediarecorder/BlobEvent.idl:
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::create):
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::activeDOMObjectName const):
(WebCore::MediaRecorder::canSuspendForDocumentSuspension const):
* Modules/mediarecorder/MediaRecorder.h: Added.
(WebCore::MediaRecorder::state const):
(WebCore::MediaRecorder::~MediaRecorder):
* Modules/mediarecorder/MediaRecorder.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const):
(WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled):
2018-10-04 Chris Dumez <cdumez@apple.com>
Unreviewed, rolling out r236803.
Caused crashes on some bots
Reverted changeset:
"Regression(r236779): Crash when changing the input element
type from inside an 'input' event listener"
https://bugs.webkit.org/show_bug.cgi?id=190252
https://trac.webkit.org/changeset/236803
2018-10-04 Dan Bernstein <mitz@apple.com>
Tried to fix the Mojave build after r236832.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
2018-10-04 Michael Catanzaro <mcatanzaro@igalia.com>
ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired
https://bugs.webkit.org/show_bug.cgi?id=190145
Reviewed by Javier Fernandez.
Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::placeItemsOnGrid const):
(WebCore::RenderGrid::baselinePosition const):
* rendering/style/GridArea.h:
(WebCore::GridSpan::GridSpan):
2018-10-04 Dan Bernstein <mitz@apple.com>
WebCore part of [Xcode] Update some build settings as recommended by Xcode 10
https://bugs.webkit.org/show_bug.cgi?id=190250
Reviewed by Andy Estes.
* Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF,
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS.
* WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a
duplicate reference in a Compile Sources build phase.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations
around implementations of deprecated accessibility methods.
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]):
Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method.
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto.
2018-10-02 Darin Adler <darin@apple.com>
AudioNode.connect should use [ReturnValue]
https://bugs.webkit.org/show_bug.cgi?id=190231
Reviewed by Eric Carlson.
This is a slightly more efficient way to return a value that is always
identical to one of the arguments, so use it here.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>.
* Modules/webaudio/AudioBasicInspectorNode.h: Ditto.
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect): Ditto.
* Modules/webaudio/AudioNode.h: Ditto.
* Modules/webaudio/AudioNode.idl: Use [ReturnValue].
2018-10-03 Justin Michaud <justin_michaud@apple.com>
Registered custom properties should allow inheritance to be controlled
https://bugs.webkit.org/show_bug.cgi?id=190038
Reviewed by Antti Koivisto.
Tests: css-custom-properties-api/inherits.html
css-custom-properties-api/length.html
css-custom-properties-api/length2.html
Add support for inherits property on registered css custom properties, as well
as a starting point for evaluating registered custom properties with types. Registered
custom properties are evaluated as length values before being substituted. Currently,
relative unit cycles are not detected.
A proper solution is still needed to resolve relative unit cycles, and to apply properties like font
and line-height before they are needed by custom properties. In this patch, the font-size property is
applied twice, once before and once after resolving custom property values.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::CSSComputedStyleDeclaration::length const):
(WebCore::CSSComputedStyleDeclaration::item const):
Allow JS to get custom properties that have been resolved to a length. Also add properties from
m_rareNonInheritedData.
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h.
(WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
(WebCore::CSSRegisteredCustomProperty::initialValueCopy const):
* css/CSSRegisteredCustomProperty.h:
(WebCore::CSSRegisteredCustomProperty::initialValue const):
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::checkVariablesForCycles const):
(WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
(WebCore::CSSVariableData::resolveVariableFallback const):
(WebCore::CSSVariableData::resolveVariableReference const):
(WebCore::CSSVariableData::resolveVariableReferences const):
(WebCore::CSSVariableData::resolveTokenRange const):
* css/CSSVariableData.h:
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
* css/CSSVariableReferenceValue.h:
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
Use RenderStyle over passing in a customProperties map.
* css/StyleBuilder.h:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertLength):
(WebCore::StyleBuilderConverter::convertLengthOrAuto):
(WebCore::StyleBuilderConverter::convertLengthSizing):
(WebCore::StyleBuilderConverter::convertLengthMaxSizing):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialCustomProperty):
(WebCore::StyleBuilderCustom::applyInheritCustomProperty):
(WebCore::StyleBuilderCustom::applyValueCustomProperty):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::useSVGZoomRules const):
(WebCore::StyleResolver::useSVGZoomRulesForLength const):
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::resolvedVariableValue const):
(WebCore::StyleResolver::applyCascadedProperties):
(WebCore::StyleResolver::useSVGZoomRules): Deleted.
(WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted.
(WebCore::StyleResolver::resolvedVariableValue): Deleted.
* css/StyleResolver.h:
* css/makeprop.pl:
Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with
inheritance, unset and revert values.
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSParserContext.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserContext.h:
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
Allow parsing custom property values as lengths.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::inheritedCustomProperties const):
(WebCore::RenderStyle::nonInheritedCustomProperties const):
(WebCore::RenderStyle::setInheritedCustomPropertyValue):
(WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
(WebCore::RenderStyle::getCustomProperty const):
(WebCore::RenderStyle::customProperties const): Deleted.
(WebCore::RenderStyle::setCustomPropertyValue): Deleted.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find
cycles between them.
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
Clear m_pendingTargets in MutationObserver::takeRecords
https://bugs.webkit.org/show_bug.cgi?id=190240
Reviewed by Geoffrey Garen.
In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between
mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records.
This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make
MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of
mutation records so that the hash set survives through the creation of JS wrappers for mutation records.
To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in
which the result is stored.
No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/test/JS/JSTestInterface.cpp:
(WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody):
(WebCore::jsTestInterfacePrototypeFunctionTakeNodes):
* bindings/scripts/test/TestImplements.idl: Added a test case.
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::takeRecords):
(WebCore::MutationObserver::deliver):
* dom/MutationObserver.h:
* dom/MutationObserver.idl:
2018-10-03 Youenn Fablet <youenn@apple.com>
Add VP8 support to WebRTC
https://bugs.webkit.org/show_bug.cgi?id=189976
Reviewed by Eric Carlson.
Add a runtime flag to control activation of VP8 codec.
Bind this runtime flag to the video codec factories.
Test: webrtc/video-mute-vp8.html
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Enable VP8 codec for tests.
2018-09-28 Jiewen Tan <jiewen_tan@apple.com>
[WebCrypto] ECDSA could not deal with invalid signature inputs
https://bugs.webkit.org/show_bug.cgi?id=189879
<rdar://problem/44701276>
Reviewed by Brent Fulgham.
Add some guards over detections of the start positions of r/s.
Covered by improved existing tests.
* crypto/mac/CryptoAlgorithmECDSAMac.cpp:
(WebCore::verifyECDSA):
2018-10-03 Jer Noble <jer.noble@apple.com>
Add a quirk to disable Modern EME for sites which are broken with it enabled
https://bugs.webkit.org/show_bug.cgi?id=190051
Reviewed by Daniel Bates.
Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings
generator to support a DisabledByQuirk attribute, and set this attribute for all
the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in
addition to the existing Setting.
* Modules/encryptedmedia/MediaKeyMessageEvent.idl:
* Modules/encryptedmedia/MediaKeySession.idl:
* Modules/encryptedmedia/MediaKeyStatusMap.idl:
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/NavigatorEME.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGenerator.pm:
(WK_ucfirst):
* bindings/scripts/CodeGeneratorJS.pm:
(NeedsRuntimeCheck):
(GenerateRuntimeEnableConditionalString):
* bindings/scripts/IDLAttributes.json:
* bindings/scripts/preprocess-idls.pl:
(GenerateConstructorAttributes):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::quirks const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
(WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered):
* html/HTMLMediaElement.idl:
* page/Quirks.cpp: Added.
(Quirks::Quirks):
(Quirks::disableEncryptedMediaAPIQuirk const):
* page/Quirks.h: Added.
2018-10-03 Antoine Quint <graouts@apple.com>
[Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style
https://bugs.webkit.org/show_bug.cgi?id=190257
<rdar://problem/41341473>
Reviewed by Dean Jackson.
Test: animations/animation-fill-forwards-removal.html
While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps
on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation
was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document
timeline as its timeline, but the document timeline will no longer see this animation as targeting this element.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
* animation/DeclarativeAnimation.h:
(WebCore::DeclarativeAnimation::target const):
2018-10-03 Jer Noble <jer.noble@apple.com>
CRASH in CVPixelBufferGetBytePointerCallback()
https://bugs.webkit.org/show_bug.cgi?id=190092
Reviewed by Eric Carlson.
Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt
to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access
error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer
calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and
release logging to try to pinpoint if mismatch lock counts are occurring in this code path.
* platform/graphics/cv/PixelBufferConformerCV.cpp:
(WebCore::CVPixelBufferGetBytePointerCallback):
(WebCore::CVPixelBufferReleaseBytePointerCallback):
(WebCore::CVPixelBufferReleaseInfoCallback):
(WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
2018-10-03 Chris Dumez <cdumez@apple.com>
Regression(r236779): Crash when changing the input element type from inside an 'input' event listener
https://bugs.webkit.org/show_bug.cgi?id=190252
Reviewed by Alex Christensen.
Add a null check for element() after firing the 'input' event and before firing the 'change' event
in case the input event listener changes the input type.
Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html
fast/dom/HTMLInputElement/change-type-in-input-event-listener.html
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
2018-10-03 Chris Dumez <cdumez@apple.com>
Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener
https://bugs.webkit.org/show_bug.cgi?id=190251
Reviewed by Alex Christensen.
Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener,
similarly to noopener=1:
- https://html.spec.whatwg.org/#window-open-steps (step 5)
It does not matter what the value is, if there is a key named "noopener", then the new window
should not have an opener.
No new tests, rebaselined existing test.
* page/WindowFeatures.cpp:
(WebCore::setWindowFeature):
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
https://bugs.webkit.org/show_bug.cgi?id=190115
Reviewed by Geoffrey Garen.
Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
target is kept alive and MutationObserverRegistration where each node which had been removed
from an observed tree is kept alive for a subtree observation.
No new test since the test which can reproduce this problem is too slow.
* dom/GCReachableRef.h:
(WebCore::GCReachableRef): Made it work with hash table.
(WebCore::GCReachableRef::operator T& const):
(WebCore::GCReachableRef::GCReachableRef):
(WebCore::GCReachableRef::isHashTableDeletedValue const):
(WebCore::GCReachableRef::isHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
(WebCore::GCReachableRef::assignToHashTableEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
to be collected before elements in mutation records are accessed. We delay until the end of the current
microtask at which point deliver() function is called.
(WebCore::MutationObserver::disconnect):
(WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
This is needed for a newly inserted node, a node with attribute change, etc...
(WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
records are delivered to each observer. These are nodes which had been removed from a tree and whose
subtree had still been obsreved up until this point.
* dom/MutationObserver.h:
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
(WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
function had been called.
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
* dom/MutationObserverRegistration.h:
2018-10-03 Dean Jackson <dino@apple.com>
Make the Pointer Events feature description valid
https://bugs.webkit.org/show_bug.cgi?id=190254
Reviewed by Simon Fraser.
* features.json:
2018-10-03 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r236781.
The test added with this commit is timing out consistently.
Reverted changeset:
"GC can collect JS wrappers of nodes in the mutation records
waiting to be delivered"
https://bugs.webkit.org/show_bug.cgi?id=190115
https://trac.webkit.org/changeset/236781
2018-10-03 Dean Jackson <dino@apple.com>
[macOS] Switching to discrete GPU should be done in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189361
<rdar://problem/43949622>
Try to fix the IOSMAC build.
* platform/graphics/GraphicsContext3D.h:
2018-10-03 Chris Dumez <cdumez@apple.com>
input.checked is incorrect while we're parsing its children
https://bugs.webkit.org/show_bug.cgi?id=190227
Reviewed by Ryosuke Niwa.
input.checked was incorrect while we're parsing its children because we were delaying updating the
checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction
with form state restoration.
In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know
that no form state to restore.
fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still
passing.
No new tests, rebaselined existing test.
* html/FormController.cpp:
(WebCore::FormController::hasFormStateToRestore const):
* html/FormController.h:
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::parseAttribute):
2018-10-03 Miguel Gomez <magomez@igalia.com>
[GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed
https://bugs.webkit.org/show_bug.cgi?id=190249
Reviewed by Žan Doberšek.
Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose
the value calculated during the layer flush. Use an OR instead to keep the old value.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
2018-10-03 Youenn Fablet <youenn@apple.com>
Enable H264 simulcast
https://bugs.webkit.org/show_bug.cgi?id=190167
Reviewed by Eric Carlson.
Activate H264 simulcast trial field.
Make track.getSettings() expose width and height for incoming tracks.
Test: webrtc/simulcast-h264.html
* Configurations/WebCore.xcconfig:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2018-10-03 Michael Catanzaro <mcatanzaro@igalia.com>
-Wunused-variable in RenderLayer::updateScrollableAreaSet
https://bugs.webkit.org/show_bug.cgi?id=190200
Reviewed by Yusuke Suzuki.
Pass it through UNUSED_VARIABLE().
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
2018-10-03 Zan Dobersek <zdobersek@igalia.com>
Ref<FetchResponse> use-after-move in DOMCache::put()
https://bugs.webkit.org/show_bug.cgi?id=190239
Reviewed by Youenn Fablet.
Retrieve reference from the Ref<FetchResponse> object before it's
move-captured in the lambda that's passed to the
FetchResponse::consumeBodyReceivedByChunk() method that is invoked on
that very same object. This is a classic use-after-move bug that pops
up on compilers with different C++ calling convention.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
2018-10-03 Ryosuke Niwa <rniwa@webkit.org>
Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=190238
Reviewed by Antti Koivisto.
Enable the feature by default.
* page/Settings.yaml:
2018-10-02 Ryosuke Niwa <rniwa@webkit.org>
Copying content with shadow DOM doesn't copy any contents
https://bugs.webkit.org/show_bug.cgi?id=157443
Reviewed by Wenson Hsieh.
This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text,
which is enabled whenever selection across shadow boundaries is enabled.
To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in
StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator.
When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when
the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree.
Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html
editing/pasteboard/copy-paste-across-shadow-boundaries-2.html
editing/pasteboard/copy-paste-across-shadow-boundaries-3.html
editing/pasteboard/copy-paste-across-shadow-boundaries-4.html
editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html
editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html
editing/pasteboard/copy-paste-with-shadow-content.html
* dom/ComposedTreeIterator.h:
(WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp.
(WebCore::shadowRootIgnoringUserAgentShadow): Ditto.
(WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto.
(WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto.
* dom/Position.h:
(WebCore::Position::treeScope const): Added.
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::addDisplayContents): Added.
* editing/EditingStyle.h:
* editing/Editor.cpp:
(WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set.
(WebCore::Editor::selectedTextForDataTransfer const): Ditto.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::appendEndTag):
* editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator): Added a new variant which takes two positions.
(WebCore::TextIterator::init):
(WebCore::firstChild):
(WebCore::nextSibling):
(WebCore::plainText): Ditto.
* editing/TextIterator.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Ditto.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::parentNode): Added.
(WebCore::StyledMarkupAccumulator::firstChild): Added.
(WebCore::StyledMarkupAccumulator::nextSibling): Added.
(WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added.
(WebCore::StyledMarkupAccumulator::hasChildNodes): Added.
(WebCore::StyledMarkupAccumulator::isDescendantOf): Added.
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents.
(WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto.
(WebCore::StyledMarkupAccumulator::serializeNodes):
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to
traverse the composed tree when m_useComposedTree is set.
(WebCore::commonShadowIncludingAncestor): Added.
(WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use
StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc...
(WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection.
(WebCore::sanitizedMarkupForFragmentInDocument):
* editing/markup.h:
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement):
* testing/Internals.cpp:
(WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across
shadow boundaries for testing purposes.
* testing/Internals.h:
* testing/Internals.idl:
2018-10-02 Chris Dumez <cdumez@apple.com>
MessageEvent.ports should return the same object
https://bugs.webkit.org/show_bug.cgi?id=190151
Reviewed by Darin Adler.
MessageEvent.ports should return the same object it was initialized to instead of
constructing a new JSValue every time.
No new tests, rebaselined existing test.
* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::ports const):
(WebCore::JSMessageEvent::visitAdditionalChildren):
* dom/MessageEvent.cpp:
(WebCore::MessageEvent::initMessageEvent):
* dom/MessageEvent.h:
* dom/MessageEvent.idl:
2018-10-01 Ryosuke Niwa <rniwa@webkit.org>
GC can collect JS wrappers of nodes in the mutation records waiting to be delivered
https://bugs.webkit.org/show_bug.cgi?id=190115
Reviewed by Geoffrey Garen.
Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef.
This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's
target is kept alive and MutationObserverRegistration where each node which had been removed
from an observed tree is kept alive for a subtree observation.
Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html
* dom/GCReachableRef.h:
(WebCore::GCReachableRef): Made it work with hash table.
(WebCore::GCReachableRef::operator T& const):
(WebCore::GCReachableRef::GCReachableRef):
(WebCore::GCReachableRef::isHashTableDeletedValue const):
(WebCore::GCReachableRef::isHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const):
(WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue):
(WebCore::GCReachableRef::assignToHashTableEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::peek):
(WTF::HashTraits<WebCore::GCReachableRef<P>>::take):
* dom/MutationObserver.cpp:
(WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers
to be collected before elements in mutation records are accessed. We delay until the end of the current
microtask at which point deliver() function is called.
(WebCore::MutationObserver::disconnect):
(WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive.
This is needed for a newly inserted node, a node with attribute change, etc...
(WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation
records are delivered to each observer. These are nodes which had been removed from a tree and whose
subtree had still been obsreved up until this point.
* dom/MutationObserver.h:
* dom/MutationObserverRegistration.cpp:
(WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach):
(WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets
that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver
function had been called.
(WebCore::MutationObserverRegistration::addRegistrationNodesToSet const):
* dom/MutationObserverRegistration.h:
2018-10-02 Chris Dumez <cdumez@apple.com>
radio / checkbox inputs should fire "click, input, change" events in order when clicked
https://bugs.webkit.org/show_bug.cgi?id=190223
Reviewed by Ryosuke Niwa.
radio / checkbox inputs should fire "click, input, change" events in order when clicked:
- https://html.spec.whatwg.org/#radio-button-state-(type=radio)
- https://html.spec.whatwg.org/#checkbox-state-(type=checkbox)
- https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11)
Gecko and Blink already behave this way. However, WebKit has the following issues:
- the input event is not fired
- the click event is fired after the change event
No new tests, updated / rebaselined existing tests.
* html/BaseCheckableInputType.cpp:
(WebCore::BaseCheckableInputType::fireInputAndChangeEvents):
* html/BaseCheckableInputType.h:
* html/CheckboxInputType.cpp:
(WebCore::CheckboxInputType::willDispatchClick):
(WebCore::CheckboxInputType::didDispatchClick):
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):
* html/HTMLInputElement.h:
* html/RadioInputType.cpp:
(WebCore::RadioInputType::willDispatchClick):
(WebCore::RadioInputType::didDispatchClick):
2018-10-02 Chris Dumez <cdumez@apple.com>
fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection
https://bugs.webkit.org/show_bug.cgi?id=190218
Reviewed by Alex Christensen.
fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection:
- https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb
Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016:
- https://bugs.chromium.org/p/chromium/issues/detail?id=665291
This simplifies our HTMLFieldSetElement code a lot.
Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html
* html/CollectionType.h:
* html/GenericCachedHTMLCollection.cpp:
(WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
* html/HTMLCollection.cpp:
(WebCore::HTMLCollection::rootTypeFromCollectionType):
(WebCore::invalidationTypeExcludingIdAndNameAttributes):
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::elements):
* html/HTMLFieldSetElement.h:
* html/HTMLFieldSetElement.idl:
* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection):
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
(WebCore::HTMLFormControlsCollection::ownerNode const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
* html/HTMLFormControlsCollection.h:
2018-10-02 Devin Rousso <drousso@apple.com>
Web Inspector: prevent layer events from firing until the layer information is re-requested
https://bugs.webkit.org/show_bug.cgi?id=190159
Reviewed by Joseph Pecoraro.
Test: inspector/layers/layerTreeDidChange.html
* inspector/agents/InspectorLayerTreeAgent.h:
* inspector/agents/InspectorLayerTreeAgent.cpp:
(WebCore::InspectorLayerTreeAgent::reset):
(WebCore::InspectorLayerTreeAgent::layerTreeDidChange):
(WebCore::InspectorLayerTreeAgent::layersForNode):
2018-10-02 Brian Burg <bburg@apple.com>
Web Automation: tab default key handler should always cycle focus when page is controlled by automation
https://bugs.webkit.org/show_bug.cgi?id=190221
<rdar://problem/44914534>
Reviewed by Joseph Pecoraro.
This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24].
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusInDocumentOrder):
Always cycle focus if the page is controlled by automation. If the chrome takes
focus, then the first responder will be something other than the WebView, which
causes subsequent WebDriver commands to hang.
2018-10-01 Dean Jackson <dino@apple.com>
[macOS] Switching to discrete GPU should be done in the UI process
https://bugs.webkit.org/show_bug.cgi?id=189361
<rdar://problem/43949622>
Reviewed by Simon Fraser.
Based on an earlier patch by Per Arne Vollan.
Due to the fact we can't talk to the Window Server, the Web Process can
no longer muxing to the discrete GPU directly. Instead we have to get the
UI Process to process the change. Do this by adding a new Chrome client
called GPUClient, that will have implementations provided by both WebKit
and legacy WebKit.
Unfortunately this can't be tested by a regular WKTR since:
- it requires specific hardware
- swapping to/from the discrete GPU takes about 20 seconds
- running concurrent tests could confuse the tests into thinking
the wrong GPU is active
Instead we'll write a specific test for this functionality and
run it on a separate bot.
* WebCore.xcodeproj/project.pbxproj: Add GPUClient files.
* page/Chrome.cpp: Drive by clean-up.
(WebCore::Chrome::windowScreenDidChange):
* platform/graphics/GraphicsContext3D.h: We need to keep track of
whether we've muxed for this context, in order to not respond to
the screen change notifications (they are misleading in the case
of muxing).
* platform/graphics/GraphicsContext3DManager.cpp: Rather than try
to mux directly, call into GPUClient.
(WebCore::GraphicsContext3DManager::displayWasReconfigured):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
(WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
* platform/graphics/GraphicsContext3DManager.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure
the virtual display if it didn't happen from muxing.
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::updateCGLContext):
(WebCore::GraphicsContext3D::screenDidChange):
* platform/graphics/mac/SwitchingGPUClient.cpp: Added.
(WebCore::SwitchingGPUClient::singleton):
(WebCore::SwitchingGPUClient::setSingleton):
* platform/graphics/mac/SwitchingGPUClient.h: Added.
* testing/Internals.cpp: Testing helper.
(WebCore::Internals::hasMuxableGPU):
* testing/Internals.h:
* testing/Internals.idl:
2018-10-02 Chris Dumez <cdumez@apple.com>
Image.__proto__ should be Function.prototype, not HTMLElement.prototype
https://bugs.webkit.org/show_bug.cgi?id=190216
Reviewed by Alex Christensen.
Properties created for named constructors should always use Function.prototype as prototype, as per:
- https://heycam.github.io/webidl/#named-constructors
Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's
prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype
instead of Function.prototype.
No new tests, rebaselined existing test.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateConstructorHelperMethods):
2018-10-02 Alex Christensen <achristensen@webkit.org>
Prepare WebCoreNSURLExtras for ARC
https://bugs.webkit.org/show_bug.cgi?id=190219
Reviewed by Tim Horton.
ARC doesn't like the explicit sending of -release.
Use RetainPtr instead.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::collectRangesThatNeedMapping):
(WebCore::collectRangesThatNeedEncoding):
(WebCore::collectRangesThatNeedDecoding):
(WebCore::applyHostNameFunctionToMailToURLString):
(WebCore::applyHostNameFunctionToURLString):
(WebCore::mapHostNames):
(WebCore::stringByTrimmingWhitespace):
(WebCore::URLWithUserTypedString):
(WebCore::userVisibleString):
(WebCore::rangeOfURLScheme):
(WebCore::looksLikeAbsoluteURL):
(WebCore::retain): Deleted.
2018-10-02 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix missing values of resource timing API.
https://bugs.webkit.org/show_bug.cgi?id=190193
Reviewed by Alex Christensen.
The property nextHopProtocol was not returned correctly. It was
returned only when remote inspector is opened.
Tests: http/wpt/resource-timing/rt-nextHopProtocol.html
http/wpt/resource-timing/rt-nextHopProtocol.worker.html
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
2018-10-02 Alex Christensen <achristensen@webkit.org>
Remove unused linked-on-or-before-iOS5 check
https://bugs.webkit.org/show_bug.cgi?id=190164
Reviewed by Michael Saboff.
If an app hasn't been updated since iOS5, it can't run supported iOS.
This value is also only checked in an uninstantiated template function.
* platform/URL.cpp:
(WebCore::enableURLSchemeCanonicalization): Deleted.
(WebCore::equal): Deleted.
* platform/URL.h:
2018-10-02 Alex Christensen <achristensen@webkit.org>
Remove ParsedURLString
https://bugs.webkit.org/show_bug.cgi?id=190154
Reviewed by Chris Dumez.
Before the introduction of URLParser, it would indicate that we should assume the String
is from a valid URL so we can skip canonicalization and just find the offsets inside the String
to quickly create a URL. It was a performance optimization that caused security issues when
misused. Since the introduction of URLParser, we have a fast path for all URL parsing, so
right now it actually doesn't change any behavior. It's just a relic of the past that complicates
the URL class, making it harder to express which constructor to use and making it harder to move
the class.
* Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
(WebCore::NavigatorContentUtils::registerProtocolHandler):
(WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
(WebCore::NavigatorContentUtils::unregisterProtocolHandler):
* dom/Document.cpp:
(WebCore::Document::updateBaseURL):
(WebCore::Document::initSecurityContext):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* editing/markup.cpp:
(WebCore::completeURLs):
* fileapi/BlobURL.cpp:
(WebCore::BlobURL::createBlobURL):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::url const):
(WebCore::HistoryItem::originalURL const):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::location const):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* html/PublicURLManager.cpp:
(WebCore::PublicURLManager::stop):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::resourceStyleSheetText const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::deleteCookie):
(WebCore::InspectorPageAgent::getResourceContent):
(WebCore::InspectorPageAgent::searchInResource):
* inspector/agents/page/PageDebuggerAgent.cpp:
(WebCore::PageDebuggerAgent::sourceMapURLForScript):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresources const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::init):
(WebCore::FrameLoader::initForSynthesizedDocument):
* loader/HistoryController.cpp:
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
(WebCore::ApplicationCache::resourceForURL):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::startLoadingEntry):
(WebCore::ApplicationCacheGroup::addEntry):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::loadCache):
(WebCore::ApplicationCacheStorage::manifestURLs):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::urlForBlankFrame):
* platform/URL.cpp:
(WebCore::blankURL):
* platform/URL.h:
(): Deleted.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::load):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::decodeBase):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
* platform/network/cf/DNSResolveQueueCFNet.cpp:
(WebCore::DNSResolveQueueCFNet::updateIsUsingProxy):
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies):
(WebCore::CookieJarDB::setCookie):
(WebCore::CookieJarDB::deleteCookie):
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* platform/network/soup/ResourceRequest.h:
(WebCore::ResourceRequest::ResourceRequest):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::docLoaderFunc):
2018-10-02 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Cue with line setting is not rendered correctly
https://bugs.webkit.org/show_bug.cgi?id=190168
Reviewed by Eric Carlson.
When the line setting contains an optional alignment value, the cue is not rendered at the correct position,
see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of
the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment
settings.
Test: media/track/track-cue-line-position.html
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
(WebCore::VTTCue::getPositionCoordinates const):
(WebCore::VTTCue::setCueSettings):
2018-10-02 Antti Koivisto <antti@apple.com>
User installed fonts are not always disabled when they should be
https://bugs.webkit.org/show_bug.cgi?id=190195
Reviewed by Geoffrey Garen.
SVG images and some theme cases fail to respect the setting. Besides the obvious problem this
is also a performance issue as various font caches include this setting in the key.
* platform/graphics/FontDescription.cpp:
(WebCore::m_shouldAllowUserInstalledFonts):
Initialize to 'No' by default. All paths where user fonts make sense already set the bit from
settings. This fixes some cases in system themes that construct FontDescriptions from scratch.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
Add assertion. This verified the change with the existing tests.
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
Always disallow user fonts in SVG used as images.
2018-10-01 Dean Jackson <dino@apple.com>
Remove CSS Animation Triggers
https://bugs.webkit.org/show_bug.cgi?id=190175
<rdar://problem/44925626>
Reviewed by Simon Fraser.
Remove the never-properly specified CSS Animation Triggers.
* Configurations/FeatureDefines.xcconfig:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSAnimationTriggerScrollValue.cpp: Removed.
* css/CSSAnimationTriggerScrollValue.h: Removed.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
(WebCore::createAnimationTriggerValue): Deleted.
(WebCore::animationTriggerValue): Deleted.
* css/CSSProperties.json:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted.
* css/CSSToStyleMap.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeAnimationValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeWebkitAnimationTrigger): Deleted.
* page/FrameView.cpp:
(WebCore::FrameView::sendScrollEvent):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::updateStateMachine):
(WebCore::AnimationBase::fireAnimationEventsIfNeeded):
(WebCore::AnimationBase::timeToNextService):
(WebCore::AnimationBase::getElapsedTime const):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved):
(WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted.
(WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted.
(WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted.
(WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted.
(WebCore::CSSAnimationController::scrollWasUpdated): Deleted.
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
(WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted.
(WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted.
* page/animation/CompositeAnimation.cpp:
(WebCore::CompositeAnimation::updateKeyframeAnimations):
* page/animation/CompositeAnimation.h:
(WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted.
* platform/animation/Animation.cpp:
(WebCore::Animation::Animation):
(WebCore::Animation::operator=):
(WebCore::Animation::animationsMatch const):
* platform/animation/Animation.h:
(WebCore::Animation::isTimingFunctionSet const):
(WebCore::Animation::isEmpty const):
(WebCore::Animation::clearTimingFunction):
(WebCore::Animation::clearAll):
(WebCore::Animation::animationMode const):
(WebCore::Animation::setAnimationMode):
(WebCore::Animation::initialTimingFunction):
(WebCore::Animation::isTriggerSet const): Deleted.
(WebCore::Animation::clearTrigger): Deleted.
(WebCore::Animation::trigger const): Deleted.
(WebCore::Animation::setTrigger): Deleted.
(WebCore::Animation::initialTrigger): Deleted.
* platform/animation/AnimationTrigger.h: Removed.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2018-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236624 and r236671.
https://bugs.webkit.org/show_bug.cgi?id=190207
The change in r236624 introduced crashes on the bots
(Requested by ryanhaddad on #webkit).
Reverted changesets:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236624
"Unify implementation in VideoFullscreenInterfaceAVKit"
https://bugs.webkit.org/show_bug.cgi?id=190091
https://trac.webkit.org/changeset/236671
2018-10-02 Sihui Liu <sihui_liu@apple.com>
Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer()
https://bugs.webkit.org/show_bug.cgi?id=190178
Reviewed by Chris Dumez.
This would help debug rdar://problem/44902833.
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer):
2018-10-02 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236719.
https://bugs.webkit.org/show_bug.cgi?id=190197
this revision caused 39 layout test failures that tested for
scrolling, a bug was also not present in the commit or change
log. (Requested by Truitt on #webkit).
Reverted changeset:
"Unreviewed, fix unused variable in
RenderLayer::updateScrollableAreaSet"
https://trac.webkit.org/changeset/236719
2018-10-02 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Add h264parse to accept MP4 without stss
https://bugs.webkit.org/show_bug.cgi?id=190143
Reviewed by Xabier Rodriguez-Calvar.
The MP4 file used in this URL does not contain a stss (Sync Sample
Box). In consequence, in acordance with the ISO BMFF spec, all samples
are assumed to be sync frames... But in this case that is not true,
it's just that the file is wrong (e.g. created with a buggy muxer).
http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
The way it works in other browsers is because instead of trusting the
MP4 stss table, they rely on parsing the h264 frames. We can do that
too.
This patch also changes RELEASE_ASSERT() when creating the parsers
to GLib criticals.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::createOptionalParserForFormat):
2018-10-02 Eric Carlson <eric.carlson@apple.com>
[MediaStream] RealtimeMediaSource should be able to vend hashed IDs
https://bugs.webkit.org/show_bug.cgi?id=190142
<rdar://problem/44911109>
Reviewed by Youenn Fablet.
No new tests, covered by existing tests.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed
to base class.
* Modules/mediastream/MediaDevicesRequest.cpp:
(WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same
as passed salt.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID.
(WebCore::MediaStreamTrack::getCapabilities const): Ditto.
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream.
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed
to base class.
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto.
* platform/mediastream/MediaConstraints.h:
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto.
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID.
(WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID.
(WebCore::RealtimeMediaSource::hashedId const): New.
(WebCore::RealtimeMediaSource::deviceIDHashSalt const): New.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating
a source.
(WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto.
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters.
* platform/mediastream/RealtimeVideoSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::create): Ditto.
(WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::create): Ditto.
(WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto.
* platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::create): Ditto.
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
(WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID.
(WebCore::AVVideoCaptureSource::capabilities): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::create): Update parameters.
(WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto.
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSource::create): Ditto.
(WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::create): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging.
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm:
(WebCore::WindowDisplayCaptureSourceMac::create): Update parameters.
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::create): Ditto.
(WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto.
(WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::create): Update parameters.
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
* platform/mock/MockRealtimeVideoSource.h:
2018-10-02 Philippe Normand <pnormand@igalia.com>
[GStreamer][playbin3] Stream tag lists leaks
https://bugs.webkit.org/show_bug.cgi?id=190192
Reviewed by Xabier Rodriguez-Calvar.
The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak.
Also check the tags list pointer which might be NULL in some cases.
* platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
(WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::naturalSize const):
* platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
(WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer):
2018-10-01 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't
have any changes in this function....
2018-10-02 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Make same thread assert non-release
https://bugs.webkit.org/show_bug.cgi?id=189924
Reviewed by Xabier Rodriguez-Calvar.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::handleNewAppsinkSample):
2018-10-01 Ryosuke Niwa <rniwa@webkit.org>
Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection
https://bugs.webkit.org/show_bug.cgi?id=190108
Reviewed by Wenson Hsieh.
Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating
a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug
demonstrated in editing/pasteboard/paste-table-003.html.
Test: editing/pasteboard/paste-table-003.html
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat): Adopt the new variant.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Ditto.
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearance): Added.
* editing/markup.h:
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard): Ditto.
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::createFromSelection): Ditto.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeSelection): Ditto.
2018-10-01 Alex Christensen <achristensen@webkit.org>
Don't read from WebCore's bundle for IDNScriptWhiteList
https://bugs.webkit.org/show_bug.cgi?id=190157
Reviewed by Dan Bernstein.
No change in behavior. This increases performance by not reading from the WebCore bundle,
and it makes it so that URL-related functionality can be moved to a place without
a bundle for resources.
* Resources/IDNScriptWhiteList.txt: Removed.
* WebCore.xcodeproj/project.pbxproj:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::whiteListIDNScripts):
(WebCore::allCharactersInIDNScriptWhiteList):
(WebCore::readIDNScriptWhiteListFile): Deleted.
2018-10-01 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r236551.
Fails URL validating too aggressively
Reverted changeset:
"URLWithUserTypedString should return nil for URLs deemed to
be invalid by WebCore::URL"
https://bugs.webkit.org/show_bug.cgi?id=189979
https://trac.webkit.org/changeset/236551
2018-10-01 Keith Miller <keith_miller@apple.com>
Create a RELEASE_AND_RETURN macro for ExceptionScopes
https://bugs.webkit.org/show_bug.cgi?id=190163
Reviewed by Mark Lam.
The new RELEASE_AND_RETURN does all the work for cases
where you want to return the result of some expression
without explicitly checking for an exception. This is
much like the existing RETURN_IF_EXCEPTION macro.
No new tests since this is a refactor.
* bridge/runtime_array.cpp:
(JSC::RuntimeArray::put):
2018-10-01 Daniel Bates <dabates@apple.com>
Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678>
(https://bugs.webkit.org/show_bug.cgi?id=189974)
Explicitly cast index to unsigned to make the operator[] call unambiguous.
* platform/ios/KeyEventIOS.mm:
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
2018-10-01 Ryosuke Niwa <rniwa@webkit.org>
ASAN failure in ~GCReachableRef()
https://bugs.webkit.org/show_bug.cgi?id=190113
Reviewed by Darin Adler.
The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN
in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's
the simplest solution here although we could unpoison Ref temporarily as done in ~Ref.
* dom/GCReachableRef.h:
(WebCore::GCReachableRef::GCReachableRef):
(WebCore::GCReachableRef::~GCReachableRef):
(WebCore::GCReachableRef::operator-> const):
(WebCore::GCReachableRef::get const):
(WebCore::GCReachableRef::operator T& const):
(WebCore::GCReachableRef::operator! const):
(WebCore::GCReachableRef::isNull const): Deleted.
2018-10-01 Sihui Liu <sihui_liu@apple.com>
Remove StorageProcess
https://bugs.webkit.org/show_bug.cgi?id=189975
Reviewed by Geoffrey Garen.
Clean up code. No behavior change.
* English.lproj/Localizable.strings:
2018-10-01 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Set a minimum sample duration
https://bugs.webkit.org/show_bug.cgi?id=190125
Reviewed by Xabier Rodriguez-Calvar.
The last sample of the audio track in the asset used in this test
player has a tiny duration (100 ns):
http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest
So small, we were truncating it to zero. We're not supposed to have
frames with zero duration. Instead, lets set a minimum frame duration
for those fringe cases.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
2018-10-01 Daniel Bates <dabates@apple.com>
[iOS] Special keys are misidentified in DOM keyboard events
https://bugs.webkit.org/show_bug.cgi?id=189974
Reviewed by Wenson Hsieh.
This patch fixes two issues:
1. Special keyboard keys would be misidentified in dispatched DOM keyboard events.
2. DOM keypress events may not be dispatched for some special keys.
UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow,
Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other
special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need
to explicitly handle these special keyboard keys in order to be able to identify the key that
was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM
keypress event for the key.
Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF7000xF8FF to
represent special keyboard keys. This makes it straightforward to disambiguate such keys using
the input string of the keyboard event alone. To simplify the implementation for iOS
we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode()
below for more details on why this is done.
Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html
fast/events/ios/keypress-keys-in-non-editable-element.html
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
Do not use unified source build strategy when building WebEvent.mm as it makes
use of SoftLinking macros that are incompatible with this strategy.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes.
These special char codes are generated by WebKit. WebKit uses the same special char codes
as AppKit as a convenience instead of defining our own constants for the same purpose.
Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us
to use integer arithmetic and switch blocks to map characters to Windows virtual key
codes as opposed to special cased branches to perform pointer or string comparisions.
The latter would be necessary in Modern WebKit in order for key down events to be properly
disambiguated to dispatch a DOM keypress event because pointers are not perserved, though
what they point to is, when sending the WebEvent from UIProcess to the WebProcess and
vice versa.
(WebCore::isFunctionKey): Convenience function that determines whether the specified char
code corresponds to a function key on the keyboard. The term "function key" is taken from
AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24,
and cursor keys among other special keyboard keys.
(WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey().
* platform/ios/PlatformEventFactoryIOS.h:
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as
we now map such special input strings to char codes and hence can use the default code path.
(WebCore::keyForKeyEvent): Ditto.
(WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding
to a UIKit special key command now that we map such special input strings to char codes and
subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code
for the event.
(WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up
WebEvent.keyCode to account for UIKit special input strings now that we map such special key
commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...]
constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code.
(WebCore::convertSpecialKeyToCharCode): Deleted.
(WebCore::keyCodeForEvent): Deleted.
* platform/ios/WebEvent.mm:
(normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string
to the corresponding AppKit-compatible one (if not already compatible). See the explaination
for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done.
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
Normalize the character strings to be AppKit compatible.
2018-10-01 Simon Fraser <simon.fraser@apple.com>
Optimize RenderStyle::diff() and clean up the code
https://bugs.webkit.org/show_bug.cgi?id=190104
Reviewed by Dan Bernstein.
RenderStyle::changeRequiresLayout() and related should only check values on
m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality.
To reduce the chances of future changes regressing this, move code comparing values
on StyleRare[Non]InheritedData into dedication functions.
In addition, the transform comparison double-compared the transformOperations,
because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform
is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform.
Change the first to be a pointer comparison.
* rendering/style/RenderStyle.cpp:
(WebCore::rareNonInheritedDataChangeRequiresLayout):
(WebCore::rareInheritedDataChangeRequiresLayout):
(WebCore::RenderStyle::changeRequiresLayout const):
(WebCore::rareNonInheritedDataChangeRequiresLayerRepaint):
(WebCore::RenderStyle::changeRequiresLayerRepaint const):
(WebCore::rareNonInheritedDataChangeRequiresRepaint):
(WebCore::rareInheritedDataChangeRequiresRepaint):
(WebCore::RenderStyle::changeRequiresRepaint const):
2018-10-01 Alex Christensen <achristensen@webkit.org>
URL should not use TextEncoding internally
https://bugs.webkit.org/show_bug.cgi?id=190111
Reviewed by Andy Estes.
That dependency makes it impossible to move or use elsewhere.
Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL.
No change in behavior as verified by new API tests.
* page/SecurityOrigin.cpp:
* page/csp/ContentSecurityPolicySourceList.cpp:
* platform/URL.cpp:
(WebCore::decodeEscapeSequencesFromParsedURL):
(WebCore::URL::user const):
(WebCore::URL::pass const):
(WebCore::URL::fileSystemPath const):
(WebCore::decodeURLEscapeSequences): Deleted.
* platform/URL.h:
* platform/network/DataURLDecoder.cpp:
* platform/text/TextEncoding.cpp:
(WebCore::decodeURLEscapeSequences):
* platform/text/TextEncoding.h:
2018-10-01 Simon Pieters <zcorpan@gmail.com>
<form> in quirks mode should have margin-block-end: 1em
https://bugs.webkit.org/show_bug.cgi?id=157788
Reviewed by Simon Fraser.
Change the default style for forms to take writing-mode into account
in quirks mode. Matches the behavior of Gecko and Edge and the HTML
standard.
Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html
* css/quirks.css:
(form):
2018-10-01 Jeremy Jones <jeremyj@apple.com>
Unify implementation in VideoFullscreenInterfaceAVKit
https://bugs.webkit.org/show_bug.cgi?id=190091
rdar://problem/44734523
Reviewed by Jer Noble.
No new tests because no behavior change.
Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include
any changes that had been made in the old path.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::requestUpdateInlineRect):
(VideoFullscreenControllerContext::requestVideoContentLayer):
(VideoFullscreenControllerContext::returnVideoContentLayer):
(VideoFullscreenControllerContext::didSetupFullscreen):
(VideoFullscreenControllerContext::didExitFullscreen):
2018-10-01 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure renderers with accelerated animations have layers
https://bugs.webkit.org/show_bug.cgi?id=189990
Reviewed by Simon Fraser.
In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has
accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with
exclusively accelerated animations running.
No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::detachFromDocument):
(WebCore::DocumentTimeline::animationWasAddedToElement):
(WebCore::DocumentTimeline::animationWasRemovedFromElement):
(WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine
whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or
add this element.
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements
running accelerated animations.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
* rendering/RenderBoxModelObject.h:
2018-10-01 Alicia Boya García <aboya@igalia.com>
[GStreamer] Fix abort in gst_sample_get_info()
https://bugs.webkit.org/show_bug.cgi?id=190135
Reviewed by Philippe Normand.
A flush can occur before any frame has finished decoding -- especially
in tests, where actions on the player often occur in quick succession.
Therefore, the code must not assume by the time a flush occurs any
frame has reached the sink. This patch fixes a case when such wrong
assumption was causing gst_sample_get_info() to abort (crashing
WebKit).
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
(WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):
2018-10-01 Olivier Blin <olivier.blin@softathome.com>
[WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet()
https://bugs.webkit.org/show_bug.cgi?id=190139
Reviewed by Michael Catanzaro.
Like done upstream for EFL in r210213
https://bugs.webkit.org/show_bug.cgi?id=166622
This has been detected by a charactersAreAllASCII() assert failure.
This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet().
mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string.
It is thus incorrect to use StringImpl::createFromLiteral() that calls
strlen() to get the string length.
The String::ConstructFromLiteral constructor can not be used, since it
skips the last character.
* platform/wpe/RenderThemeWPE.cpp:
(WebCore::RenderThemeWPE::mediaControlsStyleSheet):
Explicitely pass the size to the String constructor.
2018-10-01 Rob Buis <rbuis@igalia.com>
Align XMLHttpRequest's overrideMimeType() with the standard
https://bugs.webkit.org/show_bug.cgi?id=169276
Reviewed by Chris Dumez.
Implement the overrideMimeType() as specified in that standard, i.e.
add a check that the passed mime type is valid and if not fallback
to application/octet-stream.
In order for this patch to have any effect, I went ahead and
made an improvement to the ContentType parsing, parseContentType now
will reject mime types that do not match the type / subtype format, I
believe this is required by both RFC2045 and mimesniff specs.
This behavior matches Chrome and Firefox.
Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm
* platform/network/ParsedContentType.cpp:
(WebCore::parseContentType):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::overrideMimeType):
2018-10-01 Chris Dumez <cdumez@apple.com>
Make crossOriginObject.then undefined for promises
https://bugs.webkit.org/show_bug.cgi?id=190094
Reviewed by Darin Adler.
Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy
and Location objects.
Specification:
- https://github.com/whatwg/html/pull/3242
- https://github.com/whatwg/dom/issues/536
This aligns our behavior with Blink and Gecko.
No new tests, rebaselined existing test.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::addCrossOriginWindowOwnPropertyNames):
* bindings/js/JSLocationCustom.cpp:
(WebCore::getOwnPropertySlotCommon):
(WebCore::addCrossOriginLocationOwnPropertyNames):
2018-10-01 Xan Lopez <xan@igalia.com>
[SOUP] Fix the build for libsoup > 2.61.90
https://bugs.webkit.org/show_bug.cgi?id=190126
Reviewed by Michael Catanzaro.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
2018-10-01 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Reset running time in PlaybackPipeline::flush()
https://bugs.webkit.org/show_bug.cgi?id=190076
Reviewed by Philippe Normand.
Test: media/media-source/media-source-seek-redundant-append.html
PlaybackPipeline::flush() is called when already enqueued frames are
appended again. This may be caused by a quality change or just a
redundant append. Either way, the pipeline has to be flushed and
playback begin again, but without changing the player position by
much.
There are two kinds of time to consider here: stream time (i.e. the
time of a frame as written in the file, e.g. a frame may have stream
time 0:01:00), and running time (i.e. how much time since playback
started should pass before the frame should be played, e.g. if we
started playing at 0:00:59 that same frame would have a running time
of just 1 second).
Notice how running time depends on where and when playback starts.
Running time can also be optionally resetted after a flush. (This is
indeed done currently by most demuxers after a seek.)
Instead of resetting running time, PlaybackPipeline used to modify the
first GstSegment emitted after the flush. A GstSegment declares the
mapping between stream time and running time for the following frames.
There, PlaybackPipeline used to set `base` (the running time at which
the segment starts) to the position reported by a position query
(which is stream time).
This, of course, only worked when playback (or the last seek) started
at stream time 0:00:00, since that's the only case where running time
equals stream time. In other cases delays as long as the difference
between these timelines would appear. This is demonstrated in the
attached test, where seeks and appends are made in such an order that
the difference is more than 5 minutes, making the playback stall for
>5 minutes before playing 1 second of audio.
This patch fixes the problem by resetting running time with the flush
and not modifying GstSegment.base anymore (it will be left as zero,
which is now correct since the running time has been reset).
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::flush):
(WebCore::segmentFixerProbe): Deleted.
2018-09-30 Ryosuke Niwa <rniwa@webkit.org>
Use Position instead of Range in createMarkupInternal
https://bugs.webkit.org/show_bug.cgi?id=190107
Reviewed by Darin Adler.
Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator
in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of
Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator.
Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612.
* dom/Position.cpp:
(WebCore::Position::firstNode const): Added.
* dom/Position.h:
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range.
(WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range.
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator): Made this class non-copyable.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions.
(WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled
instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets.
(WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect
boundary offsets defined by m_start and m_end Positions instead of m_range Range.
(WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto.
(WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end
Positions. Note that the end position is always the next node in the tree order for a character node
and computeNodeAfterPosition returns nullptr for a character data.
(WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range.
(WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete
comments which were added for DOMRange in WebKitLegacy.
(WebCore::serializePreservingVisualAppearance):
(WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to
serializePreservingVisualAppearanceInternal.
(WebCore::serializeFragment):
* editing/markup.h:
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier.
2018-09-30 Walker Henderson <wjahenderson@gmail.com>
AudioNode.connect should return passed destination node
https://bugs.webkit.org/show_bug.cgi?id=188834
Reviewed by Eric Carlson.
No new tests, rebaselined existing test.
* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect): Deleted.
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioNode.cpp:
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNode.idl:
2018-09-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up RealtimeMediaSource settings change handling
https://bugs.webkit.org/show_bug.cgi?id=189998
<rdar://problem/44797884>
Reviewed by Youenn Fablet.
No new tests, updated webrtc/video-disabled-black.html.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::Source):
(WebCore::CanvasCaptureMediaStreamTrack::Source::settings):
(WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
(WebCore::RealtimeIncomingVideoSource::settings):
(WebCore::RealtimeIncomingVideoSource::settingsDidChange):
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::settingsDidChange):
(WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
(WebCore::RealtimeMediaSource::setSize):
(WebCore::RealtimeMediaSource::setFrameRate):
(WebCore::RealtimeMediaSource::setAspectRatio):
(WebCore::RealtimeMediaSource::setFacingMode):
(WebCore::RealtimeMediaSource::setVolume):
(WebCore::RealtimeMediaSource::setSampleRate):
(WebCore::RealtimeMediaSource::setSampleSize):
(WebCore::RealtimeMediaSource::setEchoCancellation):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
(WebCore::GStreamerAudioCaptureSource::settingsDidChange):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::GStreamerVideoCaptureSource::settingsDidChange):
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settingsDidChange):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::settingsDidChange):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settingsDidChange):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::settingsDidChange):
2018-09-30 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Use display-specific capture factories
https://bugs.webkit.org/show_bug.cgi?id=190043
<rdar://problem/44834412>
Reviewed by Youenn Fablet.
No new tests, no change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted.
(WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::createMediaStream):
(WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices):
* platform/mediastream/RealtimeMediaSourceCenter.h:
(WebCore::RealtimeMediaSourceCenter::setAudioFactory):
(WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
* platform/mediastream/RealtimeMediaSourceFactory.cpp: Added.
(WebCore::SingleSourceFactory::setActiveSource):
(WebCore::SingleSourceFactory::unsetActiveSource):
* platform/mediastream/RealtimeMediaSourceFactory.h: Added.
(WebCore::SingleSourceFactory::activeSource):
(WebCore::VideoCaptureFactory::setVideoCapturePageState):
(WebCore::DisplayCaptureFactory::setDisplayCapturePageState):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
(WebCore::libWebRTCVideoCaptureSourceFactory):
(WebCore::libWebRTCDisplayCaptureSourceFactory):
(WebCore::GStreamerVideoCaptureSource::factory):
(WebCore::GStreamerVideoCaptureSource::displayFactory):
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory):
(WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory):
* platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::factory):
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory):
(WebCore::RealtimeMediaSourceCenterMac::audioFactory):
(WebCore::RealtimeMediaSourceCenterMac::videoFactory):
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
(WebCore::MockRealtimeAudioSource::startProducingData):
(): Deleted.
(WebCore::mockAudioCaptureSourceFactory): Deleted.
(WebCore::MockRealtimeAudioSource::factory): Deleted.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState):
(WebCore::MockRealtimeMediaSourceCenter::audioFactory):
(WebCore::MockRealtimeMediaSourceCenter::videoFactory):
(WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory):
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(): Deleted.
(WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted.
(WebCore::mockVideoCaptureSourceFactory): Deleted.
(WebCore::MockRealtimeVideoSource::factory): Deleted.
* platform/mock/MockRealtimeVideoSource.h:
2018-09-29 Oriol Brufau <obrufau@igalia.com>
[css-grid] Properly align items next to collapsed tracks with gutters
https://bugs.webkit.org/show_bug.cgi?id=190089
Reviewed by Manuel Rego Casasnovas.
gridAreaPositionForInFlowChild could return a wrong end position for
grid items adjacent to a collapsed track, because it didn't take into
account that gutters collapse in that case. Therefore, "center" or
"end" alignments displayed the item at the wrong position.
Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::gridAreaPositionForInFlowChild const):
2018-09-29 Alicia Boya García <aboya@igalia.com>
[GStreamer][MSE] Use GObject for GST_TRACE_OBJECT
https://bugs.webkit.org/show_bug.cgi?id=190045
Reviewed by Philippe Normand.
Passing a non-GObject object to GST_TRACE_OBJECT() can be
theoretically misunderstood by the GStreamer logging function, so this
patch avoids that.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleEndOfAppend):
(WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
(WebCore::AppendPipeline::pushNewBuffer):
2018-09-28 Zamiul Haque <zhaque@apple.com>
Angled gradient backgrounds in body render vertically when body height is 0
https://bugs.webkit.org/show_bug.cgi?id=177232
<rdar://problem/34548230>.
Reviewed by Tim Horton.
Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered
as if they are vertical when the body tag containing the gradient
has a height of 0. Other browsers do not render under these circumstances,
so WebKit was modified to follow in suit. The problem was due to layout sizes for
fill tiles being calculated with a minimum height of 1px. A simple change of the
minimum height and width to 0px was enough to bring about the desired behavior.
Tests: angled-background-repeating-gradient-rendering-vertical.html
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::calculateFillTileSize const):
2018-09-28 Wenson Hsieh <wenson_hsieh@apple.com>
No DOM API to instantiate an attachment for an img element
https://bugs.webkit.org/show_bug.cgi?id=189934
<rdar://problem/44743222>
Reviewed by Ryosuke Niwa.
Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use
to ensure that an image element is backed by a unique _WKAttachment. See below for more details.
Tests: WKAttachmentTests.AddAttachmentToConnectedImageElement
WKAttachmentTests.ChangeFileWrapperForPastedImage
WKAttachmentTests.ConnectImageWithAttachmentToDocument
* dom/Document.cpp:
(WebCore::Document::registerAttachmentIdentifier):
Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating
a new empty attachment to back an image element.
* dom/Document.h:
* editing/Editor.cpp:
(WebCore::Editor::registerAttachmentIdentifier):
(WebCore::Editor::notifyClientOfAttachmentUpdates):
* editing/Editor.h:
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::getAttachmentIdentifier):
Creates an attachment element to back the image element, if an attachment does not already exist, and returns
the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose
file wrapper determines the contents of the image.
(WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):
(WebCore::HTMLAttachmentElement::hasEnclosingImage const):
(WebCore::HTMLAttachmentElement::updateEnclosingImageWithData):
Add a helper that updates the source of the enclosing image element given a content type and image data, by
creating a new blob and blob URL.
* html/HTMLAttachmentElement.h:
* html/HTMLAttachmentElement.idl:
* html/HTMLImageElement.idl:
Rename webkitAttachmentIdentifier to just attachmentIdentifier.
* page/EditorClient.h:
(WebCore::EditorClient::registerAttachmentIdentifier):
(WebCore::EditorClient::didInsertAttachmentWithIdentifier):
2018-09-28 Chris Dumez <cdumez@apple.com>
The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString
https://bugs.webkit.org/show_bug.cgi?id=190090
Reviewed by Ryosuke Niwa.
The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString:
- https://html.spec.whatwg.org/#onbeforeunloadeventhandler
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5)
In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT
cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is
because the return value cannot be false at:
- https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case).
No new tests, rebaselined existing test.
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
2018-09-28 Simon Fraser <simon.fraser@apple.com>
RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions()
https://bugs.webkit.org/show_bug.cgi?id=190093
Reviewed by Dean Jackson and Zalan Bujtas.
It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(),
because this is called at style update time, and layout will be stale.
It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update
descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity
changes and triggers layout accordingly, which will result in a full post-layout
updateLayerPositions().
This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout;
we need it to trigger layout (for now) because it affects z-order.
Covered by existing tests.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::removeOnlyThisLayer):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresLayout const):
2018-09-28 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Polish WebAuthN auto-test environment
https://bugs.webkit.org/show_bug.cgi?id=189283
<rdar://problem/44117828>
Reviewed by Chris Dumez.
This patch removes the old mocking mechanism.
Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html
http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html
http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* testing/Internals.cpp:
(WebCore::Internals::Internals):
(WebCore::Internals::mockAuthenticatorCoordinator const): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockAuthenticatorCoordinator.cpp: Removed.
* testing/MockAuthenticatorCoordinator.h: Removed.
* testing/MockAuthenticatorCoordinator.idl: Removed.
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
Two sources of raw pointers in the Fullscreen code:
- Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
they are passed around as raw references.
- Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
be ref-able.
Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
derefModel methods, overridden by implementing subclasses. Make every concrete observer
inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
the client interface.
Since every Interface class now holds a strong reference to its Model classes, and each
Model class holds a weak reference to all its clients, no explicit invalidate() method
is necessary.
Notes:
- Since the weak pointer methods need to be able to downcast to the abstract base class,
observers need to inherit publically (rather than privately) from those base classes.
- Media element Models should compose EventListener rather than inheriting from it, since
EventListener has its own RefCount.
- WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
their underlying object is destroyed), so clients should be stored in a Vector instead.
- Interfaces should be given all required Refs at creation time, so that they can store
those parameters as Refs instead of RefPtrs.
* platform/cocoa/PlaybackSessionInterface.h:
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModel::ref):
(WebCore::PlaybackSessionModel::deref):
(WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::addClient):
(WebCore::PlaybackSessionModelMediaElement::removeClient):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
(WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
* platform/cocoa/VideoFullscreenChangeObserver.h:
(WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::ref):
(WebCore::VideoFullscreenModel::deref):
(WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):
(VideoFullscreenModelVideoElement::addClient):
(VideoFullscreenModelVideoElement::removeClient):
(VideoFullscreenModelVideoElement::setHasVideo):
(VideoFullscreenModelVideoElement::setVideoDimensions):
(VideoFullscreenModelVideoElement::willEnterPictureInPicture):
(VideoFullscreenModelVideoElement::didEnterPictureInPicture):
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
(VideoFullscreenModelVideoElement::willExitPictureInPicture):
(VideoFullscreenModelVideoElement::didExitPictureInPicture):
(VideoFullscreenModelVideoElement::handleEvent): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.h:
(WebCore::PlaybackSessionInterfaceAVKit::create):
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
(): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(VideoFullscreenInterfaceAVKit::create):
(VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(VideoFullscreenInterfaceAVKit::setMode):
(VideoFullscreenInterfaceAVKit::clearMode):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
(VideoFullscreenInterfaceAVKit::invalidate): Deleted.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController delegate]):
(-[WebAVPlayerController playbackSessionInterface]):
(-[WebAVPlayerController setPlaybackSessionInterface:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::didCleanupFullscreen):
(VideoFullscreenControllerContext::addClient):
(VideoFullscreenControllerContext::removeClient):
(VideoFullscreenControllerContext::willEnterPictureInPicture):
(VideoFullscreenControllerContext::didEnterPictureInPicture):
(VideoFullscreenControllerContext::failedToEnterPictureInPicture):
(VideoFullscreenControllerContext::willExitPictureInPicture):
(VideoFullscreenControllerContext::didExitPictureInPicture):
(VideoFullscreenControllerContext::setUpFullscreen):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::create):
(WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
(WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
(WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::PlaybackSessionInterfaceMac::endScrubbing):
(WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
(WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
(WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
(WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::create):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
(WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
(WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
(WebCore::VideoFullscreenInterfaceMac::setMode):
(WebCore::VideoFullscreenInterfaceMac::clearMode):
(WebCore::VideoFullscreenInterfaceMac::invalidate):
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager togglePlayback]):
(-[WebPlaybackControlsManager setPlaying:]):
(-[WebPlaybackControlsManager isPlaying]):
(-[WebPlaybackControlsManager togglePictureInPicture]):
2018-09-28 Chris Dumez <cdumez@apple.com>
Drop support for cross-origin-window-policy header
https://bugs.webkit.org/show_bug.cgi?id=190081
Reviewed by Ryosuke Niwa.
Drop support for cross-origin-window-policy header as this was never enabled and its design has
some issues we have not resolved. An alternative is being worked on but will be substantially
different so there is not much value in keeping this code around.
* bindings/js/JSDOMBindingSecurity.cpp:
* bindings/js/JSDOMBindingSecurity.h:
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
(WebCore::addCrossOriginWindowPropertyNames):
(WebCore::addScopedChildrenIndexes):
(WebCore::addCrossOriginWindowOwnPropertyNames):
(WebCore::JSDOMWindow::getOwnPropertyNames):
* bindings/js/JSDOMWindowCustom.h:
* bindings/js/JSRemoteDOMWindowCustom.cpp:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateAttributeGetterBodyDefinition):
(GenerateAttributeSetterBodyDefinition):
(GenerateOperationBodyDefinition):
* bindings/scripts/IDLAttributes.json:
* dom/Document.cpp:
(WebCore::Document::canNavigate):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didBeginDocument):
* page/AbstractDOMWindow.cpp:
(WebCore::AbstractDOMWindow::AbstractDOMWindow):
* page/AbstractDOMWindow.h:
* page/DOMWindow.idl:
* page/Settings.yaml:
* platform/network/HTTPParsers.cpp:
* platform/network/HTTPParsers.h:
2018-09-28 Daniel Bates <dabates@apple.com>
[iOS] Allow programmatic focus when hardware keyboard is attached
https://bugs.webkit.org/show_bug.cgi?id=190017
<rdar://problem/42270463>
Reviewed by Wenson Hsieh.
Add support for checking if the embedding client is WebKitTestRunner and export isDumpRenderTree()
so that we can make use of it from WebKit. We will make use of these functions to keep the current
behavior of disallowing programmatic focus when running tests in these apps. This is needed to
keep testing deterministic. Otherwise, test results would be dependent on whether a hardware
keyboard is attached. When running tests in Simulator.app the hardware keyboard may also not be
connected (i.e. Hardware > Keyboard > Connect Hardware Keyboard is disabled).
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isWebKitTestRunner): Added.
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r236609): API tests for mso list preservation are failing
https://bugs.webkit.org/show_bug.cgi?id=190095
Reviewed by Wenson Hsieh.
The regression was caused by appendNodeToPreserveMSOList called after an early return for not having renderer.
Clearly, comment & style elements coming from a MS word document wouldn't have a renderer.
Fixed the bug by changing the order.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Build fix after r236612.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeSelection):
2018-09-28 Andy Estes <aestes@apple.com>
[Apple Pay] Remove the "in-store" button type
https://bugs.webkit.org/show_bug.cgi?id=190079
Reviewed by Tim Horton.
According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
this button is meant only for certain kinds of native apps. It shouldn't be available on the web.
Updated http/tests/ssl/applepay/ApplePayButton.html.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
* css/CSSValueKeywords.in:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* rendering/RenderThemeCocoa.mm:
(WebCore::toPKPaymentButtonType):
* rendering/style/RenderStyleConstants.h:
2018-09-28 Chris Dumez <cdumez@apple.com>
document.open() should throw errors for cross-origin calls
https://bugs.webkit.org/show_bug.cgi?id=189371
<rdar://problem/44282700>
Reviewed by Youenn Fablet.
document.open() / document.write() should throw errors for cross-origin calls as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 4)
No new tests, rebaselined existing tests.
* dom/Document.cpp:
(WebCore::Document::open):
(WebCore::Document::write):
(WebCore::Document::writeln):
* dom/Document.h:
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Rename createMarkup to serializePreservingVisualAppearance
https://bugs.webkit.org/show_bug.cgi?id=190086
Reviewed by Wenson Hsieh.
Renamed the function to clarify what it does. Also removed the unused Range::toHTML.
* dom/Range.cpp:
(WebCore::Range::toHTML const): Deleted.
* dom/Range.h:
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* editing/markup.cpp:
(WebCore::serializePreservingVisualAppearance):
(WebCore::createMarkup): Deleted.
* editing/markup.h:
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeRangeToDataObject):
2018-09-28 Simon Fraser <simon.fraser@apple.com>
Remove some unused RenderLayer code
https://bugs.webkit.org/show_bug.cgi?id=190078
Reviewed by Zalan Bujtas.
The 'outOfFlowDescendantContainingBlocks' code was related to the accelerated overflow scrolling code that
I removed recently.
updateDescendantsLayerListsIfNeeded() is never called.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateDescendantDependentFlags):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
2018-09-28 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236605.
https://bugs.webkit.org/show_bug.cgi?id=190087
caused three API test timeouts (Requested by jernoble on
#webkit).
Reverted changeset:
"Refactoring: eliminate raw pointer usage in Fullscreen code"
https://bugs.webkit.org/show_bug.cgi?id=188747
https://trac.webkit.org/changeset/236605
2018-09-28 Ryosuke Niwa <rniwa@webkit.org>
Simplify StyledMarkupAccumulator::traverseNodesForSerialization
https://bugs.webkit.org/show_bug.cgi?id=190073
Reviewed by Antti Koivisto.
Simplified the range traversal algorithm in traverseNodesForSerialization as it was too complicated
to support shadow DOM for copy and paste.
Instead of using NodeTraversal::next to traverse past ancestors and then figuring out which ancestor
must be closed or to wrap the existing markup with, new code collects the list of ancestors as we
traverse out of them.
Also extracted lambdas for generating markup and deciding whether to skip a node as well as keeping
track of the depth of the current markup. This further reduces the code complexity of the actual
node traversal algorithm. Keeping track of the depth allows us to now generate ancestor elements'
closing tags without keeping a stack of ancestor nodes we opened at all times.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
2018-09-27 Ryosuke Niwa <rniwa@webkit.org>
Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode()
https://bugs.webkit.org/show_bug.cgi?id=190069
Reviewed by Zalan Bujtas.
Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode()
because their implementations are identical.
Note that offsetInCharacters() sounds like a function which returns some kind of an offset
but it doesn't. It returns true when called on a CharacterData and false elsewhere.
* accessibility/AXObjectCache.cpp:
(WebCore::characterOffsetsInOrder):
(WebCore::AXObjectCache::startOrEndCharacterOffsetForRange):
(WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
* dom/CharacterData.cpp:
(WebCore::CharacterData::offsetInCharacters const): Deleted.
* dom/CharacterData.h:
* dom/Node.cpp:
(WebCore::Node::offsetInCharacters const): Deleted.
* dom/Node.h:
* dom/Position.cpp:
(WebCore::Position::parentAnchoredEquivalent const):
* dom/Position.h:
(WebCore::lastOffsetInNode):
(WebCore::minOffsetForNode):
(WebCore::offsetIsBeforeLastNodeOffset):
* dom/Range.cpp:
(WebCore::Range::firstNode const):
(WebCore::Range::pastLastNode const):
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setOffset):
(WebCore::RangeBoundaryPoint::setToEndOfNode):
* editing/Editing.cpp:
(WebCore::lastOffsetForEditing):
* editing/TextIterator.cpp:
(WebCore::nextInPreOrderCrossingShadowBoundaries):
(WebCore::TextIterator::node const):
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::extend):
2018-09-28 Jer Noble <jer.noble@apple.com>
Refactoring: eliminate raw pointer usage in Fullscreen code
https://bugs.webkit.org/show_bug.cgi?id=188747
<rdar://problem/43541164>
Reviewed by Alex Christensen.
Two sources of raw pointers in the Fullscreen code:
- Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so
they are passed around as raw references.
- Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and
VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't
be ref-able.
Make Model classes ref-able by adding ref() and deref() which call virtual refModel and
derefModel methods, overridden by implementing subclasses. Make every concrete observer
inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around
the client interface.
Since every Interface class now holds a strong reference to its Model classes, and each
Model class holds a weak reference to all its clients, no explicit invalidate() method
is necessary.
Notes:
- Since the weak pointer methods need to be able to downcast to the abstract base class,
observers need to inherit publically (rather than privately) from those base classes.
- Media element Models should compose EventListener rather than inheriting from it, since
EventListener has its own RefCount.
- WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when
their underlying object is destroyed), so clients should be stored in a Vector instead.
- Interfaces should be given all required Refs at creation time, so that they can store
those parameters as Refs instead of RefPtrs.
* platform/cocoa/PlaybackSessionInterface.h:
(WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted.
* platform/cocoa/PlaybackSessionModel.h:
(WebCore::PlaybackSessionModel::ref):
(WebCore::PlaybackSessionModel::deref):
(WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/cocoa/PlaybackSessionModelMediaElement.mm:
(WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement):
(WebCore::PlaybackSessionModelMediaElement::setMediaElement):
(WebCore::PlaybackSessionModelMediaElement::updateForEventName):
(WebCore::PlaybackSessionModelMediaElement::addClient):
(WebCore::PlaybackSessionModelMediaElement::removeClient):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
(WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices):
(WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted.
* platform/cocoa/VideoFullscreenChangeObserver.h:
(WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted.
* platform/cocoa/VideoFullscreenModel.h:
(WebCore::VideoFullscreenModel::ref):
(WebCore::VideoFullscreenModel::deref):
(WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted.
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):
(VideoFullscreenModelVideoElement::addClient):
(VideoFullscreenModelVideoElement::removeClient):
(VideoFullscreenModelVideoElement::setHasVideo):
(VideoFullscreenModelVideoElement::setVideoDimensions):
(VideoFullscreenModelVideoElement::willEnterPictureInPicture):
(VideoFullscreenModelVideoElement::didEnterPictureInPicture):
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
(VideoFullscreenModelVideoElement::willExitPictureInPicture):
(VideoFullscreenModelVideoElement::didExitPictureInPicture):
(VideoFullscreenModelVideoElement::handleEvent): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.h:
(WebCore::PlaybackSessionInterfaceAVKit::create):
(WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const):
(): Deleted.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit):
(WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(VideoFullscreenInterfaceAVKit::create):
(VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver):
(VideoFullscreenInterfaceAVKit::applicationDidBecomeActive):
(VideoFullscreenInterfaceAVKit::setupFullscreen):
(VideoFullscreenInterfaceAVKit::presentingViewController):
(VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
(VideoFullscreenInterfaceAVKit::preparedToExitFullscreen):
(VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
(VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
(VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
(VideoFullscreenInterfaceAVKit::doSetup):
(VideoFullscreenInterfaceAVKit::setMode):
(VideoFullscreenInterfaceAVKit::clearMode):
(VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted.
(VideoFullscreenInterfaceAVKit::invalidate): Deleted.
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController delegate]):
(-[WebAVPlayerController playbackSessionInterface]):
(-[WebAVPlayerController setPlaybackSessionInterface:]):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(VideoFullscreenControllerContext::didCleanupFullscreen):
(VideoFullscreenControllerContext::addClient):
(VideoFullscreenControllerContext::removeClient):
(VideoFullscreenControllerContext::willEnterPictureInPicture):
(VideoFullscreenControllerContext::didEnterPictureInPicture):
(VideoFullscreenControllerContext::failedToEnterPictureInPicture):
(VideoFullscreenControllerContext::willExitPictureInPicture):
(VideoFullscreenControllerContext::didExitPictureInPicture):
(VideoFullscreenControllerContext::setUpFullscreen):
* platform/mac/PlaybackSessionInterfaceMac.h:
* platform/mac/PlaybackSessionInterfaceMac.mm:
(WebCore::PlaybackSessionInterfaceMac::create):
(WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac):
(WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const):
(WebCore::PlaybackSessionInterfaceMac::rateChanged):
(WebCore::PlaybackSessionInterfaceMac::beginScrubbing):
(WebCore::PlaybackSessionInterfaceMac::endScrubbing):
(WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager):
(WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming):
(WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted.
(WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted.
* platform/mac/VideoFullscreenInterfaceMac.h:
(WebCore::VideoFullscreenInterfaceMac::create):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const):
(WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const):
(WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]):
(-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
(WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver):
(WebCore::VideoFullscreenInterfaceMac::setMode):
(WebCore::VideoFullscreenInterfaceMac::clearMode):
(WebCore::VideoFullscreenInterfaceMac::invalidate):
(WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP):
(WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted.
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
(-[WebPlaybackControlsManager togglePlayback]):
(-[WebPlaybackControlsManager setPlaying:]):
(-[WebPlaybackControlsManager isPlaying]):
(-[WebPlaybackControlsManager togglePictureInPicture]):
2018-09-28 Chris Dumez <cdumez@apple.com>
Drop iOS specific quirk in SettingsBase::scriptEnabledChanged()
https://bugs.webkit.org/show_bug.cgi?id=190077
<rdar://problem/44812613>
Reviewed by Zalan Bujtas.
Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() that would dirty style after the
"JavaScriptEnabled" setting's state is toggled. I do not see a good reason to do this given that
scripts would not get executed until a reload.
If we find out after dropping this that this is actually useful for some reason, then we can
always bring it back and consider making this non-iOS specific, as well as documenting why this
it is needed.
* page/Settings.yaml:
* page/SettingsBase.cpp:
(WebCore::SettingsBase::scriptEnabledChanged): Deleted.
* page/SettingsBase.h:
2018-09-27 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix priority issue with multiple cookies with different level of path.
https://bugs.webkit.org/show_bug.cgi?id=189920
Reviewed by Fujii Hironori.
When multiple cookies are stored in the database for same site, the priority of
multiple cookies which matches path criteria was not defined. The backend
implementation `sqlite` then returns the first matching result, which is the one
stored earlier.
Test: http/tests/cookies/cookie-with-multiple-level-path.html
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::searchCookies):
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Use enum class in createMarkup arguments
https://bugs.webkit.org/show_bug.cgi?id=190028
Reviewed by Wenson Hsieh.
Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes,
EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax.
Also replaced the boolean convertBlocksToInlines with an enum class of the same name.
Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer
to serializeFragment.
* dom/Element.cpp:
(WebCore::Element::innerHTML const):
(WebCore::Element::outerHTML const):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::innerHTML const):
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/HTMLInterchange.h:
(WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange.
* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::MarkupAccumulator):
(WebCore::MarkupAccumulator::serializeNodes):
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
(WebCore::MarkupAccumulator::resolveURLIfNeeded const):
* editing/MarkupAccumulator.h:
(WebCore::MarkupAccumulator::inXMLFragmentSerialization const):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::willApplyCommand):
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::inputEventDataTransfer const):
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentMarkupReader::readRTFD):
(WebCore::WebContentMarkupReader::readRTF):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::writeImageToPasteboard):
(WebCore::Editor::writeSelectionToPasteboard):
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator):
(WebCore::StyledMarkupAccumulator::serializeNodes):
(WebCore::StyledMarkupAccumulator::traverseNodesForSerialization):
(WebCore::highestAncestorToWrapMarkup):
(WebCore::createMarkupInternal):
(WebCore::createMarkup):
(WebCore::sanitizedMarkupForFragmentInDocument):
(WebCore::serializeFragment): Renamed from createMarkup. This is used for innerHTML and XMLSerializer,
which faithfully serializes the fragment without any computed style as inline styles.
(WebCore::documentTypeString):
(WebCore::createFullMarkup): Deleted two varinats used in WebKitLegacy.
* editing/markup.h:
(WebCore::ResolveURLs): Renamed from EAbsoluteURLs.
(WebCore::ConvertBlocksToInlines): Added.
(WebCore::SerializedNodes): Renamed from EChildrenOnly.
(WebCore::SerializationSyntax): Renamed from EFragmentSerialization.
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
* inspector/DOMEditor.cpp:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getOuterHTML):
* loader/archive/cf/LegacyWebArchive.cpp:
(WebCore::LegacyWebArchive::create):
(WebCore::LegacyWebArchive::createFromSelection):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
(WebCore::PageSerializer::serializeFrame):
* page/win/DragControllerWin.cpp:
(WebCore::DragController::declareAndWriteDragImage):
* Source/WebCore/platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeRangeToDataObject):
(WebCore::Pasteboard::writeSelection):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLSerializer.cpp:
(WebCore::XMLSerializer::serializeToString):
* xml/XSLTProcessorLibxslt.cpp:
(WebCore::xsltStylesheetPointer):
(WebCore::xmlDocPtrFromNode):
2018-09-27 John Wilander <wilander@apple.com>
Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics
https://bugs.webkit.org/show_bug.cgi?id=190055
<rdar://problem/44843460>
Reviewed by Chris Dumez.
Test: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
Corrects legacy statistics for frames and triggers a re-classification.
2018-09-27 Jer Noble <jer.noble@apple.com>
Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't
HAVE(AVCONTENTKEYSESSION).
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2018-09-27 Justin Michaud <justin_michaud@apple.com>
Remove duplicate CSS Properties and Values feature on status page
https://bugs.webkit.org/show_bug.cgi?id=189909
Reviewed by Simon Fraser.
Update CSS properties and values api feature in features.json
* features.json:
2018-09-27 Jer Noble <jer.noble@apple.com>
MediaPlayer should have mediaPlayerWaitingForKeyChanged() / bool waitingForKey() accessor
https://bugs.webkit.org/show_bug.cgi?id=189951
Reviewed by Eric Carlson.
In order to implement the "Resume Playback" section of EME, part 4, we need to be able
to query whether the MediaPlayer is still waiting for a key after attemptToDecrypt()
has been called. Currently this involves no behavioral changes, as all modern EME ports
will still just notify the media element that they no longer need keys after one has
been added, but future ports may be able to wait for multiple keys before reporting
that it is no longer waiting for keys.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKeyChanged):
(WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKey): Deleted.
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::waitingForKeyChanged):
(WebCore::MediaPlayer::waitingForKey const):
(WebCore::MediaPlayer::waitingForKey): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKeyChanged):
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKey): Deleted.
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::waitingForKey const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
(WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
(WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey):
(WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
2018-09-27 Alicia Boya García <aboya@igalia.com>
[MSE] Fix unwanted sample erase from the decode queue
https://bugs.webkit.org/show_bug.cgi?id=180643
Reviewed by Jer Noble.
Test: media/media-source/media-source-append-acb-no-frame-lost.html
This bug reproduced when unordered appends were made. For instance, if
the application appended [0, 10) and then [20, 30), the frame at 20
would be wrongly discarded from the decode queue.
Later the application could append [10, 20) and the gap at [20, 21)
would persist in the decode queue, even if the frame remained in the
track buffer table.
Thanks to Daniel Zhang for reporting the issue.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::provideMediaData):
2018-09-27 Alex Christensen <achristensen@webkit.org>
URLParser should use TextEncoding through an abstract class
https://bugs.webkit.org/show_bug.cgi?id=190027
Reviewed by Andy Estes.
URLParser uses TextEncoding for one call to encode, which is only used for encoding the query of URLs in documents with non-UTF encodings.
There are 3 call sites that specify the TextEncoding to use from the Document, and even those call sites use a UTF encoding most of the time.
All other URL parsing is done using a well-optimized path which assumes UTF-8 encoding and uses macros from ICU headers, not a TextEncoding.
Moving the logic in this way breaks URL and URLParser's dependency on TextEncoding, which makes it possible to use in a lower-level project
without also moving TextEncoding, TextCodec, TextCodecICU, ThreadGlobalData, and the rest of WebCore and JavaScriptCore.
There is no observable change in behavior. There is now one virtual function call in a code path in URLParser that is not performance-sensitive,
and TextEncodings now have a vtable, which uses a few more bytes of memory total for WebKit.
* css/parser/CSSParserContext.h:
(WebCore::CSSParserContext::completeURL const):
* css/parser/CSSParserIdioms.cpp:
(WebCore::completeURL):
* dom/Document.cpp:
(WebCore::Document::completeURL const):
* html/HTMLBaseElement.cpp:
(WebCore::HTMLBaseElement::href const):
Move the call to encodingForFormSubmission from the URL constructor to the 3 call sites that specify the encoding from the Document.
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
* loader/TextResourceDecoder.cpp:
(WebCore::TextResourceDecoder::encodingForURLParsing):
* loader/TextResourceDecoder.h:
* platform/URL.cpp:
(WebCore::URL::URL):
* platform/URL.h:
(WebCore::URLTextEncoding::~URLTextEncoding):
* platform/URLParser.cpp:
(WebCore::URLParser::encodeNonUTF8Query):
(WebCore::URLParser::copyURLPartsUntil):
(WebCore::URLParser::URLParser):
(WebCore::URLParser::parse):
(WebCore::URLParser::encodeQuery): Deleted.
A pointer replaces the boolean isUTF8Encoding and the TextEncoding& which had a default value of UTF8Encoding.
Now the pointer being null means that we use UTF8, and the pointer being non-null means we use that encoding.
* platform/URLParser.h:
(WebCore::URLParser::URLParser):
* platform/text/TextEncoding.cpp:
(WebCore::UTF7Encoding):
(WebCore::TextEncoding::encodingForFormSubmissionOrURLParsing const):
(WebCore::ASCIIEncoding):
(WebCore::Latin1Encoding):
(WebCore::UTF16BigEndianEncoding):
(WebCore::UTF16LittleEndianEncoding):
(WebCore::UTF8Encoding):
(WebCore::WindowsLatin1Encoding):
(WebCore::TextEncoding::encodingForFormSubmission const): Deleted.
Use NeverDestroyed because TextEncoding now has a virtual destructor.
* platform/text/TextEncoding.h:
Rename encodingForFormSubmission to encodingForFormSubmissionOrURLParsing to make it more clear that we are intentionally using it for both.
2018-09-27 John Wilander <wilander@apple.com>
Resource Load Statistics: Remove temporary compatibility fix for auto-dismiss popups
https://bugs.webkit.org/show_bug.cgi?id=189980
<rdar://problem/44780645>
Reviewed by Alex Christensen.
Test: http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss.html
The change in https://bugs.webkit.org/show_bug.cgi?id=183620 was a temporary
compatibility fix as explained in:
https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/. We should
remove it.
Most of these changes remove the parameter isTriggeredByUserGesture since it's no longer needed.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
(WebCore::ResourceLoadObserver::logWindowCreation): Deleted.
* loader/ResourceLoadObserver.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
Now no longer logs anything to ResourceLoadObserver.
2018-09-27 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r236557.
Really roll out r236557 this time because it breaks internal
builds.
Reverted changeset:
"Add VP8 support to WebRTC"
https://bugs.webkit.org/show_bug.cgi?id=189976
https://trac.webkit.org/changeset/236557
2018-09-27 Chris Dumez <cdumez@apple.com>
Fragment should be stripped from document URL during document.open() URL propagation
https://bugs.webkit.org/show_bug.cgi?id=189374
<rdar://problem/44282736>
Reviewed by Alex Christensen.
Strip the Document URL fragment during document.open() URL propagation if the entry document
is not the current document, as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 11.2.)
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::open):
2018-09-27 Youenn Fablet <youenn@apple.com>
Add VP8 support to WebRTC
https://bugs.webkit.org/show_bug.cgi?id=189976
Reviewed by Eric Carlson.
Add a runtime flag to control activation of VP8 codec.
Bind this runtime flag to the video codec factories.
Test: webrtc/video-mute-vp8.html
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::createLibWebRTCPeerConnectionBackend):
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
Enable VP8 codec for tests.
2018-09-27 Chris Dumez <cdumez@apple.com>
Crash under WebCore::deleteCookiesForHostnames()
https://bugs.webkit.org/show_bug.cgi?id=190040
<rdar://problem/38020368>
Reviewed by Alex Christensen.
Update NetworkStorageSession::deleteCookiesForHostnames() to properly deal with the fact
that NSHTTPCookie.domain can return nil.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookiesForHostnames):
2018-09-27 Youenn Fablet <youenn@apple.com>
Use kCVPixelFormatType_420YpCbCr8Planar for capturing frames
https://bugs.webkit.org/show_bug.cgi?id=190014
Reviewed by Eric Carlson.
On Mac, rely on the monoplanar format which can be displayed without any issue.
Once rendering is fixed, we should change it back to biplanar as it is closer to what libwebrtc consumes.
Covered by manual testing.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::avVideoCapturePixelBufferFormat):
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
2018-09-27 Andy Estes <aestes@apple.com>
[Apple Pay] Support granular errors in PaymentDetailsUpdate
https://bugs.webkit.org/show_bug.cgi?id=189938
Reviewed by Youenn Fablet.
Implemented the shippingAddressErrors, payerErrors, and paymentMethodErrors properties on
PaymentDetailsUpdate, as specified in the Payment Request API W3C Editor's Draft of
26 September 2018.
When these errors are specified in a PaymentDetailsUpdate, map them to PaymentErrors. For
shippingAddressErrors and payerErrors, we use the "shippingContactInvalid" code and a
contact field that matches the shippingAddressError or payerError property specified.
For paymentMethodErrors, we interpret this as a sequence of ApplePayErrors, which are
converted to PaymentErrors as in Apple Pay JS.
Tests: http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html
http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html
* DerivedSources.make: Removed some tabs and added new .idl files.
* Modules/applepay/ApplePayError.idl: Moved ApplePayErrorCode and ApplePayErrorContactField
into their own .idl files so they can be used in MockPaymentError.
* Modules/applepay/ApplePayErrorCode.h: Added.
* Modules/applepay/ApplePayErrorCode.idl: Added.
* Modules/applepay/ApplePayErrorContactField.h: Added.
* Modules/applepay/ApplePayErrorContactField.idl: Added.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::appendShippingContactInvalidError): Appended a "shippingContactInvalid"
PaymentError to errors if the message is non-null.
(WebCore::ApplePayPaymentHandler::computeErrors const):
(WebCore::ApplePayPaymentHandler::detailsUpdated):
(WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Computed a vector of PaymentErrors
based on shippingAddressErrors, payerErrors, and paymentMethodErrors.
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentDetailsUpdate.h:
* Modules/paymentrequest/PaymentDetailsUpdate.idl: Defined shippingAddressErrors,
payerErrors, and paymentMethodErrors.
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::paymentMethodChanged):
(WebCore::PaymentRequest::settleDetailsPromise): Passed shippingAddressErrors, payerErrors,
and paymentMethodErrors to the payment handler.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::completeShippingContactSelection): Stored errors in m_errors.
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl: Added an errors attribute.
* testing/MockPaymentError.h: Added.
* testing/MockPaymentError.idl: Added.
2018-09-27 Alex Christensen <achristensen@webkit.org>
URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL
https://bugs.webkit.org/show_bug.cgi?id=189979
Reviewed by Youenn Fablet.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithUserTypedString):
(WebCore::dataForURLComponentType):
(WebCore::URLByRemovingComponentAndSubsequentCharacter):
(WebCore::URLByCanonicalizingURL):
(WebCore::originalURLData):
(WebCore::userVisibleString):
2018-09-27 Chris Dumez <cdumez@apple.com>
document.open() should not propagate URLs to non-fully active documents
https://bugs.webkit.org/show_bug.cgi?id=189375
<rdar://problem/44282755>
Reviewed by Youenn Fablet.
Update our document.open() to not propagate URLs to non-fully active documents, as per:
- https://html.spec.whatwg.org/#document-open-steps (Step 11)
A "fully active" document is defined by at:
- https://html.spec.whatwg.org/#fully-active
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::open):
(WebCore::Document::isFullyActive const):
* dom/Document.h:
* dom/Document.idl:
2018-09-27 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Use sentinel buffer to detect end of append
https://bugs.webkit.org/show_bug.cgi?id=189924
Reviewed by Philippe Normand.
This patch introduces a new mechanism to detect when an append has
been consumed completely by the demuxer. It takes advantage of the
fact that buffer pushing is synchronous: both the appsrc and the
demuxer live in the same streaming thread. When appsrc pushes a
buffer, it's actually making a qtdemux function call (it calls its
"chain" function). The demuxer will return from that call when it has
finished processing that buffer; only then the control returns to
appsrc, that can push the next buffer.
By pushing an additional buffer and capturing it in a probe we can
detect reliably when the previous buffer has been processed.
Because the pipeline only has one thread, at this point no more frames
can arrive to the appsink.
This replaces the old method of detecting end of append which relied
on the `need-data` event, which is more difficult to handle correctly
because it fires whenever the appsrc is empty (or below a given
level), which also happens when a buffer has not been pushed yet or
in response to a flush.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::EndOfAppendMeta::init):
(WebCore::EndOfAppendMeta::transform):
(WebCore::EndOfAppendMeta::free):
(WebCore::AppendPipeline::staticInitialization):
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::handleEndOfAppend):
(WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::pushNewBuffer):
(WebCore::AppendPipeline::handleAppsrcNeedDataReceived): Deleted.:
(WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft): Deleted.
(WebCore::AppendPipeline::checkEndOfAppend): Deleted.
(WebCore::AppendPipeline::setAppsrcDataLeavingProbe): Deleted.
(WebCore::AppendPipeline::removeAppsrcDataLeavingProbe): Deleted.
(WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft): Deleted.
(WebCore::AppendPipeline::reportAppsrcNeedDataReceived): Deleted.
(WebCore::appendPipelineAppsrcDataLeaving): Deleted.
(WebCore::appendPipelineAppsrcNeedData): Deleted.
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2018-09-27 Chris Dumez <cdumez@apple.com>
The WebContent process should not process incoming IPC while waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=184183
<rdar://problem/36800576>
Reviewed by Ryosuke Niwa.
Drop test infrastructure for the DoNotProcessIncomingMessagesWhenWaitingForSyncReply IPC::SendOption
given that this SendOption was removed from this patch.
* page/ChromeClient.h:
* testing/Internals.cpp:
* testing/Internals.h:
* testing/Internals.idl:
2018-09-27 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK Ubuntu LTS build fix attempt after r236396.
* platform/graphics/gstreamer/GStreamerCommon.h:
2018-09-27 Antoine Quint <graouts@apple.com>
[Web Animations] Turn Web Animations with CSS integration on
https://bugs.webkit.org/show_bug.cgi?id=184819
<rdar://problem/39597337>
Reviewed by Dean Jackson.
* page/RuntimeEnabledFeatures.h:
2018-09-26 YUHAN WU <yuhan_wu@apple.com>
Video track clone cannot preserve original property
https://bugs.webkit.org/show_bug.cgi?id=189872
<rdar://problem/44706579>
Reviewed by Youenn Fablet.
Fix the issue that the cloned track created by canvas.captureStream().getVideoTracks() cannot keep some attributes, such as enabled.
Updated a testcase expected result:
LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack):
(WebCore::CanvasCaptureMediaStreamTrack::create):
(WebCore::CanvasCaptureMediaStreamTrack::clone):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.h:
2018-09-26 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r236524.
Broke API tests
Reverted changeset:
"URLWithUserTypedString should return nil for URLs deemed to
be invalid by WebCore::URL"
https://bugs.webkit.org/show_bug.cgi?id=189979
https://trac.webkit.org/changeset/236524
2018-09-26 Per Arne Vollan <pvollan@apple.com>
WebVTT cue alignment broken
https://bugs.webkit.org/show_bug.cgi?id=190004
Reviewed by Eric Carlson.
If the position of the queue is unspecified, the default value of 50 was used, which is incorrect.
This patch also updates the API according to https://w3c.github.io/webvtt/#the-vttcue-interface.
The position attribute should not be a double, but either a double or the "auto" keyword. Parts
of this patch is inspired by the associated code in the Chromium project.
Test: media/track/track-cue-left-align.html
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
(WebCore::TextTrackCueGeneric::setPosition):
* html/track/TextTrackCueGeneric.h:
* html/track/VTTCue.cpp:
(WebCore::VTTCueBox::applyCSSProperties):
(WebCore::VTTCue::initialize):
(WebCore::VTTCue::position const):
(WebCore::VTTCue::setPosition):
(WebCore::VTTCue::textPositionIsAuto const):
(WebCore::VTTCue::calculateComputedTextPosition const):
(WebCore::VTTCue::calculateDisplayParameters):
(WebCore::VTTCue::toJSON const):
* html/track/VTTCue.h:
(WebCore::VTTCue::position const): Deleted.
* html/track/VTTCue.idl:
2018-09-26 James Savage <james.savage@apple.com>
Allow override of viewport configuration.
https://bugs.webkit.org/show_bug.cgi?id=188772.
<rdar://problem/43538892>.
Reviewed by Simon Fraser.
* page/Settings.yaml:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::nativeWebpageParameters): Provide a viewport configuration
similar to width=device-width, with initial scale set to 1.
* page/ViewportConfiguration.h:
2018-09-26 Alex Christensen <achristensen@webkit.org>
URLs with mismatched surrogate pairs in the host should fail to parse
https://bugs.webkit.org/show_bug.cgi?id=190005
Reviewed by Chris Dumez.
Elsewhere in the URLParser, when we encounter mismatched surrogate pairs we use the replacement character,
but that just fails later on in domainToASCII, so we may as well just fail.
This behavior matches Chrome, but is unclear in the spec. There are no valid uses of hosts containing mismatched surrogate pairs.
Covered by new API tests.
* platform/URLParser.cpp:
(WebCore::URLParser::parseHostAndPort):
2018-09-26 Alex Christensen <achristensen@webkit.org>
uidna_nameToASCII only needs a buffer capacity of 64
https://bugs.webkit.org/show_bug.cgi?id=190006
Reviewed by Chris Dumez.
This is specified in https://www.unicode.org/reports/tr46/#ToASCII
This is how Chrome and Firefox also behave with long unicode hosts.
* platform/URLParser.cpp:
(WebCore::URLParser::domainToASCII):
2018-09-26 Alex Christensen <achristensen@webkit.org>
URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL
https://bugs.webkit.org/show_bug.cgi?id=189979
<rdar://problem/44119696>
Reviewed by Chris Dumez.
Covered by an API test.
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::URLWithData):
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Selection should work across shadow boundary when initiated by a mouse drag
https://bugs.webkit.org/show_bug.cgi?id=151380
<rdar://problem/24363872>
Revert the change that I said I would from r236519.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries):
2018-09-26 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r236511.
https://bugs.webkit.org/show_bug.cgi?id=190008
It is breaking some WebRTC tests (Requested by youenn on
#webkit).
Reverted changeset:
"[MediaStream] Clean up RealtimeMediaSource settings change
handling"
https://bugs.webkit.org/show_bug.cgi?id=189998
https://trac.webkit.org/changeset/236511
2018-09-26 Ryosuke Niwa <rniwa@webkit.org>
Selection should work across shadow boundary when initiated by a mouse drag
https://bugs.webkit.org/show_bug.cgi?id=151380
<rdar://problem/24363872>
Reviewed by Antti Koivisto and Wenson Hsieh.
This patch adds the basic support for selecting content across shadow DOM boundaries to VisibleSelection,
which is enough to allow users to select content across shadow DOM boundaries via a mouse drag.
This is the first step in allowing users to select, copy and paste content across shadow DOM boundaries,
which is a serious user experience regression right now. The new behavior is disabled by default under
an interal debug feature flag: selectionAcrossShadowBoundariesEnabled.
Like Chrome, we are not going to support selecting editable content across shadow DOM boundaries since
we'd have to generalize every editing commands to make that work, and there aren't any HTML editors that
use shadow DOM boundaries within an editable region yet. For simplicity, we also don't support extending
a selection out of a shadow root which resides inside an editing region.
The keyboard based navigation & manipulation of selection as well as allowing copy & paste of content
across shadow DOM boundaries will be implemented by separate patches. DOMSelection will not expose this new
behavior either. This is tracked in the spec as https://github.com/w3c/webcomponents/issues/79
Tests: editing/selection/selection-across-shadow-boundaries-mixed-editability-1.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-2.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-3.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-4.html
editing/selection/selection-across-shadow-boundaries-mixed-editability-5.html
editing/selection/selection-across-shadow-boundaries-readonly-1.html
editing/selection/selection-across-shadow-boundaries-readonly-2.html
editing/selection/selection-across-shadow-boundaries-readonly-3.html
editing/selection/selection-across-shadow-boundaries-user-select-all-1.html
* editing/VisibleSelection.cpp:
(WebCore::isInUserAgentShadowRootOrHasEditableShadowAncestor): Added.
(WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): When the feature is enabled,
allow crossing shadow DOM boundaries except when either end is inside an user agent shadow root, or one of
its shadow includign ancestor is inside an editable region. The latter check is needed to disallow
an extension of a selection starting in a shadow tree inside a non-editable region inside an editable region
to outside the editable region. The rest of the editing code is not ready to deal with selection like that.
* page/Settings.yaml: Added an internal debug feature to enable this new behavior.
2018-09-26 Chris Dumez <cdumez@apple.com>
Ignore-opens-during-unload counter of a parent should apply to its children during beforeunload event
https://bugs.webkit.org/show_bug.cgi?id=189376
<rdar://problem/44282754>
Reviewed by Ryosuke Niwa.
Make sure the Ignore-opens-during-unload counter of a parent stays incremented while we are firing the
beforeunload event for its descendants, as per:
- https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document
No new tests, rebaselined existing tests.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldClose):
(WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2018-09-26 Justin Fan <justin_fan@apple.com>
WebGL 2: Adding logging to in-progress features
https://bugs.webkit.org/show_bug.cgi?id=189978
Reviewed by Jon Lee.
Logging will allow us to better identify the most in-demand WebGL 2 features and prioritize our efforts.
No tests as no change in WebGL functionality.
* html/canvas/WebGL2RenderingContext.cpp: Added logging statement to every function not yet implemented.
(WebCore::WebGL2RenderingContext::blitFramebuffer):
(WebCore::WebGL2RenderingContext::framebufferTextureLayer):
(WebCore::WebGL2RenderingContext::invalidateFramebuffer):
(WebCore::WebGL2RenderingContext::invalidateSubFramebuffer):
(WebCore::WebGL2RenderingContext::readBuffer):
(WebCore::WebGL2RenderingContext::texStorage3D):
(WebCore::WebGL2RenderingContext::texImage2D):
(WebCore::WebGL2RenderingContext::texImage3D):
(WebCore::WebGL2RenderingContext::texSubImage2D):
(WebCore::WebGL2RenderingContext::texSubImage3D):
(WebCore::WebGL2RenderingContext::copyTexSubImage3D):
(WebCore::WebGL2RenderingContext::compressedTexImage2D):
(WebCore::WebGL2RenderingContext::compressedTexImage3D):
(WebCore::WebGL2RenderingContext::compressedTexSubImage3D):
(WebCore::WebGL2RenderingContext::getFragDataLocation):
(WebCore::WebGL2RenderingContext::uniform1ui):
(WebCore::WebGL2RenderingContext::uniform2ui):
(WebCore::WebGL2RenderingContext::uniform3ui):
(WebCore::WebGL2RenderingContext::uniform4ui):
(WebCore::WebGL2RenderingContext::uniform1uiv):
(WebCore::WebGL2RenderingContext::uniform2uiv):
(WebCore::WebGL2RenderingContext::uniform3uiv):
(WebCore::WebGL2RenderingContext::uniform4uiv):
(WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
(WebCore::WebGL2RenderingContext::vertexAttribI4i):
(WebCore::WebGL2RenderingContext::vertexAttribI4iv):
(WebCore::WebGL2RenderingContext::vertexAttribI4ui):
(WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
(WebCore::WebGL2RenderingContext::vertexAttribIPointer):
(WebCore::WebGL2RenderingContext::drawRangeElements):
(WebCore::WebGL2RenderingContext::createQuery):
(WebCore::WebGL2RenderingContext::deleteQuery):
(WebCore::WebGL2RenderingContext::isQuery):
(WebCore::WebGL2RenderingContext::beginQuery):
(WebCore::WebGL2RenderingContext::endQuery):
(WebCore::WebGL2RenderingContext::getQuery):
(WebCore::WebGL2RenderingContext::getQueryParameter):
(WebCore::WebGL2RenderingContext::createSampler):
(WebCore::WebGL2RenderingContext::deleteSampler):
(WebCore::WebGL2RenderingContext::isSampler):
(WebCore::WebGL2RenderingContext::bindSampler):
(WebCore::WebGL2RenderingContext::samplerParameteri):
(WebCore::WebGL2RenderingContext::samplerParameterf):
(WebCore::WebGL2RenderingContext::getSamplerParameter):
(WebCore::WebGL2RenderingContext::fenceSync):
(WebCore::WebGL2RenderingContext::isSync):
(WebCore::WebGL2RenderingContext::deleteSync):
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::waitSync):
(WebCore::WebGL2RenderingContext::getSyncParameter):
(WebCore::WebGL2RenderingContext::createTransformFeedback):
(WebCore::WebGL2RenderingContext::deleteTransformFeedback):
(WebCore::WebGL2RenderingContext::isTransformFeedback):
(WebCore::WebGL2RenderingContext::bindTransformFeedback):
(WebCore::WebGL2RenderingContext::beginTransformFeedback):
(WebCore::WebGL2RenderingContext::endTransformFeedback):
(WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
(WebCore::WebGL2RenderingContext::getTransformFeedbackVarying):
(WebCore::WebGL2RenderingContext::pauseTransformFeedback):
(WebCore::WebGL2RenderingContext::resumeTransformFeedback):
(WebCore::WebGL2RenderingContext::bindBufferBase):
(WebCore::WebGL2RenderingContext::bindBufferRange):
(WebCore::WebGL2RenderingContext::getUniformIndices):
(WebCore::WebGL2RenderingContext::getUniformBlockIndex):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter):
(WebCore::WebGL2RenderingContext::getActiveUniformBlockName):
(WebCore::WebGL2RenderingContext::uniformBlockBinding):
2018-09-26 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Clean up RealtimeMediaSource settings change handling
https://bugs.webkit.org/show_bug.cgi?id=189998
<rdar://problem/44797884>
Reviewed by Youenn Fablet.
No new tests, no change in functionality.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers):
(WebCore::RealtimeMediaSource::setSize):
(WebCore::RealtimeMediaSource::setFrameRate):
(WebCore::RealtimeMediaSource::setAspectRatio):
(WebCore::RealtimeMediaSource::setFacingMode):
(WebCore::RealtimeMediaSource::setVolume):
(WebCore::RealtimeMediaSource::setSampleRate):
(WebCore::RealtimeMediaSource::setSampleSize):
(WebCore::RealtimeMediaSource::setEchoCancellation):
(WebCore::RealtimeMediaSource::settingsDidChange): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::settingsDidChange):
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::settingsDidChange):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settingsDidChange):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::settingsDidChange):
2018-09-26 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure renderers with accelerated animations have layers
https://bugs.webkit.org/show_bug.cgi?id=189990
<rdar://problem/44791222>
Reviewed by Zalan Bujtas.
We have done some work already in webkit.org/b/189784 to prevent never-ending calls to DocumentTimeline::updateAnimations(). This was due to
the change made for webkit.org/b/186930 where we queued calls to updateAnimations() in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
while we were waiting for a renderer with a layer backing for a given animation target. Instead of doing this, we now ensure renderers always
have a layer when they have an accelerated animation applied.
No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html
which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): This method should have been marked const all along and it is
now required so it can be called through RenderBox::requiresLayer() and RenderInline::requiresLayer().
(WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Deleted.
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Stop enqueuing the accelerated actions in case we're lacking a composited renderer
since this situation should no longer arise.
* rendering/RenderBox.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasRunningAcceleratedAnimations const): Query the document timeline, if it exists, to check that this renderer's element
has accelerated animations applied.
* rendering/RenderBoxModelObject.h:
* rendering/RenderInline.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations.
2018-09-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mac window capture source
https://bugs.webkit.org/show_bug.cgi?id=189958
<rdar://problem/44767616>
Reviewed by Youenn Fablet.
* SourcesCocoa.txt: Add WindowDisplayCaptureSourceMac.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::captureDevices): Include window "devices".
(WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices): New.
(WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID): New.
(WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID): Include window devices.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::settings): Use frameSize, report surface type and
logical surface.
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange): Clear m_lastSampleBuffer when size changes.
(WebCore::DisplayCaptureSourceCocoa::frameSize const): New, return size() or intrinsic size.
(WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): New.
(WebCore::DisplayCaptureSourceCocoa::emitFrame): generateFrame now returns a CVPixelBuffer
so derived classes don't have to deal with resizing/transforming.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Add fixme.
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update intrinsic size when
width/height changes.
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return a CVPixelBuffer.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: Added.
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: Added.
(WebCore::anyOfCGWindow):
(WebCore::windowDescription):
(WebCore::WindowDisplayCaptureSourceMac::create):
(WebCore::WindowDisplayCaptureSourceMac::WindowDisplayCaptureSourceMac):
(WebCore::WindowDisplayCaptureSourceMac::windowImage):
(WebCore::WindowDisplayCaptureSourceMac::generateFrame):
(WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage):
(WebCore::WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID):
(WebCore::WindowDisplayCaptureSourceMac::windowCaptureDevices):
2018-09-25 Justin Fan <justin_fan@apple.com>
WebGL 2 Conformance: primitive restart and draw_primitive_restart WebGL2 sample
https://bugs.webkit.org/show_bug.cgi?id=189625
<rdar://problem/42882620>
Reviewed by Dean Jackson.
Ref test: webgl/webgl2-primitive-restart.html.
Implement support for Primitive Restart Fixed Index as expected
by the WebGL 2 specifications.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::getLastIndex): Template that must be defined in header.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::primitiveRestartIndex):
2018-09-25 John Wilander <wilander@apple.com>
Change from HAVE(CFNETWORK_STORAGE_PARTITIONING) to ENABLE(RESOURCE_LOAD_STATISTICS)
https://bugs.webkit.org/show_bug.cgi?id=189959
<rdar://problem/44767642>
Reviewed by Chris Dumez.
No new tests because of no code change.
We no longer make use of CFNetwork's cookie partitioning so we should
change the compile-time flag to something that makes sense. This should
also make it easier/cleaner for other ports.
* dom/Document.cpp:
(WebCore::Document::hasStorageAccess):
(WebCore::Document::requestStorageAccess):
(WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
* dom/Document.h:
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::ResourceLoadObserver::logWindowCreation):
* loader/ResourceLoadObserver.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::cookiesForURL):
(WebCore::NetworkStorageSession::setCookiesFromDOM const):
2018-09-25 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Make AuthenticatorManager
https://bugs.webkit.org/show_bug.cgi?id=189279
<rdar://problem/44116792>
Reviewed by Chris Dumez.
This patch does the following things in WebCore in order to support AuthenticatorManager:
1) It separates AuthenticatorTransport from PublicKeyCredentialDescriptor such that the enum
can be queried from WebKit directly.
2) It adds AuthenticatorAttachment to PublicKeyCredentialCreationOptions such that relying parties
could express their interests in cross platform authenticators.
3) It enhances IPC encoder/decoder of a few such that Vectors and empty objects can be correctly coded.
4) It moves the LocalAuthenticator implementation to WebKit to better integrate with AuthenticatorManager.
5) It moves linking to LocalAuthentication.framework to WebKit as well.
6) It temporarily bans old mock test mechanism in Internals so we could enable the new mock test mechanism in
WebKitTestRunner which we will have a better coverage of codes in UI Process. Those tests will be either
removed or ported to the new mechanism in Bug 189283.
7) It also removes "using namespace WebCore" from the top namespace in some .mm files as they are reordered
to where they could introduce name confusions.
Tests: http/wpt/webauthn/public-key-credential-create-failure-local.https.html
http/wpt/webauthn/public-key-credential-create-success-local.https.html
http/wpt/webauthn/public-key-credential-get-failure-local.https.html
http/wpt/webauthn/public-key-credential-get-success-local.https.html
http/wpt/webauthn/public-key-credential-is-user-verifying-platform-authenticator-available.html
* CMakeLists.txt:
* Configurations/WebCore.xcconfig:
* DerivedSources.make:
* Modules/webauthn/AuthenticatorTransport.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h.
* Modules/webauthn/AuthenticatorTransport.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.idl.
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(WebCore::PublicKeyCredentialCreationOptions::encode const):
(WebCore::PublicKeyCredentialCreationOptions::decode):
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialData.h:
(WebCore::PublicKeyCredentialData::encode const):
(WebCore::PublicKeyCredentialData::decode):
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
(WebCore::PublicKeyCredentialDescriptor::encode const):
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Modules/webauthn/cocoa/LocalAuthenticator.mm: Removed.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/ExceptionData.h:
* platform/cocoa/LocalAuthenticationSoftLink.mm: Removed.
* platform/cocoa/SharedBufferCocoa.mm:
(-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): Deleted.
(VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement): Deleted.
(VideoFullscreenModelVideoElement::setVideoElement): Deleted.
(VideoFullscreenModelVideoElement::handleEvent): Deleted.
(VideoFullscreenModelVideoElement::updateForEventName): Deleted.
(VideoFullscreenModelVideoElement::willExitFullscreen): Deleted.
(VideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
(VideoFullscreenModelVideoElement::waitForPreparedForInlineThen): Deleted.
(VideoFullscreenModelVideoElement::requestFullscreenMode): Deleted.
(VideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
(VideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
(VideoFullscreenModelVideoElement::observedEventNames): Deleted.
(VideoFullscreenModelVideoElement::eventNameAll): Deleted.
(VideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
(VideoFullscreenModelVideoElement::addClient): Deleted.
(VideoFullscreenModelVideoElement::removeClient): Deleted.
(VideoFullscreenModelVideoElement::isVisible const): Deleted.
(VideoFullscreenModelVideoElement::setHasVideo): Deleted.
(VideoFullscreenModelVideoElement::setVideoDimensions): Deleted.
(VideoFullscreenModelVideoElement::willEnterPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::didEnterPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::willExitPictureInPicture): Deleted.
(VideoFullscreenModelVideoElement::didExitPictureInPicture): Deleted.
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::hasExplicitBeginTime):
(WebCore::setHasExplicitBeginTime):
(WebCore::toCAFillModeType):
(WebCore::toCAValueFunctionType):
(WebCore::toCAMediaTimingFunction):
(WebCore::PlatformCAAnimationCocoa::setFromValue):
(WebCore::PlatformCAAnimationCocoa::setToValue):
(WebCore::PlatformCAAnimationCocoa::setValues):
(fromCAFillModeType): Deleted.
(fromCAValueFunctionType): Deleted.
(PlatformCAAnimationCocoa::create): Deleted.
(PlatformCAAnimationCocoa::PlatformCAAnimationCocoa): Deleted.
(PlatformCAAnimationCocoa::~PlatformCAAnimationCocoa): Deleted.
(PlatformCAAnimationCocoa::copy const): Deleted.
(PlatformCAAnimationCocoa::platformAnimation const): Deleted.
(PlatformCAAnimationCocoa::keyPath const): Deleted.
(PlatformCAAnimationCocoa::beginTime const): Deleted.
(PlatformCAAnimationCocoa::setBeginTime): Deleted.
(PlatformCAAnimationCocoa::duration const): Deleted.
(PlatformCAAnimationCocoa::setDuration): Deleted.
(PlatformCAAnimationCocoa::speed const): Deleted.
(PlatformCAAnimationCocoa::setSpeed): Deleted.
(PlatformCAAnimationCocoa::timeOffset const): Deleted.
(PlatformCAAnimationCocoa::setTimeOffset): Deleted.
(PlatformCAAnimationCocoa::repeatCount const): Deleted.
(PlatformCAAnimationCocoa::setRepeatCount): Deleted.
(PlatformCAAnimationCocoa::autoreverses const): Deleted.
(PlatformCAAnimationCocoa::setAutoreverses): Deleted.
(PlatformCAAnimationCocoa::fillMode const): Deleted.
(PlatformCAAnimationCocoa::setFillMode): Deleted.
(PlatformCAAnimationCocoa::setTimingFunction): Deleted.
(PlatformCAAnimationCocoa::copyTimingFunctionFrom): Deleted.
(PlatformCAAnimationCocoa::isRemovedOnCompletion const): Deleted.
(PlatformCAAnimationCocoa::setRemovedOnCompletion): Deleted.
(PlatformCAAnimationCocoa::isAdditive const): Deleted.
(PlatformCAAnimationCocoa::setAdditive): Deleted.
(PlatformCAAnimationCocoa::valueFunction const): Deleted.
(PlatformCAAnimationCocoa::setValueFunction): Deleted.
(PlatformCAAnimationCocoa::setFromValue): Deleted.
(PlatformCAAnimationCocoa::copyFromValueFrom): Deleted.
(PlatformCAAnimationCocoa::setToValue): Deleted.
(PlatformCAAnimationCocoa::copyToValueFrom): Deleted.
(PlatformCAAnimationCocoa::setValues): Deleted.
(PlatformCAAnimationCocoa::copyValuesFrom): Deleted.
(PlatformCAAnimationCocoa::setKeyTimes): Deleted.
(PlatformCAAnimationCocoa::copyKeyTimesFrom): Deleted.
(PlatformCAAnimationCocoa::setTimingFunctions): Deleted.
(PlatformCAAnimationCocoa::copyTimingFunctionsFrom): Deleted.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(PlatformCAFilters::filterValueForOperation): Deleted.
(PlatformCAFilters::colorMatrixValueForFilter): Deleted.
(PlatformCAFilters::setBlendingFiltersOnLayer): Deleted.
(PlatformCAFilters::numAnimatedFilterProperties): Deleted.
(PlatformCAFilters::animatedFilterPropertyName): Deleted.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(-[WebAnimationDelegate animationDidStart:]):
(-[WebAnimationDelegate animationDidStop:finished:]):
(-[WebAnimationDelegate setOwner:]):
(PlatformCALayerCocoa::create): Deleted.
(PlatformCALayer::platformCALayer): Deleted.
(mediaTimeToCurrentTime): Deleted.
(PlatformCALayerCocoa::setOwner): Deleted.
(toCAFilterType): Deleted.
(PlatformCALayerCocoa::layerTypeForPlatformLayer): Deleted.
(PlatformCALayerCocoa::PlatformCALayerCocoa): Deleted.
(PlatformCALayerCocoa::commonInit): Deleted.
(PlatformCALayerCocoa::clone const): Deleted.
(PlatformCALayerCocoa::~PlatformCALayerCocoa): Deleted.
(PlatformCALayerCocoa::animationStarted): Deleted.
(PlatformCALayerCocoa::animationEnded): Deleted.
(PlatformCALayerCocoa::setNeedsDisplay): Deleted.
(PlatformCALayerCocoa::setNeedsDisplayInRect): Deleted.
(PlatformCALayerCocoa::copyContentsFromLayer): Deleted.
(PlatformCALayerCocoa::superlayer const): Deleted.
(PlatformCALayerCocoa::removeFromSuperlayer): Deleted.
(PlatformCALayerCocoa::setSublayers): Deleted.
(PlatformCALayerCocoa::removeAllSublayers): Deleted.
(PlatformCALayerCocoa::appendSublayer): Deleted.
(PlatformCALayerCocoa::insertSublayer): Deleted.
(PlatformCALayerCocoa::replaceSublayer): Deleted.
(PlatformCALayerCocoa::adoptSublayers): Deleted.
(PlatformCALayerCocoa::addAnimationForKey): Deleted.
(PlatformCALayerCocoa::removeAnimationForKey): Deleted.
(PlatformCALayerCocoa::animationForKey): Deleted.
(PlatformCALayerCocoa::setMask): Deleted.
(PlatformCALayerCocoa::isOpaque const): Deleted.
(PlatformCALayerCocoa::setOpaque): Deleted.
(PlatformCALayerCocoa::bounds const): Deleted.
(PlatformCALayerCocoa::setBounds): Deleted.
(PlatformCALayerCocoa::position const): Deleted.
(PlatformCALayerCocoa::setPosition): Deleted.
(PlatformCALayerCocoa::anchorPoint const): Deleted.
(PlatformCALayerCocoa::setAnchorPoint): Deleted.
(PlatformCALayerCocoa::transform const): Deleted.
(PlatformCALayerCocoa::setTransform): Deleted.
(PlatformCALayerCocoa::sublayerTransform const): Deleted.
(PlatformCALayerCocoa::setSublayerTransform): Deleted.
(PlatformCALayerCocoa::isHidden const): Deleted.
(PlatformCALayerCocoa::setHidden): Deleted.
(PlatformCALayerCocoa::contentsHidden const): Deleted.
(PlatformCALayerCocoa::setContentsHidden): Deleted.
(PlatformCALayerCocoa::userInteractionEnabled const): Deleted.
(PlatformCALayerCocoa::setUserInteractionEnabled): Deleted.
(PlatformCALayerCocoa::setBackingStoreAttached): Deleted.
(PlatformCALayerCocoa::backingStoreAttached const): Deleted.
(PlatformCALayerCocoa::geometryFlipped const): Deleted.
(PlatformCALayerCocoa::setGeometryFlipped): Deleted.
(PlatformCALayerCocoa::isDoubleSided const): Deleted.
(PlatformCALayerCocoa::setDoubleSided): Deleted.
(PlatformCALayerCocoa::masksToBounds const): Deleted.
(PlatformCALayerCocoa::setMasksToBounds): Deleted.
(PlatformCALayerCocoa::acceleratesDrawing const): Deleted.
(PlatformCALayerCocoa::setAcceleratesDrawing): Deleted.
(PlatformCALayerCocoa::wantsDeepColorBackingStore const): Deleted.
(PlatformCALayerCocoa::setWantsDeepColorBackingStore): Deleted.
(PlatformCALayerCocoa::supportsSubpixelAntialiasedText const): Deleted.
(PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText): Deleted.
(PlatformCALayerCocoa::hasContents const): Deleted.
(PlatformCALayerCocoa::contents const): Deleted.
(PlatformCALayerCocoa::setContents): Deleted.
(PlatformCALayerCocoa::setContentsRect): Deleted.
(PlatformCALayerCocoa::setMinificationFilter): Deleted.
(PlatformCALayerCocoa::setMagnificationFilter): Deleted.
(PlatformCALayerCocoa::backgroundColor const): Deleted.
(PlatformCALayerCocoa::setBackgroundColor): Deleted.
(PlatformCALayerCocoa::setBorderWidth): Deleted.
(PlatformCALayerCocoa::setBorderColor): Deleted.
(PlatformCALayerCocoa::opacity const): Deleted.
(PlatformCALayerCocoa::setOpacity): Deleted.
(PlatformCALayerCocoa::setFilters): Deleted.
(PlatformCALayerCocoa::copyFiltersFrom): Deleted.
(PlatformCALayerCocoa::filtersCanBeComposited): Deleted.
(PlatformCALayerCocoa::setBlendMode): Deleted.
(PlatformCALayerCocoa::setName): Deleted.
(PlatformCALayerCocoa::setSpeed): Deleted.
(PlatformCALayerCocoa::setTimeOffset): Deleted.
(PlatformCALayerCocoa::contentsScale const): Deleted.
(PlatformCALayerCocoa::setContentsScale): Deleted.
(PlatformCALayerCocoa::cornerRadius const): Deleted.
(PlatformCALayerCocoa::setCornerRadius): Deleted.
(PlatformCALayerCocoa::setEdgeAntialiasingMask): Deleted.
(PlatformCALayerCocoa::shapeRoundedRect const): Deleted.
(PlatformCALayerCocoa::setShapeRoundedRect): Deleted.
(PlatformCALayerCocoa::shapeWindRule const): Deleted.
(PlatformCALayerCocoa::setShapeWindRule): Deleted.
(PlatformCALayerCocoa::shapePath const): Deleted.
(PlatformCALayerCocoa::setShapePath): Deleted.
(PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const): Deleted.
(PlatformCALayerCocoa::updateCustomAppearance): Deleted.
(layerContentsFormat): Deleted.
(PlatformCALayerCocoa::updateContentsFormat): Deleted.
(PlatformCALayerCocoa::tiledBacking): Deleted.
(PlatformCALayer::isWebLayer): Deleted.
(PlatformCALayer::setBoundsOnMainThread): Deleted.
(PlatformCALayer::setPositionOnMainThread): Deleted.
(PlatformCALayer::setAnchorPointOnMainThread): Deleted.
(PlatformCALayer::collectRectsToPaint): Deleted.
(PlatformCALayer::drawLayerContents): Deleted.
(PlatformCALayer::frameForLayer): Deleted.
(PlatformCALayerCocoa::createCompatibleLayer const): Deleted.
(PlatformCALayerCocoa::enumerateRectsBeingDrawn): Deleted.
(PlatformCALayerCocoa::backingStoreBytesPerPixel const): Deleted.
(PlatformCALayerCocoa::avPlayerLayer const): Deleted.
* platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm:
(-[WebLightSystemBackdropLayer init]):
(-[WebDarkSystemBackdropLayer init]):
* platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
(-[WebTiledBackingLayer createTileController:]):
(-[WebTiledBackingLayer setNeedsDisplayInRect:]):
(-[WebTiledBackingLayer setBorderColor:]):
* testing/Internals.cpp:
(WebCore::Internals::Internals):
2018-09-25 YUHAN WU <yuhan_wu@apple.com>
Implement MediaStreamTrack Content Hints
https://bugs.webkit.org/show_bug.cgi?id=189262
<rdar://problem/44101773>
Reviewed by Youenn Fablet.
contentHint is a new attribute which is stored in MediaStreamTrackPrivate.
https://w3c.github.io/mst-content-hint/
Covered by tests:
LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html
LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/idlharness.window.html
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::contentHint const):
(WebCore::MediaStreamTrack::setContentHint):
* Modules/mediastream/MediaStreamTrack.h:
* Modules/mediastream/MediaStreamTrack.idl:
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::setContentHint):
(WebCore::MediaStreamTrackPrivate::clone):
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::contentHint):
2018-09-25 Alex Christensen <achristensen@webkit.org>
Allow for suffixes to com.apple.WebKit.WebContent
https://bugs.webkit.org/show_bug.cgi?id=189972
Reviewed by Chris Dumez.
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::isInWebProcess):
2018-09-25 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Fix the open source iOS 12 build after r236445
https://bugs.webkit.org/show_bug.cgi?id=189953
Reviewed by Alex Christensen.
Remove soft-linking macros from several sources in WebCore, and instead import UIKitSoftLink from PAL. This
allows different WebCore sources to soft-link UIKit (and its classes and symbols) without reimplementing
WebCore::UIKitLibrary.
* editing/cocoa/FontAttributesCocoa.mm:
* editing/cocoa/FontShadowCocoa.mm:
(WebCore::FontShadow::createShadow const):
* platform/graphics/cocoa/ColorCocoa.mm:
(WebCore::platformColor):
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenIsMonochrome):
(WebCore::screenHasInvertedColors):
(WebCore::screenSize):
(WebCore::availableScreenSize):
(WebCore::screenScaleFactor):
2018-09-25 Thibault Saunier <tsaunier@igalia.com>
[WPE][GTK][WebRTC] Fixup VP8 encoding support
https://bugs.webkit.org/show_bug.cgi?id=189921
Previous leak fixing commit introduced a regression in
the way the encoded buffer were prepared in the default
GStreamerVideoEncoder::Fragmentize implementation (when
encoding with VP8 basically).
+ Fix a build warning in the decoder.
+ Fix some wrong object members namings.
+ Properly move the caps reference when setting restriction caps.
+ Do not raise a GStreamer error when GStreamerVideoEncoder::OnEncodedImage
fails - this might be a network issue and other encoders do not consider that
fatal.
+ Use GstMappedBuffer where appropriate.
Reviewed by Philippe Normand.
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
(WebCore::GStreamerVideoEncoder::Fragmentize):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2018-09-25 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Update constraints supported by getDisplayMedia
https://bugs.webkit.org/show_bug.cgi?id=189930
Reviewed by Youenn Fablet.
No new tests, updated http/tests/media/media-stream/get-display-media-prompt.html.
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getDisplayMedia const): Ignore audio constraints.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::hasInvalidGetDisplayMediaConstraint): Check for invalid constraints.
(WebCore::UserMediaRequest::start): Check for invalid constraints.
(WebCore::UserMediaRequest::deny): Support new error.
* Modules/mediastream/UserMediaRequest.h:
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
2018-09-25 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] Fix variable name that should have gone in r236317
https://bugs.webkit.org/show_bug.cgi?id=189944
Reviewed by Jer Noble.
m_cdmInstanceClientWeakPtrFactory becomes
m_cdmInstanceSessionClientWeakPtrFactory as its type changes to
CDMInstanceSessionClient.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::MediaKeySession):
* Modules/encryptedmedia/MediaKeySession.h:
2018-09-25 Simon Fraser <simon.fraser@apple.com>
Clean up code around RenderLayer's "has accelerated scrolling" functions
https://bugs.webkit.org/show_bug.cgi?id=189932
Reviewed by Zalan Bujtas.
RenderLayer had:
bool hasAcceleratedTouchScrolling()
bool hasTouchScrollableOverflow()
bool usesAcceleratedScrolling()
bool usesCompositedScrolling()
bool usesAsyncScrolling()
which are hard to keep in your head. Removed usesAcceleratedScrolling() since it just returns hasTouchScrollableOverflow().
Renamed hasAcceleratedTouchScrolling() to canUseAcceleratedTouchScrolling() to indicate that it just looks at style,
not whether layout has given the layer scrollable overflow yet. Tidy up some #ifdefs.
usesCompositedScrolling() and usesAsyncScrolling() are ScrollableArea overrides, and
look at backing layers, so require that compositing has run already. Note this in comments.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::canUseAcceleratedTouchScrolling const):
(WebCore::RenderLayer::hasTouchScrollableOverflow const):
(WebCore::RenderLayer::handleTouchEvent):
(WebCore::RenderLayer::usesAsyncScrolling const):
(WebCore::RenderLayer::showsOverflowControls const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::hasAcceleratedTouchScrolling const): Deleted.
(WebCore::RenderLayer::usesAcceleratedScrolling const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling):
(WebCore::RenderLayerBacking::updateConfiguration):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
2018-09-24 Fujii Hironori <Hironori.Fujii@sony.com>
Rename WTF_COMPILER_GCC_OR_CLANG to WTF_COMPILER_GCC_COMPATIBLE
https://bugs.webkit.org/show_bug.cgi?id=189733
Reviewed by Michael Catanzaro.
No new tests (No behavior change).
* platform/graphics/cpu/arm/filters/FELightingNEON.cpp:
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApply):
* platform/graphics/filters/FELighting.h:
2018-09-24 John Wilander <wilander@apple.com>
Cap lifetime of persistent cookies created client-side through document.cookie
https://bugs.webkit.org/show_bug.cgi?id=189933
<rdar://problem/44741888>
Reviewed by Chris Dumez.
Test: http/tests/cookies/capped-lifetime-for-cookie-set-in-js.html
As pointed out in https://github.com/mikewest/http-state-tokens:
1) Cookies are available to JavaScript by default via document.cookie, which
enables a smooth upgrade from one-time XSS to theft of persistent credentials
and also makes cookies available to Spectre-like attacks on memory.
2) Though the HttpOnly attribute was introduced well over a decade ago, only
~8.31% of Set-Cookie operations use it today (stats from Chrome). We need
developer incentives to put proper protections in place.
3) The median (uncompressed) Cookie request header is 409 bytes, while the 90th
percentile is 1,589 bytes, the 95th 2,549 bytes, the 99th 4,601 bytes, and
~0.1% of Cookie headers are over 10kB (stats from Chrome). This is bad for load
performance.
In addition to this, third-party scripts running in first-party contexts can
read user data through document.cookie and even store cross-site tracking data
in them.
Authentication cookies should be HttpOnly and thus not be affected by
restrictions to document.cookie. Cookies that persist for a long time should
be Secure, HttpOnly, and SameSite to provide good security and privacy.
By capping the lifetime of persistent cookies set through document.cookie we
embark on a journey towards better cookie management on the web.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::filterCookies):
Now caps the life time of persistent cookies to one week (seven days).
* testing/Internals.cpp:
(WebCore::Internals::getCookies const):
New test function to get to cookie meta data such as expiry.
* testing/Internals.h:
* testing/Internals.idl:
2018-09-24 Simon Fraser <simon.fraser@apple.com>
Remove filterRes parameter from SVG filters
https://bugs.webkit.org/show_bug.cgi?id=129565
<rdar://problem/44714340>
Reviewed by Dean Jackson.
Remove support for the "filterRes" attribute on SVG filters. It's marked as
deprecated in https://drafts.fxtf.org/filter-effects/#element-attrdef-filter-filterres
and no longer supported by Chrome or Firefox.
Removed existing filterRes tests, added new test checking that it has no effect.
Tests: svg/filters/filterRes-is-noop.svg
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
* svg/SVGElement.cpp:
(WebCore::SVGElement::animatableAttributeForName):
* svg/SVGFilterElement.cpp:
(WebCore::SVGFilterElement::registerAttributes):
(WebCore::SVGFilterElement::parseAttribute):
(WebCore::SVGFilterElement::filterResXIdentifier): Deleted.
(WebCore::SVGFilterElement::filterResYIdentifier): Deleted.
(WebCore::SVGFilterElement::setFilterRes): Deleted.
* svg/SVGFilterElement.h:
* svg/SVGFilterElement.idl:
* svg/svgattrs.in:
2018-09-24 Ryosuke Niwa <rniwa@webkit.org>
Don't cause a crash even when some IDL attribute is missing CEReactions
https://bugs.webkit.org/show_bug.cgi?id=189937
Reviewed by Simon Fraser.
Replaced release assertions in ElementQueue::add and ElementQueue::invokeAll by debug assertions
since a missing CEReactions resulting in a crash is a terrible user experience.
Also made the iteration in invokeAll safe when more elements were added to m_elements.
No new tests since we would still hit debug assertions, and this behavior should only come up
when some IDL attribute is erroneously missing CEReactions.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::ElementQueue::add):
(WebCore::CustomElementReactionQueue::ElementQueue::invokeAll):
2018-09-24 Wenson Hsieh <wenson_hsieh@apple.com>
Refactor Editor::fontAttributesForSelectionStart to be platform-agnostic
https://bugs.webkit.org/show_bug.cgi?id=189918
Work towards <rdar://problem/44648705>
Reviewed by Tim Horton.
Refactors the functionality in Editor::fontAttributesForSelectionStart to not be Cocoa-only. Rename this to
fontAttributesAtSelectionStart (to be consistent with `EditingStyle::styleAtSelectionStart`) and move it from
EditorCocoa.mm to Editor.cpp; instead of creating and populating an NSDictionary with font attribute
information, create and populate a new `FontAttributes` struct that contains the same information. Cocoa clients
in WebKitLegacy may then create an `NSDictionary` as needed from the `FontAttributes`.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* editing/Editor.cpp:
(WebCore::Editor::platformFontAttributesAtSelectionStart const):
Add a hook to allow platforms to supply additional information in FontAttributes. On Cocoa, this adds a UIFont
or NSFont to FontAttributes; otherwise, this is a no-op.
(WebCore::Editor::fontAttributesAtSelectionStart const):
* editing/Editor.h:
* editing/FontAttributeChanges.cpp:
(WebCore::cssValueListForShadow):
* editing/FontAttributeChanges.h:
(): Deleted.
(WebCore::FontShadow::encode const): Deleted.
(WebCore::FontShadow::decode): Deleted.
* editing/FontAttributes.h: Added.
Introduce a new struct that contains font attribute information. May be converted into an NSDictionary for use
by Cocoa clients in WebKitLegacy and WebKit. In a future patch, this will become serializable over IPC for use
in WebKit2.
* editing/FontShadow.h: Added.
Move FontShadow out into a separate header file, included in `FontAttributeChanges.h` and `FontAttributes.h`.
(WebCore::FontShadow::encode const):
(WebCore::FontShadow::decode):
* editing/cocoa/EditorCocoa.mm:
Add a helper function to convert a WebCore::Color to either `UIColor` on iOS or `NSColor` when AppKit is being
used.
(WebCore::Editor::platformFontAttributesAtSelectionStart const):
(WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const): Deleted.
Remove a helper function that was only used to compute text decoration attributes in
fontAttributesForSelectionStart.
(WebCore::Editor::fontAttributesForSelectionStart const): Deleted.
* editing/cocoa/FontAttributesCocoa.mm: Added.
(WebCore::FontAttributes::createDictionary const):
* editing/cocoa/FontShadowCocoa.mm: Added.
(WebCore::FontShadow::createShadow const):
* editing/cocoa/HTMLConverter.mm:
(_webKitBundle):
(HTMLConverter::_colorForElement):
(_platformColor): Deleted.
Adopt platformColor().
* platform/graphics/cocoa/ColorCocoa.h: Added.
* platform/graphics/cocoa/ColorCocoa.mm: Added.
(WebCore::platformColor):
* platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
Build fix due to changes in unified sources.
* platform/mac/WebCoreNSFontManagerExtras.mm:
(WebCore::computedFontAttributeChanges):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
More build fixes due to changes in unified sources.
2018-09-24 Jer Noble <jer.noble@apple.com>
SharedBuffer should have an equality test
https://bugs.webkit.org/show_bug.cgi?id=189919
Reviewed by Alex Christensen.
Test: TestWebKitAPI SharedBuffer.isEqualTo.
* platform/SharedBuffer.cpp:
* platform/SharedBuffer.h:
(WebCore::operator==):
(WebCore::operator!=):
2018-09-24 Ryosuke Niwa <rniwa@webkit.org>
imported/w3c/web-platform-tests/shadow-dom/slotchange.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=167652
Reviewed by Saam Barati.
The bug appears to be caused by the JS wrappers of slot elements getting prematurely collected.
Deployed GCReachableRef introduced in r236376 to fix the bug.
Test: fast/shadow-dom/signal-slot-list-retains-js-wrappers.html
* dom/MutationObserver.cpp:
(WebCore::signalSlotList):
(WebCore::MutationObserver::enqueueSlotChangeEvent):
(WebCore::MutationObserver::notifyMutationObservers):
2018-09-24 Ryosuke Niwa <rniwa@webkit.org>
Release assert when using paper-textarea due to autocorrect IDL attribute missing CEReactions
https://bugs.webkit.org/show_bug.cgi?id=174629
<rdar://problem/33407620>
Reviewed by Simon Fraser.
The bug was caused by autocorrect and autocapitalize IDL attributes missing CEReactions.
Test: fast/custom-elements/autocorrect-autocapitalize-idl-attributes-crash.html
* html/HTMLElement.idl:
2018-09-24 Chris Dumez <cdumez@apple.com>
No-op document.open() calls should not have any side effects
https://bugs.webkit.org/show_bug.cgi?id=189373
<rdar://problem/44282702>
Reviewed by Geoffrey Garen.
Update document.open() implementation to match the specification [1] more closely.
In particular, URLs updates should happen much later, at step 11. They were happening
too early and would cause side effects when returning early.
[1] https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-open-steps
No new tests, rebaselined existing test.
* dom/Document.cpp:
(WebCore::Document::open):
2018-09-24 Daniel Bates <dabates@apple.com>
Include more headers in IOSurface.mm, PixelBufferResizer.{h, mm}
https://bugs.webkit.org/show_bug.cgi?id=189928
Reviewed by Andy Estes.
Make building IOSurface.mm and PixelBufferResizer.mm deterministic regardless of
which bundle of unified sources they are built in.
* platform/graphics/cocoa/IOSurface.mm: Include headers HostWindow.h and PlatformScreen.h
since we make use of functionality from these headers.
* platform/graphics/cv/PixelBufferResizer.h: Include header IntSize.h since
we need the size of an IntSize for m_size.
* platform/graphics/cv/PixelBufferResizer.mm: Include header Logging.h since
this file makes use of logging facilities. Also substitute #import for #include
while I am here since this file is an Objective-C++ file.
2018-09-24 Andy Estes <aestes@apple.com>
[Payment Request] Events cleanup
https://bugs.webkit.org/show_bug.cgi?id=189925
Reviewed by Simon Fraser.
1. Constructed MerchantValidationEvents (and ApplePayValidateMerchantEvents) with rvalue
references to validationURLs.
2. Instead of MerchantValidationEvent and PaymentRequestUpdateEvent having a
RefPtr<PaymentRequest>, downcasted their target to a PaymentRequest. Trusted versions of
these events are always dispatched to a PaymentRequest object.
3. Defined MerchantValidationEventInit in MerchantValidationEvent.idl instead of having a
separate .idl and .h for this dictionary.
No new tests. No change in behavior.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::ApplePaySession::validateMerchant):
* Modules/applepay/ApplePaySession.h:
* Modules/applepay/ApplePayValidateMerchantEvent.cpp:
(WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
* Modules/applepay/ApplePayValidateMerchantEvent.h:
(WebCore::ApplePayValidateMerchantEvent::create):
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::validateMerchant):
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentSession.h:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::validateMerchant):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/MerchantValidationEvent.cpp:
(WebCore::MerchantValidationEvent::create):
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
(WebCore::MerchantValidationEvent::complete):
* Modules/paymentrequest/MerchantValidationEvent.h:
* Modules/paymentrequest/MerchantValidationEvent.idl:
* Modules/paymentrequest/MerchantValidationEventInit.h: Removed.
* Modules/paymentrequest/MerchantValidationEventInit.idl: Removed.
* Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
(WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
* Modules/paymentrequest/PaymentMethodChangeEvent.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::shippingAddressChanged):
(WebCore::PaymentRequest::shippingOptionChanged):
(WebCore::PaymentRequest::paymentMethodChanged):
* Modules/paymentrequest/PaymentRequest.h:
(isType):
* Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
(WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
(WebCore::PaymentRequestUpdateEvent::updateWith):
* Modules/paymentrequest/PaymentRequestUpdateEvent.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventTarget.cpp:
(WebCore::EventTarget::isPaymentRequest const):
* dom/EventTarget.h:
2018-09-24 Daniel Bates <dabates@apple.com>
Separate Mac and iOS implementation of windowsKeyCodeForCharCode()
https://bugs.webkit.org/show_bug.cgi?id=189898
Reviewed by Tim Horton.
Extract the Mac and iOS implementations into a windowsKeyCodeForCharCode() defined in file
KeyEventMac.mm and file KeyEventIOS, respectively.
Mac and iOS have significant differences in how they represent function keys. It is not worthwhile
to share windowsKeyCodeForCharCode() between them given these differences. On Mac function keys
are represented by a char code in the range 0xF700-0xF8FF. On iOS these keys may not have a unique
char code (e.g. F1 = 0x10 = F10) and must be identified either by special string (e.g. UIKeyInputUpArrow)
or key code.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::windowsKeyCodeForCharCode): Deleted.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForCharCode): Added. Remove the handling of NS*FunctionKey char codes
as function keys are not represented using them as of iOS 12.
* platform/mac/KeyEventMac.mm:
(WebCore::windowsKeyCodeForCharCode): Added.
2018-09-21 Simon Fraser <simon.fraser@apple.com>
Remove the old "AcceleratedCompositingForOverflowScroll" code
https://bugs.webkit.org/show_bug.cgi?id=189870
Reviewed by Zalan Bujtas.
The "AcceleratedCompositingForOverflowScroll" code was added to allow overflow:scroll to use
composited scrolling if an overflow:scroll could be made a stacking context without affecting
z-order. We need overflow:scroll to be accelerated always, so a different approach is needed.
Remove this old code (unused by any platform?) to make working on new code easier.
* page/Settings.yaml:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::setHasVisibleContent):
(WebCore::RenderLayer::updateDescendantDependentFlags):
(WebCore::RenderLayer::dirty3DTransformedDescendantStatus):
(WebCore::RenderLayer::stackingContext const):
(WebCore::compositingContainer):
(WebCore::RenderLayer::addChild):
(WebCore::RenderLayer::removeChild):
(WebCore::RenderLayer::hasAcceleratedTouchScrolling const):
(WebCore::RenderLayer::usesAcceleratedScrolling const):
(WebCore::adjustedScrollDelta):
(WebCore::RenderLayer::updateCompositingLayersAfterScroll):
(WebCore::RenderLayer::updateScrollInfoAfterLayout):
(WebCore::RenderLayer::enclosingFragmentedFlowAncestor const):
(WebCore::RenderLayer::calculateClipRects const):
(WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled const): Deleted.
(WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder): Deleted.
(WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrderRecursive): Deleted.
(WebCore::RenderLayer::positionNewlyCreatedOverflowControls): Deleted.
(WebCore::RenderLayer::canBeStackingContainer const): Deleted.
(WebCore::RenderLayer::stackingContainer const): Deleted.
(WebCore::RenderLayer::needsCompositedScrolling const): Deleted.
(WebCore::RenderLayer::updateNeedsCompositedScrolling): Deleted.
* rendering/RenderLayer.h:
(WebCore::RenderLayer::clearZOrderLists):
(WebCore::RenderLayer::updateZOrderLists):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateAfterLayout):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::compositingOpacity const):
(WebCore::traverseVisibleNonCompositedDescendantLayers):
(WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const): Deleted.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush):
(WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush):
(WebCore::styleChangeRequiresLayerRebuild):
(WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const):
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::requiresCompositingLayer const):
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
(WebCore::RenderLayerCompositor::reasonsForCompositing const):
(WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const):
(WebCore::RenderLayerCompositor::requiresCompositingForScrolling const): Deleted.
* rendering/RenderLayerCompositor.h:
2018-09-24 Youenn Fablet <youenn@apple.com>
Enable conversion of libwebrtc internal frames as CVPixelBuffer
https://bugs.webkit.org/show_bug.cgi?id=189892
Reviewed by Eric Carlson.
Make sure to handle the case of libwebrtc frames that are not backed by CVPixelBuffer.
No observable change of behavior.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
Update according renamed methods.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
In case of libwebrtc frame that are not backed by CVPixelBuffer, we create
a CVPixelBuffer from a pixel buffer pool.
This CVPixelBuffer is then filled as part of webrtc::pixelBufferFromFrame.
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
(WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
Make sure to use preferred pixel buffer format.
2018-09-24 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add mock window capture source
https://bugs.webkit.org/show_bug.cgi?id=189843
<rdar://problem/44687445>
Reviewed by Youenn Fablet.
No new tests, the API is disabled and it isn't possible to test yet.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::processNewFrame): Remove an extra blank line.
* platform/mock/MockMediaDevice.h:
(WebCore::MockDisplayProperties::encode const): Get rid of defaultFrameRate, add type.
(WebCore::MockDisplayProperties::decode): Ditto.
(WebCore::MockMediaDevice::type const):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices): Add mock window devices.
(WebCore::MockRealtimeMediaSourceCenter::audioDevices): Cleanup.
(WebCore::MockRealtimeMediaSourceCenter::videoDevices): Cleanup.
(WebCore::MockRealtimeMediaSourceCenter::displayDevices): New.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Set default size on displays.
(WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate): Call RealtimeVideoSource for
mock camera, base class for device.
(WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Ditto.
(WebCore::MockRealtimeVideoSource::generatePresets): ASSERT if called as a camera.
(WebCore::MockRealtimeVideoSource::capabilities): updateCapabilities is only appropriate for cameras.
(WebCore::MockRealtimeVideoSource::settings): Camera and Device are different surface types.
(WebCore::MockRealtimeVideoSource::drawText): Render name, not ID.
(WebCore::MockRealtimeVideoSource::mockDisplayType const):
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockDisplay const):
(WebCore::MockRealtimeVideoSource::mockScreen const):
(WebCore::MockRealtimeVideoSource::mockWindow const):
2018-09-24 Daniel Bates <dabates@apple.com>
[iOS] Key code is 0 for many hardware keyboard keys
https://bugs.webkit.org/show_bug.cgi?id=189604
Reviewed by Wenson Hsieh.
Based off a patch by Jeremy Jones.
Add iOS-specific implementation of windowsKeyCodeForKeyCode() to map an iOS virtual key code to
the corresponding Windows virtual key code. Only hardware keyboard-generated events have a
virtual key code. For software-generated keyboard events we do what we do now and compute the
Windows virtual key code from the character string associated with the event.
When a WebEvent is instantiated with a non-zero iOS virtual key code (keyCode) we now always
convert it to its corresponding Windows virtual key code without considering the specified
charactersIgnoringModifiers character string. Currently we prefer computing the key code from
charactersIgnoringModifiers regardless of whether a non-zero iOS virtual key code was given.
However this causes special keys, including function keys (e.g. F10) to be misidentified because
keyboard layouts in iOS (at least iOS 12) map such special keys to ASCII control characters (e.g.
F10 maps to ASCII control character "data link escape" = 0x10) as opposed to special 16-bit
integral constants as we do on Mac (e.g. F10 maps to NSF10FunctionKey = 0xF70D on Mac). I will
look to fix up the computation of a Windows virtual key code from a char code on iOS in a
subsequent commit(s). For now, computing the Windows virtual key code directly from the iOS
virtual key code specified to the WebEvent constructor avoids the misidentification using
an ANSI US keyboard layout.
* platform/cocoa/KeyEventCocoa.mm:
(WebCore::windowsKeyCodeForKeyCode): Deleted; moved to KeyEventMac.mm as this mapping is specific to Mac.
* platform/ios/KeyEventIOS.mm:
(WebCore::windowsKeyCodeForKeyCode): Added.
* platform/ios/WebEvent.mm:
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Address the NOTE comment and compute the Windows virtual key code from
the iOS virtual key code when we have one. Also inline the value of an unncessary local variable.
(-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): Ditto.
* platform/mac/KeyEventMac.mm:
(WebCore::windowsKeyCodeForKeyCode): Moved from KeyEventCocoa.mm. Updated code to make use of WTF_ARRAY_LENGTH() instead
of hardcoding the upper bound of the lookup table.
2018-09-24 Simon Fraser <simon.fraser@apple.com>
feMorphology filter in CSS doesn't update when element moves
https://bugs.webkit.org/show_bug.cgi?id=189895
Reviewed by Dean Jackson.
SourceAlpha needs to be invalidated from clearIntermediateResults(),
so get it from the SVGFilterBuilder (which always creates one) and store in
a member variable.
Test: css3/filters/invalidate-sourceAlpha.html
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::buildReferenceFilter):
(WebCore::CSSFilter::clearIntermediateResults):
* rendering/CSSFilter.h:
* svg/graphics/filters/SVGFilterBuilder.h:
2018-09-24 Simon Fraser <simon.fraser@apple.com>
CSS reference filter with feDisplacementMap shows buffer corruption on Retina displays
https://bugs.webkit.org/show_bug.cgi?id=188486
<rdar://problem/43189750>
Reviewed by Dean Jackson.
The paintSize needs to be scaled by filterScale on Retina displays.
Test: css3/filters/hidpi-feDisplacementMap.html
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDisplacementMap.h:
2018-09-24 Simon Fraser <simon.fraser@apple.com>
ReferenceFilterOperation doesn't need to store the FilterEffect
https://bugs.webkit.org/show_bug.cgi?id=189904
Reviewed by Dean Jackson.
ReferenceFilterOperation doesn't do anything with m_filterEffect so don't store it.
* platform/graphics/filters/FilterOperation.cpp:
(WebCore::ReferenceFilterOperation::setFilterEffect): Deleted.
* platform/graphics/filters/FilterOperation.h:
(WebCore::ReferenceFilterOperation::filterEffect const): Deleted.
* rendering/CSSFilter.cpp:
(WebCore::CSSFilter::build):
2018-09-24 Simon Fraser <simon.fraser@apple.com>
Garbled rendering of image when applied feConvolveMatrix to it, on Retina display
https://bugs.webkit.org/show_bug.cgi?id=189748
<rdar://problem/44621494>
Reviewed by Jon Lee.
feConvolveMatrix needs to scale the paintSize by the filter scale (2x on Retina displays),
otherwise parts of the output buffer are uninitialized and the result is incorrect.
Test: css3/filters/hidpi-feConvolveMatrix.html
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware):
2018-09-22 Dean Jackson <dino@apple.com>
Ensure PointerEvent is not visible when disabled
https://bugs.webkit.org/show_bug.cgi?id=189889
<rdar://problem/44708253>
Reviewed by Eric Carlson.
Test: pointerevents/disabled.html
* bindings/js/WebCoreBuiltinNames.h: Now that it is enabled at runtime, it needs
a built-in name.
* dom/PointerEvent.idl: Add EnabledAtRuntime.
2018-09-24 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Pull demuxed samples in batches
https://bugs.webkit.org/show_bug.cgi?id=189871
Reviewed by Xabier Rodriguez-Calvar.
After this patch, only the notifications of "new samples available"
(appsink-new-sample bus messages) travel from the streaming thread to
the main thread through the bus and the main thread is the responsible
of pulling as many samples as it can from appsink. Before, the samples
were pulled from appsink in the non-main thread and traveled to the
main thread through the bus one by one.
This reduces drastically the amount of context switches and waiting
time in the streaming thread, resulting in a noticeable performance
improvement.
This fixes stutter while loading YouTube videos.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::~AppendPipeline):
(WebCore::AppendPipeline::clearPlayerPrivate):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::appsinkNewSample):
(WebCore::AppendPipeline::consumeAppSinkAvailableSamples):
(WebCore::AppendPipeline::resetPipeline):
(WebCore::AppendPipeline::handleNewAppsinkSample):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2018-09-24 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Change name of WebVTT region attribute 'height' to 'lines'.
https://bugs.webkit.org/show_bug.cgi?id=189862
Reviewed by Eric Carlson.
The WebVTT region attribute 'height' has been renamed to 'lines', see https://w3c.github.io/webvtt/#region-settings.
No new tests, covered by existing tests.
* html/track/VTTRegion.cpp:
(WebCore::VTTRegion::setLines):
(WebCore::VTTRegion::updateParametersFromRegion):
(WebCore::VTTRegion::scanSettingName):
(WebCore::VTTRegion::parseSettingValue):
(WebCore::VTTRegion::prepareRegionDisplayTree):
(WebCore::VTTRegion::setHeight): Deleted.
* html/track/VTTRegion.h:
* html/track/VTTRegion.idl:
2018-09-24 Alicia Boya García <aboya@igalia.com>
[MSE][GStreamer] Use no-more-pads event for noticing initialization segments
https://bugs.webkit.org/show_bug.cgi?id=189868
Reviewed by Xabier Rodriguez-Calvar.
Fixes the following YTTV 2018 tests:
62.VideoDimensionVP9
63.PlaybackStateVP9
This removes the hack that was making supporting multiple tracks in
the same file in MSE impossible.
For WebM, this GStreamer patch is required:
https://bugzilla.gnome.org/show_bug.cgi?id=797187
"matroskademux: Emit no-more-pads after parsing Tracks"
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::AppendPipeline):
(WebCore::AppendPipeline::handleApplicationMessage):
(WebCore::AppendPipeline::demuxerNoMorePads):
(WebCore::AppendPipeline::appsinkCapsChanged):
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
(WebCore::AppendPipeline::appendPipelineDemuxerNoMorePadsFromAnyThread):
(WebCore::appendPipelineDemuxerNoMorePads):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
2018-09-24 Thibault Saunier <tsaunier@igalia.com>
[WPE][GTK][WebRTC] Fix leaks in the libwebrtc Decoder and Encoder
https://bugs.webkit.org/show_bug.cgi?id=189835
Reviewed by Philippe Normand.
- Rework memory management to avoid leaking encoded frames (basically use the same
strategy as other libwebrtc encoder implementation).
- Plug a GstCaps leak.
* platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::InitEncode):
(WebCore::GStreamerVideoEncoder::newSampleCallback):
(WebCore::GStreamerVideoEncoder::Fragmentize):
(WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
2018-09-24 Philippe Normand <pnormand@igalia.com>
[GStreamer] Utilities cleanups
https://bugs.webkit.org/show_bug.cgi?id=189699
<rdar://problem/44634143>
Reviewed by Xabier Rodriguez-Calvar.
The GstMappedBuffer now has a move constructor so that it can be easily
reused in the webaudiosrc element. The now-unused corresponding
buffer-mapping utilities are removed from the code-base.
The HTTP source element used to handle a GstBuffer in its private
structure but this is no longer required since data is now pushed
in chunks, see bug #182829.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createGstBuffer): Deleted.
(WebCore::createGstBufferForData): Deleted.
(WebCore::getGstBufferDataPointer): Deleted.
(WebCore::mapGstBuffer): Deleted.
(WebCore::unmapGstBuffer): Deleted.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): New method returning a
reference to a newly created GstMappedBuffer instance.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStop): Remove reference to unused GstBuffer.
(CachedResourceStreamingClient::dataReceived): Ditto.
2018-09-24 Enrique Ocaña González <eocanha@igalia.com>
[MSE][GStreamer] Don't update duration when it was not previously NaN
https://bugs.webkit.org/show_bug.cgi?id=189869
Reviewed by Xabier Rodriguez-Calvar.
This is what the spec mandates. The spec doesn't say anything about
updating duration when it had been previously set, even if the new
init segment says that the duration is growing.
This fixes MSE YTTV 2018 69.MediaSourceDurationVP9.
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
2018-09-23 Frederic Wang <fwang@igalia.com>
Add missing includes in TextCodecReplacement.cpp
https://bugs.webkit.org/show_bug.cgi?id=189894
Reviewed by Darin Adler.
No new tests, behavior unchanged.
* platform/text/TextCodecReplacement.cpp: Add missing headers.
2018-09-22 Adrian Perez de Castro <aperez@igalia.com>
[ARM] Building FELightingNEON.cpp fails due to missing lightVector member
https://bugs.webkit.org/show_bug.cgi?id=189890
Reviewed by Darin Adler.
No new tests needed.
* platform/graphics/cpu/arm/filters/FELightingNEON.h:
(WebCore::FELighting::platformApplyNeon): Adapt to new layout of "struct PaintingData" after r225122.
2018-09-22 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Null-check cairo_pattern_t gradient objects
https://bugs.webkit.org/show_bug.cgi?id=189820
Reviewed by Alex Christensen.
Cairo-specific implementation of Gradient::createPlatformGradient() can
now return a nullptr value when a conic gradient is described by the
Gradient object. Cairo doesn't have a way to create cairo_pattern_t
objects for such gradients.
Null-checks are now done on return values of createPlatformGradient(),
in order to avoid proceeding to paint a null cairo_pattern_t object.
* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::fill):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::fillRect):
2018-09-21 Ryosuke Niwa <rniwa@webkit.org>
Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element
https://bugs.webkit.org/show_bug.cgi?id=136836
Reviewed by Wenson Hsieh.
Fixed the bug by simply generalizing the existing code path existed for video / input type=color.
Tests: fast/shadow-dom/dragging-element-inside-shadow-tree.html
fast/shadow-dom/dragging-element-with-shadow-tree.html
* page/DragController.cpp:
(WebCore::DragController::startDrag):
2018-09-22 Chris Dumez <cdumez@apple.com>
FontDataCache should use Ref<Font> instead of a RefPtr<Font>
https://bugs.webkit.org/show_bug.cgi?id=189861
Reviewed by Antti Koivisto.
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::fontForPlatformData):
(WebCore::FontCache::purgeInactiveFontData):
2018-09-21 Justin Michaud <justin_michaud@apple.com>
Implement initialValue support for CSS Custom Properties and Values API
https://bugs.webkit.org/show_bug.cgi?id=189819
Reviewed by Simon Fraser.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::customPropertyValue):
* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
* css/CSSCustomPropertyValue.h:
* css/CSSRegisteredCustomProperty.h:
* css/CSSVariableData.cpp:
(WebCore::CSSVariableData::resolveVariableFallback const):
(WebCore::CSSVariableData::resolveVariableReference const):
(WebCore::CSSVariableData::resolveVariableReferences const):
(WebCore::CSSVariableData::resolveTokenRange const):
* css/CSSVariableData.h:
* css/DOMCSSRegisterCustomProperty.cpp:
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
* css/DOMCSSRegisterCustomProperty.h:
* css/DOMCSSRegisterCustomProperty.idl:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::resolvedVariableValue):
(WebCore::StyleResolver::applyCascadedProperties):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* dom/Document.h:
(WebCore::Document::getCSSRegisteredCustomPropertySet const):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::checkVariablesInCustomProperties):
* rendering/style/RenderStyle.h:
2018-09-21 Dean Jackson <dino@apple.com>
Add PointerEvent, plus feature flag, plus Web Platform Tests
https://bugs.webkit.org/show_bug.cgi?id=189867
<rdar://problem/44697384>
Reviewed by Simon Fraser.
Add the PointerEvent interface.
Tests: imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html
imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html
imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html
imported/w3c/web-platform-tests/pointerevents/idlharness.window.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html
imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Add the new files.
* dom/Event.h:
(WebCore::Event::isPointerEvent const): New virtual identification method.
* dom/EventNames.in: Add PointerEvent so the InterfaceType code is generated.
* dom/PointerEvent.cpp: The PointerEvent interface, as specified by W3C.
(WebCore::PointerEvent::PointerEvent):
(WebCore::PointerEvent::eventInterface const):
* dom/PointerEvent.h: Added.
* dom/PointerEvent.idl: Added.
* page/RuntimeEnabledFeatures.h: Clean up the ordering of the features, so there aren't
confusing blank lines interspersed with #if USE macros.
(WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Add a new flag for Pointer Events.
(WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const):
2018-09-21 Ryosuke Niwa <rniwa@webkit.org>
Custom elements in a reaction queue can lose its JS wrapper and become HTMLUnknownElement
https://bugs.webkit.org/show_bug.cgi?id=184307
Reviewed by Keith Miller.
The bug was caused by the custom elements reaction queue not reporting its content to GC during marking.
When there is no JS reference to the JS wrappers of those custom element, and if those custom elements
are disconnected, GC would happily collect those the wrappers. Unfortunately, the same bug exists for
any asynchronous events and other WebCore code which keeps elements alive for a later use but doesn't
report them to GC (e.g. during visitChildren).
This patch, therefore, introduces a generic mechanism to keep these elements' wrappers alive. Namely,
we introduce GCReachableRef, a new smart pointer type for Node's subclasses, which keeps element as well
as its wrappers alive. GCReachableRef works by adding its Node to a global hash counted set when it's
created and making JSNodeOwner::isReachableFromOpaqueRoots return true when the node is in the set.
Test: fast/custom-elements/custom-elements-reaction-queue-retains-js-wrapper.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSNodeCustom.cpp:
(WebCore::isReachableFromDOM):
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Don't swap the vector of elements in
in the queue. Assuming each DOM API has an appropriate CustomElementsReactionStack, we should never
append a new element to this queue while invoking custom element reactions.
* dom/CustomElementReactionQueue.h:
* dom/GCReachableRef.cpp: Added.
* dom/GCReachableRef.h: Added.
(WebCore::GCReachableRefMap::contains): Added.
(WebCore::GCReachableRefMap::add): Added.
(WebCore::GCReachableRefMap::remove): Added.
(WebCore::GCReachableRef::GCReachableRef): Added. We need isNull() check since WTFMove may have been
called on the source GCReachableRef.
(WebCore::GCReachableRef::~GCReachableRef): Ditto.
(WebCore::GCReachableRef::operator-> const): Added.
(WebCore::GCReachableRef::get const): Added.
(WebCore::GCReachableRef::operator T& const): Added.
(WebCore::GCReachableRef::operator! const): Added.
(WebCore::GCReachableRef::isNull const): Added. Returns true if WTFMove had been called on Ref.
2018-09-21 Alex Christensen <achristensen@webkit.org>
Use a Variant for FormDataElement
https://bugs.webkit.org/show_bug.cgi?id=189777
Reviewed by Chris Dumez.
* platform/network/FormData.cpp:
(WebCore::FormData::FormData):
(WebCore::FormDataElement::lengthInBytes const):
(WebCore::FormDataElement::isolatedCopy const):
(WebCore::FormData::appendData):
(WebCore::FormData::flatten const):
(WebCore::FormData::resolveBlobReferences):
(WebCore::FormData::generateFiles):
(WebCore::FormData::hasGeneratedFiles const):
(WebCore::FormData::hasOwnedGeneratedFiles const):
(WebCore::FormData::removeGeneratedFilesIfNeeded):
(WebCore::FormData::asSharedBuffer const):
(WebCore::FormData::asBlobURL const):
(WebCore::FormData::expandDataStore): Deleted.
* platform/network/FormData.h:
(WebCore::FormDataElement::FormDataElement):
(WebCore::FormDataElement::encode const):
(WebCore::FormDataElement::decode):
(WebCore::FormDataElement::EncodedFileData::isolatedCopy const):
(WebCore::FormDataElement::EncodedFileData::operator== const):
(WebCore::FormDataElement::EncodedFileData::encode const):
(WebCore::FormDataElement::EncodedFileData::decode):
(WebCore::FormDataElement::EncodedBlobData::operator== const):
(WebCore::FormDataElement::EncodedBlobData::encode const):
(WebCore::FormDataElement::EncodedBlobData::decode):
(WebCore::FormDataElement::operator== const):
(WebCore::FormDataElement::operator!= const):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::advanceCurrentStream):
(WebCore::createHTTPBodyCFReadStream):
(WebCore::setHTTPBody):
* platform/network/curl/CurlFormDataStream.cpp:
(WebCore::CurlFormDataStream::computeContentLength):
(WebCore::CurlFormDataStream::read):
(WebCore::CurlFormDataStream::readFromFile):
(WebCore::CurlFormDataStream::readFromData):
* platform/network/curl/CurlFormDataStream.h:
2018-09-20 Simon Fraser <simon.fraser@apple.com>
Simplify the logic around has*ScrollbarWithAutoBehavior
https://bugs.webkit.org/show_bug.cgi?id=189813
Reviewed by Zalan Bujtas.
The boolean logic in scrollsOverflowX() and hasHorizontalScrollbarWithAutoBehavior() (and the vertical
equivalents) reduces simply to hasOverflowClip() && (style().overflowX() == Overflow::Scroll || style().overflowX() == Overflow::Auto);
Similarly, RenderBox::intrinsicScrollbarLogicalWidth() just needs the part of the logic
that asks whether the theme uses overlay scrollbars which are not customized (and thus
turned into non-overlay scrollbars).
* rendering/RenderBox.cpp:
(WebCore::RenderBox::intrinsicScrollbarLogicalWidth const):
(WebCore::RenderBox::canUseOverlayScrollbars const):
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
* rendering/RenderBox.h:
(WebCore::RenderBox::scrollsOverflowX const):
(WebCore::RenderBox::scrollsOverflowY const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollbarsAfterLayout):
2018-09-21 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, rolling out r236255.
Many WebAudio crashes
Reverted changeset:
"[GStreamer] Utilities cleanups"
https://bugs.webkit.org/show_bug.cgi?id=189699
https://trac.webkit.org/changeset/236255
2018-09-21 Jer Noble <jer.noble@apple.com>
Move AVVideoPerformanceMetrics into AVFoundationSPI.h
https://bugs.webkit.org/show_bug.cgi?id=189842
Reviewed by Jon Lee.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2018-09-21 Chris Dumez <cdumez@apple.com>
WebSQL: User cannot grant quota increase if the JS provides an expected usage value that is too low
https://bugs.webkit.org/show_bug.cgi?id=189801
<rdar://problem/43592498>
Reviewed by Youenn Fablet.
User was unable to grant a quota increase for WebSQL if the JS provided an expected usage value that
is too low. This is because WebKit was passing this provided expectedUsage value to the client for
the purpose of quota increase, even when this expectedUsage value does not make any sense (i.e. it
is lower than the current database size). As a result, the client would grant a quota that is equal
to the previous quota and the JS would not be able to insert any data.
In order to address the issue, when the current quota is exceeded and Database::didExceedQuota()
is called, we now make sure that the expectedUsage value is greater than the current quota. If it
is not, we provide `current quota + 5MB` as expected usage to the client. This way, the client will
grant a quota that is actually increased (provided that the user accepts).
Test: storage/websql/transaction-database-expand-quota.html
* Modules/webdatabase/Database.cpp:
(WebCore::Database::setEstimatedSize):
(WebCore::Database::didExceedQuota):
* Modules/webdatabase/Database.h:
2018-09-21 Youenn Fablet <youenn@apple.com>
Use biplanar CVPixelBuffer for black frames sent to libwebrtc
https://bugs.webkit.org/show_bug.cgi?id=189837
Reviewed by Eric Carlson.
Covered by webrtc/video-mute.html.
Add support to call CVPixelBufferGetBytesPerRowOfPlane.
Make createBlackPixelBuffer use a biplanar CVPixelBuffer as this is better supported in libwebrtc.
It is also what is being used in iOS for capture.
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
2018-09-21 Youenn Fablet <youenn@apple.com>
Add RTCCodecStats support
https://bugs.webkit.org/show_bug.cgi?id=189792
<rdar://problem/32370668>
Reviewed by Eric Carlson.
Covered by updated and rebased tests.
* Modules/mediastream/RTCStatsReport.h:
Removed fields that are already defined in the base class.
(WebCore::RTCStatsReport::CodecStats::CodecStats):
Add support for RTCCodecStats.
* Modules/mediastream/RTCStatsReport.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
(WebCore::fillRTCRTPStreamStats):
(WebCore::fillRTCCodecStats):
(WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
Add routines to fill RTCCodecStats from libwebrtc stats.
2018-09-20 Simon Fraser <simon.fraser@apple.com>
Make "overflow: overlay" a synonym for "overflow: auto"
https://bugs.webkit.org/show_bug.cgi?id=189811
Reviewed by Zalan Bujtas.
The "overlay" value for overflow was added for an internal Safari feature, and only has
an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS.
It's little used on the web.
To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto".
It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle
as "auto".
Test: fast/css/getComputedStyle/getComputedStyle-overflow.html
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator Overflow const):
* css/CSSProperties.json:
* css/CSSValueKeywords.in:
* css/StyleResolver.cpp:
(WebCore::isScrollableOverflow):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
* page/ios/FrameIOS.mm:
(WebCore::Frame::nodeRespondingToScrollWheelEvents):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const):
(WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const):
* rendering/RenderLayer.cpp:
(WebCore::styleDefinesAutomaticScrollbar):
* rendering/RenderLayerCompositor.cpp:
(WebCore::isScrollableOverflow):
* rendering/style/RenderStyleConstants.h:
2018-09-21 Youenn Fablet <youenn@apple.com>
Centralize which CVPixelBuffer format is being used
https://bugs.webkit.org/show_bug.cgi?id=189772
Reviewed by Eric Carlson.
Get the format type from a single point.
This changes the video capture and mock realtime video sources on Mac to use a biplanar format.
No observable change of behavior.
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
* platform/mediastream/mac/RealtimeVideoUtilities.h: Added.
2018-09-21 Antoine Quint <graouts@apple.com>
REGRESSION (r235962-r235963): Layout Test animations/suspend-resume-animation-events.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=189607
<rdar://problem/44652315>
Reviewed by Dean Jackson.
There is no reason we shouldn't return the document timeline's time when suspended as otherwise animations may
report an unresolved current time when suspended which would wreak havoc when invalidating what DOM events to
dispatch for CSS Animations and Transitions. We also shouldn't be invalidation DOM events when suspended.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::DocumentTimeline::performInvalidationTask):
2018-09-21 Mike Gorse <mgorse@suse.com>
Build tools should work when the /usr/bin/python is python3
https://bugs.webkit.org/show_bug.cgi?id=156674
Reviewed by Michael Catanzaro.
No new tests (no behavior change).
* platform/network/create-http-header-name-table: remove xreadlines.
2018-09-21 Jer Noble <jer.noble@apple.com>
[EME] Introduce the concept of CDMInstanceSession.
https://bugs.webkit.org/show_bug.cgi?id=189725
Reviewed by Eric Carlson.
Currently, the same CDMInstance owned by a MediaKeys object is passed to every MediaKeySession created by that
MediaKeys, and since the CDMInstance has only a single CDMInstanceClient, subsequent MediaKeySessions prevent
previous ones from getting updates.
Add a new virtual interface, CDMInstanceSession, to be passed to MediaKeySession upon creation. Refactor
CDMInstanceClearKey and CDMInstanceFairPlayStreamingAVFObjC to adopt this new interface.
Drive-by fixes: Made a number of virtual overrides in final classes final themselves.
* Modules/encryptedmedia/MediaKeySession.cpp:
(WebCore::MediaKeySession::create):
(WebCore::MediaKeySession::MediaKeySession):
(WebCore::MediaKeySession::generateRequest):
(WebCore::MediaKeySession::load):
(WebCore::MediaKeySession::update):
(WebCore::MediaKeySession::remove):
(WebCore::MediaKeySession::updateKeyStatuses):
* Modules/encryptedmedia/MediaKeySession.h:
* Modules/encryptedmedia/MediaKeys.cpp:
(WebCore::MediaKeys::createSession):
* WebCore.xcodeproj/project.pbxproj:
* platform/encryptedmedia/CDMInstance.h:
(WebCore::CDMInstance::setHDCPStatus):
(WebCore::CDMInstance::setClient): Deleted.
(WebCore::CDMInstance::clearClient): Deleted.
* platform/encryptedmedia/CDMInstanceSession.h: Copied from Source/WebCore/platform/encryptedmedia/CDMInstance.h.
(WebCore::CDMInstanceSession::setClient):
(WebCore::CDMInstanceSession::clearClient):
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::parseLicenseFormat):
(WebCore::CDMInstanceClearKey::keySystem const):
(WebCore::CDMInstanceClearKey::createSession):
(WebCore::CDMInstanceSessionClearKey::requestLicense):
(WebCore::CDMInstanceSessionClearKey::keys const):
(WebCore::CDMInstanceSessionClearKey::updateLicense):
(WebCore::CDMInstanceSessionClearKey::loadSession):
(WebCore::CDMInstanceSessionClearKey::closeSession):
(WebCore::CDMInstanceSessionClearKey::removeSessionData):
(WebCore::CDMInstanceSessionClearKey::storeRecordOfKeyUsage):
(WebCore::CDMInstanceClearKey::requestLicense): Deleted.
(WebCore::CDMInstanceClearKey::keys const): Deleted.
(WebCore::CDMInstanceClearKey::updateLicense): Deleted.
(WebCore::CDMInstanceClearKey::loadSession): Deleted.
(WebCore::CDMInstanceClearKey::closeSession): Deleted.
(WebCore::CDMInstanceClearKey::removeSessionData): Deleted.
(WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage): Deleted.
* platform/encryptedmedia/clearkey/CDMClearKey.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::processContentKeyRequestForSession):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::processNextContentKeyRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::storeRecordOfKeyUsage):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setClient):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::clearClient):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvidePersistableRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::sessionIdentifierChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::isLicenseTypeSupported const):
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::isLicenseTypeSupported const): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::storeRecordOfKeyUsage): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient): Deleted.
(WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient): Deleted.
* testing/MockCDMFactory.cpp:
(WebCore::MockCDMInstance::keySystem const):
(WebCore::MockCDMInstance::createSession):
(WebCore::MockCDMInstanceSession::MockCDMInstanceSession):
(WebCore::MockCDMInstanceSession::requestLicense):
(WebCore::MockCDMInstanceSession::updateLicense):
(WebCore::MockCDMInstanceSession::loadSession):
(WebCore::MockCDMInstanceSession::closeSession):
(WebCore::MockCDMInstanceSession::removeSessionData):
(WebCore::MockCDMInstanceSession::storeRecordOfKeyUsage):
(WebCore::MockCDMInstance::requestLicense): Deleted.
(WebCore::MockCDMInstance::updateLicense): Deleted.
(WebCore::MockCDMInstance::loadSession): Deleted.
(WebCore::MockCDMInstance::closeSession): Deleted.
(WebCore::MockCDMInstance::removeSessionData): Deleted.
(WebCore::MockCDMInstance::storeRecordOfKeyUsage): Deleted.
* testing/MockCDMFactory.h:
(WebCore::MockCDMInstance::factory const):
(WebCore::MockCDMInstance::distinctiveIdentifiersAllowed const):
(WebCore::MockCDMInstance::persistentStateAllowed const):
2018-09-21 Alicia Boya García <aboya@igalia.com>
[MSE] Fix comparsion with uninitialized greatestDecodeDuration
https://bugs.webkit.org/show_bug.cgi?id=189805
Reviewed by Michael Catanzaro.
This bug was causing greatestDecodeDuration to never be initialized,
which in turned caused unintended frame erase as distant appends where
not being recognized as distinct coded frame groups.
A test reproducing the sequence of appends that caused unintended
frame deletion has also been added (media-source-append-out-of-order.html).
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-09-21 Antoine Quint <graouts@apple.com>
[Web Animations] Accelerated animations don't get suspended
https://bugs.webkit.org/show_bug.cgi?id=189783
<rdar://problem/44652315>
Unreviewed, correct a merge error in the previous commit.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::performInvalidationTask):
2018-09-21 Antoine Quint <graouts@apple.com>
[Web Animations] Accelerated animations don't get suspended
https://bugs.webkit.org/show_bug.cgi?id=189783
<rdar://problem/43033568>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-suspension.html
We used to set the flag that marked the timeline as suspended prior to notifying animations that they need to be suspended.
However, since the timeline was marked as suspended, querying the running state of the animations would indicate that the
animations weren't running since a suspended timeline would identify its animations as not running. As such we would fail
to pause the accelerated animations because they were already not marked as running. We now set the suspended flag on the
timeline _after_ suspending its animations.
We also fix a bug in the new internals.acceleratedAnimationsForElement() test function so that we read from the actual
CA animations and not from a stale list of animations which would not indicate the correct animation speeds.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::suspendAnimations):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::acceleratedAnimationsForTesting):
2018-09-21 Zan Dobersek <zdobersek@igalia.com>
TransformationMatrix::toColumnMajorFloatArray() should return a std::array<> object
https://bugs.webkit.org/show_bug.cgi?id=189823
Reviewed by Michael Catanzaro.
Alias the TransformationMatrix::FloatMatrix4 type to
std::array<float, 16>. Instead of filling out the array object that's
passed in through a reference parameter, return the std::array<>
object from the function.
* Modules/webvr/VRFrameData.cpp:
(WebCore::matrixToArray):
* Modules/webvr/VRStageParameters.cpp:
(WebCore::VRStageParameters::sittingToStandingTransform const):
* platform/graphics/texmap/TextureMapperShaderProgram.cpp:
(WebCore::TextureMapperShaderProgram::setMatrix):
* platform/graphics/transforms/TransformationMatrix.cpp:
(WebCore::TransformationMatrix::toColumnMajorFloatArray const):
* platform/graphics/transforms/TransformationMatrix.h:
2018-09-21 Zan Dobersek <zdobersek@igalia.com>
FloatQuad point getters should return const references
https://bugs.webkit.org/show_bug.cgi?id=189821
Reviewed by Yusuke Suzuki.
Be pedantic and have the FloatQuad point getters return const references
to the FloatPoint member variables, instead of technically creating
copies of them (though much of this copying is eliminated when the
getters are inlined).
* platform/graphics/FloatQuad.h:
(WebCore::FloatQuad::p1 const):
(WebCore::FloatQuad::p2 const):
(WebCore::FloatQuad::p3 const):
(WebCore::FloatQuad::p4 const):
2018-09-20 Antoine Quint <graouts@apple.com>
[Web Animations] DocumentTimeline::updateAnimations() is called endlessly
https://bugs.webkit.org/show_bug.cgi?id=189784
<rdar://problem/41705679>
Reviewed by Dean Jackson.
Test: webanimations/accelerated-animation-interruption-display-none.html
We have code that keeps queueing pending accelerated actions for an animation that does not have a renderer until it has one
so that we can deal with situations where animations are ready to commited before its composited renderer is available. This
code ended up running continuously when an element with an accelerated animation had its renderer removed without the animation
being removed itself, such as setting "display: none" on an element with an acceelerated CSS Animation targeting it.
We fix this by queueing up a "Stop" accelerated action when updating the accelerated state if there is no renderer for the current
animation target. Then, we no longer re-queue pending accelerated actions if the last queued operation is "Stop". This ensures that
we no longer queue actions endlessly when there is no longer a visible animation.
To test this, we add a new internals.numberOfAnimationTimelineInvalidations() method that indicates the number of times the current
document's animation timeline was invalidated.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimations):
(WebCore::DocumentTimeline::numberOfAnimationTimelineInvalidationsForTesting const):
* animation/DocumentTimeline.h:
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): If the animation target does not have a renderer and it's still
marked as running, enqueue a "Stop" accelerated action.
(WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): If we enqueue a "Stop" accelerated action, remove any other queued
action so that we only process the "Stop" action, which would have superseded all previously queued actions anyway.
(WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Only re-queue pending accelerated actions when a composited renderer
is not yet available if we don't have a "Stop" action queued.
* testing/Internals.cpp:
(WebCore::Internals::numberOfAnimationTimelineInvalidations const):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-21 Yacine Bandou <yacine.bandou@softathome.com>
[EME] Fix typo in WebM sanitization variable
https://bugs.webkit.org/show_bug.cgi?id=189789
Reviewed by Xabier Rodriguez-Calvar.
This commit corrects a typo in the name of a local variable, sanitizedBuffer
instead of sanitazedBuffer.
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsWebM):
2018-09-20 Dean Jackson <dino@apple.com>
Restrict the total combined size of backdrop filters
https://bugs.webkit.org/show_bug.cgi?id=189812
<rdar://problem/44532782>
Reviewed by Simon Fraser.
If the total area of all backdrop filters on the page gets
too large, the universe collapses in on itself and we enter
the Quantum Realm (i.e. crash horribly).
Put a hard limit on the total coverage, and ignore any backdrop
filters after the limit. This might break some content, but
such content is likely not doing things in the most optimal manner.
There isn't any reason to have a backdrop larger than the size of
the screen, because you'd be better off applying a foreground
filter to the main content and showing something above it.
Tests: css3/filters/backdrop/resource-use-add-more-layers.html
css3/filters/backdrop/resource-use-excessive.html
css3/filters/backdrop/resource-use-ok.html
css3/filters/backdrop/resource-use-remove-some-layers.html
* platform/graphics/ca/GraphicsLayerCA.cpp: Pick a fairly small maximum size. We
can consider increasing this if necessary, and as devices with less RAM are
upgraded.
(WebCore::GraphicsLayerCA::recursiveCommitChanges): Gather the accumulated size
of backdrop filters into the commit state as we are recursing through the tree.
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Force any layer
with backdrop filters, or any that is removing backdrop filters, into an update.
(WebCore::GraphicsLayerCA::updateBackdropFilters): Update the logic to first
check if this backdrop layer causes us to exceed the total allowed size, and if
it does, forbid it from getting the GraphicsLayer that composits the backdrop.
* platform/graphics/ca/GraphicsLayerCA.h: Remove const from some parameters so
that we can use the CommitState to hold the accumulated size.
2018-09-20 Benjamin Poulain <benjamin@webkit.org>
Adopt safe-area-insets on ImageDocument
https://bugs.webkit.org/show_bug.cgi?id=189774
Reviewed by Tim Horton.
rdar://problem/44624432
By having the safe-area insets on the image, we ensure that they only
grow the document if there is not enough space. This also ensures the image
does not have parts under UI elements.
* html/ImageDocument.cpp:
(WebCore::ImageDocument::createDocumentStructure):
(WebCore::ImageDocument::imageUpdated):
2018-09-20 Zalan Bujtas <zalan@apple.com>
Release assert under RenderView::pageOrViewLogicalHeight
https://bugs.webkit.org/show_bug.cgi?id=189798
<rdar://problem/43659749>
Reviewed by Simon Fraser.
Only the mainframe's render view is sized to the page while printing.
Use the matching check (see RenderView::layout) when accessing m_pageLogicalSize.
Test: printing/crash-while-formatting-subframe-for-printing.html
* rendering/RenderView.cpp:
(WebCore::RenderView::pageOrViewLogicalHeight const):
2018-09-20 Sihui Liu <sihui_liu@apple.com>
REGRESSION(r196265): WKWebView fires mouseover, mouseenter, and mouseleave events even when it's in a background window
https://bugs.webkit.org/show_bug.cgi?id=187545
<rdar://problem/42401575>
Reviewed by Ryosuke Niwa.
When the window is not active, we should only update the scrollbar for mouse events. GTK
apps have different expectation on this behavior.
Test: fast/events/inactive-window-no-mouse-event.html
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::shouldSendMouseEventsToInactiveWindows const):
* page/EventHandler.h:
2018-09-20 Alex Christensen <achristensen@webkit.org>
Unreviewed, rolling out r235976.
Broke ARM
Reverted changeset:
"Use a Variant instead of a union in CSSSelector"
https://bugs.webkit.org/show_bug.cgi?id=188559
https://trac.webkit.org/changeset/235976
2018-09-20 Oriol Brufau <obrufau@igalia.com>
Fix 'border' serialization with both common and uncommon values
https://bugs.webkit.org/show_bug.cgi?id=189597
Reviewed by Simon Fraser.
Remove CommonValueMode enum and make borderPropertyValue always return null
when there are uncommon values (the previous ReturnNullOnUncommonValues mode).
Test: fast/css/getPropertyValue-border.html
Test: fast/dom/css-shorthand-common-value.html
* css/StyleProperties.cpp:
(WebCore::StyleProperties::getPropertyValue const):
(WebCore::StyleProperties::borderPropertyValue const):
(WebCore::StyleProperties::asText const):
* css/StyleProperties.h:
2018-09-20 Justin Michaud <justin_michaud@apple.com>
Implement CSS Custom Properties and Values Skeleton
https://bugs.webkit.org/show_bug.cgi?id=189694
Reviewed by Simon Fraser.
Add feature flag, CSS.registerProperty binding and registered property set in Document.h
for the css custom properties and values api.
Test: css-properties-values-api/registerProperty.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSRegisteredCustomProperty.h: Added.
* css/DOMCSSCustomPropertyDescriptor.h: Added.
* css/DOMCSSCustomPropertyDescriptor.idl: Added.
* css/DOMCSSNamespace.h:
* css/DOMCSSRegisterCustomProperty.cpp: Added.
(WebCore::DOMCSSRegisterCustomProperty::registerProperty):
(WebCore::DOMCSSRegisterCustomProperty::from):
(WebCore::DOMCSSRegisterCustomProperty::supplementName):
* css/DOMCSSRegisterCustomProperty.h: Added.
* css/DOMCSSRegisterCustomProperty.idl: Added.
* css/parser/CSSParserContext.cpp:
* dom/Document.cpp:
(WebCore::Document::registerCSSProperty):
* dom/Document.h:
* features.json:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled):
(WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const):
2018-09-20 Justin Michaud <justin_michaud@apple.com>
JS bindings generator should support EnabledAtRuntime for static methods
https://bugs.webkit.org/show_bug.cgi?id=189729
Reviewed by Chris Dumez.
Add support for EnabledAtRuntime to static methods in the JS bindings
code generator.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateRuntimeEnableConditionalStringForExposed):
(GenerateRuntimeEnableConditionalString):
(GetRuntimeEnabledStaticProperties):
(GenerateConstructorHelperMethods):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::JSTestGlobalObjectConstructor::initializeProperties):
(WebCore::JSTestGlobalObject::finishCreation):
(WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody):
(WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObjConstructor::initializeProperties):
(WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStaticGetter):
(WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStatic):
(WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter):
(WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStatic):
(WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody):
(WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic):
* bindings/scripts/test/TestGlobalObject.idl:
* bindings/scripts/test/TestObj.idl:
2018-09-20 Per Arne Vollan <pvollan@apple.com>
[WebVTT] Update the parser according to the new region syntax.
https://bugs.webkit.org/show_bug.cgi?id=189767
Reviewed by Eric Carlson.
The majority of the code added in this patch is adopted from the Chromium project, which has added
support for the new region syntax. The complete parser specification can be found at
https://w3c.github.io/webvtt/#file-parsing. One small difference in behavior is that the new parser
will not add regions with empty id.
No new tests, covered by existing tests.
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::getNewRegions):
(WebCore::WebVTTParser::parse):
(WebCore::WebVTTParser::collectRegionSettings):
(WebCore::WebVTTParser::collectWebVTTBlock):
(WebCore::WebVTTParser::checkAndRecoverCue):
(WebCore::WebVTTParser::checkAndCreateRegion):
(WebCore::WebVTTParser::checkAndStoreRegion):
(WebCore::WebVTTParser::collectMetadataHeader): Deleted.
(WebCore::WebVTTParser::createNewRegion): Deleted.
* html/track/WebVTTParser.h:
2018-09-20 Alicia Boya García <aboya@igalia.com>
[GStreamer][MSE] Add a default sample duration
https://bugs.webkit.org/show_bug.cgi?id=189788
Some WebM files don't provide sample durations, so we need to provide
a safe default in order for them to be playable.
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaSampleGStreamer.cpp:
(WebCore::MediaSampleGStreamer::MediaSampleGStreamer):
2018-09-20 Alicia Boya García <aboya@igalia.com>
[MSE] Use some tolerance when deciding whether a frame should be appended to the decode queue
https://bugs.webkit.org/show_bug.cgi?id=189782
Reviewed by Xabier Rodriguez-Calvar.
Ideally, container formats should use exact timestamps and frames
should not overlap. Unfortunately, there are lots of files out there
where this is not always the case.
This is particularly a problem in WebM, where timestamps are expressed
in a power of 10 timescale, which forces some rounding.
This patch makes SourceBuffer allow frames with a small overlaps
(<=1ms) as those usually found in WebM. 1 ms is chosen because it's
the default time scale of WebM files.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-09-20 Yacine Bandou <yacine.bandou@softathome.com>
[EME] Add WebM sanitization
https://bugs.webkit.org/show_bug.cgi?id=189740
Reviewed by Xabier Rodriguez-Calvar.
This patch adds support for sanitizing the WebM initialization data,
ensures there are no bogus values.
See https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest.
Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::sanitizeWebM): Added implementation, check if the initialization data doesn't empty and its size
should be less than 64KB, return the buffer copy if it is ok, otherwise a nullptr.
(WebCore::extractKeyIDsWebM): Added implementation.
2018-09-20 Philippe Normand <pnormand@igalia.com>
[GStreamer] Utilities cleanups
https://bugs.webkit.org/show_bug.cgi?id=189699
Reviewed by Xabier Rodriguez-Calvar.
The GstMappedBuffer now has a move constructor so that it can be easily
reused in the webaudiosrc element. The now-unused corresponding
buffer-mapping utilities are removed from the code-base.
The HTTP source element used to handle a GstBuffer in its private
structure but this is no longer required since data is now pushed
in chunks, see bug #182829.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop):
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::createGstBuffer): Deleted.
(WebCore::createGstBufferForData): Deleted.
(WebCore::getGstBufferDataPointer): Deleted.
(WebCore::mapGstBuffer): Deleted.
(WebCore::unmapGstBuffer): Deleted.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): New method returning a
reference to a newly created GstMappedBuffer instance.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webKitWebSrcStop): Remove reference to unused GstBuffer.
(CachedResourceStreamingClient::dataReceived): Ditto.
2018-09-20 Simon Fraser <simon.fraser@apple.com>
Fix crash under FontCache::purgeInactiveFontData() when a memory warning fires
https://bugs.webkit.org/show_bug.cgi?id=189722
rdar://problem/44182860
Reviewed by Myles C. Maxfield.
Hashing of FontPlatformData for cachedFonts() is somewhat broken because CFEqual() on CTFont
can return false when the fonts are actually the same, and have the same CFHash(). This
can result in multiple entries in cachedFonts() with the same Font.
Then in FontCache::purgeInactiveFontData(), the loop that appends fonts to fontsToDelete
gets the value by reference, and WTFMoves it into fontsToDelete. This nulls out all
the entries sharing the same value, leaving null entries in the hash table.
We later crash at font->hasOneRef() when using one of those null entries.
Fix by making a copy of the RefPtr<Font> in the loop, so the WTFMove doesn't nuke
the hash table entries. The entries will get removed at cachedFonts().remove() lower down.
* platform/graphics/FontCache.cpp:
(WebCore::FontCache::purgeInactiveFontData):
2018-09-20 Antoine Quint <graouts@apple.com>
[Web Animations] Provide a way to query accelerated animations for internal testing
https://bugs.webkit.org/show_bug.cgi?id=189762
Reviewed by Dean Jackson.
Expose a new internals.acceleratedAnimationsForElement(element) method to allow layout tests to query the current list
of accelerated animations for a given element. Currently only the animated property and animation speed are exposed, which
will allow us to identify missing, running and paused accelerated animations.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::acceleratedAnimationsForElement const):
* animation/DocumentTimeline.h:
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::acceleratedAnimationsForTesting const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* testing/Internals.cpp:
(WebCore::Internals::acceleratedAnimationsForElement):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-19 Ryosuke Niwa <rniwa@webkit.org>
Improve node statistics for rare data
https://bugs.webkit.org/show_bug.cgi?id=189775
Reviewed by Simon Fraser.
Report reasons we created NodeRareData and ElementRareData in node statistics.
Added NodeRareData::useTypes and ElementRareData::useTypes which returns OptionSet<NodeRareData::UseType>
indicating which instance member of the rare data is currently in use.
* dom/Element.cpp:
* dom/Element.h:
* dom/ElementRareData.h:
(WebCore::defaultMinimumSizeForResizing):
(WebCore::ElementRareData::useTypes const):
* dom/Node.cpp:
(WebCore::stringForRareDataUseType):
(WebCore::Node::dumpStatistics):
* dom/NodeRareData.cpp:
* dom/NodeRareData.h:
(WebCore::NodeRareData::useTypes const):
2018-09-19 Ryosuke Niwa <rniwa@webkit.org>
REGRESSION(r235917): 2% regression in Dromaeo CSS selector on MacBookPro11,4
https://bugs.webkit.org/show_bug.cgi?id=189738
Reviewed by Yusuke Suzuki.
The regression was caused by the regundant walk to the parent element. Removed it to fix the regression.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
2018-09-19 John Wilander <wilander@apple.com>
Resource Load Statistics: Add optional cap on partitioned cache max age
https://bugs.webkit.org/show_bug.cgi?id=189711
<rdar://problem/39246837>
Reviewed by Antti Koivisto and Chris Dumez.
Test: http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::maxAgeCacheCap):
Checks if a max age cap is set and returns it if the request
represents a prevalent resource.
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
New functionality to receive a max age cap setting in the session.
2018-09-19 Youenn Fablet <youenn@apple.com>
Layout Test webrtc/video-mute.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=177501
Reviewed by Eric Carlson.
Covered by updated test expectation.
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer): Make sure the whole buffer is properly initialized.
2018-09-19 David Kilzer <ddkilzer@apple.com>
WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
<https://webkit.org/b/189742>
<rdar://problem/44589774>
Reviewed by Joseph Pecoraro.
* platform/network/cocoa/WebCoreNSURLSession.h:
(WebCoreNSURLSession._sessionDescription): Change type from
NSString * to RetainPtr<NSString>.
* platform/network/cocoa/WebCoreNSURLSession.mm: Remove
@synthesized statement for sessionDescription so that custom
methods can be implemented to handle RetainPtr<NSString>.
(-[WebCoreNSURLSession sessionDescription]): Add.
(-[WebCoreNSURLSession setSessionDescription:]): Add.
2018-09-19 Youenn Fablet <youenn@apple.com>
Implement sender/receiver getStats
https://bugs.webkit.org/show_bug.cgi?id=189707
Reviewed by Eric Carlson.
Add support for sender and receiver getStats.
Also add support for peer connection selector parameter.
Add the plumbing of the selector to LibWebRTCMediaEndpoint.
Then make use of libwebrtc overloaded methods to retrieve the right stats.
Covered by updated/rebased tests.
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::RTCRtpReceiver):
(WebCore::RTCRtpReceiver::getStats):
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::create):
(WebCore::RTCRtpReceiver::backend):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::getStats):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::backendFromRTPSender):
(WebCore::createReceiverForSource):
(WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
2018-09-19 Jer Noble <jer.noble@apple.com>
REGRESSION (r236006): New waitingForKey() requirement breaks Modern EME tests.
https://bugs.webkit.org/show_bug.cgi?id=189720
<rdar://problem/44572140>
Reviewed by Xabier Rodriguez-Calvar.
Always call waitingForKey() after calling initializationDataEncountered().
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):
2018-09-19 Philippe Normand <pnormand@igalia.com>
[GStreamer] Add support for AV1 decoding
https://bugs.webkit.org/show_bug.cgi?id=189647
Tweaked by Xabier Rodriguez Calvar <calvaris@igalia.com>.
Reviewed by Žan Doberšek.
AV1 can be muxed in MP4 and WebM containers. The test is an adaptation from Chromium's unittest:
https://chromium.googlesource.com/chromium/src/+/master/content/browser/media/media_canplaytype_browsertest.cc
Test: media/media-can-play-av1.html
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Add AV1
support. The av01 codec has to be explicitely checked, along with
the presence of a compatible AV1 decoder.
2018-09-18 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Limit capturing extra metrics for Web Inspector when not required.
https://bugs.webkit.org/show_bug.cgi?id=189520
Reviewed by Alex Christensen.
Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process
time when they are not needed.
No new tests because there's no behavior change.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):
2018-09-18 Megan Gardner <megan_gardner@apple.com>
Support Images Module Level 4's double-position gradient color stop syntax
https://bugs.webkit.org/show_bug.cgi?id=186154
<rdar://problem/44158152>
Reviewed by Simon Fraser.
The CSS spec for all gradients allows for each color stop to have two angles to be used for hints.
This makes pie chart and checkerboard conic gradients much simpler to write.
Any time you want to have a hard line in a gradient, this syntax simplifies the gradient specification.
Test: fast/gradients/conic-two-hints.html
Test: fast/gradients/linear-two-hints-angle.html
Test: fast/gradients/linear-two-hints.html
Test: fast/gradients/radial-two-hints.html
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops): Removed.
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
2018-09-18 Simon Fraser <simon.fraser@apple.com>
Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
https://bugs.webkit.org/show_bug.cgi?id=189689
Reviewed by Alex Christensen.
enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use
a SetForScope<>.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted.
* rendering/RenderLayerCompositor.h:
2018-09-18 Joseph Pecoraro <pecoraro@apple.com>
[macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask
https://bugs.webkit.org/show_bug.cgi?id=189685
<rdar://problem/44541974>
Reviewed by Per Arne Vollan.
* platform/mac/PlatformScreenMac.mm:
(WebCore::gpuIDForDisplayMask):
2018-09-18 Youenn Fablet <youenn@apple.com>
Implement RTCRtpReceiver getContributingSources/getSynchronizationSources
https://bugs.webkit.org/show_bug.cgi?id=189671
Reviewed by Eric Carlson.
Introduce implementation of these two methods by calling the libwebrtc corresponding method.
Add corresponding IDL as per spec.
Covered by rebased WPT tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCRtpContributingSource.h: Added.
* Modules/mediastream/RTCRtpContributingSource.idl: Added.
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::getContributingSources const):
(WebCore::RTCRtpReceiver::getSynchronizationSources const):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpReceiverBackend.h:
(WebCore::RTCRtpReceiverBackend::getContributingSources const):
(WebCore::RTCRtpReceiverBackend::getSynchronizationSources const):
* Modules/mediastream/RTCRtpSynchronizationSource.h: Added.
* Modules/mediastream/RTCRtpSynchronizationSource.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::fillRTCRtpContributingSource):
(WebCore::toRTCRtpContributingSource):
(WebCore::toRTCRtpSynchronizationSource):
(WebCore::LibWebRTCRtpReceiverBackend::getContributingSources const):
(WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-09-18 Youenn Fablet <youenn@apple.com>
Enable Unified Plan by default
https://bugs.webkit.org/show_bug.cgi?id=189675
Reviewed by Eric Carlson.
RTCRtpTransceiver.currentDirection is now gated by the unified plan runtime flag.
This will allow easy feature detection of unified plan support.
Covered by updated test.
* Modules/mediastream/RTCRtpTransceiver.idl:
2018-09-18 Per Arne Vollan <pvollan@apple.com>
[WebVTT] change "middle" to "center" for consistency with CSS
https://bugs.webkit.org/show_bug.cgi?id=158478
Reviewed by Eric Carlson.
No new tests, covered by existing tests.
* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::centerKeyword):
(WebCore::VTTCue::initialize):
(WebCore::VTTCue::align const):
(WebCore::VTTCue::setAlign):
(WebCore::VTTCue::calculateDisplayParameters):
(WebCore::VTTCue::setCueSettings):
(WebCore::middleKeyword): Deleted.
* html/track/VTTCue.h:
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::buildFromString):
2018-09-18 Chris Dumez <cdumez@apple.com>
"DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page from PageCache
https://bugs.webkit.org/show_bug.cgi?id=189681
<rdar://problem/44526171>
Reviewed by Alex Christensen and Zalan Bujtas.
The "DidFirstVisuallyNonEmptyLayout" callback was not getting called when restoring a page from PageCache
because the FrameView is restored from PageCache and we would fail to restore its flags (such as
m_firstVisuallyNonEmptyLayoutCallbackPending) when entering Page Cache. We now call reset those flags that
are related to layout miletones when entering PageCache so that layout milestone events properly get sent
again when restoring from Page Cache.
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
2018-09-18 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Static position should use content-box, not padding-box
https://bugs.webkit.org/show_bug.cgi?id=189698
Reviewed by Javier Fernandez.
This is a recent change by the CSSWG:
https://github.com/w3c/csswg-drafts/issues/3020
The spec text (https://drafts.csswg.org/css-grid/#static-position):
"The static position of an absolutely-positioned child
of a grid container is determined as if it were the sole grid item
in a grid area whose edges coincide with the content edges
of the grid container."
Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::prepareChildForPositionedLayout):
Simple change to use border and padding.
2018-09-18 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=185590
Reviewed by Philippe Normand.
When decryptors are blocked waiting for the key, instruct the
player to run the Wait for key algorithm. As per spec, if we run
out of blocks pending to decrypt because we don't have the key, we
request running the algorithm again.
Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webkitMediaCommonEncryptionDecryptSinkEventHandler):
2018-09-12 Ryosuke Niwa <rniwa@webkit.org>
Update composedPath to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=180378
<rdar://problem/42843004>
Reviewed by Darin Adler.
This patch makes the check for whether a given node in the event path be included in composedPath
pre-determined at the time of the event dispatching per https://github.com/whatwg/dom/issues/525.
This was a fix for the issue that if an event listener in a closed shadow tree removes a node in the
same tree in the event path, then composedPath called on its shadow host, for example, will include
the removed node since it's no longer in the closed shadow tree.
Naively, implementing this behavior would require remembering the original document or shadow root
of each node in the event path as well as its parent shadow root, or worse which node is disclosed
to every other node at the time of computing the event path.
This patch takes a more novel and efficient approach to implement the new behavior by adding a single
integer indicating the number of closed-mode shadow root ancestors of each node in the event path.
In computePathUnclosedToTarget, any node whose *depth* is greater than the context object is excluded.
Consider the following example:
div ------- ShadowRoot (closed)
+- span +- slot
If an event is dispatched on span, then the event path would be [span, slot, ShadowRoot, div]. Then
the values of integers assigned to each node would be: [0, 1, 1, 0] respectively. When composedPath
is called on span or div, slot and ShadowRoot are excluded because they have a greater *depth* value.
Unfortunately, this simplistic solution doesn't work when there are multiple shadow roots of the same
depth through which an event is dispatched as in:
section -- ShadowRoot (closed, SR2)
| +- slot (s2)
+div ------ ShadowRoot (closed, SR1)
+- span +- slot (s1)
If an event is dispatched on span, the event path would be [span, s1, SR1, div, s2, SR2, section].
The values of integers assigned are: [0, 1, 1, 0, 1, 1, 0] respectively. When composedPath is called
on SR1, the simplistic approach would include s2 and SR2, which would be wrong.
To account for this case, in computePathUnclosedToTarget, we traverse the event path upwards (i.e.
ancestors) and downwards (i.e. descendants) from the context object and decrease the *allowed depth*
of shadow trees when we traverse out of a shadow tree in either direction. When traversing upwards,
therefore, moving out of a shadow root to its host would would decrease the allowed depth. When
traversing dowards, moving from a slot element to its assigned node would decrease the allowed depth.
Note that the depths can be negative when a composed event is dispatched inside a closed shadow tree,
and it gets out of its shadow host.
Unfortunately, the latest DOM specification has a bug and doesn't match the behavior of Chrome. This
patch proposes a new algorithm which can be adopted in https://github.com/whatwg/dom/issues/684.
Test: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html
* dom/EventContext.cpp:
(WebCore::EventContext::EventContext):
(WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext):
(WebCore::TouchEventContext::TouchEventContext):
* dom/EventContext.h:
(WebCore::EventContext::closedShadowDepth const): Added.
* dom/EventPath.cpp:
(WebCore::WindowEventContext::WindowEventContext):
(WebCore::EventPath::buildPath): Compute the closed shadow tree's depths for each node in the path.
(WebCore::computePathUnclosedToTarget const): Implemented the aforementioned algorithm.
(WebCore::EventPath::EventPath):
2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com>
[WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=185339
Reviewed by Mark Lam.
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
(WebCore::NetworkExtensionContentFilter::willSendRequest):
(WebCore::NetworkExtensionContentFilter::responseReceived):
(WebCore::NetworkExtensionContentFilter::addData):
(WebCore::NetworkExtensionContentFilter::finishedAddingData):
(WebCore::NetworkExtensionContentFilter::handleDecision):
Use per-function BinarySemaphore instead of holding it in NetworkExtensionContentFilter's field.
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
(WebCore::FileMonitor::~FileMonitor):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
Use BinarySemaphore. And remove unused dispatch_semaphore_t.
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
Use Box<Semaphore> and Box<BinarySemaphore>.
* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
Remove unused dispatch_semaphore_t.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::getRunLoop):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):
(-[WebCoreResourceHandleAsOperationQueueDelegate dealloc]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
Use BinarySemaphore instead.
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Many modern media control tests leak documents in testing
https://bugs.webkit.org/show_bug.cgi?id=189437
Reviewed by Darin Adler.
In order to accurately detect leaks in media controls tests which use lots of
SVGImages, we have to:
- Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
to clear references to elements.
- Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
to drop the last handle to the CachedResource for an SVGImage.
- Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
to run again after that timer has fired.
This should fix most of the spurious leak reports involving SVGImage documents.
* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):
2018-09-17 Jer Noble <jer.noble@apple.com>
Add support for HEVC codec types in Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=189565
Reviewed by Eric Carlson.
Test: media/hevc-codec-parameters.html
Add some utility methods for parsing HEVC codec strings, and using those parsed
values to query the platform for detailed support for HEVC decoding.
Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function
pointers in the encode/decode factory pair.
* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/HEVCUtilities.cpp: Added.
(WebCore::parseHEVCCodecParameters):
* platform/graphics/HEVCUtilities.h: Added.
* platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added.
(WebCore::validateHEVCParameters):
* platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added.
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added.
(WebCore::videoCodecTypeFromRFC4281Type):
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* testing/Internals.cpp:
(WebCore::Internals::parseHEVCCodecParameters):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-17 Devin Rousso <drousso@apple.com>
Web Inspector: generate CSSKeywordCompletions from backend values
https://bugs.webkit.org/show_bug.cgi?id=189041
Reviewed by Joseph Pecoraro.
Modified existing test inspector/css/getSupportedCSSProperties.html.
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Send alias and longhand information for all properties, and any known keyword values for
those applicable. This makes use of `CSSParserFastPaths::isValidKeywordPropertyAndValue` to
determine if a given keyword is a valid value for each property. This only generates a list
for properties who have no non-keyword values.
* css/makeprop.pl:
* css/makevalues.pl:
Create additional helper functions/constants for retrieving strings of each CSS keyword.
* css/CSSProperty.h:
(WebCore::CSSProperty::aliasesForProperty):
* css/CSSPrimitiveValue.cpp:
(WebCore::valueName):
* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createIdentifierValue):
2018-09-17 Youenn Fablet <youenn@apple.com>
track.onmute isn't called for a remote MediaStreamTrack when its counter part track is removed from the peer connection
https://bugs.webkit.org/show_bug.cgi?id=176281
<rdar://problem/44525674>
Reviewed by Eric Carlson.
Listen to libwebrtc remove track callbacks.
Implement handling as per https://w3c.github.io/webrtc-pc/#process-remote-track-removal.
This triggers a mute event on the track.
Test: webrtc/remove-track.html
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::OnRemoveTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
Drive by fix: Plan B code path does not mandate having an rtc backend for each sender.
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Add more Fullscreen logging
https://bugs.webkit.org/show_bug.cgi?id=189656
Reviewed by Jer Noble.
Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
the fullscreen element.
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):
2018-09-14 Simon Fraser <simon.fraser@apple.com>
Add support for dumping the GraphicsLayer tree via notifyutil
https://bugs.webkit.org/show_bug.cgi?id=189639
Reviewed by Zalan Bujtas.
Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree
for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints
the entire tree for each main frame).
It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should
be converted in the same way).
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* rendering/RenderLayerCompositor.cpp:
(showGraphicsLayerTreeForCompositor):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.cpp:
(WebCore::printGraphicsLayerTreeForLiveDocuments):
* rendering/RenderObject.h:
2018-09-17 Christopher Reid <chris.reid@sony.com>
[Curl] Add schema version and enable auto vacuum for cookie database.
https://bugs.webkit.org/show_bug.cgi?id=189669
Reviewed by Alex Christensen.
Turning on auto incremental vacuuming and adding versioning to the database. Right now we
reset tables if there's an unknown schema or if the none is set. There is placeholder logic
in place to upgrade databases as the schema changes in the future.
Tested by checking the database manually after launching MiniBrowser.
* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::verifySchemaVersion):
(WebCore::CookieJarDB::deleteAllTables):
(WebCore::CookieJarDB::createPrepareStatement):
(WebCore::CookieJarDB::getPrepareStatement):
(WebCore::CookieJarDB::executeSimpleSql):
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultSession):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): fixed a bug.
2018-09-14 Ryosuke Niwa <rniwa@webkit.org>
Re-order Node flags based on semantics
https://bugs.webkit.org/show_bug.cgi?id=189643
Reviewed by Simon Fraser.
Re-ordered Node flags based on their category and subclasses of Node which use them.
* dom/Node.h:
2018-09-17 Simon Fraser <simon.fraser@apple.com>
Add more ResourceLoading logging, particularly in MemoryCache code
https://bugs.webkit.org/show_bug.cgi?id=189651
Reviewed by Tim Horton.
Adding more logging to the ResourceLoading log channel, which I found useful
when trying to understand cached SVGImage lifetimes (bug 189437).
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::deleteIfPossible):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::garbageCollectDocumentResources):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResources):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::dumpLRULists const):
2018-09-17 Jer Noble <jer.noble@apple.com>
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096
Reviewed by Eric Carlson.
Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
Now Playing implementation on iOS and Mac.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
(PlatformMediaSessionManager::sharedManager):
(PlatformMediaSessionManager::sharedManagerIfExists):
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(MediaSessionManagerCocoa::nowPlayingEligibleSession):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.h:
(): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
(WebCore::MediaSessionManageriOS::removeSession): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
(WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h: Removed.
2018-09-17 Frederic Wang <fwang@igalia.com>
Build error in ImageBufferCG when compiled with IOSurfacePool
https://bugs.webkit.org/show_bug.cgi?id=189579
Reviewed by Tim Horton.
IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing
compilation errors when files in the same unified source do not agree on the definition.
This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h
to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files.
Finally some minors changes to explicitly declare/define ImageBuffer are performed in order
to prevent future issues with Unified build rotating.
No new tests, behavior unchanged.
* html/HTMLCanvasElement.cpp: Explicitly include ImageBuffer.h since it's used in this file.
* platform/graphics/cg/ImageBufferDataCG.h: Move definition into Platform.h.
* platform/graphics/cocoa/IOSurface.h: Forward-declare ImageBuffer since it's used in this
header.
2018-09-17 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Respond with requested authentication scheme for authentication challenge.
https://bugs.webkit.org/show_bug.cgi?id=189318
Reviewed by Alex Christensen.
Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
mode, the round-trip communication between the client and the server is handled by libcurl
internally. That's okay for many cases. But when initial request has a credentials
(i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
the returned response is not 401.
Passes following tests:
- http/tests/websocket/tests/hybi/httponly-cookie.pl
- http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl
- http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl
- http/tests/xmlhttprequest/basic-auth-default.html
- http/tests/xmlhttprequest/cross-origin-authorization.html
- http/tests/xmlhttprequest/logout.html
- http/tests/xmlhttprequest/null-auth.php
- http/tests/xmlhttprequest/re-login-async.html
- http/tests/xmlhttprequest/re-login.html
- http/tests/xmlhttprequest/redirect-credentials-responseURL.html
- http/tests/xmlhttprequest/remember-bad-password.html
* platform/network/ResourceHandle.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setHttpAuthUserPass):
(WebCore::CurlHandle::enableHttpAuthentication): Deleted.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setAuthenticationScheme):
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
2018-09-17 Youenn Fablet <youenn@apple.com>
Enable VCP for iOS and reenable it for MacOS
https://bugs.webkit.org/show_bug.cgi?id=189635
<rdar://problem/43621029>
Reviewed by Eric Carlson.
Covered by exsiting and modified tests.
Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient.
Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms.
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* testing/Internals.cpp:
(WebCore::Internals::supportsVCPEncoder):
* testing/Internals.h:
* testing/Internals.idl:
2018-09-17 Chris Dumez <cdumez@apple.com>
PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
https://bugs.webkit.org/show_bug.cgi?id=189602
<rdar://problem/44430549>
Reviewed by Geoff Garen.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setTriggeringAction):
* loader/DocumentLoader.h:
* loader/FrameLoadRequest.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
Move NavigationAction's opener setting to loadWithNavigationAction() as this is a better bottleneck.
Otherwise, we'd have to set it at several call sites. Also move the NavigationAction around instead
of copying it.
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/NavigationAction.h:
(WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
2018-09-17 Darin Adler <darin@apple.com>
Use OpaqueJSString rather than JSRetainPtr inside WebKit
https://bugs.webkit.org/show_bug.cgi?id=189652
Reviewed by Saam Barati.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
(WebCore::jsValueWithAVMetadataItemInContext): Use adoptCF.
* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
2018-09-08 Darin Adler <darin@apple.com>
Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext
https://bugs.webkit.org/show_bug.cgi?id=189455
Reviewed by Keith Miller.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Adding a missing
JSStringRelease to fix a leak.
2018-09-15 Rob Buis <rbuis@igalia.com>
XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response
https://bugs.webkit.org/show_bug.cgi?id=189627
Reviewed by Alexey Proskuryakov.
Right now we return an empty Blob without type when the response is empty, but
it should always include the type [1].
Test: web-platform-tests/xhr/overridemimetype-blob.html
[1] https://xhr.spec.whatwg.org/#blob-response
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createResponseBlob):
2018-09-14 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Bug fix on some inaccurate values in NetworkLoadMetrics.
https://bugs.webkit.org/show_bug.cgi?id=189530
Reviewed by Alex Christensen.
Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread.
Record the start time of request instead of libcurl's start timing and use it to measure the metrics.
Also respondEnd was not correctly recorded and fixed.
No new tests because it cannot be measured from DRT.
* platform/network/ResourceHandleInternal.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::setStartTime):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::willSendRequest):
(WebCore::ResourceHandle::continueAfterWillSendRequest):
2018-09-14 Justin Fan <justin_fan@apple.com>
WebGL 2 conformance: rgb-format-support.html
https://bugs.webkit.org/show_bug.cgi?id=189610
<rdar://problem/44403343>
Reviewed by Dean Jackson.
Implementing getInternalformatParameter (emulating on macOS) and updating
renderbufferStorage{Multisample} for WebGL 2 conformance.
Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::isRenderableInternalformat):
(WebCore::WebGL2RenderingContext::getInternalformatParameter):
(WebCore::WebGL2RenderingContext::renderbufferStorageMultisample):
(WebCore::WebGL2RenderingContext::renderbufferStorage):
(WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat):
(WebCore::WebGL2RenderingContext::isIntegerFormat):
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::getInternalformativ):
(WebCore::GraphicsContext3D::renderbufferStorageMultisample):
2018-09-14 Justin Michaud <justin_michaud@apple.com>
Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
https://bugs.webkit.org/show_bug.cgi?id=5968
Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
the result of multiplying stop-opacity with the opacity of the color.
Reviewed by Simon Fraser.
Tests: svg/gradients/spreadMethod-expected.svg
svg/gradients/spreadMethod.svg
svg/gradients/spreadMethodAlpha-expected.svg
svg/gradients/spreadMethodAlpha.svg
svg/gradients/spreadMethodClose0-expected-mismatch.svg
svg/gradients/spreadMethodClose0.svg
svg/gradients/spreadMethodClose1-expected-mismatch.svg
svg/gradients/spreadMethodClose1.svg
svg/gradients/spreadMethodClose2-expected.svg
svg/gradients/spreadMethodClose2.svg
svg/gradients/spreadMethodDiagonal-expected.svg
svg/gradients/spreadMethodDiagonal.svg
svg/gradients/spreadMethodDiagonal2-expected.svg
svg/gradients/spreadMethodDiagonal2.svg
svg/gradients/spreadMethodDuplicateStop-expected.svg
svg/gradients/spreadMethodDuplicateStop.svg
svg/gradients/spreadMethodReversed-expected.svg
svg/gradients/spreadMethodReversed.svg
svg/gradients/stopAlpha-expected.svg
svg/gradients/stopAlpha.svg
* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):
2018-09-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, attempt to fix the iOSMac build after r236015.
* platform/graphics/cv/PixelBufferResizer.mm:
(WebCore::PixelBufferResizer::PixelBufferResizer):
2018-09-11 Simon Fraser <simon.fraser@apple.com>
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521
Reviewed by Tim Horton.
Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
All the other changes are just to adapt to the new ownership patterns.
I verified that no GraphicsLayers were leaked or abandoned after this change.
No behavior change.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
(WebCore::PageOverlayController::didChangeViewSize):
(WebCore::PageOverlayController::didChangeDocumentSize):
(WebCore::PageOverlayController::didChangeSettings):
(WebCore::PageOverlayController::paintContents):
(WebCore::PageOverlayController::didChangeOverlayFrame):
(WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::Highlight::layer const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::invalidate):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
(WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::willBeDestroyed):
(WebCore::GraphicsLayer::setChildren):
(WebCore::GraphicsLayer::addChild):
(WebCore::GraphicsLayer::addChildAtIndex):
(WebCore::GraphicsLayer::addChildBelow):
(WebCore::GraphicsLayer::addChildAbove):
(WebCore::GraphicsLayer::replaceChild):
(WebCore::GraphicsLayer::removeAllChildren):
(WebCore::GraphicsLayer::removeFromParent):
(WebCore::GraphicsLayer::setMaskLayer):
(WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
(WebCore::GraphicsLayer::distributeOpacity):
(WebCore::GraphicsLayer::traverse):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::children const):
(WebCore::GraphicsLayer::children):
(WebCore::GraphicsLayer::maskLayer const):
(WebCore::GraphicsLayer::replicaLayer const):
(WebCore::GraphicsLayer::beingDestroyed const):
(WebCore::GraphicsLayer:: const): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::setChildren):
(WebCore::GraphicsLayerCA::addChild):
(WebCore::GraphicsLayerCA::addChildAtIndex):
(WebCore::GraphicsLayerCA::addChildBelow):
(WebCore::GraphicsLayerCA::addChildAbove):
(WebCore::GraphicsLayerCA::replaceChild):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::initialize): Deleted.
(WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
2018-09-14 Eric Carlson <eric.carlson@apple.com>
Support arbitrary video resolution in getUserMedia API
https://bugs.webkit.org/show_bug.cgi?id=178109
<rdar://problem/35083128>
Reviewed by Youenn Fablet.
Support arbitrary video resolutions by configuring the camera to capture at the closest
larger size it supports and scaling/cropping frames as necessary.
No new tests, existing tests updated.
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/webaudio/MediaStreamAudioSource.cpp:
(WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::MediaStreamAudioSource::settings): Ditto.
(WebCore::MediaStreamAudioSource::capabilities const): Deleted.
(WebCore::MediaStreamAudioSource::settings const): Deleted.
* Modules/webaudio/MediaStreamAudioSource.h:
* SourcesCocoa.txt: Add PixelBufferResizer.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/cocoa/CoreVideoSoftLink.h:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/cv/PixelBufferResizer.h: Added.
(WebCore::PixelBufferResizer::canResizeTo):
* platform/graphics/cv/PixelBufferResizer.mm: Added.
(WebCore::PixelBufferResizer::PixelBufferResizer):
(WebCore::PixelBufferResizer::resize):
* platform/mediastream/RealtimeIncomingAudioSource.cpp:
(WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::RealtimeIncomingAudioSource::settings): Ditto.
(WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted.
(WebCore::RealtimeIncomingAudioSource::settings const): Deleted.
* platform/mediastream/RealtimeIncomingAudioSource.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::RealtimeIncomingVideoSource::settings): Ditto.
(WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted.
(WebCore::RealtimeIncomingVideoSource::settings const): Deleted.
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsConstraint):
(WebCore::RealtimeMediaSource::supportsConstraint const): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::presets):
(WebCore::RealtimeVideoSource::setSupportedPresets):
(WebCore::standardVideoSizes):
(WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful.
(WebCore::presetSupportsFrameRate):
(WebCore::RealtimeVideoSource::supportsCaptureSize):
(WebCore::RealtimeVideoSource::shouldUsePreset):
(WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate):
(WebCore::RealtimeVideoSource::setSizeAndFrameRate):
(WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted.
* platform/mediastream/RealtimeVideoSource.h:
(WebCore::VideoPresetData::encode const):
(WebCore::VideoPresetData::decode):
(WebCore::VideoPreset::create):
(WebCore::VideoPreset::VideoPreset):
(WebCore::RealtimeVideoSource::prefersPreset):
(WebCore::RealtimeVideoSource::canResizeVideoFrames const):
(WebCore::RealtimeVideoSource::setDefaultSize):
(WebCore::RealtimeVideoSource::observedFrameRate const):
(WebCore::VideoPreset::encode const): Deleted.
(WebCore::VideoPreset::decode): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.h:
(WebCore::AVVideoCaptureSource::videoPresets): Deleted.
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoPreset::create):
(WebCore::AVVideoPreset::AVVideoPreset):
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::settings):
(WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::AVVideoCaptureSource::setFrameRate):
(WebCore::AVVideoCaptureSource::prefersPreset):
(WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset):
(WebCore::AVVideoCaptureSource::frameDurationForFrameRate):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::processNewFrame):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVVideoCaptureSource::isFrameRateSupported):
(WebCore::AVVideoCaptureSource::generatePresets):
(WebCore::updateSizeMinMax): Deleted.
(WebCore::updateAspectRatioMinMax): Deleted.
(WebCore::AVVideoCaptureSource::settings const): Deleted.
(WebCore::AVVideoCaptureSource::capabilities const): Deleted.
(WebCore::AVVideoCaptureSource::sizeForPreset): Deleted.
(WebCore::AVVideoCaptureSource::setPreset): Deleted.
(WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted.
(WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted.
(WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::CoreAudioCaptureSource::settings): Ditto.
(WebCore::CoreAudioCaptureSource::capabilities const): Deleted.
(WebCore::CoreAudioCaptureSource::settings const): Deleted.
* platform/mediastream/mac/CoreAudioCaptureSource.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful.
(WebCore::DisplayCaptureSourceCocoa::settings): Ditto.
(WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted.
(WebCore::DisplayCaptureSourceCocoa::settings const): Deleted.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
(WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
(WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset):
* platform/mock/MockMediaDevice.h:
(WebCore::MockCameraProperties::decode):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful.
(WebCore::MockRealtimeAudioSource::capabilities): Ditto.
(WebCore::MockRealtimeAudioSource::settings const): Deleted.
(WebCore::MockRealtimeAudioSource::capabilities const): Deleted.
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::defaultDevices): Change video device presets to trigger resize code more often.
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
(WebCore::MockRealtimeVideoSource::generatePresets):
(WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful.
(WebCore::MockRealtimeVideoSource::settings): Ditto.
(WebCore::MockRealtimeVideoSource::capabilities const): Deleted.
(WebCore::MockRealtimeVideoSource::settings const): Deleted.
* platform/mock/MockRealtimeVideoSource.h:
2018-09-14 Frederic Wang <fwang@igalia.com>
Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together
https://bugs.webkit.org/show_bug.cgi?id=189541
Reviewed by Alex Christensen.
FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the
FontTaggedSettings::hash() template function. This instantiation may happen before
FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid
compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit,
we declare full specialization of the hash() functions in FontTaggedSettings.h.
No new tests, behavior unchanged.
* platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage.
* platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash().
2018-09-14 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235990.
Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS
Reverted changeset:
"Enable USE_MEDIAREMOTE on iOS"
https://bugs.webkit.org/show_bug.cgi?id=189096
https://trac.webkit.org/changeset/235990
2018-09-14 Jer Noble <jer.noble@apple.com>
Turn SourceBufferChangeTypeEnabled on by default
https://bugs.webkit.org/show_bug.cgi?id=189527
Reviewed by Eric Carlson.
* page/Settings.yaml:
2018-09-14 Devin Rousso <webkit@devinrousso.com>
Web Inspector: Record actions performed on ImageBitmapRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=181341
Reviewed by Joseph Pecoraro.
Test: inspector/canvas/recording-bitmaprenderer.html
* html/canvas/ImageBitmapRenderingContext.idl:
* inspector/InspectorCanvas.cpp:
(WebCore::shouldSnapshotBitmapRendererAction):
(WebCore::InspectorCanvas::recordAction):
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
* page/PageConsoleClient.cpp:
(canvasRenderingContext):
2018-09-14 David Kilzer <ddkilzer@apple.com>
REGRESSION (r235954): Fix build failure on watchOS
<https://webkit.org/b/189605>
Reviewed by Geoffrey Garen.
Remove `using WebCore::IndexedDB::KeyType;` from
Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the
resulting build failures.
* Modules/indexeddb/IDBKey.cpp:
(WebCore::IDBKey::IDBKey):
(WebCore::IDBKey::isValid const):
(WebCore::IDBKey::compare const):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::createNumber):
(WebCore::IDBKey::createDate):
(WebCore::IDBKey::type const):
(WebCore::IDBKey::array const):
(WebCore::IDBKey::string const):
(WebCore::IDBKey::date const):
(WebCore::IDBKey::number const):
(WebCore::IDBKey::binary const):
(WebCore::IDBKey::compareTypes):
(WebCore::IDBKey::IDBKey):
* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::maybeCreateIDBKey const):
(WebCore::IDBKeyData::isolatedCopy):
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
(WebCore::IDBKeyData::compare const):
(WebCore::IDBKeyData::loggingString const):
(WebCore::IDBKeyData::setArrayValue):
(WebCore::IDBKeyData::setBinaryValue):
(WebCore::IDBKeyData::setStringValue):
(WebCore::IDBKeyData::setDateValue):
(WebCore::IDBKeyData::setNumberValue):
(WebCore::IDBKeyData::isValid const):
(WebCore::IDBKeyData::operator== const):
* Modules/indexeddb/IDBKeyData.h:
(WebCore::IDBKeyData::IDBKeyData):
(WebCore::IDBKeyData::minimum):
(WebCore::IDBKeyData::maximum):
(WebCore::IDBKeyData::type const):
(WebCore::IDBKeyData::hash const):
(WebCore::IDBKeyData::string const):
(WebCore::IDBKeyData::date const):
(WebCore::IDBKeyData::number const):
(WebCore::IDBKeyData::binary const):
(WebCore::IDBKeyData::array const):
(WebCore::IDBKeyData::encode const):
(WebCore::IDBKeyData::decode):
* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS):
2018-09-14 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] Add support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=189616
Reviewed by Philippe Normand.
Crossplatform support to fire the waitingforkey event from the
player to the element. The element implements the W3C specified
algorithm.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerWaitingForKey):
(WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::waitingForKey):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerWaitingForKey):
2018-09-14 Mike Gorse <mgorse@suse.com>
builtins directory causes name conflict on Python 3
https://bugs.webkit.org/show_bug.cgi?id=189552
Reviewed by Michael Catanzaro.
No new tests (No behavior change).
* CMakeLists.txt: builtins -> wkbuiltins.
* DerivedSources.make: builtins -> wkbuiltins.
2018-09-13 Ryosuke Niwa <rniwa@webkit.org>
Capturing event listeners are called during bubbling phase for shadow hosts
https://bugs.webkit.org/show_bug.cgi?id=174288
<rdar://problem/33530455>
Reviewed by Darin Adler.
Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
dispatched within its shadow tree.
To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
section#hostParent
+ div#host -- ShadowRoot
- p#parent
- span#target
Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
the following order in WebKit & Chrome right now:
1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2. #parent, capturing, eventPhase: CAPTURING_PHASE
3. #target, capturing, eventPhase: AT_TARGET
4. #target, non-capturing, eventPhase: AT_TARGET
5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
6. #host, capturing, eventPhase: AT_TARGET
7. #host, non-capturing, eventPhase: AT_TARGET
8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
started. A more natural ordering would be:
1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
2. #host, capturing, eventPhase: AT_TARGET
3. #parent, capturing, eventPhase: CAPTURING_PHASE
4. #target, capturing, eventPhase: AT_TARGET
5. #target, non-capturing, eventPhase: AT_TARGET
6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
7. #host, non-capturing, eventPhase: AT_TARGET
8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
event listeners on the event's target is invoked in the registration order. After this patch, all capturing
event listeners are invoked before bubbling event listeners are invoked.
To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.
Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
media controls before author scripts recieve the event.
(MediaControllerSupport.prototype.disable): Ditto.
* dom/EventContext.cpp:
(WebCore::EventContext::handleLocalEvents const):
(WebCore::MouseOrFocusEventContext::handleLocalEvents const):
(WebCore::TouchEventContext::handleLocalEvents const):
* dom/EventContext.h:
* dom/EventDispatcher.cpp:
(WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
the special code path for the event's target with the code in the bubbling phase.
* dom/EventPath.cpp:
(WebCore::WindowEventContext::handleLocalEvents const):
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
(WebCore::EventTarget::fireEventListeners):
(WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
event listeners even when eventPhase is Event::Phase::AT_TARGET.
* dom/EventTarget.h:
* dom/Node.cpp:
(WebCore::Node::handleLocalEvents):
* dom/Node.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::handleLocalEvents):
* html/HTMLFormElement.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::dispatchEvent):
2018-09-13 Megan Gardner <megan_gardner@apple.com>
Fix color stop blending in conic gradients for stops past 1
https://bugs.webkit.org/show_bug.cgi?id=189532
<rdar://problem/44158221>
Reviewed by Simon Fraser.
Calculation was wrong, fixed it, and wrote a test that failed
without the change, and passes with it.
Test: fast/gradients/conic-repeating-last-stop.html
* css/CSSGradientValue.cpp:
(WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
2018-09-13 Chris Dumez <cdumez@apple.com>
Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
https://bugs.webkit.org/show_bug.cgi?id=189590
<rdar://problem/44422725>
Reviewed by Geoffrey Garen.
Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.
Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/NavigationAction.h:
(WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
(WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/Page.h:
(WebCore::Page::openedViaWindowOpenWithOpener const):
(WebCore::Page::setOpenedViaWindowOpenWithOpener):
2018-09-13 Jer Noble <jer.noble@apple.com>
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096
Reviewed by Eric Carlson.
Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
Now Playing implementation on iOS and Mac.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
(PlatformMediaSessionManager::sharedManager):
(PlatformMediaSessionManager::sharedManagerIfExists):
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(MediaSessionManagerCocoa::nowPlayingEligibleSession):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.h:
(): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
(WebCore::MediaSessionManageriOS::removeSession): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
(WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h: Removed.
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
https://bugs.webkit.org/show_bug.cgi?id=189576
Reviewed by Alex Christensen.
Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
statements, but "friend LazyNeverDestroyed<X>".
No new tests (No behavior change).
* css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
statement.
* css/CSSInitialValue.h: Ditto.
* css/CSSPrimitiveValue.h: Ditto.
* css/CSSRevertValue.h: Ditto.
* css/CSSUnsetValue.h: Ditto.
2018-09-13 Ms2ger <Ms2ger@igalia.com>
[GLib] Fix format string in KeyedEncoderGlib::beginObject().
https://bugs.webkit.org/show_bug.cgi?id=189585
Reviewed by Michael Catanzaro.
This appears to fix the following assertion locally:
GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
Covered by existing tests.
* platform/glib/KeyedEncoderGlib.cpp:
(WebCore::KeyedEncoderGlib::beginObject):
2018-09-13 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r235953.
Caused layout test crashes under GuardMalloc.
Reverted changeset:
"Make GraphicsLayers ref-counted, so their tree can persist
when disconnected from RenderLayerBackings"
https://bugs.webkit.org/show_bug.cgi?id=189521
https://trac.webkit.org/changeset/235953
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
Remove a MSVC workaround in XPath::Step::NodeTest
https://bugs.webkit.org/show_bug.cgi?id=189578
Reviewed by Alex Christensen.
XPath::Step::NodeTest has a special code for MSVC bug workaround.
It has been introduced in 5 years ago in Bug 121082 Comment 19.
I think it is safe just to remove the workaround.
No new tests (No behavior change).
* xml/XPathStep.h: Removed the MSVC workaround.
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
Remove a MSVC workaround in InspectorStyle::styleWithProperties
https://bugs.webkit.org/show_bug.cgi?id=189577
Reviewed by Alex Christensen.
No new tests (No behavior change).
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
2018-09-13 Alex Christensen <achristensen@webkit.org>
Use a Variant instead of a union in CSSSelector
https://bugs.webkit.org/show_bug.cgi?id=188559
Reviewed by Antti Koivisto.
No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
I only have m_isForPage when assertions are enabled because it's only used for an assertion.
The rest is pretty straightforward translating union syntax to Variant syntax.
I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
* css/CSSSelector.cpp:
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::createRareData):
(WebCore::CSSSelector::setAttribute):
(WebCore::CSSSelector::setArgument):
(WebCore::CSSSelector::setLangArgumentList):
(WebCore::CSSSelector::setSelectorList):
(WebCore::CSSSelector::setNth):
(WebCore::CSSSelector::matchNth const):
(WebCore::CSSSelector::nthA const):
(WebCore::CSSSelector::nthB const):
(WebCore::CSSSelector::RareData::RareData):
* css/CSSSelector.h:
(WebCore::CSSSelector::argument const):
(WebCore::CSSSelector::langArgumentList const):
(WebCore::CSSSelector::selectorList const):
(WebCore::CSSSelector::attribute const):
(WebCore::CSSSelector::attributeCanonicalLocalName const):
(WebCore::CSSSelector::setValue):
(WebCore::CSSSelector::CSSSelector):
(WebCore::CSSSelector::~CSSSelector):
(WebCore::CSSSelector::tagQName const):
(WebCore::CSSSelector::tagLowercaseLocalName const):
(WebCore::CSSSelector::value const):
(WebCore::CSSSelector::serializingValue const):
(WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
(WebCore::CSSSelector::RareData::create): Deleted.
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::parsePageSelector):
* css/parser/CSSParserSelector.h:
2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
https://bugs.webkit.org/show_bug.cgi?id=189575
Reviewed by Alex Christensen.
No new tests (No behavior change).
* platform/win/WheelEventWin.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
2018-09-13 Youenn Fablet <youenn@apple.com>
Introduce RTCRtpSendParameters
https://bugs.webkit.org/show_bug.cgi?id=189563
Reviewed by Eric Carlson.
Introduce RTCRtpSendParameters to match the WebRTC specification.
Split RTCRtpPrameters fields accordingly and update call sites.
Covered by updated test.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCRtpCodingParameters.h: Added
* Modules/mediastream/RTCRtpCodingParameters.idl: Added
* Modules/mediastream/RTCRtpDecodingParameters.h: Added
* Modules/mediastream/RTCRtpDecodingParameters.idl: Added
* Modules/mediastream/RTCRtpEncodingParameters.h:
* Modules/mediastream/RTCRtpEncodingParameters.idl:
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
* Modules/mediastream/RTCRtpSendParameters.h: Added.
(WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
* Modules/mediastream/RTCRtpSendParameters.idl: Added.
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::getParameters):
(WebCore::RTCRtpSender::setParameters):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/RTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
(WebCore::LibWebRTCRtpSenderBackend::getParameters const):
(WebCore::LibWebRTCRtpSenderBackend::setParameters):
* Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCRtpParameters):
(WebCore::toRTCRtpSendParameters):
(WebCore::fromRTCRtpSendParameters):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-09-13 Xabier Rodriguez Calvar <calvaris@igalia.com>
[GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
https://bugs.webkit.org/show_bug.cgi?id=189547
Reviewed by Philippe Normand.
decrypt-key-needed message renamed to drm-cdm-instance-needed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
renaming the message, removed the class prefix for
dispatchCDMInstance.
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
2018-09-11 Ryosuke Niwa <rniwa@webkit.org>
imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
https://bugs.webkit.org/show_bug.cgi?id=189493
Reviewed by Alex Christensen.
The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
When a form (or any other) element has more than one ref inside removeDetachedChildren,
addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
However, when a form associated element of this form element appears later in the tree order,
FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
operations happening in this function so this should be safe.
Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
* html/FormAssociatedElement.cpp:
(WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
2018-09-12 Dan Bernstein <mitz@apple.com>
[Cocoa] Complete support for Paste as Quotation
https://bugs.webkit.org/show_bug.cgi?id=189504
Reviewed by Wenson Hsieh.
Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
editing/pasteboard/4930986-2-paste-as-quotation.html
editing/pasteboard/4930986-3-paste-as-quotation.html
* editing/Editor.cpp:
Added ClipboardEventKind::PasteAsQuotation.
(WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
(WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
This means that currently event handlers cant emulate pasting as quotation, because they
neither have the quoted content nor knowledge that quoting has been requested. We could
change this in the future if needed.
(WebCore::Editor::paste): Updated for change in pasteWithPasteboards argument type.
(WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
PasteOption::AsQuotation to pasteWithPasteboard.
(WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
the fragment in a blockquote element with the "type" attribute set to "cite" and the
"class" attribute set to a well-known value, which is used to trigger special behavior in
ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
so eventually, we could stop using this form of in-band signaling.
* editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
behavior.
* editing/EditorCommand.cpp:
(WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
(WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
here.
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
quote the fragment if needed.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::pasteWithPasteboard): Ditto.
(WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
quote the fragment if needed.
(WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
pasteWithPasteboard.
(WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
quote the fragment if needed.
* editing/wpe/EditorWPE.cpp:
(WebCore::Editor::pasteWithPasteboard): Ditto.
2018-09-11 Simon Fraser <simon.fraser@apple.com>
Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
https://bugs.webkit.org/show_bug.cgi?id=189521
Reviewed by Tim Horton.
Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
All the other changes are just to adapt to the new ownership patterns.
I verified that no GraphicsLayers were leaked or abandoned after this change.
No behavior change.
* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::layerWithDocumentOverlays):
(WebCore::PageOverlayController::layerWithViewOverlays):
(WebCore::PageOverlayController::installPageOverlay):
(WebCore::PageOverlayController::uninstallPageOverlay):
(WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
(WebCore::PageOverlayController::didChangeViewSize):
(WebCore::PageOverlayController::didChangeDocumentSize):
(WebCore::PageOverlayController::didChangeSettings):
(WebCore::PageOverlayController::paintContents):
(WebCore::PageOverlayController::didChangeOverlayFrame):
(WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
* page/PageOverlayController.h:
* page/mac/ServicesOverlayController.h:
(WebCore::ServicesOverlayController::Highlight::layer const):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::Highlight):
(WebCore::ServicesOverlayController::Highlight::invalidate):
(WebCore::ServicesOverlayController::Highlight::fadeIn):
(WebCore::ServicesOverlayController::Highlight::fadeOut):
(WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
(WebCore::ServicesOverlayController::determineActiveHighlight):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::willBeDestroyed):
(WebCore::GraphicsLayer::setChildren):
(WebCore::GraphicsLayer::addChild):
(WebCore::GraphicsLayer::addChildAtIndex):
(WebCore::GraphicsLayer::addChildBelow):
(WebCore::GraphicsLayer::addChildAbove):
(WebCore::GraphicsLayer::replaceChild):
(WebCore::GraphicsLayer::removeAllChildren):
(WebCore::GraphicsLayer::removeFromParent):
(WebCore::GraphicsLayer::setMaskLayer):
(WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
(WebCore::GraphicsLayer::distributeOpacity):
(WebCore::GraphicsLayer::traverse):
(WebCore::dumpChildren):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::children const):
(WebCore::GraphicsLayer::children):
(WebCore::GraphicsLayer::maskLayer const):
(WebCore::GraphicsLayer::replicaLayer const):
(WebCore::GraphicsLayer::beingDestroyed const):
(WebCore::GraphicsLayer:: const): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::setChildren):
(WebCore::GraphicsLayerCA::addChild):
(WebCore::GraphicsLayerCA::addChildAtIndex):
(WebCore::GraphicsLayerCA::addChildBelow):
(WebCore::GraphicsLayerCA::addChildAbove):
(WebCore::GraphicsLayerCA::replaceChild):
(WebCore::GraphicsLayerCA::setMaskLayer):
(WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::updateSublayerList):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerTextureMapper::setChildren):
(WebCore::GraphicsLayerTextureMapper::addChild):
(WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
(WebCore::GraphicsLayerTextureMapper::addChildAbove):
(WebCore::GraphicsLayerTextureMapper::addChildBelow):
(WebCore::GraphicsLayerTextureMapper::replaceChild):
(WebCore::GraphicsLayerTextureMapper::setMaskLayer):
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
(WebCore::CoordinatedGraphicsLayer::addChild):
(WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
(WebCore::CoordinatedGraphicsLayer::addChildAbove):
(WebCore::CoordinatedGraphicsLayer::addChildBelow):
(WebCore::CoordinatedGraphicsLayer::replaceChild):
(WebCore::CoordinatedGraphicsLayer::setMaskLayer):
(WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
(WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::initialize): Deleted.
(WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
(WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateInternalHierarchy):
(WebCore::RenderLayerBacking::updateMaskingLayer):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
(WebCore::RenderLayerCompositor::setCompositingParent):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
(WebCore::RenderLayerCompositor::updateLayerForHeader):
(WebCore::RenderLayerCompositor::updateLayerForFooter):
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
(WebCore::RenderLayerCompositor::ensureRootLayer):
(WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
* rendering/RenderLayerCompositor.h:
2018-09-12 Alex Christensen <achristensen@webkit.org>
Expose fewer of URL's internal members
https://bugs.webkit.org/show_bug.cgi?id=189528
Reviewed by Chris Dumez.
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::urlHostHash):
* platform/URL.cpp:
(WebCore::URL::hostStart const):
(WebCore::protocolHostAndPortAreEqual):
(WebCore::hostsAreEqual):
* platform/URL.h:
(WebCore::URL::hostStart const): Deleted.
(WebCore::URL::hostEnd const): Deleted.
2018-09-12 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Implement correct total received bytes.
https://bugs.webkit.org/show_bug.cgi?id=189555
Reviewed by Alex Christensen.
Curl port only reported total network received bytes before decoding.
No new test. InspectorTest is only available for WebKitTestRunner.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
2018-09-12 Youenn Fablet <youenn@apple.com>
Split RTCRtpParameters idl and header file
https://bugs.webkit.org/show_bug.cgi?id=189524
Reviewed by Eric Carlson.
This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
No change of behavior.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCDegradationPreference.idl: Added.
* Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCDtxStatus.idl: Added.
* Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCPriorityType.idl: Added.
* Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpCodecParameters.idl: Added.
* Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
* Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpFecParameters.idl: Added.
* Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
* Modules/mediastream/RTCRtpParameters.h:
* Modules/mediastream/RTCRtpParameters.idl:
* Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
* Modules/mediastream/RTCRtpRtxParameters.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCEncodingParameters):
(WebCore::fromRTCEncodingParameters):
(WebCore::toRTCHeaderExtensionParameters):
(WebCore::fromRTCHeaderExtensionParameters):
(WebCore::toRTCCodecParameters):
(WebCore::toRTCRtpParameters):
(WebCore::fromRTCRtpParameters):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-09-12 Ali Juma <ajuma@chromium.org>
[IntersectionObserver] Implement rootMargin expansion
https://bugs.webkit.org/show_bug.cgi?id=189525
Reviewed by Simon Fraser.
Expand the root intersection rectangle by the observer's rootMargin when computing
intersections.
Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
* dom/Document.cpp:
(WebCore::expandRootBoundsWithRootMargin):
(WebCore::computeIntersectionRects):
* page/IntersectionObserver.h:
(WebCore::IntersectionObserver::rootMarginBox const):
* platform/graphics/FloatRect.h:
(WebCore::FloatRect::expand):
2018-09-12 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
https://bugs.webkit.org/show_bug.cgi?id=189542
Reviewed by Alex Christensen.
No new tests (No behavior change).
* platform/graphics/win/IntPointWin.cpp:
(WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
2018-09-12 Guillaume Emont <guijemont@igalia.com>
Add IGNORE_WARNING_.* macros
https://bugs.webkit.org/show_bug.cgi?id=188996
Reviewed by Michael Catanzaro.
* Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::overrideAttachmentParent):
(WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper renderWidgetChildren]):
(-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
(-[WebAccessibilityObjectWrapper role]):
(-[WebAccessibilityObjectWrapper roleDescription]):
* bridge/objc/WebScriptObject.mm:
* bridge/objc/objc_class.mm:
(JSC::Bindings::ObjcClass::fieldNamed const):
* crypto/CommonCryptoUtilities.cpp:
(WebCore::getCommonCryptoDigestAlgorithm):
* crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
(WebCore::encryptAES_GCM):
(WebCore::decyptAES_GCM):
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::wrapSerializedCryptoKey):
(WebCore::unwrapSerializedCryptoKey):
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* editing/TextIterator.cpp:
* editing/mac/EditorMac.mm:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::takeFindStringFromSelection):
(WebCore::Editor::replaceNodeFromPasteboard):
* page/mac/EventHandlerMac.mm:
(WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::paintContents):
* platform/LocalizedStrings.cpp:
(WebCore::formatLocalizedString):
* platform/ScreenProperties.h:
(WebCore::ScreenData::decode):
* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::stopMonitoringInput):
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::sharedDisplay):
* platform/graphics/SurrogatePairAwareTextIterator.cpp:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
(WebCore::MediaSelectionGroupAVFObjC::updateOptions):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update):
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
(WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::IGNORE_CLANG_WARNING_END):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
(-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
(-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::IGNORE_CLANG_WARNING_END):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayer::drawLayerContents):
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const):
* platform/graphics/cg/ImageDecoderCG.cpp:
(WebCore::ImageDecoderCG::createFrameImageAtIndex):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::GraphicsContext::drawLineForDocumentMarker):
* platform/graphics/cocoa/WebGLLayer.h:
(IGNORE_CLANG_WARNING):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/IconMac.mm:
(WebCore::Icon::Icon):
* platform/graphics/mac/PDFDocumentImageMac.mm:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/mac/WebKitNSImageExtras.mm:
(-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
* platform/ios/DragImageIOS.mm:
* platform/mac/DragImageMac.mm:
(WebCore::scaleDragImage):
(WebCore::createDragImageForLink):
* platform/mac/LegacyNSPasteboardTypes.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
(WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::createForCopyAndPaste):
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::setDragImageImpl):
* platform/mac/PlatformEventFactoryMac.mm:
(WebCore::globalPoint):
* platform/mac/SSLKeyGeneratorMac.mm:
* platform/mac/ScrollViewMac.mm:
(WebCore::ScrollView::platformContentsToScreen const):
(WebCore::ScrollView::platformScreenToContents const):
* platform/mac/ThemeMac.mm:
(WebCore::drawCellFocusRingWithFrameAtTime):
* platform/mac/WebPlaybackControlsManager.mm:
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint):
* platform/mediastream/RealtimeIncomingAudioSource.h:
* platform/mediastream/RealtimeIncomingVideoSource.h:
* platform/mediastream/RealtimeOutgoingAudioSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection):
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::SocketStreamHandleImpl::reportErrorToClient):
* platform/network/create-http-header-name-table:
* platform/text/TextEncoding.cpp:
* testing/MockLibWebRTCPeerConnection.h:
* xml/XPathGrammar.cpp:
2018-09-12 Pablo Saavedra <psaavedra@igalia.com>
Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
https://bugs.webkit.org/show_bug.cgi?id=189540
Reviewed by Philippe Normand.
Related issues:
This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
No new tests, no changes in the functionality.
* platform/GStreamer.cmake:
* platform/SourcesGLib.txt:
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):
2018-09-11 Zan Dobersek <zdobersek@igalia.com>
Unreviewed WPE build fix.
* platform/network/soup/SocketStreamHandleImplSoup.cpp:
Add extra header inclusions to get this code building after the unified
sources system shifted it into a different translation unit.
2018-09-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] WebInspector doesn't display request headers added during processing.
https://bugs.webkit.org/show_bug.cgi?id=189531
Reviewed by Alex Christensen.
While processing the request, Curl port network layer adds some headers to the request
such as cookies. Those headers should be displayed in the WebInspector.
Tested on MiniBrowser.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
2018-09-11 James Savage <james.savage@apple.com>
Follow up to:
Expose -apple-system-container-border color to internal web views.
https://bugs.webkit.org/show_bug.cgi?id=189178.
Reviewed by Timothy Hatcher.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
for this change, I had to write out the condition in the first change, but
mistakenly thought I could reuse the block here. Turns out the versions were
different, and I could not.
2018-09-11 Youenn Fablet <youenn@apple.com>
Remove MediaDevices NoInterfaceObject
https://bugs.webkit.org/show_bug.cgi?id=189512
Reviewed by Alex Christensen.
Covered by rebased WPT tests.
* Modules/mediastream/MediaDevices.idl:
2018-09-11 Jer Noble <jer.noble@apple.com>
[MediaCapabilities] Implement MediaEngineConfigurationFactory registration
https://bugs.webkit.org/show_bug.cgi?id=189438
Reviewed by Eric Carlson.
Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
objects representing video and audio configurations are IDLDictionaries, the native objects
are just structs full of POD types (and Strings). Since these have no dependencies on
higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
* Modules/mediacapabilities/MediaCapabilities.cpp:
(WebCore::isValidVideoConfiguration):
(WebCore::MediaCapabilities::decodingInfo):
(WebCore::MediaCapabilities::encodingInfo):
* Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
* Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
* Modules/mediacapabilities/VideoConfiguration.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
* platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
* platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
* platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
* platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
* platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
* platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
* platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
* platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* platform/mediacapabilities/MediaEngineConfigurationFactory.h:
* platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
* platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
(WebCore::canDecodeMedia):
(WebCore::canSmoothlyDecodeMedia):
(WebCore::canPowerEfficientlyDecodeMedia):
(WebCore::canEncodeMedia):
(WebCore::canSmoothlyEncodeMedia):
(WebCore::canPowerEfficientlyEncodeMedia):
(WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
* platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
* platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
* platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
* platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
* platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
2018-09-08 Ryosuke Niwa <rniwa@webkit.org>
:first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
https://bugs.webkit.org/show_bug.cgi?id=166748
<rdar://problem/29649177>
Reviewed by Yusuke Suzuki.
Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
fast/shadow-dom/nth-node-on-shadow-child.html
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
* dom/ShadowRoot.h:
* domjit/DOMJITHelpers.h:
(WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
(WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
2018-09-11 Per Arne Vollan <pvollan@apple.com>
Addressing post-review feedback on r235619.
https://bugs.webkit.org/show_bug.cgi?id=187925
Unreviewed.
* testing/Internals.cpp:
(WebCore::Internals::primaryScreenDisplayID):
* testing/Internals.h:
2018-09-11 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK2] Support changing foreground colors via color panel
https://bugs.webkit.org/show_bug.cgi?id=189382
<rdar://problem/44227311>
Reviewed by Ryosuke Niwa.
Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
Tested by FontManagerTests.ChangeFontColorWithColorPanel.
* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles):
Support setting foreground text color with alpha by using a styled span element rather than a font element with
attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
`rgba()` result in a garbage value for the computed color style.
* editing/FontAttributeChanges.cpp:
(WebCore::FontAttributeChanges::editAction const):
Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
* editing/FontAttributeChanges.h:
(WebCore::FontChanges::isEmpty const):
2018-09-11 Yusuke Suzuki <yusukesuzuki@slowstart.org>
Shrink size of ResourseResponseBase
https://bugs.webkit.org/show_bug.cgi?id=189501
Reviewed by Simon Fraser.
We reduce the size of ResourceResponseBase by the following two optimizations.
1. Use bitfields for bool flags and reorder them.
2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
No behavior change.
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::responseReceived):
(WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
* platform/network/CacheValidation.h:
(WebCore::CacheControlDirectives::CacheControlDirectives):
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::ResourceResponseBase):
(WebCore::ResourceResponseBase::contentRange const):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::decode):
2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix some -Wreturn-type warnings
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::sourceFromNewReceiver):
* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::toRTCRtpTransceiverDirection):
(WebCore::fromRTCRtpTransceiverDirection):
2018-09-11 Jiewen Tan <jiewen_tan@apple.com>
Unreviewed, a speculative build fix for r235888.
* Modules/mediastream/MediaDevices.h:
Add class Document forward declaration.
2018-09-11 Woodrow Wang <woodrow_wang@apple.com>
Add Web API Statistics Collection
https://bugs.webkit.org/show_bug.cgi?id=187773
<rdar://problem/44155162>
Reviewed by Brent Fulgham.
Added data collection for web API statistics, specifically regarding the canvas, font loads,
screen functions, and navigator functions. The data collection code is placed under a runtime
enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written
to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
includes a struct to keep track of HTML5 canvas element read and writes.
Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
http/tests/webAPIStatistics/font-load-data-collection.html
http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::fontRangesForFamily):
(WebCore::CSSFontSelector::fallbackFontAt):
The following are the functions where we'd like to record a canvas read.
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::toDataURL):
(WebCore::HTMLCanvasElement::toBlob):
(WebCore::HTMLCanvasElement::getImageData):
(WebCore::HTMLCanvasElement::toMediaSample):
(WebCore::HTMLCanvasElement::captureStream):
The following are the functions where we'd like to record a canvas write.
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::measureText):
(WebCore::CanvasRenderingContext2D::drawTextInternal):
The following files and functions handle the CanvasActivityRecord struct and
its respective functions.
* loader/CanvasActivityRecord.cpp: Added.
(WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
(WebCore::CanvasActivityRecord::mergeWith):
* loader/CanvasActivityRecord.h: Added.
(WebCore::CanvasActivityRecord::encode const):
(WebCore::CanvasActivityRecord::decode):
* loader/DocumentThreadableLoader.cpp:
* loader/FrameLoader.cpp:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key.
Now the encodeHashSet function has been generalized to take any key to encode the entries
in the HashSet. Also added functionality to encode an OptionSet by converting it to its
raw bitmask state.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::encodeHashSet):
(WebCore::encodeOriginHashSet):
(WebCore::encodeOptionSet):
(WebCore::encodeFontHashSet):
(WebCore::encodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::decodeHashSet):
(WebCore::decodeOriginHashSet):
(WebCore::decodeOptionSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::navigatorAPIEnumToString):
(WebCore::screenAPIEnumToString):
(WebCore::appendNavigatorAPIOptionSet):
(WebCore::appendScreenAPIOptionSet):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
* loader/ResourceTiming.cpp:
The following are the navigator functions recorded for the web API statistics.
* page/Navigator.cpp:
(WebCore::Navigator::appVersion const):
(WebCore::Navigator::userAgent const):
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
(WebCore::Navigator::cookieEnabled const):
(WebCore::Navigator::javaEnabled const):
The following are the screen functions recorded for the web API statistics.
* page/Screen.cpp:
(WebCore::Screen::height const):
(WebCore::Screen::width const):
(WebCore::Screen::colorDepth const):
(WebCore::Screen::pixelDepth const):
(WebCore::Screen::availLeft const):
(WebCore::Screen::availTop const):
(WebCore::Screen::availHeight const):
(WebCore::Screen::availWidth const):
2018-09-11 Pablo Saavedra <psaavedra@igalia.com>
playbackControlsManagerUpdateTimerFired and
m_playbackControlsManagerUpdateTimer must be
guarded with ENABLE(VIDEO), otherwise the following
error occurs with the VIDEO feature turned off:
error: 'MediaElementSession' has not been declared
Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
https://bugs.webkit.org/show_bug.cgi?id=189500
Reviewed by Anders Carlsson.
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::schedulePlaybackControlsManagerUpdate):
* page/Page.h:
2018-09-11 Frederic Wang <fwang@igalia.com>
Refactor filter list checking code
https://bugs.webkit.org/show_bug.cgi?id=185087
Reviewed by Antonio Gomes.
No new tests, behavior unchanged.
* page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
== Rolled over to ChangeLog-2018-09-11 ==