blob: 3e10d6f70bd67e2726d9bbd737029db9517da3b2 [file] [log] [blame]
2020-04-28 Wenson Hsieh <wenson_hsieh@apple.com>
[Text manipulation] Add a userInfo dictionary to _WKTextManipulationToken
https://bugs.webkit.org/show_bug.cgi?id=211151
<rdar://problem/62329534>
Reviewed by Darin Adler.
Add an extensible mechanism for the text manipulation controller to send additional
metadata for each text manipulation token through to the WebKit client, for debugging
purposes.
Test: TextManipulation.StartTextManipulationExtractsUserInfo
* editing/TextManipulationController.cpp:
(WebCore::tokenInfo):
(WebCore::TextManipulationController::observeParagraphs):
* editing/TextManipulationController.h:
Add TextManipulationTokenInfo, and add an optional TextManipulationTokenInfo member to
TextManipulationToken. For now, just send over the document URL, element tag name, and
the value of the role attribute.
(WebCore::TextManipulationController::ManipulationTokenInfo::encode const):
(WebCore::TextManipulationController::ManipulationTokenInfo::decode):
(WebCore::TextManipulationController::ManipulationToken::encode const):
(WebCore::TextManipulationController::ManipulationToken::decode):
2020-04-28 Simon Fraser <simon.fraser@apple.com>
Update the xcfilelists.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2020-04-28 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r260808): Backdrops on music.apple.com are offset
https://bugs.webkit.org/show_bug.cgi?id=211153
<rdar://problem/62543158>
Reviewed by Zalan Bujtas.
The border-radius code path failed to offset the rounded rect by contentOffsetInCompositingLayer().
Test: compositing/filters/backdrop-filter-rect-border-radius.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
2020-04-28 Daniel Bates <dabates@apple.com>
Modernize EndPointsAdjustmentMode enumeration and fix misspelled enumerator
https://bugs.webkit.org/show_bug.cgi?id=211141
Reviewed by Eric Carlson.
Fix the misspelled enumerator DoNotAdjsutEndpoints. While I am here, make
EndPointsAdjustmentMode an enum class sized as a bool and simplify the naming
of its enumerators now that they have to be qualified. I also re-ordered them
so that DoNotAdjust is the first enumerator (it will have value 0). This doesn't
really matter, but I like it because it makes it so that this enumeration behaves
more like an equivalent boolean should casts be involved.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setSelectionByMouseIfDifferent):
* editing/FrameSelection.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::updateSelectionForMouseDrag):
2020-04-28 Daniel Bates <dabates@apple.com>
[WebKitLegacy] Implement -hidePlaceholder and -showPlaceholderIfNecessary in terms of setCanShowPlaceholder()
https://bugs.webkit.org/show_bug.cgi?id=211139
Reviewed by Simon Fraser.
Remove hidePlaceholder() and showPlaceholderIfNecessary() as they are no longer needed.
Callers should use setCanShowPlaceholder() instead.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::hidePlaceholder): Deleted.
(WebCore::HTMLTextFormControlElement::showPlaceholderIfNecessary): Deleted.
* html/HTMLTextFormControlElement.h:
2020-04-28 ChangSeok Oh <changseok@webkit.org>
[GTK] Fix build failures for ANGLE_WEBGL after r259589
https://bugs.webkit.org/show_bug.cgi?id=211116
Reviewed by Alex Christensen.
The compiler is unhappy with coverting GCGLint64 (long long int) to GLInt64 (long int).
Passing GCGLuint62 as GLuint64 is a similar issue.
No new tests since no new functionalities.
* platform/graphics/angle/ExtensionsGLANGLE.cpp:
(WebCore::ExtensionsGLANGLE::getInteger64vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getInteger64i_vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getBufferParameteri64vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getQueryObjecti64vRobustANGLE):
(WebCore::ExtensionsGLANGLE::getQueryObjectui64vRobustANGLE):
* platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp:
(Nicosia::GC3DLayer::swapBuffersIfNeeded): Unaccelerated -> RenderingMode::Unaccelerated
2020-04-28 Noam Rosenthal <noam@webkit.org>
Implement FCP (first contentful paint)
https://bugs.webkit.org/show_bug.cgi?id=208499
Reviewed by Simon Fraser.
Added the necessary interface, extensions to the performance interface and observer, new runtime flag.
Detecting contentfulness after layout and before actual paint, by running a "dummy" paint, similar to
invalidateControlTints() / invalidateImagesWithAsyncDecodes(). Save the result to the GraphicsContext and then to the document.
This would run for every paint until we detect a contentful one.
Note that it paints the entire frame contents, as FCP is not viewport-dependent.
Also, paint timing is currently disabled for LFC (layout formatting context), and will be dealt with later.
Tests: http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-num-chars.html
http/tests/performance/paint-timing/performance-paint-timing-fcp-after-visually-non-empty-for-style.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-background-size.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-set.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-bg-image-two-steps.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-canvas-context.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-gradient.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate-descendant.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-3d-rotate.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale-transition.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-scale.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-invisible-text.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity-descendant.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-opacity.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds-translate.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-out-of-bounds.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-display.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-image.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-opacity.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-text.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-pseudo-element-visibility.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-svg.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-text-input.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-typographic-pseudo.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-frame.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-video-poster.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-whitespace.html
imported/w3c/web-platform-tests/paint-timing/fcp-only/fcp-with-rtl.html
performance-api/paint-timing/paint-timing-apis.html
performance-api/paint-timing/paint-timing-frames.html
performance-api/paint-timing/paint-timing-with-worker.html
performance-api/paint-timing/performance-observer-first-contentful-paint.html
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSPerformanceEntryCustom.cpp:
(WebCore::toJSNewlyCreated):
* bindings/js/WebCoreBuiltinNames.h:
Add PerformancePaintTiming interface. https://w3c.github.io/paint-timing/#sec-PerformancePaintTiming
* dom/Document.cpp:
* dom/Document.h:
(WebCore::Document::supportsPaintTiming const):
We only report paint timing for document that can access the top level security origin, to avoid leakage of information to sandboxed iframes.
(WebCore::Document::enqueuePaintTimingEntryIfNeeded):
Enqueue a paint timing entry, according to https://w3c.github.io/paint-timing/#sec-reporting-paint-timing
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
Disable FCP fake-paint in LFC mode.
* page/Page.cpp:
(WebCore::Page::doAfterUpdateRendering):
* page/Performance.cpp:
(WebCore::Performance::getEntries const):
(WebCore::Performance::getEntriesByType const):
(WebCore::Performance::getEntriesByName const):
(WebCore::Performance::reportFirstContentfulPaint):
* page/Performance.h:
Support first-contentful-paint reporting.
* page/PerformanceEntry.cpp:
(WebCore::PerformanceEntry::parseEntryTypeString):
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::isPaint const):
* page/PerformanceObserver.cpp:
(WebCore::PerformanceObserver::supportedEntryTypes):
* page/PerformanceObserver.h:
* page/PerformanceObserver.idl:
* page/PerformancePaintTiming.h: Added.
(isType):
* page/PerformancePaintTiming.idl: Added.
Add paint performance entry type.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPaintTimingEnabled):
(WebCore::RuntimeEnabledFeatures::paintTimingEnabled const):
New runtime flag for paint timing.
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::detectingContentfulPaint const):
(WebCore::GraphicsContext::setContentfulPaintDetected):
(WebCore::GraphicsContext::contenfulPaintDetected const):
Add a flag in GraphicsContext where different render operations can report if they're contentful.
* rendering/ContentfulPaintChecker.cpp: Added.
(WebCore::ContentfulPaintChecker::qualifiesForContentfulPaint):
* rendering/ContentfulPaintChecker.h: Added.
Run a "dummy" paint of the FrameView, to detect contentful elements.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderHTMLCanvas.cpp:
(WebCore::RenderHTMLCanvas::paintReplaced):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintReplaced):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
* rendering/RenderVideo.cpp:
(WebCore::RenderVideo::paintReplaced):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paintTextOrEmphasisMarks):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::paintReplaced):
Report contentfulness when we reach anything that qualifies as contentful,
based on https://w3c.github.io/paint-timing/#contentful.
2020-04-28 Simon Fraser <simon.fraser@apple.com>
MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin log with no error
https://bugs.webkit.org/show_bug.cgi?id=211145
Reviewed by Jer Noble.
Don't log when MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin() returns 0.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::setNowPlayingInfo):
2020-04-28 Ross Kirsling <ross.kirsling@sony.com>
[JSC] Align upon the name isCallable instead of isFunction
https://bugs.webkit.org/show_bug.cgi?id=211140
Reviewed by Darin Adler.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
* bindings/js/JSCustomElementRegistryCustom.cpp:
(WebCore::getCustomElementCallback):
* bindings/js/JSDOMConvertCallbacks.h:
(WebCore::Converter<IDLCallbackFunction<T>>::convert):
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::queueMicrotask):
* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::queueMicrotask):
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::pipeTo):
(WebCore::ReadableStream::tee):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::ReadableStreamDefaultController::invoke):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::callInWorld):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateOverloadDispatcher):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
* testing/Internals.cpp:
(WebCore::Internals::parserMetaData):
(WebCore::Internals::cloneArrayBuffer):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
2020-04-28 Simon Fraser <simon.fraser@apple.com>
Rewrite GraphicsLayerCA::updateSublayerList()
https://bugs.webkit.org/show_bug.cgi?id=211137
Reviewed by Zalan Bujtas.
This function was hard to understand, with aliasing of a layer list to handle
the various configurations. Future patches will add a bit more complexity here.
Rewrite using lambdas, which makes it easier to follow.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):
2020-04-28 Christopher Reid <chris.reid@sony.com>
[Win] Bundle Inspector Resources in Release builds
https://bugs.webkit.org/show_bug.cgi?id=210942
Reviewed by Fujii Hironori.
* CMakeLists.txt:
2020-04-28 Rob Buis <rbuis@igalia.com>
Remove downloadAttribute from DocumentLoader
https://bugs.webkit.org/show_bug.cgi?id=210493
Reviewed by Darin Adler.
Remove downloadAttribute from DocumentLoader since this
can be obtained from the NavigationAction.
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::downloadAttribute const):
(WebCore::DocumentLoader::setDownloadAttribute): Deleted.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
2020-04-28 Jack Lee <shihchieh_lee@apple.com>
Nullptr crash in EditCommand::EditCommand via CompositeEditCommand::removeNode
https://bugs.webkit.org/show_bug.cgi?id=207600
<rdar://problem/56969450>
Reviewed by Geoffrey Garen.
Move FrameSelection and Editor objects from Frame to Document so when a document is detached
in nested command executions, the next EditCommand would not fail in constructor.
Test: editing/inserting/insert-list-then-edit-command-crash.html
* dom/Document.cpp:
(WebCore::m_selection):
(WebCore::Document::prepareForDestruction):
(WebCore::m_undoManager): Deleted.
* dom/Document.h:
(WebCore::Document::editor):
(WebCore::Document::editor const):
(WebCore::Document::selection):
(WebCore::Document::selection const):
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate const):
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::AlternativeTextController):
(WebCore::AlternativeTextController::stopPendingCorrection):
(WebCore::AlternativeTextController::isSpellingMarkerAllowed const):
(WebCore::AlternativeTextController::applyAutocorrectionBeforeTypingIfAppropriate):
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection):
(WebCore::AlternativeTextController::timerFired):
(WebCore::AlternativeTextController::handleAlternativeTextUIResult):
(WebCore::AlternativeTextController::rootViewRectForRange const):
(WebCore::AlternativeTextController::respondToChangedSelection):
(WebCore::AlternativeTextController::respondToAppliedEditing):
(WebCore::AlternativeTextController::respondToUnappliedEditing):
(WebCore::AlternativeTextController::editorClient):
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand):
(WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
(WebCore::AlternativeTextController::respondToMarkerAtEndOfWord):
(WebCore::AlternativeTextController::alternativeTextClient):
(WebCore::AlternativeTextController::applyAlternativeTextToRange):
(WebCore::AlternativeTextController::insertDictatedText):
(WebCore::AlternativeTextController::applyDictationAlternative):
* editing/AlternativeTextController.h:
(WebCore::AlternativeTextController::UNLESS_ENABLED):
* editing/CompositeEditCommand.cpp:
(WebCore::EditCommandComposition::unapply):
(WebCore::EditCommandComposition::reapply):
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::didApplyCommand):
(WebCore::CompositeEditCommand::targetRanges const):
(WebCore::CompositeEditCommand::moveParagraphs):
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::saveTypingStyleState):
(WebCore::DeleteSelectionCommand::mergeParagraphs):
(WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete):
(WebCore::DeleteSelectionCommand::doApply):
* editing/EditCommand.cpp:
(WebCore::EditCommand::EditCommand):
(WebCore::EditCommand::isEditingTextAreaOrTextInput const):
(WebCore::EditCommand::postTextStateChangeNotification):
(WebCore::EditCommand::frame): Deleted.
(WebCore::EditCommand::frame const): Deleted.
* editing/EditCommand.h:
* editing/Editing.cpp:
(WebCore::createDefaultParagraphElement):
* editing/EditingStyle.cpp:
(WebCore::StyleChange::StyleChange):
* editing/Editor.cpp:
(WebCore::ClearTextCommand::CreateAndApply):
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::TemporarySelectionChange::~TemporarySelectionChange):
(WebCore::TemporarySelectionChange::setSelection):
(WebCore::Editor::selectionForCommand):
(WebCore::Editor::behavior const):
(WebCore::Editor::client const):
(WebCore::Editor::canEdit const):
(WebCore::Editor::canEditRichly const):
(WebCore::Editor::canDHTMLCut):
(WebCore::Editor::canDHTMLCopy):
(WebCore::Editor::canCopy const):
(WebCore::Editor::canPaste const):
(WebCore::Editor::canDelete const):
(WebCore::Editor::shouldSmartDelete):
(WebCore::Editor::deleteWithDirection):
(WebCore::Editor::deleteSelectionWithSmartDelete):
(WebCore::Editor::clearText):
(WebCore::Editor::replaceSelectionWithFragment):
(WebCore::Editor::selectedRange):
(WebCore::Editor::tryDHTMLCopy):
(WebCore::Editor::tryDHTMLCut):
(WebCore::Editor::shouldInsertText const):
(WebCore::Editor::hasBidiSelection const):
(WebCore::Editor::selectionUnorderedListState const):
(WebCore::Editor::selectionOrderedListState const):
(WebCore::Editor::increaseSelectionListLevel):
(WebCore::Editor::increaseSelectionListLevelOrdered):
(WebCore::Editor::increaseSelectionListLevelUnordered):
(WebCore::Editor::decreaseSelectionListLevel):
(WebCore::Editor::findEventTargetFromSelection const):
(WebCore::Editor::applyStyle):
(WebCore::Editor::applyParagraphStyle):
(WebCore::Editor::applyStyleToSelection):
(WebCore::Editor::applyParagraphStyleToSelection):
(WebCore::Editor::selectionStartHasStyle const):
(WebCore::Editor::selectionHasStyle const):
(WebCore::Editor::selectionStartCSSPropertyValue):
(WebCore::Editor::appliedEditing):
(WebCore::Editor::Editor):
(WebCore::Editor::clear):
(WebCore::Editor::insertText):
(WebCore::Editor::insertTextForConfirmedComposition):
(WebCore::Editor::insertTextWithoutSendingTextEvent):
(WebCore::Editor::insertLineBreak):
(WebCore::Editor::insertParagraphSeparator):
(WebCore::Editor::performCutOrCopy):
(WebCore::Editor::paste):
(WebCore::Editor::pasteAsQuotation):
(WebCore::Editor::renderLayerDidScroll):
(WebCore::Editor::setBaseWritingDirection):
(WebCore::Editor::baseWritingDirectionForSelectionStart const):
(WebCore::Editor::selectComposition):
(WebCore::SetCompositionScope::SetCompositionScope):
(WebCore::SetCompositionScope::~SetCompositionScope):
(WebCore::Editor::setComposition):
(WebCore::Editor::ignoreSpelling):
(WebCore::Editor::learnSpelling):
(WebCore::Editor::advanceToNextMisspelling):
(WebCore::Editor::misspelledWordAtCaretOrRange const):
(WebCore::Editor::isSelectionUngrammatical):
(WebCore::Editor::guessesForMisspelledWord const):
(WebCore::Editor::guessesForMisspelledOrUngrammatical):
(WebCore::Editor::markMisspellingsAfterTypingToWord):
(WebCore::Editor::isSpellCheckingEnabledInFocusedNode const):
(WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
(WebCore::Editor::markAndReplaceFor):
(WebCore::Editor::updateMarkersForWordsAffectedByEditing):
(WebCore::Editor::rangeForPoint):
(WebCore::Editor::revealSelectionAfterEditingOperation):
(WebCore::Editor::setIgnoreSelectionChanges):
(WebCore::Editor::getCompositionSelection const):
(WebCore::Editor::transpose):
(WebCore::Editor::changeSelectionAfterCommand):
(WebCore::Editor::selectedText const):
(WebCore::Editor::selectedTextForDataTransfer const):
(WebCore::Editor::insertTextPlaceholder):
(WebCore::Editor::removeTextPlaceholder):
(WebCore::Editor::shouldChangeSelection const):
(WebCore::Editor::computeAndSetTypingStyle):
(WebCore::Editor::findString):
(WebCore::Editor::countMatchesForText):
(WebCore::Editor::respondToChangedSelection):
(WebCore::Editor::shouldDetectTelephoneNumbers):
(WebCore::Editor::scanSelectionForTelephoneNumbers):
(WebCore::Editor::editorUIUpdateTimerFired):
(WebCore::Editor::selectionStartHasMarkerFor const):
(WebCore::candidateRangeForSelection):
(WebCore::Editor::stringForCandidateRequest const):
(WebCore::Editor::contextRangeForCandidateRequest const):
(WebCore::Editor::fontAttributesAtSelectionStart const):
(WebCore::Editor::notifyClientOfAttachmentUpdates):
(WebCore::Editor::handleAcceptedCandidate):
(WebCore::Editor::unifiedTextCheckerEnabled const):
(WebCore::Editor::toggleOverwriteModeEnabled):
(WebCore::Editor::fontForSelection const):
(WebCore::Editor::canCopyExcludingStandaloneImages const):
(WebCore::Editor::document const): Deleted.
* editing/Editor.h:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::IgnoreSelectionChangeForScope::IgnoreSelectionChangeForScope):
(WebCore::Editor::document const):
* editing/EditorCommand.cpp:
(WebCore::executeSwapWithMark):
(WebCore::Editor::command):
(WebCore::Editor::Command::Command):
(WebCore::Editor::Command::execute const):
* editing/FrameSelection.cpp:
(WebCore::shouldAlwaysUseDirectionalSelection):
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::rootEditableElementOrDocumentElement const):
(WebCore::FrameSelection::setSelectionByMouseIfDifferent):
(WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
(WebCore::FrameSelection::setSelection):
(WebCore::updateSelectionByUpdatingLayoutOrStyle):
(WebCore::FrameSelection::setNeedsSelectionUpdate):
(WebCore::FrameSelection::updateAndRevealSelection):
(WebCore::FrameSelection::updateDataDetectorsForSelection):
(WebCore::FrameSelection::positionForPlatform const):
(WebCore::FrameSelection::nextWordPositionForPlatform):
(WebCore::FrameSelection::modifyMovingRight):
(WebCore::FrameSelection::modifyMovingLeft):
(WebCore::FrameSelection::modify):
(WebCore::FrameSelection::prepareForDestruction):
(WebCore::FrameSelection::absoluteCaretBounds):
(WebCore::FrameSelection::recomputeCaretRect):
(WebCore::FrameSelection::contains const):
(WebCore::FrameSelection::selectAll):
(WebCore::FrameSelection::focusedOrActiveStateChanged):
(WebCore::FrameSelection::isFocusedAndActive const):
(WebCore::shouldStopBlinkingDueToTypingCommand):
(WebCore::FrameSelection::updateAppearance):
(WebCore::FrameSelection::setCaretVisibility):
(WebCore::FrameSelection::setFocusedElementIfNeeded):
(WebCore::FrameSelection::shouldDeleteSelection const):
(WebCore::FrameSelection::selectionBounds const):
(WebCore::FrameSelection::getClippedVisibleTextRectangles const):
(WebCore::FrameSelection::currentForm const):
(WebCore::FrameSelection::revealSelection):
(WebCore::FrameSelection::setSelectionFromNone):
(WebCore::FrameSelection::shouldChangeSelection const):
(WebCore::FrameSelection::setShouldShowBlockCursor):
(WebCore::FrameSelection::appearanceUpdateTimerFired):
(WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange):
(WebCore::FrameSelection::selectRangeOnElement):
(WebCore::FrameSelection::setCaretBlinks):
* editing/FrameSelection.h:
* editing/InsertIntoTextNodeCommand.cpp:
(WebCore::InsertIntoTextNodeCommand::doApply):
* editing/InsertLineBreakCommand.cpp:
(WebCore::InsertLineBreakCommand::doApply):
* editing/InsertTextCommand.cpp:
(WebCore::InsertTextCommand::doApply):
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::doApply):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplaceSelectionCommand::doApply):
* editing/SetSelectionCommand.cpp:
(WebCore::SetSelectionCommand::doApply):
(WebCore::SetSelectionCommand::doUnapply):
* editing/SpellChecker.cpp:
(WebCore::SpellChecker::SpellChecker):
(WebCore::SpellChecker::client const):
(WebCore::SpellChecker::isAsynchronousEnabled const):
(WebCore::SpellChecker::invokeRequest):
(WebCore::SpellChecker::didCheck):
(WebCore::SpellChecker::didCheckSucceed):
* editing/SpellChecker.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::doApply):
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteSelection):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):
(WebCore::TypingCommand::updateSelectionIfDifferentFromCurrentSelection):
(WebCore::TypingCommand::insertText):
(WebCore::TypingCommand::insertLineBreak):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContent):
(WebCore::TypingCommand::insertParagraphSeparator):
(WebCore::TypingCommand::lastTypingCommandIfStillOpenForTyping):
(WebCore::TypingCommand::closeTyping):
(WebCore::TypingCommand::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
(WebCore::TypingCommand::markMisspellingsAfterTyping):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::typingAddedToOpenCommand):
(WebCore::TypingCommand::insertTextAndNotifyAccessibility):
(WebCore::TypingCommand::insertTextRunWithoutNewlines):
(WebCore::TypingCommand::insertLineBreakAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorAndNotifyAccessibility):
(WebCore::TypingCommand::insertParagraphSeparatorInQuotedContentAndNotifyAccessibility):
* editing/TypingCommand.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::selectionInHTMLFormat):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::writeSelection):
(WebCore::Editor::selectionInWebArchiveFormat):
(WebCore::Editor::replaceSelectionWithAttributedString):
(WebCore::Editor::webContentFromPasteboard):
(WebCore::Editor::takeFindStringFromSelection):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::webContentFromPasteboard):
* editing/ios/EditorIOS.mm:
(WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection):
(WebCore::Editor::removeUnchangeableStyles):
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::insertDictationPhrases):
(WebCore::Editor::setDictationPhrasesAsChildOfElement):
(WebCore::Editor::setTextAsChildOfElement):
(WebCore::Editor::ensureLastEditCommandHasCurrentSelectionIfOpenForMoreTyping):
* editing/libwpe/EditorLibWPE.cpp:
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::pasteWithPasteboard):
* editing/mac/EditorMac.mm:
(WebCore::Editor::readSelectionFromPasteboard):
(WebCore::Editor::replaceNodeFromPasteboard):
(WebCore::Editor::selectionWillChange):
* editing/win/EditorWin.cpp:
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::webContentFromPasteboard):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::willTransitionToCommitted):
(WebCore::FrameLoader::closeURL):
(WebCore::FrameLoader::didOpenURL):
(WebCore::FrameLoader::clear):
* page/Frame.cpp:
(WebCore::Frame::Frame):
(WebCore::Frame::requestDOMPasteAccess):
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Frame.h:
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange):
2020-04-28 Antti Koivisto <antti@apple.com>
msn.com: Header flickers when scrolling articles
https://bugs.webkit.org/show_bug.cgi?id=211126
<rdar://problem/56439177>
Reviewed by Simon Fraser.
Test: compositing/fixed-with-clip-stability.html
In case of fixed positioned elements the decision to create backing depends on clip rect.
However RenderLayer::localClipRect() tests for backing in call to clippingRootForPainting(). This creates
instability since clipping depends on backing decision, and backing decision depends on clipping.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::localClipRect const):
Specifically the result of clipExceedsBounds test here is affected by computed offsetFromRoot:
"clipRect.contains(cssClipRect)" test fails for zero sized clips with different offsets.
Compute clipExceedsBounds by looking at the clip sizes only and ignoring the position (which should match).
2020-04-28 Zalan Bujtas <zalan@apple.com>
[LFC] Introduce FormattingContext::ConstraintsForOutOfFlowContent
https://bugs.webkit.org/show_bug.cgi?id=211125
Reviewed by Antti Koivisto.
Horizontal and vertical out-of-flow constraints are always computed and used in pairs.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry):
(WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry):
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::constraintsForOutOfFlowContent):
(WebCore::Layout::FormattingContext::Geometry::horizontalConstraintsForOutOfFlow): Deleted.
(WebCore::Layout::FormattingContext::Geometry::verticalConstraintsForOutOfFlow): Deleted.
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/LayoutUnits.h:
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
2020-04-28 Zalan Bujtas <zalan@apple.com>
[LFC] Introduce FormattingContext::ConstraintsForInFlowContent
https://bugs.webkit.org/show_bug.cgi?id=211113
Reviewed by Antti Koivisto.
This makes the layoutInFlowContent() related code look simpler.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::layoutOutOfFlowContent):
* layout/FormattingContext.h:
* layout/LayoutContext.cpp:
(WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
* layout/blockformatting/BlockFormattingContext.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutInFlowContent):
(WebCore::Layout::InlineFormattingContext::lineLayout):
* layout/inlineformatting/InlineFormattingContext.h:
* layout/integration/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::layout):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
* layout/tableformatting/TableFormattingContext.h:
2020-04-28 Philippe Normand <pnormand@igalia.com>
media/track/track-load-error-readyState.html passes only when accompanied by some other tests
https://bugs.webkit.org/show_bug.cgi?id=210976
Reviewed by Xabier Rodriguez-Calvar.
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState): Reset caption
display mode, which might have been overriden by a previous test.
2020-04-28 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes late April 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=211099
Unreviewed build fix.
No new tests needed.
* Modules/cache/DOMCacheStorage.cpp: Sprinkle DOMCacheEngine:: namespace prefixes as needed.
(WebCore::DOMCacheStorage::findCacheOrCreate):
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::doOpen):
(WebCore::DOMCacheStorage::doRemove):
* bindings/js/JSExecStateInstrumentation.h: Ditto for JSC:: namespace prefixes.
(WebCore::JSExecState::instrumentFunction):
* dom/ScriptedAnimationController.h: Add missing ReducedResolutionSeconds.h header.
* editing/TextCheckingHelper.h: Add missing forward declaration for Position.
* html/URLSearchParams.h: Add missing ExceptionOr.h header.
2020-04-28 Charlie Turner <cturner@igalia.com>
[EME][CDMProxy] Default initialize m_numDecryptorsWaitingForKey member
https://bugs.webkit.org/show_bug.cgi?id=210970
Reviewed by Xabier Rodriguez-Calvar.
This was causing non-deterministic reads of the
m_numDecryptorsWaitingForKey member. Sometimes a waiting for key
event would fail to fire and cause test failures. I thought
std::atomic<int> would default initialize to zero, but after
spec-diving I realise now I was wrong about that.
Test: encrypted-media/clearkey-mp4-waiting-for-a-key.https.html
* platform/encryptedmedia/CDMProxy.h:
2020-04-28 Youenn Fablet <youenn@apple.com>
RTCPeerConnection should not remove its created remote MediaStream objects until getting close
https://bugs.webkit.org/show_bug.cgi?id=211070
Reviewed by Alex Christensen.
Remove no longer needed code.
This aligns with the spec and Firefox implementation.
Test: webrtc/direction-change.html
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2020-04-28 Youenn Fablet <youenn@apple.com>
Ensure remote track event gets unmuted after the track event is fired
https://bugs.webkit.org/show_bug.cgi?id=211071
Reviewed by Alex Christensen.
This code was made obsolete by the setMuted(false) call done just after firing the track event.
Given the setMuted(false) in addPendingTrackEvent was done asynchronously and was triggering firing the muted event asynchronously,
this change should not be observable from JS.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::addPendingTrackEvent):
2020-04-28 Rob Buis <rbuis@igalia.com>
Make HistoryController an inner class of FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=211090
Reviewed by Darin Adler.
Make HistoryController an inner class of FrameLoader, this allows
us to move some methods only used by HistoryController out of the
FrameLoader public API.
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
* loader/HistoryController.h:
2020-04-27 Simon Fraser <simon.fraser@apple.com>
Do correct clipping of composited replaced elements with border-radius
https://bugs.webkit.org/show_bug.cgi?id=211114
Reviewed by Zalan Bujtas.
For replaced elements with composited content (video, WebGL), RenderLayerBacking
incorrectly used the rounded inner border rect to clip the contents. This doesn't match
painted replaced elements, which clip to the inside of the padding box.
Fix by implementing RenderReplaced::roundedContentBoxRect() and calling it from compositing
code. Also add a helper to get the rounded border box rect, and call it in various places.
Test: compositing/clipping/border-radius-on-webgl.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::roundedBorderBoxRect const):
* rendering/RenderBox.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateContentsRects):
(WebCore::RenderLayerBacking::resetContentsRect):
(WebCore::RenderLayerBacking::updateChildClippingStrategy):
(WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
(WebCore::RenderLayerBacking::updateImageContents):
(WebCore::backgroundRectForBox):
* rendering/RenderLayerBacking.h:
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::roundedContentBoxRect const):
* rendering/RenderReplaced.h:
2020-04-27 Said Abou-Hallawa <sabouhallawa@apple.com>
Timestamps should be the same for all rendering update steps
https://bugs.webkit.org/show_bug.cgi?id=207153
Reviewed by Simon Fraser.
The HTML 5 event loop sepcs states that timestamps should be the same for
all rendering update steps.
Specs link (step 9):
https://html.spec.whatwg.org/multipage/webappapis.html#event-loop-processing-model
This patch also fixes some issues in IntersectionObserver.
Test: intersection-observer/intersection-observer-callback-timestamp.html
* dom/Document.cpp:
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::notifyIntersectionObserversTimerFired): Deleted.
* dom/Document.h:
-- Handle the case when two floats are areEssentiallyEqual().
-- Execute the IntersectionObserver immediately and do not wait until the
next CFRunLoop event since this does not implement the specs.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::freezeNowTimestamp):
(WebCore::DOMWindow::unfreezeNowTimestamp):
(WebCore::DOMWindow::frozenNowTimestamp const):
* page/DOMWindow.h:
Provide a frozen now() timestamp in seconds to be used internally only.
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::nowTimestamp const):
Use the frozenNowTimestamp().
* page/Page.cpp:
(WebCore::Page::updateRendering):
Freeze the timestamps while serving the rendering update steps.
2020-04-27 Dean Jackson <dino@apple.com>
getShaderPrecisionFormat returns the wrong values
https://bugs.webkit.org/show_bug.cgi?id=211013
<rdar://problem/62378056>
Reviewed by Darin Adler.
Gregg pointed out that our code hardcodes values for
getShaderPrecisionFormat. The fix is simply to call into
the underlying GL function.
Covered by the existing test: webgl/1.0.3/conformance/misc/shader-precision-format.html
However, that just tests minimum values. Devices have different
actual results.
* platform/graphics/angle/GraphicsContextGLANGLE.cpp:
(WebCore::GraphicsContextGLOpenGL::getShaderPrecisionFormat):
2020-04-27 Simon Fraser <simon.fraser@apple.com>
Rename scrollableAreaForScrollLayerID to scrollableAreaForScrollingNodeID
https://bugs.webkit.org/show_bug.cgi?id=211091
Reviewed by Myles C. Maxfield.
The argument to scrollableAreaForScrollLayerID() is a ScrollingNodeID, not a layerID.
* page/FrameView.cpp:
(WebCore::FrameView::scrollableAreaForScrollingNodeID const):
(WebCore::FrameView::scrollableAreaForScrollLayerID const): Deleted.
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
(WebCore::AsyncScrollingCoordinator::setActiveScrollSnapIndices):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scrollableAreaForScrollingNodeID const):
(WebCore::RenderLayerCompositor::scrollableAreaForScrollLayerID const): Deleted.
* rendering/RenderLayerCompositor.h:
2020-04-27 Ryan Haddad <ryanhaddad@apple.com>
[Cocoa] stop using out arguments for document attributes when converting to attributed strings
https://bugs.webkit.org/show_bug.cgi?id=211048
Unreviewed partial revert of r260739 to remove unexpected logging that broke Catalina-Release-WK2-Perf tests.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::policyProperties):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::siteForCookies):
2020-04-27 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation should not aggregate text from different navigation anchor elements
https://bugs.webkit.org/show_bug.cgi?id=211081
<rdar://problem/59553658>
Reviewed by Megan Gardner.
Tweak the item boundary heuristic in `TextManipulationController::observeParagraphs` to separate text in
links and list items under navigation elements (either nav elements, or elements with the "navigation"
accessibility role) into separate paragraphs.
Also, extend the item boundary rule for button elements to apply to elements with the "button"
accessibility role as well.
Test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAsParagraphs
TextManipulation.StartTextManipulationTreatsLinksInNavigationElementsAsParagraphs
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
2020-04-27 Antoine Quint <graouts@apple.com>
Clean up some useless includes of CSSAnimationController.h
https://bugs.webkit.org/show_bug.cgi?id=211066
Reviewed by Antti Koivisto.
These files don't actually use any of the CSSAnimationController APIs.
* page/ios/FrameIOS.mm:
* rendering/RenderObject.cpp:
2020-04-27 Antoine Quint <graouts@apple.com>
Rename CSSAnimationController accessors from animation() to legacyAnimation()
https://bugs.webkit.org/show_bug.cgi?id=211082
Reviewed by Simon Fraser.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computeRenderStyleForProperty):
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
(WebCore::Document::didBecomeCurrentDocumentInFrame):
(WebCore::Document::prepareForDestruction):
(WebCore::Document::implicitClose):
(WebCore::Document::resume):
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* history/CachedFrame.cpp:
(WebCore::CachedFrame::destroy):
* page/Frame.cpp:
(WebCore::Frame::clearTimers):
(WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
* page/Frame.h:
* page/FrameView.cpp:
(WebCore::FrameView::didDestroyRenderTree):
(WebCore::FrameView::updateLayoutAndStyleIfNeededRecursive):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layout):
* page/Page.cpp:
(WebCore::Page::handleLowModePowerChange):
(WebCore::Page::setIsVisibleInternal):
(WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
(WebCore::CSSAnimationControllerPrivate::suspendAnimations):
(WebCore::CSSAnimationControllerPrivate::resumeAnimations):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::currentTransform const):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::notifyAnimationStarted):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::requiresCompositingForAnimation const):
(WebCore::RenderLayerCompositor::isRunningTransformAnimation const):
* rendering/RenderObject.h:
(WebCore::RenderObject::legacyAnimation const):
(WebCore::RenderObject::animation const): Deleted.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* testing/Internals.cpp:
(WebCore::Internals::numberOfActiveAnimations const):
(WebCore::Internals::animationsAreSuspended const):
(WebCore::Internals::animationsInterval const):
(WebCore::Internals::suspendAnimations const):
(WebCore::Internals::resumeAnimations const):
(WebCore::Internals::pauseAnimationAtTimeOnElement):
(WebCore::Internals::pauseAnimationAtTimeOnPseudoElement):
(WebCore::Internals::pauseTransitionAtTimeOnElement):
(WebCore::Internals::pauseTransitionAtTimeOnPseudoElement):
2020-04-27 Per Arne Vollan <pvollan@apple.com>
[Cocoa] After r258891, r255119 can be reverted
https://bugs.webkit.org/show_bug.cgi?id=211083
<rdar://problem/60714318>
Unreviewed revert of r255119.
Copying a MIME type map from the UI process to the WebContent process on startup is not needed anymore,
since r258891 will map the Launch Services database in the WebContent process.
* platform/MIMETypeRegistry.cpp:
(WebCore::commonMimeTypesMap):
(WebCore::typesForCommonExtension):
(WebCore::overriddenMimeTypesMap): Deleted.
* platform/MIMETypeRegistry.h:
* testing/Internals.cpp:
(WebCore::Internals::mediaMIMETypeForExtension): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2020-04-27 Darin Adler <darin@apple.com>
Improve performance of commonInclusiveAncestor for deeply nested nodes
https://bugs.webkit.org/show_bug.cgi?id=211078
Reviewed by Antti Koivisto.
* dom/Node.cpp:
(WebCore::depth): Added.
(WebCore::commonInclusiveAncestor): Replaced implementation that walks the
parent chain of the second node repeatedly with one that walks the parent
chain of each node twice.
2020-04-27 Daniel Bates <dabates@apple.com>
Caret may be placed in the wrong spot for text input context that is a form control
https://bugs.webkit.org/show_bug.cgi?id=210939
<rdar://problem/61943089>
Reviewed by Darin Adler.
Add a helper function that returns the closest editable position inside an element
for a given point (if any).
* editing/Editing.cpp:
(WebCore::closestEditablePositionInElementForAbsolutePoint): Added.
* editing/Editing.h:
2020-04-27 Alicia Boya García <aboya@igalia.com>
[GStreamer] Rework WebKitWebSrc threading
https://bugs.webkit.org/show_bug.cgi?id=210284
Reviewed by Xabier Rodriguez-Calvar.
WebKitWebSrc as it is in master has a number of race conditions
leading to occasional starvation (due to cancelling the wrong request)
or data corruption (due to pushing data from a cancelled request).
The threading situation wasn't easy to follow, as it wasn't clear
access to what members should be protected by what mutex, in what
circumstances. Also, some parts of the design were also introducing
addicional complexity, such as the first request being sent from the
main thread whereas the rest were being sent from the streaming thread
or basesrc async start.
In response, this patch reworks all the locking in WebKitWebSrc to use
WTF::DataMutex. This ensures all accesses to its (now explicit)
protected members are locked. The two mutexes and condition variables
have been simplified into one, as there was no obvious need or benefit
for two of each in this case.
Requests have been numbered, which allows to safely and atomically
ignore results from cancelled requests, avoiding data corruption
races, and makes following them in debug logs much easier.
The conditions for making and cancelling requests have been simplified
to a simpler and safer model: There is at most only one active request
at anytime, flushes cancel the request, and the first create() call
always makes the new request (both at startup and after a flush).
Debug asserts and notes about the flow of operations during basesrc
seeks have been provided.
As this effort needed a review of the entire WebKitWebSrc, cleanups,
corrections and documentation comments have been provided where
appropriate.
This patch introduces no visible behavior changes, just stability
improvements.
* platform/graphics/gstreamer/GRefPtrGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(WebKitWebSrcPrivate::~WebKitWebSrcPrivate):
(webkit_web_src_class_init):
(webkitWebSrcReset):
(webKitWebSrcConstructed):
(webKitWebSrcSetProperty):
(webKitWebSrcGetProperty):
(webKitWebSrcSetContext):
(webKitWebSrcSendEvent):
(restartLoaderIfNeeded):
(stopLoaderIfNeeded):
(webKitWebSrcCreate):
(webKitWebSrcStart):
(webKitWebSrcMakeRequest):
(webKitWebSrcStop):
(webKitWebSrcGetSize):
(webKitWebSrcIsSeekable):
(webKitWebSrcDoSeek):
(webKitWebSrcQuery):
(webKitWebSrcUnLock):
(webKitWebSrcUnLockStop):
(webKitWebSrcSetUri):
(webKitWebSrcSetMediaPlayer):
(webKitSrcPassedCORSAccessCheck):
(CachedResourceStreamingClient::CachedResourceStreamingClient):
(CachedResourceStreamingClient::checkUpdateBlocksize):
(CachedResourceStreamingClient::responseReceived):
(CachedResourceStreamingClient::dataReceived):
(CachedResourceStreamingClient::accessControlCheckFailed):
(CachedResourceStreamingClient::loadFailed):
(CachedResourceStreamingClient::loadFinished):
(webKitSrcWouldTaintOrigin):
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h:
2020-04-26 Darin Adler <darin@apple.com>
Replace more uses of live ranges with SimpleRange
https://bugs.webkit.org/show_bug.cgi?id=211058
Reviewed by Antti Koivisto.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::textUnderElement const): Use SimpleRange.
* dom/BoundaryPoint.h: Moved makeBoundaryPointAfterNodeContents here so it
can be used more places.
* dom/Node.cpp:
(WebCore::commonInclusiveAncestor): Moved the commonAncestorContainer function
here from Range, decided to use the "inclusive ancestor" naming from the
DOM specification, and used RefPtr for the result since it's part of our modern
safer design to always use smart pointers for return values.
* dom/Node.h: Added commonInclusiveAncestor.
* dom/Position.cpp:
(WebCore::commonShadowIncludingAncestor): Call commonInclusiveAncestor.
* dom/Range.cpp:
(WebCore::Range::commonAncestorContainer): Deleted.
(WebCore::Range::isPointInRange): Call commonInclusiveAncestor.
(WebCore::Range::comparePoint const): Ditto.
(WebCore::Range::compareBoundaryPoints): Ditto.
(WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const): Ditto.
* dom/Range.h:
(WebCore::Range::commonAncestorContainer const): Call commonInclusiveAncestor.
* dom/SimpleRange.cpp:
(WebCore::makeBoundaryPointAfterNodeContents): Moved to BoundaryPoint.h.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Use
SimpleRange instead of live range.
(WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
(WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
(WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult): Ditto.
* editing/ChangeListTypeCommand.cpp:
(WebCore::listConversionTypeForSelection): use commonInclusiveAncestor.
* editing/Editing.cpp:
(WebCore::isNodeVisiblyContainedWithin): Take a SimpleRange argument.
* editing/Editing.h: Updated for the above.
* editing/Editor.cpp:
(WebCore::Editor::addRangeToKillRing): Take a SimpleRange argument.
(WebCore::Editor::shouldDetectTelephoneNumbers const): Made this const and
tweaked coding style a bit.
(WebCore::scanForTelephoneNumbers): Moved this, made it a non-member function,
renamed from scanRangeForTelephoneNumbers, use SimpleRange.
(WebCore::extendSelection): Added. Factored out some logic from the function below.
(WebCore::Editor::scanSelectionForTelephoneNumbers): Use SimpleRange. Removed
some unnecessary code that subtracts 1 and then adds 1 again.
* editing/Editor.h: Updated for the above.
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::replace): Use commonInclusiveAncestor.
* editing/VisibleSelection.cpp:
(WebCore::makeSearchRange): Return a SimpleRange.
(WebCore::VisibleSelection::appendTrailingWhitespace): Use SimpleRange.
* editing/WebContentReader.h: Use SimpleRange instead of a live range.
* editing/cocoa/DataDetection.h: Use a struct, DetectedItem, for the return value
from the detection functions. Also changed DataDetectorTypes to an enum class so
it can be forward-declared instead of having to include this header.
* editing/cocoa/DataDetection.mm:
(WebCore::detectItem): Renamed from detectItemAtPositionWithRange. Return the
DetectedItem struct, with a SimpleRange rather than an out argument live range.
(WebCore::DataDetection::detectItemAroundHitTestResult): Ditto.
(WebCore::contains): Added a helper function for testing bits in the
DataDetectorType enum. Later we can make this better using OptionSet.
(WebCore::constructURLStringForResult): Refactored a bit, updated for the new
DataDetectorTypes enum class, and to use CFEqual instead of CFStringCompare.
(WebCore::DataDetection::detectContentInRange): Ditto.
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::webContentFromPasteboard): Use SimpleRange.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readPlainText): Updated since context is SimpleRange.
* editing/gtk/EditorGtk.cpp:
(WebCore::createFragmentFromPasteboardData): Use SimpleRange.
(WebCore::Editor::webContentFromPasteboard): Use SimpleRange.
* editing/win/EditorWin.cpp:
(WebCore::Editor::webContentFromPasteboard): Use SimpleRange.
* editing/mac/EditorMac.mm:
(WebCore::Editor::replaceNodeFromPasteboard): Use SimpleRange.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame): Use SimpleRange.
* page/EventHandler.cpp:
(WebCore::targetNodeForClickEvent): Use commonInclusiveAncestor. Also updated
to return a RefPtr.
(WebCore::EventHandler::handleMouseReleaseEvent): Updated for the above.
* page/Settings.yaml: Changed the default for DataDetectorTypes to be the empty
string rather than a named constant.
* page/SettingsBase.h: Forward-declare DataDetectorTypes instead of including
the DataDetection.h header.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Take a SimpleRange.
(WebCore::TextIndicator::createWithSelectionInFrame): Ditto.
(WebCore::hasNonInlineOrReplacedElements): Ditto.
(WebCore::selectionRects): Ditto. Also renamed from getSelectionRectsForRange.
(WebCore::styleContainsComplexBackground): Tweaked implementation.
(WebCore::estimatedTextColorsForRange): Take a SimpleRange.
(WebCore::absoluteBoundingRectForRange): Ditto.
(WebCore::estimatedBackgroundColorForRange): Ditto.
(WebCore::containsOnlyWhiteSpaceText): Ditto.
(WebCore::initializeIndicator): Ditto.
* page/TextIndicator.h: Updated for the above.
* page/mac/ServicesOverlayController.h: Use SimpleRange instead of a live
range for highlights.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::createForSelection): Take SimpleRange.
(WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto.
(WebCore::ServicesOverlayController::Highlight::Highlight): Ditto.
(WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto.
(WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::telephoneNumberRangesForFocusedFrame): Ditto.
(WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto.
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto.
(WebCore::ServicesOverlayController::handleClick): Ditto.
* platform/ios/DragImageIOS.mm:
(WebCore::createDragImageForLink): Use SimpleRange.
(WebCore::createDragImageForSelection): Tweaked a bit.
2020-04-27 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4] Make it possible to build with GTK4 without errors
https://bugs.webkit.org/show_bug.cgi?id=210967
Reviewed by Adrian Perez de Castro.
* platform/PlatformPasteboard.h:
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor):
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
* platform/graphics/gtk/DisplayRefreshMonitorGtk.h:
* platform/graphics/gtk/GdkCairoUtilities.cpp:
(WebCore::getDefaultCairoFontOptions):
* platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor):
* platform/gtk/DragImageGtk.cpp:
(WebCore::dissolveDragImageToFraction):
* platform/gtk/GRefPtrGtk.cpp:
* platform/gtk/GRefPtrGtk.h:
* platform/gtk/GUniquePtrGtk.h:
* platform/gtk/GtkVersioning.h:
(gdk_event_copy):
(gtk_widget_size_allocate):
(gtk_widget_queue_resize_no_redraw):
(gdk_event_get_state):
(gdk_event_get_coords):
(gdk_event_get_root_coords):
(gdk_event_is_scroll_stop_event):
(gdk_event_get_scroll_direction):
(gdk_event_get_scroll_deltas):
(gdk_event_get_button):
* platform/gtk/PasteboardHelper.cpp:
* platform/gtk/PasteboardHelper.h:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
* platform/gtk/PlatformPasteboardGtk.cpp:
(WebCore::PlatformPasteboard::PlatformPasteboard):
(WebCore::PlatformPasteboard::writeToClipboard):
(WebCore::PlatformPasteboard::readFromClipboard):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::getCurrentScreenMonitor):
2020-04-27 Rob Buis <rbuis@igalia.com>
Make loadURLIntoChildFrame private and non-exported
https://bugs.webkit.org/show_bug.cgi?id=211051
Reviewed by Darin Adler.
Make loadURLIntoChildFrame private and non-exported to reduce the amount of public API functions
that start loads. In order to do this loadURLIntoChildFrame is being called from SubframeLoader
and SubframeLoader is made an inner class of FrameLoader. Because this simplifies createFrame (and
makes createFrame behave strictly like its name) url and referrer do not have to be passed.
* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::parametersForPlugin):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::createFrame):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* loader/SubframeLoader.cpp:
(WebCore::FrameLoader::SubframeLoader::SubframeLoader):
(WebCore::FrameLoader::SubframeLoader::clear):
(WebCore::FrameLoader::SubframeLoader::requestFrame):
(WebCore::FrameLoader::SubframeLoader::resourceWillUsePlugin):
(WebCore::FrameLoader::SubframeLoader::pluginIsLoadable):
(WebCore::FrameLoader::SubframeLoader::requestPlugin):
(WebCore::FrameLoader::SubframeLoader::requestObject):
(WebCore::FrameLoader::SubframeLoader::createJavaAppletWidget):
(WebCore::FrameLoader::SubframeLoader::loadOrRedirectSubframe):
(WebCore::FrameLoader::SubframeLoader::loadSubframe):
(WebCore::FrameLoader::SubframeLoader::shouldUsePlugin):
(WebCore::FrameLoader::SubframeLoader::loadPlugin):
(WebCore::FrameLoader::SubframeLoader::completeURL const):
(WebCore::FrameLoader::SubframeLoader::shouldConvertInvalidURLsToBlank const):
(WebCore::SubframeLoader::SubframeLoader): Deleted.
(WebCore::SubframeLoader::clear): Deleted.
(WebCore::SubframeLoader::requestFrame): Deleted.
(WebCore::SubframeLoader::resourceWillUsePlugin): Deleted.
(WebCore::SubframeLoader::pluginIsLoadable): Deleted.
(WebCore::SubframeLoader::requestPlugin): Deleted.
(WebCore::SubframeLoader::requestObject): Deleted.
(WebCore::SubframeLoader::createJavaAppletWidget): Deleted.
(WebCore::SubframeLoader::loadOrRedirectSubframe): Deleted.
(WebCore::SubframeLoader::loadSubframe): Deleted.
(WebCore::SubframeLoader::shouldUsePlugin): Deleted.
(WebCore::SubframeLoader::loadPlugin): Deleted.
(WebCore::SubframeLoader::completeURL const): Deleted.
(WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank const): Deleted.
* loader/SubframeLoader.h:
(WebCore::SubframeLoader::containsPlugins const): Deleted.
2020-04-27 Alberto Garcia <berto@igalia.com>
[GTK] [2.28.0] The Yelp build crashes if DISPLAY is not set
https://bugs.webkit.org/show_bug.cgi?id=209431
Reviewed by Carlos Garcia Campos.
Don't create a PlatformDisplayLibWPE as a fallback when using
Wayland or X11.
* platform/graphics/PlatformDisplay.cpp:
(WebCore::PlatformDisplay::createPlatformDisplay):
2020-04-27 Claudio Saavedra <csaavedra@igalia.com>
Unreviewed compile-warning fix.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
2020-04-27 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, GTK LTS build fix after r260744
https://bugs.webkit.org/show_bug.cgi?id=211069
* bindings/js/JSDOMBuiltinConstructor.h:
(WebCore::JSDOMBuiltinConstructor<JSClass>::getConstructData):
2020-04-27 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] GdkRGBA has float members instead of double
Unreviewed warning fix.
* platform/graphics/gtk/ColorGtk.cpp:
(WebCore::Color::operator GdkRGBA const):
2020-04-27 Ross Kirsling <ross.kirsling@sony.com>
[JSC] CallData/ConstructData should include CallType/ConstructType
https://bugs.webkit.org/show_bug.cgi?id=211059
Reviewed by Darin Adler.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement::installReplacement):
* bindings/js/JSCallbackData.cpp:
(WebCore::JSCallbackData::invokeCallback):
* bindings/js/JSCustomElementInterface.cpp:
(WebCore::constructCustomElementSynchronously):
(WebCore::JSCustomElementInterface::upgradeElement):
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomXPathNSResolver.cpp:
(WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
* bindings/js/JSDOMBuiltinConstructor.h:
(WebCore::JSDOMBuiltinConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMBuiltinConstructorBase.cpp:
(WebCore::JSDOMBuiltinConstructorBase::callFunctionWithCurrentArguments):
* bindings/js/JSDOMConstructor.h:
(WebCore::JSDOMConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMConstructorBase.cpp:
(WebCore::JSDOMConstructorBase::getCallData):
* bindings/js/JSDOMConstructorBase.h:
* bindings/js/JSDOMConstructorNotConstructable.h:
* bindings/js/JSDOMIterator.h:
(WebCore::iteratorForEach):
* bindings/js/JSDOMMapLike.cpp:
(WebCore::clearBackingMap):
(WebCore::setToBackingMap):
(WebCore::forwardFunctionCallToBackingMap):
(WebCore::forwardForEachCallToBackingMap):
* bindings/js/JSDOMNamedConstructor.h:
(WebCore::JSDOMNamedConstructor<JSClass>::getConstructData):
* bindings/js/JSDOMPromise.cpp:
(WebCore::DOMPromise::whenPromiseIsSettled):
* bindings/js/JSDOMPromiseDeferred.cpp:
(WebCore::createRejectedPromiseWithTypeError):
* bindings/js/JSDOMSetLike.cpp:
(WebCore::clearBackingSet):
(WebCore::addToBackingSet):
(WebCore::forwardFunctionCallToBackingSet):
(WebCore::forwardForEachCallToBackingSet):
* bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::handleEvent):
* bindings/js/JSExecState.cpp:
(WebCore::functionCallHandlerFromAnyThread):
* bindings/js/JSExecState.h:
(WebCore::JSExecState::call):
(WebCore::JSExecState::profiledCall):
* bindings/js/JSExecStateInstrumentation.h:
(WebCore::JSExecState::instrumentFunction):
(WebCore::JSExecState::instrumentFunctionInternal): Deleted.
(WebCore::JSExecState::instrumentFunctionCall): Deleted.
(WebCore::JSExecState::instrumentFunctionConstruct): Deleted.
* bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::getUserMedia):
* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::callPlugin):
(WebCore::pluginElementCustomGetCallData):
* bindings/js/JSPluginElementFunctions.h:
* bindings/js/ReadableStream.cpp:
(WebCore::ReadableStream::create):
(WebCore::ReadableStreamInternal::callFunction):
(WebCore::ReadableStream::lock):
* bindings/js/ReadableStreamDefaultController.cpp:
(WebCore::readableStreamCallFunction):
* bindings/js/ScheduledAction.cpp:
(WebCore::ScheduledAction::executeFunctionInContext):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeAsynchronousUserAgentScriptInWorld):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GeneratePluginCall):
(GenerateLegacyCallerDefinitions):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::getCallData):
* bindings/scripts/test/JS/JSTestObj.h:
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::JSTestPluginInterface::getCallData):
* bindings/scripts/test/JS/JSTestPluginInterface.h:
* bridge/NP_jsobject.cpp:
* bridge/objc/WebScriptObject.mm:
(-[WebScriptObject callWebScriptMethod:withArguments:]):
* bridge/objc/objc_runtime.h:
* bridge/objc/objc_runtime.mm:
(JSC::Bindings::ObjcFallbackObjectImp::getCallData):
* bridge/runtime_object.cpp:
(JSC::Bindings::RuntimeObject::getCallData):
(JSC::Bindings::RuntimeObject::getConstructData):
* bridge/runtime_object.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateCaptionContainer):
(WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
(WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange):
(WebCore::HTMLMediaElement::getCurrentMediaControlsStatus):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
* testing/Internals.cpp:
(WebCore::Internals::cloneArrayBuffer):
2020-04-27 Diego Pino Garcia <dpino@igalia.com>
Unreviewed, reverting r260672.
[GTK] WebInspector tests are timing out after r260672
Reverted changeset:
"[Win] Bundle Inspector Resources in Release builds"
https://bugs.webkit.org/show_bug.cgi?id=210942
https://trac.webkit.org/changeset/260672
2020-04-27 Kenneth Russell <kbr@chromium.org>
Build failure in WebGL2RenderingContext after r260588
https://bugs.webkit.org/show_bug.cgi?id=211057
Reviewed by Darin Adler.
Fix non-ANGLE build failure in WebGL2RenderingContext after
r260588.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texStorage2D):
2020-04-26 Darin Adler <darin@apple.com>
[Cocoa] stop using out arguments for document attributes when converting to attributed strings
https://bugs.webkit.org/show_bug.cgi?id=211048
Reviewed by Sam Weinig.
* DerivedSources-input.xcfilelist: Building modified this file automatically. Uploading
the new version.
* WebCore.xcodeproj/project.pbxproj: Added AttributedString.h.
* editing/cocoa/AttributedString.h: Added. Moved this from WebKit, but removed a lot of
inessentials.
* editing/cocoa/DictionaryLookup.mm: Removed unneeded include.
* editing/cocoa/EditorCocoa.mm:
(WebCore::selectionAsAttributedString): Updated for change to the return value of the
attributedString function, and use init instead of initWithString:@"".
* editing/cocoa/HTMLConverter.h: Changed to an Objective-C-only header, omitting things
like #pramga once. Return the AttributedString struct from the functions instead of
using an out argument for document attributes.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::convert): Return an AttributedString and drop the out argument.
(WebCore::attributedString): Ditto.
(WebCore::editingAttributedString): Ditto. Also refactor a little bit.
* editing/ios/EditorIOS.mm: Removed unneeded include.
* editing/mac/DictionaryLookupLegacy.mm: Removed unneeded include.
* editing/mac/EditorMac.mm:
(WebCore::Editor::dataSelectionForPasteboard): Updated since attributedString
now returns a structure.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::policyProperties): Use init instead of initWithString:@"".
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::siteForCookies): Use init instead of initWithString:@"".
2020-04-26 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com>
[PlayStation] Enable TestWTF and TestWebCore
https://bugs.webkit.org/show_bug.cgi?id=208849
Reviewed by Don Olmstead.
* PlatformPlayStation.cmake:
Add WebCore_CopySharedLibs to install dependencies.
2020-04-26 Said Abou-Hallawa <sabouhallawa@apple.com>
Rendering update steps should use Seconds for the timestamps
https://bugs.webkit.org/show_bug.cgi?id=210990
Reviewed by Daniel Bates.
Make DOMWindow::nowTimestamp() return ReducedResolutionSeconds and change
the callers accordingly. ReducedResolutionSeconds is a new type but it's
just an alias of the type Seconds. It indicates that the returned value
is a web-safe seconds.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::cacheCurrentTime):
(WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents):
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/DocumentTimelinesController.h:
* dom/Document.cpp:
(WebCore::Document::serviceRequestAnimationFrameCallbacks):
(WebCore::Document::updateIntersectionObservations):
* dom/Document.h:
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
* dom/ScriptedAnimationController.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::getVideoPlaybackQuality):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::nowTimestamp const):
* page/DOMWindow.h:
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::nowTimestamp const):
(WebCore::IntersectionObserver::createTimestamp const): Deleted.
* page/IntersectionObserver.h:
* page/Page.cpp:
(WebCore::Page::updateRendering):
* page/Performance.cpp:
(WebCore::Performance::now const):
(WebCore::Performance::nowInReducedResolutionSeconds const):
* page/Performance.h:
* page/ReducedResolutionSeconds.h: Added.
2020-04-26 Alexey Shvayka <shvaikalesh@gmail.com>
InternalFunction::createSubclassStructure should use newTarget's globalObject
https://bugs.webkit.org/show_bug.cgi?id=202599
Reviewed by Yusuke Suzuki.
Accounts for InternalFunction::createSubclassStructure() signature change and
utilizes getFunctionRealm() helper to handle cross-realm JSBoundFunction and
ProxyObject instances as NewTarget value.
Tests: web-platform-tests/WebIDL/ecmascript-binding/constructors.html
web-platform-tests/custom-elements/htmlconstructor/newtarget.html
* bindings/js/JSDOMWrapperCache.h:
(WebCore::setSubclassStructureIfNeeded):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
2020-04-26 Yusuke Suzuki <ysuzuki@apple.com>
Use `static Lock` instead of `static NeverDestroyed<Lock>`
https://bugs.webkit.org/show_bug.cgi?id=211036
Reviewed by Darin Adler.
* platform/GenericTaskQueue.cpp:
(WebCore::TaskDispatcher<Timer>::sharedLock):
2020-04-26 Peng Liu <peng.liu6@apple.com>
Remove unused class PlaybackSessionInterface
https://bugs.webkit.org/show_bug.cgi?id=211031
Reviewed by Daniel Bates.
No new tests, no functional changes.
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/PlaybackSessionInterface.h: Removed.
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/mac/PlaybackSessionInterfaceMac.h:
2020-04-26 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Compute and distribute extra vertical space for rows
https://bugs.webkit.org/show_bug.cgi?id=211046
Reviewed by Antti Koivisto.
When the table computed height is bigger than the sum of the row heigts, we need to distribute the extra vertical
space among the non-fixed height rows. The distribution is based on the preferred height of those non-fixed rows.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
2020-04-11 Darin Adler <darin@apple.com>
Stop using live ranges in functions that return range of the selection
https://bugs.webkit.org/show_bug.cgi?id=210396
Reviewed by Sam Weinig.
- Added makeRangeSelectingNode, to create a range that selects a node
and all its descendants.
- Improved intersectingNodes so it can now easily be used in a while loop
style as well as the range-for loop style. Also made it more robust
against tree changes while iterating; it will now always stop at the
end of the document.
- Changed functions that work with selection to get a SimpleRange, and
then either do all the work without a live range, or call createLiveRange
right where it's needed, making it clearer when we can delete that
call later as we cut down live ranges even more.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectionRange const): Return a SimpleRange
instead of a live range.
(WebCore::AccessibilityObject::findTextRanges const): Use createLiveRange
on the result of selectionRange since this still mostly uses live ranges.
* accessibility/AccessibilityObject.h: Updated for the above.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::documentBasedSelectedTextRange const):
Updated to create a live range only in the one place we need to call a
Range class member function.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper textMarkerRangeForSelection]):
Use createLiveRange here.
* dom/SimpleRange.cpp:
(WebCore::makeRangeSelectingNode): Added. For use when we need to make
a range that selects a node, not just the node's contents.
(WebCore::firstIntersectingNode): Renamed from IntersectingNodeRange::first
since this is now used in the iterator class, not the range class. Also
letting it be a non-member function so we can tweak it without touching
the haeder file.
(WebCore::nodePastLastIntersectingNode): Ditto.
(WebCore::IntersectingNodeIterator::IntersectingNodeIterator): Changed
this constructor to take a SimpleRange. To add the advanceSkippingChildren
feature, had to build the termination condition into the iterator rather
than basing it on the value of the sentinel.
(WebCore::IntersectingNodeIterator::advance): Added. Contains the logic
from the ++ operator, so it can be called in a more straightforward way
when this is being used with a while loop rather than a range-for loop.
(WebCore::IntersectingNodeIterator::advanceSkippingChildren): Added.
* dom/SimpleRange.h: Updated for the changes to IntersectingNodeIterator
and IntersectingNodeRange.
* editing/AlternativeTextController.cpp:
(WebCore::AlternativeTextController::timerFired): Use createLiveRange.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::targetRanges const): Use WTFMove in
a place where the old code was copying instead.
* editing/DeleteSelectionCommand.cpp:
(WebCore::DeleteSelectionCommand::makeStylingElementsDirectChildrenOfEditableRootToPreventStyleLoss):
Use intersectingNodes to make the function's logic easier to understand.
* editing/Editing.cpp:
(WebCore::visibleImageElementsInRangeWithNonLoadedImages): Changed
the argument type to SimpleRange.
* editing/Editing.h: Updated for the change above.
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleAtSelectionStart): Use createLiveRange.
* editing/Editor.cpp:
(WebCore::Editor::selectedRange): Use createLiveRange.
(WebCore::Editor::applyStyleToSelection): Ditto.
(WebCore::Editor::applyParagraphStyleToSelection): Ditto.
(WebCore::Editor::insertTextWithoutSendingTextEvent): Ditto.
(WebCore::Editor::insertLineBreak): Ditto.
(WebCore::Editor::insertParagraphSeparator): Ditto.
(WebCore::Editor::ignoreSpelling): Remove use of live range.
(WebCore::Editor::learnSpelling): Ditto.
(WebCore::Editor::misspelledWordAtCaretOrRange const): Ditto.
(WebCore::Editor::isSelectionUngrammatical): Ditto.
(WebCore::Editor::guessesForMisspelledOrUngrammatical): Ditto.
(WebCore::Editor::markMisspellingsAfterTypingToWord): Use createLiveRange.
(WebCore::Editor::markMisspellingsOrBadGrammar): Ditto.
(WebCore::Editor::markMisspellingsAndBadGrammar): Ditto.
(WebCore::Editor::rangeForPoint): Ditto.
(WebCore::Editor::insertTextPlaceholder): Ditto.
(WebCore::Editor::shouldChangeSelection const): Ditto.
(WebCore::Editor::findString): Ditto.
(WebCore::Editor::rangeOfString): Ditto.
(WebCore::Editor::scanSelectionForTelephoneNumbers): Ditto.
(WebCore::Editor::editorUIUpdateTimerFired): Remove use of live range.
(WebCore::candidateRangeForSelection): Deleted.
(WebCore::Editor::stringForCandidateRequest const): Use createLiveRange
and merged in the logic from candidateRangeForSelection.
(WebCore::Editor::fontForSelection const): Remove use of live range.
* editing/EditorCommand.cpp:
(WebCore::expandSelectionToGranularity): Use createLiveRange.
(WebCore::executeDeleteToMark): Ditto.
(WebCore::executeSelectToMark): Ditto.
(WebCore::valueFormatBlock): Ditto.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::respondToNodeModification): Use createLiveRange.
(WebCore::FrameSelection::shouldDeleteSelection const): Ditto.
(WebCore::FrameSelection::getClippedVisibleTextRectangles const): Do the work
without a live range.
(WebCore::FrameSelection::expandSelectionToElementContainingCaretSelection): Ditto.
(WebCore::FrameSelection::elementRangeContainingCaretSelection const): Changed
to return a SimpleRange rather than a live range. Also removed redundant checks
and renamed locals to streamline the function.
(WebCore::FrameSelection::wordRangeContainingCaretSelection): Return a
SimpleRange instead of a live range.
(WebCore::FrameSelection::rangeByMovingCurrentSelection const): Ditto.
(WebCore::FrameSelection::rangeByExtendingCurrentSelection const): Ditto.
(WebCore::FrameSelection::rangeByAlteringCurrentSelection const): Ditto.
* editing/FrameSelection.h: Removed the toNormalizedRange function, since the
VisibleSelection class has a comment claiming most callers should not call it.
Updated forthe other changes above.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply): Use createLiveRange.
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment): Ditto.
* editing/TextCheckingHelper.cpp:
(WebCore::TextCheckingHelper::TextCheckingHelper): Remove use of live range,
changing the type of m_range to SimpleRange.
(WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): Reduce use
of live range.
(WebCore::TextCheckingHelper::findFirstGrammarDetail const): Use createLiveRange.
(WebCore::TextCheckingHelper::findFirstBadGrammar const): Ditto.
(WebCore::TextCheckingHelper::isUngrammatical const): Remove use of live range.
(WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
Use createLiveRange.
(WebCore::TextCheckingHelper::unifiedTextCheckerEnabled const): Updated for
different interface to get the document for a SimpleRange.
* editing/TextCheckingHelper.h: Change constructor to take a SimpleRange.
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::deleteKeyPressed): Use createLiveRange.
(WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::firstRange const): Return a SimpleRange.
(WebCore::VisibleSelection::toNormalizedRange const): Ditto.
* editing/VisibleSelection.h: Updated for the above.
* editing/cocoa/DictionaryLookup.mm: Removed an uneeded check of the
selection range against null. Code already guards against null endpoints.
* editing/cocoa/EditorCocoa.mm:
(WebCore::selectionAsAttributedString): Added. Uses the attributedString
function with it's new argument and return value types. There's no longer
a special function for the selection in the HTMLConverter header, so we
put it here instead.
(WebCore::Editor::writeSelectionToPasteboard): Updated to use the function
above and to deal with RetainPtr.
(WebCore::Editor::writeSelection): Ditto.
* editing/cocoa/HTMLConverter.h: Removed attributedStringFromSelection and
attributedStringBetweenStartAndEnd. Renamed attributedStringFromRange to
just attributedString and renamed editingAttributedStringFromRange to
just editingAttributedString. Also renamed IncludeImagesInAttributedString
to just IncludeImages.
* editing/cocoa/HTMLConverter.mm:
(HTMLConverter::HTMLConverter): Use a SimpleRange rther than two Position
arguments to the constructor.
(HTMLConverter::convert): Use RetainPtr for the return value and the
optional out argument.
(WebCore::attributedStringFromSelection): Deleted.
(WebCore::attributedStringBetweenStartAndEnd): Deleted.
(WebCore::attributedString): Renamed the version that takes a range and
made it take a SimpleRange, not a live range.
(WebCore::editingAttributedString): Ditto.
* editing/mac/EditorMac.mm:
(WebCore::Editor::dataSelectionForPasteboard): Updated for changes to
attributedString.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent const):
Changed to not use live ranges any more.
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::contextMenuItemSelected):
Use createLiveRange.
* page/DOMSelection.cpp:
(WebCore::DOMSelection::getRangeAt): Use createLiveRange.
(WebCore::DOMSelection::addRange): Use Ditto.
(WebCore::DOMSelection::deleteFromDocument): Ditto.
* page/DragController.cpp:
(WebCore::setSelectionToDragCaret): Removed in/out argument that was
used to update a range that was never looked at afterward.
(WebCore::DragController::concludeEditDrag): Use createLiveRange.
(WebCore::DragController::draggableElement const): Ditto.
(WebCore::DragController::startDrag): Ditto.
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent): Use createLiveRange.
(WebCore::EventHandler::sendContextMenuEventForKey): Ditto.
(WebCore::EventHandler::didStartDrag): Remove use of live range.
* page/Page.cpp:
(WebCore::Page::findStringMatchingRanges): Use createLiveRange.
* page/TextIndicator.cpp:
(WebCore::TextIndicator::createWithRange): Ditto.
(WebCore::TextIndicator::createWithSelectionInFrame): Ditto.
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::buildSelectionHighlight):
Use createLiveRange.
(WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight):
Use createLiveRange.
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::selectedText const): Remove use of
live range.
2020-04-26 Darin Adler <darin@apple.com>
Remove unnecessary inlining and templates for URL decomposition DOM functions
https://bugs.webkit.org/show_bug.cgi?id=211025
Reviewed by Alex Christensen.
* Headers.cmake: Renamed URLUtils.h to URLDecomposition.h.
* Modules/cache/DOMCacheStorage.cpp: Updated include and using namespace.
* Sources.txt: Added URLDecomposition.cpp.
* WebCore.xcodeproj/project.pbxproj: Added URLDecomposition.cpp and
renamed URLUtils.h to URLDecomposition.h.
* html/DOMURL.h: Removed the WEBCORE_EXPORT on this class. Added final.
Derive from URLDecomposition instead of URLUtils. Changed return type of
href to const&. Moved toJSON here from URLUtils. Added overrides of the
fullURL and setFullURL functions for URLDecomposition.
* html/DOMURL.idl: Removed ImplementationLacksVTable.
* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::HTMLAnchorElement): Moved initialization of
boolean data members to the class definition.
* html/HTMLAnchorElement.h: Derive from URLDecomposition instead of
URLUtils. Added overrides of the fullURL and setFullURL functions for
URLDecomposition. Initialize data members here in the class definition.
* html/HTMLMediaElement.cpp: Removed unnecessary include of DOMURL.h.
* html/URLDecomposition.cpp: Added. Contains most of the code from
the URLUtils class template, which no longer needs to be in a header.
* html/URLDecomposition.h: Renamed URLUtils.h to this. It's now an
abstract base class rather than a class template using the curiously
recurring template pattern.
* html/URLSearchParams.h: Forward-declare DOMURL rather than including
the DOMURL.h header.
* html/URLUtils.h: Removed. Renamed to URLDecompostion.h.
* page/DOMWindow.cpp: Removed unneeded include of DOMURL.h.
* testing/Internals.cpp: Added include of DOMURL.h.
2020-04-26 Cathie Chen <cathiechen@igalia.com>
fast/scrolling/scroll-behavior-invalidate-if-disabled.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=210917
Reviewed by Darin Adler.
The flaky failure is caused by reusing the CSSPropertyInfo value cached propertyInfoCache
after experimental flags changed. Add propertyInfoFromJavaScriptCSSPropertyName
to perform disabled checking after parsing. If the property is disabled, it will return
an invalid CSSPropertyInfo instead.
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName):
(WebCore::CSSStyleDeclaration::namedItem):
(WebCore::CSSStyleDeclaration::setNamedItem):
2020-04-25 Ross Kirsling <ross.kirsling@sony.com>
[JSC] isCallable is redundant with isFunction
https://bugs.webkit.org/show_bug.cgi?id=211037
Reviewed by Yusuke Suzuki.
* bindings/js/JSDOMConvertScheduledAction.h:
(WebCore::Converter<IDLScheduledAction>::convert):
* worklets/PaintWorkletGlobalScope.cpp:
(WebCore::PaintWorkletGlobalScope::registerPaint):
Don't use getCallData if you don't need CallData.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Build fix.
https://bugs.webkit.org/show_bug.cgi?id=210521
* Modules/applepay/ApplePaySetupFeature.mm:
2020-04-25 Alex Christensen <achristensen@webkit.org>
Move ApplePay code from WebKitAdditions to WebCore and WebKit
https://bugs.webkit.org/show_bug.cgi?id=210521
I accidentally committed an older version of the patch.
This is the diff between the two to fix the internal build.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Move ApplePay code from WebKitAdditions to WebCore and WebKit
https://bugs.webkit.org/show_bug.cgi?id=210521
Reviewed by Andy Estes.
Only 4 minor modifications were necessary, as follows:
1. PaymentSetupFeatures's RetainPtr<NSArray<PKPaymentSetupFeature *>> was changed to RetainPtr<NSArray> to work with C++.
2. WebPaymentCoordinatorProxyAdditions messages were moved to WebPaymentCoordinatorProxy, removing the need for
the extra message receiver, the Optional<WebPaymentCoordinatorProxyAdditions>, and the finishConstruction.
3. WebMediaSessionManager.cpp's macros that collided with other macros were renamed. This was necessary because of different source unification.
4. PaymentSetupFeatures.h was renamed to ApplePayPaymentSetupFeatures.h to be able to build with PaymentSetupFeatures.h in the SDK.
The rest is just copy and paste.
There isn't a good way to land this without breaking the build without removing the files from WebKitAdditions at the same time,
so I'll do the two at the same time late at night to not cause disruption.
* DerivedSources.make:
* Modules/applepay/ApplePayInstallmentConfiguration.h: Added.
* Modules/applepay/ApplePayInstallmentConfiguration.idl: Added.
* Modules/applepay/ApplePayPayment.h:
* Modules/applepay/ApplePayPayment.idl:
* Modules/applepay/ApplePayPaymentMethod.h:
* Modules/applepay/ApplePayPaymentMethod.idl:
* Modules/applepay/ApplePayPaymentMethodUpdate.h:
* Modules/applepay/ApplePayPaymentMethodUpdate.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::finishConverting):
(WebCore::requiresSupportedNetworks):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::finishConverting):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::installmentConfiguration const):
(WebCore::ApplePaySessionPaymentRequest::setInstallmentConfiguration):
* Modules/applepay/ApplePaySetup.cpp: Added.
(WebCore::shouldDiscloseFeatures):
(WebCore::ApplePaySetup::getSetupFeatures):
(WebCore::ApplePaySetup::begin):
(WebCore::ApplePaySetup::ApplePaySetup):
(WebCore::ApplePaySetup::stop):
(WebCore::ApplePaySetup::suspend):
* Modules/applepay/ApplePaySetup.h: Added.
(WebCore::ApplePaySetup::create):
* Modules/applepay/ApplePaySetup.idl: Added.
* Modules/applepay/ApplePaySetupFeature.h: Added.
(WebCore::ApplePaySetupFeature::create):
(WebCore::ApplePaySetupFeature::platformFeature const):
* Modules/applepay/ApplePaySetupFeature.idl: Added.
* Modules/applepay/ApplePaySetupFeature.mm: Added.
(WebCore::ApplePaySetupFeature::type const):
(WebCore::ApplePaySetupFeature::state const):
(WebCore::ApplePaySetupFeature::supportsInstallments const):
(WebCore::ApplePaySetupFeature::ApplePaySetupFeature):
* Modules/applepay/ApplePaySetupFeatureType.h: Added.
* Modules/applepay/ApplePaySetupFeatureType.idl: Added.
* Modules/applepay/PaymentCoordinatorClient.h:
(WebCore::PaymentCoordinatorClient::getSetupFeatures):
(WebCore::PaymentCoordinatorClient::beginApplePaySetup):
(WebCore::PaymentCoordinatorClient::endApplePaySetup):
* Modules/applepay/PaymentInstallmentConfiguration.h: Added.
* Modules/applepay/PaymentInstallmentConfiguration.mm: Added.
(WebCore::toDecimalNumber):
(WebCore::platformFeatureType):
(WebCore::createPlatformConfiguration):
(WebCore::PaymentInstallmentConfiguration::PaymentInstallmentConfiguration):
(WebCore::PaymentInstallmentConfiguration::platformConfiguration const):
* Modules/applepay/PaymentMethodUpdate.h:
* Modules/applepay/cocoa/PaymentCocoa.mm:
(WebCore::finishConverting):
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
(WebCore::finishConverting):
* Modules/applepay/cocoa/PaymentMethodUpdateCocoa.mm:
(WebCore::PaymentMethodUpdate::setInstallmentGroupIdentifier):
* Modules/applepay/cocoa/PaymentSessionErrorCocoa.mm:
(WebCore::additionalError):
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerEnabled):
(WebCore::WebMediaSessionManager::setMockMediaPlaybackTargetPickerState):
(WebCore::WebMediaSessionManager::mockMediaPlaybackTargetPickerDismissPopup):
(WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient):
(WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient):
(WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
(WebCore::WebMediaSessionManager::clientStateDidChange):
(WebCore::WebMediaSessionManager::setPlaybackTarget):
(WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
(WebCore::WebMediaSessionManager::playbackTargetPickerWasDismissed):
(WebCore::WebMediaSessionManager::configurePlaybackTargetClients):
(WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring):
(WebCore::WebMediaSessionManager::configureWatchdogTimer):
(WebCore::WebMediaSessionManager::watchdogTimerFired):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/WebCoreAdditions.mm:
2020-04-25 Simon Fraser <simon.fraser@apple.com>
Commit the scrolling tree from the main thread
https://bugs.webkit.org/show_bug.cgi?id=211026
<rdar://problem/62374855>
Reviewed by Darin Adler.
ScrollingCoordinatorMac::commitTreeStateIfNeeded() passed the new state tree to
the scrolling thread which then did the commit (which updates the scrolling tree
from the state tree). However, applyLayerPositions() immediately waited for that
commit to complete, blocking the main thread anyway.
We might as well just commit the scrolling tree on the main thread. ScrollingTree::commitTreeState()
locks m_treeMutex, so this is still safe. Lock contention with the scrolling or event dispatcher
threads should be rare; those threads are both mostly responsive.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingTreeAsText const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::waitForScrollingTreeCommit): Deleted.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::commitTreeState): Deleted.
(WebCore::ThreadedScrollingTree::incrementPendingCommitCount): Deleted.
(WebCore::ThreadedScrollingTree::decrementPendingCommitCount): Deleted.
(WebCore::ThreadedScrollingTree::waitForPendingCommits): Deleted.
(WebCore::ThreadedScrollingTree::waitForScrollingTreeCommit): Deleted.
(WebCore::ThreadedScrollingTree::applyLayerPositions): Deleted.
* page/scrolling/ThreadedScrollingTree.h:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
* page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
(WebCore::ScrollingCoordinatorNicosia::commitTreeState):
2020-04-25 Yusuke Suzuki <ysuzuki@apple.com>
Use static initialized Lock instead of LazyNeverDestroyed<Lock>
https://bugs.webkit.org/show_bug.cgi?id=211010
Reviewed by Mark Lam.
WTF::Lock can be static-initialized, so no need to use LazyNeverDestroyed<Lock>.
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::WebGPUDevice::instancesMutex):
* Modules/webgpu/WebGPUPipeline.cpp:
(WebCore::WebGPUPipeline::instancesMutex):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::instancesMutex):
* html/canvas/WebGLProgram.cpp:
(WebCore::WebGLProgram::instancesMutex):
2020-04-25 Darin Adler <darin@apple.com>
[Cocoa] Deal with another round of Xcode upgrade checks
https://bugs.webkit.org/show_bug.cgi?id=211027
Reviewed by Alexey Proskuryakov.
* WebCore.xcodeproj/project.pbxproj: Bump the upgrade check version.
2020-04-25 Alex Christensen <achristensen@webkit.org>
Prepare to remove automatic URL->String conversion operators
https://bugs.webkit.org/show_bug.cgi?id=211007
Reviewed by Darin Adler.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::requestFromInfo):
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::urlString const):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::fetch):
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::create):
* accessibility/AccessibilityImageMapLink.cpp:
(WebCore::AccessibilityImageMapLink::stringValueForMSAA const):
* bindings/IDLTypes.h:
(WebCore::IDLString::isNullValue):
* bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
* bindings/js/JSDOMConvertStrings.h:
(WebCore::JSConverter<IDLDOMString>::convert):
(WebCore::Converter<IDLUSVString>::convert):
(WebCore::JSConverter<IDLUSVString>::convert):
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::evaluateInWorld):
(WebCore::ScriptController::evaluateModule):
(WebCore::ScriptController::callInWorld):
(WebCore::ScriptController::executeIfJavaScriptURL):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneSerializer::write):
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::updateCursorElement):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::customCSSText const):
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper const):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceSrcURI):
* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
* dom/ExtensionStyleSheets.cpp:
(WebCore::createExtensionsStyleSheet):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::createSheet):
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
(WebCore::ScriptElement::executeClassicScript):
* dom/StyledElement.cpp:
(WebCore::StyledElement::styleAttributeChanged):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::sanitizeMarkupWithArchive):
(WebCore::WebContentReader::readWebArchive):
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::formAction const):
* html/HTMLFrameElementBase.cpp:
(WebCore::HTMLFrameElementBase::canLoadURL const):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::shouldLoadLink):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild):
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::canLoadURL const):
* html/parser/XSSAuditor.cpp:
(WebCore::XSSAuditor::filterToken):
* inspector/InspectorAuditResourcesObject.cpp:
(WebCore::InspectorAuditResourcesObject::getResources):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildArrayForGroupings):
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::responseReceived):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
(WebCore::InspectorNetworkAgent::willSendRequest):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
(WebCore::InspectorPageAgent::searchInResources):
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
* inspector/agents/InspectorWorkerAgent.cpp:
(WebCore::InspectorWorkerAgent::connectToWorkerInspectorProxy):
* inspector/agents/WebConsoleAgent.cpp:
(WebCore::WebConsoleAgent::didFailLoading):
* inspector/agents/worker/ServiceWorkerAgent.cpp:
(WebCore::ServiceWorkerAgent::getInitializationInfo):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::subresources const):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::clientRedirectDestinationForHistory const):
(WebCore::DocumentLoader::serverRedirectDestinationForHistory const):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::submitForm):
(WebCore::FrameLoader::receivedFirstData):
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
(WebCore::createWindow):
* loader/HistoryController.cpp:
(WebCore::HistoryController::currentItemShouldBeReplaced const):
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/MixedContentChecker.cpp:
(WebCore::MixedContentChecker::checkFormForMixedContent const):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::shouldScheduleNavigation const):
(WebCore::NavigationScheduler::scheduleLocationChange):
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
* loader/ResourceLoadNotifier.cpp:
(WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::requestObject):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* loader/appcache/ApplicationCache.cpp:
(WebCore::ApplicationCache::addResource):
(WebCore::ApplicationCache::resourceForRequest):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::selectCache):
(WebCore::ApplicationCacheGroup::finishedLoadingMainResource):
(WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
(WebCore::ApplicationCacheGroup::didFailLoadingEntry):
(WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::shouldLoadResourceFromApplicationCache):
(WebCore::ApplicationCacheHost::getApplicationCacheFallbackResource):
* loader/appcache/ApplicationCacheStorage.cpp:
(WebCore::ApplicationCacheStorage::loadCacheGroup):
(WebCore::ApplicationCacheStorage::findOrCreateCacheGroup):
(WebCore::ApplicationCacheStorage::findInMemoryCacheGroup const):
(WebCore::ApplicationCacheStorage::cacheGroupForURL):
(WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
(WebCore::ApplicationCacheStorage::cacheGroupDestroyed):
(WebCore::ApplicationCacheStorage::cacheGroupMadeObsolete):
(WebCore::ApplicationCacheStorage::store):
(WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
* loader/archive/ArchiveResourceCollection.cpp:
(WebCore::ArchiveResourceCollection::addAllResources):
(WebCore::ArchiveResourceCollection::addResource):
(WebCore::ArchiveResourceCollection::archiveResourceForURL):
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::didAddClient):
(WebCore::CachedCSSStyleSheet::checkNotify):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::cachedResource const):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
(WebCore::CachedResourceLoader::notifyFinished):
* loader/cache/CachedXSLStyleSheet.cpp:
(WebCore::CachedXSLStyleSheet::didAddClient):
(WebCore::CachedXSLStyleSheet::checkNotify):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::checkOrEnableIfNeeded const):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::setLocation):
(WebCore::DOMWindow::createWindow):
(WebCore::DOMWindow::open):
* page/Location.cpp:
(WebCore::Location::reload):
* page/PageSerializer.cpp:
(WebCore::PageSerializer::retrieveResourcesForProperties):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::shouldIgnoreHost):
* page/SecurityPolicy.cpp:
(WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner):
(WebCore::SecurityPolicy::isBaseURLSchemeAllowed):
* page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::assetURL const):
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobToFilePath):
* platform/network/mac/ResourceErrorMac.mm:
(WebCore::ResourceError::platformLazyInit):
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
(WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
* svg/SVGImageLoader.cpp:
(WebCore::SVGImageLoader::sourceURI const):
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::scope const):
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::hash const):
(WebCore::ServiceWorkerRegistrationKey::isMatching const):
* workers/service/context/ServiceWorkerDebuggable.cpp:
(WebCore::ServiceWorkerDebuggable::ServiceWorkerDebuggable):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::startScriptFetch):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
2020-04-25 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add vertical-align: baseline support
https://bugs.webkit.org/show_bug.cgi?id=211024
Reviewed by Antti Koivisto.
Adjust the padding with the baseline offset when the cell is baseline aligned (as opposed to the initial value of 'middle').
Test: fast/layoutformattingcontext/table-basic-row-vertical-align-baseline.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Cell::setBaselineOffset):
(WebCore::Layout::TableGrid::Cell::baselineOffset const):
2020-04-25 Darin Adler <darin@apple.com>
Move URL to use StringView when returning substrings of the URL
https://bugs.webkit.org/show_bug.cgi?id=210431
Reviewed by Anders Carlsson.
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::matchURLs): Removed unneeded calls to hasQuery.
* Modules/fetch/FetchRequest.cpp:
(WebCore::FetchRequest::initializeWith): Use hasCredentials.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::redirect): Use hasCredentials.
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::isValidURLBasedPaymentMethodIdentifier): Use hasCredentials.
* Modules/plugins/YouTubePluginReplacement.cpp:
(WebCore::createYouTubeURL): Take StringView.
(WebCore::queryKeysAndValues): Take StringView.
(WebCore::processAndCreateYouTubeURL): Use auto since URL pieces are
now returned as StringView.
(WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL):
Use StringView and makeString rather than StringBuilder.
* Modules/websockets/WebSocketHandshake.cpp:
(WebCore::resourceName): Use queryWithLeadingQuestionMark.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::internalLinkElement const):
Use StringView.
* dom/Document.cpp:
(WebCore::Document::setURL): Use setHostAndPort.
* dom/Element.cpp:
(WebCore::Element::findAnchorElementForLink): Update since
fragmentIdentifier returns StringView.
* dom/TreeScope.cpp: Added a comment.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::replaceRichContentWithAttachments): Update since
lastPathComponent returns a StringView. Also got rid of some strange
use of AtomString that was not necessary and used WTFMove more.
* editing/ios/EditorIOS.mm:
(WebCore::Editor::writeImageToPasteboard): Update since
lastPathComponent returns a StringView.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
Use makeString instead of StringBuilder, and StringView instead of
String for name and extension values.
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType): Update since lastPathComponent
returns a StringView.
* html/MediaFragmentURIParser.cpp:
(WebCore::MediaFragmentURIParser::parseFragments): Update since
fragmentIdentifier returns a StringView.
* html/URLUtils.h: Changed many functions to take a StringView, changed
various other functions to call toString, since the underlying URL
function now returns a StringView. Updated names since "pass" is now
"password".
(WebCore::countASCIIDigits): Added. Replaces unusual function
named parsePortFromStringPosition because we can use StringView now
and so don't need such an unusual function.
* loader/AdClickAttribution.cpp:
(WebCore::AdClickAttribution::parseConversionRequest): Use hasCredentials.
Also removed unnecessary use of ASCIILiteral that hurts performance
a tiny bit.
(WebCore::AdClickAttribution::urlForTesting const): Use makeString
instead of StringBuilder.
* loader/CrossOriginAccessControl.cpp:
(WebCore::validateCrossOriginRedirectionURL): Use hasCredentials.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest): Use hasCredentials.
* loader/FormSubmission.cpp:
(WebCore::appendMailtoPostFormDataToURL): Update since query returns
StringView.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadInSameDocument): Use equalRespectingNullity on
fragment identifiers to preserve behavior, since at this time
StringView == StringView does not respect nullity, but String == String does.
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::createFileURL): Use fileURLWithFileSystemPath.
* loader/appcache/ManifestParser.cpp:
(WebCore::manifestPath): Return a StringView.
(WebCore::parseManifest): Use StringView.
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateItemInCollection const): Update since
fragmentIdentifer returns a StringView.
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::splitFragmentIdentifierFromRequestURL): Ditto.
* page/FrameView.cpp:
(WebCore::FrameView::scrollToFragment): Ditto.
(WebCore::FrameView::scrollToFragmentInternal): Updated log message.
* page/History.cpp:
(WebCore::History::stateObjectAdded): Updated for URL::password name change
and to use the new stringWithoutQueryOrFragmentIdentifier rather than the
old equalIgnoringQueryAndFragment.
* page/Location.cpp:
(WebCore::Location::href const): Use removeCredentials.
(WebCore::Location::port const): Streamlined.
(WebCore::Location::pathname const): Use an ASCIILiteral.
(WebCore::Location::search const): Use queryWithLeadingQuestionMark.
(WebCore::Location::hash const): Use fragmentIdentifierWithLeadingNumberSign.
(WebCore::Location::setPort): Use parseUInt16.
* page/UserContentURLPattern.cpp: Coding style tweaks.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
Use contains instead of reverseFind to check for a period in the filename.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::load): Updated since lastPathComponent is a StringView.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::convertToInternalProtocol): Updated to use makeString since
setProtocol takes a StringView.
* platform/network/ResourceHandleInternal.h: Renamed m_pass to m_password
and call password instead of pass.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::removeCredentials): Use removeCredentials.
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::createCFURLConnection): Updated for m_password
name change.
(WebCore::ResourceHandle::willSendRequest): Updated for m_password and
password name changes.
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): Ditto.
* platform/network/curl/CurlProxySettings.cpp:
(WebCore::CurlProxySettings::setUserPass): Updated for setPassword name change.
(WebCore::createProxyUrl): Use hasCredentials, updated for password name change.
* platform/network/curl/CurlProxySettings.h:
(WebCore::CurlProxySettings::password const): Updated for password name change.
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge): Updated for
m_password name change.
(WebCore::ResourceHandle::getCredential): Ditto.
(WebCore::ResourceHandle::willSendRequest): Updated for m_password and
password name changes.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::createNSURLConnection): Updated for m_password
and setPassword name changes.
(WebCore::ResourceHandle::willSendRequest): Ditto.
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication): Ditto.
* platform/network/soup/ResourceRequestSoup.cpp:
(WebCore::ResourceRequest::createSoupURI const): Updated for password name change.
* platform/network/soup/URLSoup.cpp:
(WebCore::soupURIToURL): Updated for setPassword name change.
* platform/win/PasteboardWin.cpp:
(WebCore::writeURL): Updated since lastPathComponent returns a StringView.
(WebCore::filesystemPathFromUrlOrTitle): Ditto.
(WebCore::Pasteboard::write): Ditto.
* style/StyleBuilderState.cpp:
(WebCore::Style::BuilderState::createFilterOperations): Updated since
fragmentIdentifier returns a StringView.
* workers/WorkerLocation.cpp:
(WebCore::WorkerLocation::port const): Streamlined.
(WebCore::WorkerLocation::pathname const): Use an ASCIILiteral.
(WebCore::WorkerLocation::search const): Use queryWithLeadingQuestionMark.
(WebCore::WorkerLocation::hash const): Use fragmentIdentifierWithLeadingNumberSign.
* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::ServiceWorkerRegistrationKey):
Updated for hasFragmentIdentifier name change.
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::topOriginURL): Simplified code to set port.
* workers/service/server/SWServer.cpp:
(WebCore::originURL): Ditto.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open): Updated for setPassword name change.
2020-04-25 Chris Fleizach <cfleizach@apple.com>
AX: Improve tracking of Element* pointers in AXObjectCache with WeakHashSet
https://bugs.webkit.org/show_bug.cgi?id=210879
Reviewed by Daniel Bates.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::handleFocusedUIElementChanged):
(WebCore::filterListForRemoval):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
2020-04-25 Antoine Quint <graouts@apple.com>
[Web Animations] KeyframeEffect should ensure its target remains alive
https://bugs.webkit.org/show_bug.cgi?id=211019
Reviewed by Daniel Bates.
Test: webanimations/keyframe-effect-target-kept-alive.html
Make KeyframeEffect::m_target a RefPtr so that assigning an element to effect.target guarantees that element
is kept alive even if there are no other references to that element.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::setTarget):
* animation/KeyframeEffect.h:
2020-04-25 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Cleanup TableFormattingContext::layoutInFlowContent
https://bugs.webkit.org/show_bug.cgi?id=211023
Reviewed by Sam Weinig.
Move some code to dedicated functions.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForCells):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setUsedGeometryForSections):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
(WebCore::Layout::TableFormattingContext::initializeDisplayBoxToBlank const): Deleted.
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows): Deleted.
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::cellHeigh const):
(WebCore::Layout::TableFormattingContext::Geometry::computedColumnWidth const):
(WebCore::Layout::TableFormattingContext::Geometry::tableCellHeightAndMargin const): Deleted.
2020-04-25 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove the build warning below since r260247.
warning: unused parameter ‘foo’ [-Wunused-parameter]
No new tests, no new behaviors.
* testing/Internals.cpp:
(WebCore::Internals::hasSandboxIOKitOpenAccessToClass):
2020-04-24 Chris Dumez <cdumez@apple.com>
[iOS] Unable to sign up on twitter.com
https://bugs.webkit.org/show_bug.cgi?id=211003
<rdar://problem/58804852>
Reviewed by Darin Adler.
This is similar to the bug we had on nytimes.com and that was fixed in
r258767. However, instead of a 'resize' event, it is a 'change' event
on a MediaQueryList that is getting twitter.com in a bad state.
The issue is that when we home out of Safari, SpringBoard takes does
a snapshot sequence at various sizes / orientations and this causes
many JS events to get fired (e.g. 'resize', 'orientationchange',
'change', ...), which can get some sites in a bad state. To address
the issue, we now prevent firing of ALL JS events during the
SpringBoard snapshot, instead of merely preventing the 'resize' ones.
* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
* page/FrameView.cpp:
(WebCore::FrameView::sendResizeEventIfNeeded):
* page/Page.h:
(WebCore::Page::shouldFireEvents const):
(WebCore::Page::setShouldFireEvents):
(WebCore::Page::shouldFireResizeEvents const): Deleted.
(WebCore::Page::setShouldFireResizeEvents): Deleted.
2020-04-24 Saam Barati <sbarati@apple.com>
Return BigInt32 whenever we can
https://bugs.webkit.org/show_bug.cgi?id=210922
Reviewed by Yusuke Suzuki.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneDeserializer::readBigInt):
2020-04-24 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] allThreads registration is racy with allThreads unregistration
https://bugs.webkit.org/show_bug.cgi?id=210995
<rdar://problem/61609690>
Reviewed by Keith Miller.
* page/cocoa/ResourceUsageThreadCocoa.mm:
(WebCore::ResourceUsageThread::platformCollectCPUData):
2020-04-24 Wenson Hsieh <wenson_hsieh@apple.com>
Make some more adjustments to TextManipulationController's paragraph boundary heuristic
https://bugs.webkit.org/show_bug.cgi?id=210993
<rdar://problem/61571299>
Reviewed by Tim Horton.
Adjust the heuristic added in r260583 to account for a few more common scenarios where we currently consider
text as a part of the same paragraph. This can lead to many issues during text manipulation where text is moved
between these elements, when it should not be.
The new scenarios include block and inline-block links, as well as button elements.
Test: TextManipulation.StartTextManipulationTreatsInlineBlockLinksAndButtonsAsParagraphs
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
Additionally rename "paragraph boundary element" to "item boundary element", to avoid colliding with the
existing notion of paragraph boundaries in editing code.
2020-04-24 Christopher Reid <chris.reid@sony.com>
[Win] Bundle Inspector Resources in Release builds
https://bugs.webkit.org/show_bug.cgi?id=210942
Reviewed by Fujii Hironori.
* CMakeLists.txt:
2020-04-24 Antoine Quint <graouts@apple.com>
[Web Animations] Ensure calling Web Animations APIs override future CSS Animations style properties
https://bugs.webkit.org/show_bug.cgi?id=210988
Reviewed by Dean Jackson.
The CSS Animations Level 2 spec specifies how the Web Animations APIs and the CSS Animations style
properties should interact in https://drafts.csswg.org/css-animations-2/#animations. This patch
implements the specified behavior and this is reflected by progress on the relevant WPT tests.
The gist of this change is that once a Web Animations API is called on an animation created using
CSS Animations, any changes made to related CSS Animations style properties on the target element
will be ignored so that the overrides applied via the Web Animations API remain in effect.
For instance, calling pause() or play() in a way that changes the playback state of the CSS Animation
will mean that future changes to the CSS animation-play-state property are ignored.
To do this we make more IDL properties and methods use dedicated methods to distinguish between the
bindings entry-point and internal usage of the same methods to integrate the behavior only when the
API itself is being used.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getBindingsTiming const): Ensure we flush styles when animation.effect.getTiming()
is called.
(WebCore::AnimationEffect::getBindingsComputedTiming const): Ensure we flush styles when
animation.effect.getComputedTiming() is called.
(WebCore::AnimationEffect::bindingsUpdateTiming): Notify the associated CSSAnimation object, if any, when
animation.effect.updateTiming() is called such that the CSSAnimation may apply the relevant overrides.
* animation/AnimationEffect.h:
* animation/AnimationEffect.idl:
* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Only apply new values of CSS Animations style
properties if there are no overrides for them resulting from calling related Web Animations APIs.
(WebCore::CSSAnimation::bindingsPlay): Mark animation-play-state as overridden if play() is called.
(WebCore::CSSAnimation::bindingsPause): Mark animation-play-state as overridden if pause() is called.
(WebCore::CSSAnimation::setBindingsEffect): Mark all animation style properties, except for animation-name
and animation-play-state as overridden if animation.effect is set.
(WebCore::CSSAnimation::setBindingsStartTime): Mark animation-play-state as overridden if animation.startTime
is set.
(WebCore::CSSAnimation::bindingsReverse): Mark animation-play-state as overridden if reverse() is called.
(WebCore::CSSAnimation::effectTimingWasUpdatedUsingBindings): Mark each CSS property associated with a key
found on the timing object passed to animation.effect.updateTiming() as overridden.
(WebCore::CSSAnimation::effectKeyframesWereSetUsingBindings): Mark animation-timing-function as overridden
if animation.effect.setKeyframes() is called.
* animation/CSSAnimation.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::bindingsStartTime const):
(WebCore::DeclarativeAnimation::setBindingsStartTime):
(WebCore::DeclarativeAnimation::startTime const): Deleted.
(WebCore::DeclarativeAnimation::setStartTime): Deleted.
* animation/DeclarativeAnimation.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::getBindingsKeyframes): Ensure we flush styles when animation.effect.getKeyframes()
is called.
(WebCore::KeyframeEffect::getKeyframes): Only use the CSS-originated animation path if we don't have JS-originated
keyframes.
(WebCore::KeyframeEffect::setBindingsKeyframes): Notify the associated CSSAnimation object, if any, when
animation.effect.setKeyframes() is called such that the CSSAnimation may apply the relevant overrides.
(WebCore::KeyframeEffect::processKeyframes): Correctly return early if part of the processing yields an exception.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setBindingsEffect):
(WebCore::WebAnimation::setBindingsStartTime):
(WebCore::WebAnimation::bindingsReverse):
* animation/WebAnimation.h:
(WebCore::WebAnimation::bindingsEffect const):
(WebCore::WebAnimation::bindingsStartTime const):
* animation/WebAnimation.idl:
2020-04-24 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: m_wrapper under HTMLMediaElement::setIsPlayingToWirelessTarget
https://bugs.webkit.org/show_bug.cgi?id=210983
<rdar://problem/61611994>
Reviewed by Eric Carlson.
The issue was that we were trying to fire a JS event as a result of ActiveDOMObject::stop()
getting called, which is not allowed. To address the issue, we avoid firing the event if
the context is already stopped.
No new tests, already covered by:
media/modern-media-controls/placard-support/placard-support-airplay-fullscreen.html
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
2020-04-24 Tim Horton <timothy_horton@apple.com>
iPad: "Pocket City" interaction does not work with trackpad
https://bugs.webkit.org/show_bug.cgi?id=210985
<rdar://problem/62273077>
Reviewed by Wenson Hsieh.
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isPocketCity):
2020-04-24 Tomoki Imai <Tomoki.Imai@sony.com>
[OpenSSL] Implement WebCrypto APIs for HMAC
https://bugs.webkit.org/show_bug.cgi?id=210902
Reviewed by Don Olmstead.
Support WebCrypto HMAC sign/verify with OpenSSL.
The design and some functions are inherited from the other ports.
* crypto/openssl/CryptoAlgorithmHMACOpenSSL.cpp:
(WebCore::HMACAlgorithm): Added. Helper function to map CryptoAlgorithmIdentifier to OpenSSL EVP_MD type.
(WebCore::calculateSignature): Added. Helper function to calculate the signature for sign/verify.
(WebCore::CryptoAlgorithmHMAC::platformSign): Implemented, mostly same as the other ports.
(WebCore::CryptoAlgorithmHMAC::platformVerify): Implemented, mostly same as the other ports.
* crypto/openssl/CryptoAlgorithmRegistryOpenSSL.cpp:
(WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms): Added CryptoAlgorithmHMAC support.
* crypto/openssl/OpenSSLCryptoUniquePtr.h: Added specialized unique_ptrs for EVP_MD_CTX and EVP_PKEY.
(WebCore::OpenSSLCryptoPtrDeleter<EVP_MD_CTX>::operator() const):
(WebCore::OpenSSLCryptoPtrDeleter<EVP_PKEY>::operator() const):
2020-04-24 Brian Burg <bburg@apple.com>
Web Automation: timeout underneath Automation.evaluateJavaScriptFunction in Selenium test frame_switching_tests.py::testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs[Safari]
https://bugs.webkit.org/show_bug.cgi?id=210162
<rdar://problem/60561009>
Reviewed by Devin Rousso.
* page/DOMWindow.h: Expose DOMWindow::{register, unregister}Observer.
2020-04-24 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Take first in-flow table-row baseline into account when computing cell baseline
https://bugs.webkit.org/show_bug.cgi?id=210972
Reviewed by Antti Koivisto.
Check if the cell has a nested table and use its first row as the baseline for the cell (unless there's an IFC before).
Test: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::usedBaselineForCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Row::setBaselineOffset):
(WebCore::Layout::TableGrid::Row::baselineOffset const):
2020-04-24 Antti Koivisto <antti@apple.com>
Nullptr crash in objc_msgSend under WebCore::genericFamily
https://bugs.webkit.org/show_bug.cgi?id=210911
<rdar://problem/61510208>
Reviewed by Geoffrey Garen.
Speculative fix.
* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::genericFamily):
Test that CTFontDescriptorCopyAttribute is really returning CFStringRef.
Also explicitly return String from lambda to clarify lifetimes.
2020-04-24 Simon Fraser <simon.fraser@apple.com>
Move some post-renderingUpdate code into WebCore
https://bugs.webkit.org/show_bug.cgi?id=210952
Reviewed by Antti Koivisto.
Factor some code called by the various DrawingArea subclasses into Page::finalizeRenderingUpdate(),
with some flags to control behavior that differs between drawing areas.
ScrollingCoordinator::commitTreeStateIfNeeded() is a no-op for RemoteScrollingCoordinator so
it's fine to always call it.
* page/Page.cpp:
(WebCore::Page::passiveTouchEventListenerRectsForTesting):
(WebCore::Page::finalizeRenderingUpdate):
* page/Page.h:
2020-04-24 Adrian Perez de Castro <aperez@igalia.com>
Add missing HTMLNames:: namespace prefix to usage of liTag object
Unreviewed build fix.
No new tests needed.
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
2020-04-23 Rob Buis <rbuis@igalia.com>
Make CachedResourceLoader more conforming to Fetch specification
https://bugs.webkit.org/show_bug.cgi?id=210925
Reviewed by Alex Christensen.
Make CachedResourceLoader more conforming to Fetch specification
by fixing links, re-ordering steps to match main fetch [1] and do
early exit code paths earlier.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestImage): adjust to parameter change.
(WebCore::CachedResourceLoader::canRequest): replace CachedResourceRequest param with ResourceLoaderOptions.
(WebCore::CachedResourceLoader::prepareFetch): fix comment.
(WebCore::CachedResourceLoader::requestResource): re-order.
* loader/cache/CachedResourceLoader.h:
2020-04-23 Simon Fraser <simon.fraser@apple.com>
Move the storage of DisplayID from Chrome to Page
https://bugs.webkit.org/show_bug.cgi?id=210943
Reviewed by Tim Horton.
The less Chrome knows about Frames and Documents the better. At some point Page is going
to talk to ScrollingCoordinator in this callback too.
* page/Chrome.cpp:
(WebCore::Chrome::displayID const):
(WebCore::Chrome::windowScreenDidChange):
* page/Chrome.h:
* page/Page.cpp:
(WebCore::Page::windowScreenDidChange):
* page/Page.h:
(WebCore::Page::displayID const):
2020-04-23 Simon Fraser <simon.fraser@apple.com>
EventHandler::selectCursor() has broken resize over coordinate conversion code
https://bugs.webkit.org/show_bug.cgi?id=210778
Reviewed by Zalan Bujtas.
EventHandler::selectCursor() appeared to make a local hit-test point from window
to content coordinates, which made no sense, but this happened to work because
RenderLayer::hitTestLayer() set the HitTestResult localPoint to a global point
if you hit the resizer.
Clean up this mess by having all resizer-related geometry queries be in local coordinates.
As a bonus, actually set the cursor to a resize cursor when over the resizer.
Test: fast/events/cursors/mouse-cursor-over-resizer.html
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
(WebCore::EventHandler::handleMousePressEvent):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::offsetFromResizeCorner const):
(WebCore::RenderLayer::isPointInResizeControl const):
(WebCore::RenderLayer::hitTestLayer):
(WebCore::RenderLayer::hitTestResizerInFragments const):
* rendering/RenderLayer.h:
2020-04-23 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation does not account for text in fully clipped containers
https://bugs.webkit.org/show_bug.cgi?id=210940
<rdar://problem/61137648>
Reviewed by Tim Horton.
Allow text manipulation to find both text in `visibility: hidden;` containers, as well as text in fully clipped
overflow containers. In both cases, renderers exist for these nodes, but TextIterator ignores them by default.
If these containers become visible in the future, we don't want to skip out on performing text manipulation on
them.
An alternative would be to detect when any element that has not undergone text manipulation has become visible
(i.e. no longer clipped by an ancestor), but this is likely more complicated (and possibly less performant) than
just eagerly extracting text from hidden containers, once they gain renderers.
TextManipulation.StartTextManipulationIncludesFullyClippedText
* editing/TextManipulationController.cpp:
(WebCore::ParagraphContentIterator::ParagraphContentIterator):
(WebCore::TextManipulationController::didCreateRendererForElement):
(WebCore::TextManipulationController::scheduleObservationUpdate):
(WebCore::TextManipulationController::scheduleObservartionUpdate): Deleted.
While I'm here, also rename scheduleObservartionUpdate to scheduleObservationUpdate.
* editing/TextManipulationController.h:
2020-04-23 Alex Christensen <achristensen@webkit.org>
Allow credentials for same-origin css mask images
https://bugs.webkit.org/show_bug.cgi?id=210895
<rdar://problem/60093888>
Reviewed by Brent Fulgham.
Test: http/tests/security/css-mask-image-credentials.html
r230006 went a step too far in restricting what is allowed with css mask images.
Basic authentication credentials should be allowed with such requests as they are in Chrome and Firefox.
This can be seen by doing run-webkit-httpd then opening http://127.0.0.1:8000/security/css-mask-image-credentials.html
In Chrome and Firefox you'll see it forward to a page that has a blue square.
In Safari before this change you'll see a yellow square and a basic authentication prompt.
In Safari after this change you'll see the same blue square you see in Chrome and Firefox.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):
2020-04-23 Alex Christensen <achristensen@webkit.org>
Jesus Calling app needs more WebSQL
https://bugs.webkit.org/show_bug.cgi?id=210889
<rdar://problem/61795507>
Reviewed by Chris Dumez.
Manually verified this fixes the issue in the radar.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowInstanceFunctionOpenDatabaseBody):
2020-04-23 Rob Buis <rbuis@igalia.com>
Move applyUserAgentIfNeeded calls to a more central place
https://bugs.webkit.org/show_bug.cgi?id=209587
Reviewed by Darin Adler.
Make main resource loads stop calling applyUserAgentIfNeeded
and instead do it in the CachedResourceLoader.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadResourceSynchronously):
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::createRequest):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateReferrerAndOriginHeaders):
(WebCore::CachedResourceRequest::updateUserAgentHeader):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders): Deleted.
* loader/cache/CachedResourceRequest.h:
2020-04-23 Kenneth Russell <kbr@chromium.org>
[WebGL2] Update texture packing code for software uploads from DOM
https://bugs.webkit.org/show_bug.cgi?id=209515
Reviewed by Dean Jackson.
Update the bottommost DOM-to-texture packing code in
GraphicsContextGLOpenGL and FormatConverter to full WebGL 2.0
capability. Reorganize some code to make side-by-side comparisons
easier with other WebGL 2.0 implementations.
Added NEEDS_PORT comments to areas in the calling code which need
particular attention in subsequent patches. Roughly two more
patches will be needed on top of this one in order to fully pass
the associated conformance tests.
Fix a bug in the non-ANGLE ENABLE(WEBGL2) code path which
accidentally disabled WebGL entirely in this configuration.
Covered by the WebGL 2.0 conformance tests.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
(WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::texImageSource2D):
(WebCore::WebGLRenderingContextBase::texImage2DImpl):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::texSubImage2DImpl):
(WebCore::WebGLRenderingContextBase::texSubImage2D):
(WebCore::WebGLRenderingContextBase::validateTexFuncData):
(WebCore::WebGLRenderingContextBase::getPackPixelStoreParams const):
(WebCore::WebGLRenderingContextBase::getUnpackPixelStoreParams const):
* html/canvas/WebGLRenderingContextBase.h:
* platform/graphics/FormatConverter.cpp:
(WebCore::convertFloatToHalfFloat):
(WebCore::float>):
(WebCore::uint8_t>):
(WebCore::uint16_t>):
(WebCore::int8_t>):
(WebCore::int16_t>):
(WebCore::uint32_t>):
(WebCore::int32_t>):
(WebCore::FormatConverter::convert):
* platform/graphics/FormatConverter.h:
(WebCore::FormatConverter::FormatConverter):
* platform/graphics/GraphicsContextGL.h:
(WebCore::GraphicsContextGL::hasAlpha):
(WebCore::GraphicsContextGL::hasColor):
* platform/graphics/opengl/GraphicsContextGLOpenGL.cpp:
(WebCore::GraphicsContextGLOpenGL::texImage2DResourceSafe):
(WebCore::GraphicsContextGLOpenGL::computeFormatAndTypeParameters):
(WebCore::GraphicsContextGLOpenGL::computeImageSizeInBytes):
(WebCore::GraphicsContextGLOpenGL::PixelStoreParams::PixelStoreParams):
(WebCore::GraphicsContextGLOpenGL::packImageData):
(WebCore::GraphicsContextGLOpenGL::extractImageData):
(WebCore::GraphicsContextGLOpenGL::extractTextureData):
(WebCore::TexelBytesForFormat):
(WebCore::GraphicsContextGLOpenGL::packPixels):
* platform/graphics/opengl/GraphicsContextGLOpenGL.h:
2020-04-23 Wenson Hsieh <wenson_hsieh@apple.com>
Add a heuristic for text manipulation to treat some list items as paragraph boundaries
https://bugs.webkit.org/show_bug.cgi?id=210915
<rdar://problem/61907080>
Reviewed by Megan Gardner.
Adds a mechanism to allow text manipulation to emit an item containing the current list of text manipulation
tokens early, in the case where the paragraph content iterator crosses the boundary of an element that encloses
a paragraph. Currently, the only enclosing paragraph element will be list items that have `display: block;`,
which we can take as a hint that the text in these list items should be vended as separate items, rather than as
tokens in a single item.
This may be extended in the future to other situations by adjusting logic in `isEnclosingParagraphElement`.
Test: TextManipulation.StartTextManipulationBreaksParagraphInBetweenListItems
* editing/TextManipulationController.cpp:
(WebCore::TextManipulationController::observeParagraphs):
2020-04-23 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for basic baseline align inside a table row
https://bugs.webkit.org/show_bug.cgi?id=210918
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-basic-row-baseline-align.html
The minimum height of a row is defined as the height of an hypothetical linebox containing
the cells originating in the row. In this hypothetical linebox, we use baseline alignment to
align the cells vertically.
Use these vertically aligned cells to compute the final row height.
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::verticalMarginBorderAndPadding const):
(WebCore::Display::Box::setVerticalPadding):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
* layout/tableformatting/TableFormattingContext.h:
2020-04-23 Sihui Liu <sihui_liu@apple.com>
TextManipulationController should set range of paragraph using token's positions
https://bugs.webkit.org/show_bug.cgi?id=210866
<rdar://problem/60646283>
Reviewed by Wenson Hsieh.
Set the range of paragraph using positions of first token and last token in the paragraph because:
1. Accurate range makes token matching in TextManipulationController::replace() easier, as TextIterator could
visit different positions with different ranges or different conditions. For example, in our previous
implementation, start of a paragraph can be set as the first visible position of document, while position of
first token is after that. Then in replace(), TextManipulationController may extract a word before the position
of first token and return error. See added test TextManipulation.CompleteTextManipulationCorrectParagraphRange.
2. TextManipulationController can handle fewer content and this is less error-prone. For example, svg elements
before/after the paragraph text will not be identified as tokens [] in a paragraph now. See updated API tests
for example.
New test: TextManipulation.CompleteTextManipulationCorrectParagraphRange
* editing/TextManipulationController.cpp:
(WebCore::ParagraphContentIterator::moveCurrentNodeForward): m_currentNodeForFindingInvisibleContent should not
be advanced if it is already at the end.
(WebCore::containsOnlyHTMLSpaces):
(WebCore::TextManipulationController::observeParagraphs):Set the paragraph start as the position of the first
token and end as the position of last token. If the paragraph is split with <br>, the end will be extended to
position of <br> so that we can add this node back later; otherwise, <br> can be removed after original
text of paragraph is removed in TextManipulationController::replace(). Also, stop identifying spaces as tokens
because non-text Node can emit spaces.
(WebCore::TextManipulationController::replace): Only identify tokens from content with meaningful text.
2020-04-23 Chris Dumez <cdumez@apple.com>
[ Mac wk2 ] imported/w3c/web-platform-tests/notifications/event-onclose.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209483
<rdar://problem/60830377>
Reviewed by Geoff Garen.
Align garbage collection of Notification JS wrapper with the specification:
- https://notifications.spec.whatwg.org/#garbage-collection [1]
In particular, the following changes were made:
1. Instead of using the legacy setPendingActivity() / unsetPendingActivity(), override
ActiveDOMObject::virtualHasPendingActivity() to implement the behavior documented
in the specification.
2. Keep the wrapper alive as long as the notification is showing and as long as there
are relevant event listeners, as per [1]. Previously, we failed to check for event
listeners, which was suboptimal.
3. Update the constructor to queue a task on the event loop in order to show the
notification asynchronously, instead of relying on a SuspendableTimer for this
purpose. Previously, the JS wrapper could get collected between construction and
the notification getting shown, which was leading to the test flakiness.
No new tests, unskipped existing test.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::Notification::finalize):
(WebCore::Notification::dispatchShowEvent):
(WebCore::Notification::dispatchClickEvent):
(WebCore::Notification::dispatchCloseEvent):
(WebCore::Notification::dispatchErrorEvent):
(WebCore::Notification::eventListenersDidChange):
(WebCore::Notification::virtualHasPendingActivity const):
* Modules/notifications/Notification.h:
2020-04-23 Andres Gonzalez <andresg_22@apple.com>
Correction for patch 397001.
https://bugs.webkit.org/show_bug.cgi?id=210914
Reviewed by Chris Fleizach.
- No need to check for isEmpty when retrieving the primary screen size,
as pointed out by Darin Adler in bug 210760, patch 397001.
- Added some helpful AXLOGing.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper primaryScreenHeight]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
2020-04-23 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WebCoreTestSupport target
https://bugs.webkit.org/show_bug.cgi?id=210867
Unreviewed build fix.
Make the dependencies explicit.
* CMakeLists.txt:
2020-04-22 Simon Fraser <simon.fraser@apple.com>
In the scrolling tree, separate wheel event handling from layer updating
https://bugs.webkit.org/show_bug.cgi?id=210899
Reviewed by Antti Koivisto.
Working towards webkit.org/b/210884, it needs to be possible to have the scrolling
tree handle a wheelEvent and update its internal state about scroll positions, but not
immediately map those scroll positions onto CALayers.
To achieve this, have ScrollingTreeScrollingNode::currentScrollPositionChanged()
not call applyLayerPositions(), or notifyRelatedNodesAfterScrollPositionChange() which
just applies layer positions on related nodes.
Instead, at the end of wheel event handling, do a full scrolling tree traversal and update
all the layer positions there.
Delegated scrolling (iOS) still needs notifyRelatedNodesAfterScrollPositionChange() so it
can't be removed.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::applyLayerPositions):
(WebCore::ScrollingTree::applyLayerPositionsInternal):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged):
2020-04-23 Charlie Turner <cturner@igalia.com>
[EME][CDMProxy] Sort key status array lexicographically by key IDs
https://bugs.webkit.org/show_bug.cgi?id=210659
Reviewed by Xabier Rodriguez-Calvar.
This is required by section 6.1 of
https://www.w3.org/TR/encrypted-media/.
Test: encrypted-media/clearkey-keystatuses.https.html
* platform/encryptedmedia/CDMProxy.cpp:
(WebCore::KeyStore::add): We could use a set here and keep it
sorted by design, but this is more complexity than needed. The
store has for practical purposes an upper limit of 2
items. Sorting such a vector lowers to either a noop or a swap. So
the simple approach here wins over using some kind of self-sorting
set structure. I also considered only sorting on-demand, since it
only has to appear sorted from the perspective of JS, we could
sort the array in convertToJSKeyStatusVector. However, that is
semantically a const method, so sorting here felt too surprising.
* platform/encryptedmedia/CDMProxy.h:
(WebCore::Key::operator<): Add a lexicographic comparator to
Key.
2020-04-23 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] excessive wakeups/polling due to gdk_frame_clock_begin_updating
https://bugs.webkit.org/show_bug.cgi?id=210561
Reviewed by Žan Doberšek.
The problem is that we are destroying the display refresh monitor from the frame clock update callback, and GTK
schedules another update from the callback itself in some cases, which ends up happening forever. We were
assuming that destroying the window of immediately destroy the frame clock as well, but the paint source idle
keeps a reference of the frame clock. At the end of the source idle callback the source is scheduled again,
taking a new reference. We need to call gdk_frame_clock_end_updating() to ensure the idle is not scheduled
again.
* platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp:
(WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk): Disconnect the update signal and call
gdk_frame_clock_end_updating().
(WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback): Toplevel window should always have a frame clock,
so remove the early return and add an assert instead.
2020-04-23 Youenn Fablet <youenn@apple.com>
getDisplayMedia is not respecting aspect ratio with max constraints
https://bugs.webkit.org/show_bug.cgi?id=210858
Reviewed by Eric Carlson.
Add computation of exact frame size to respect aspect ratio in DisplayCaptureSourceCocoa::updateFrameSize.
Refactor code to have one source class DisplayCaptureSourceCocoa and specific capturer for screen and window.
This simplifies code and allows reusing DisplayCaptureSourceCocoa with a mock capturer.
Update mock code to use DisplayCaptureSourceCocoa.
Tests: fast/mediastream/getDisplayMedia-max-constraints.html
fast/mediastream/getDisplayMedia-max-constraints1.html
fast/mediastream/getDisplayMedia-max-constraints2.html
fast/mediastream/getDisplayMedia-max-constraints3.html
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices):
(WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices):
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
(WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::create):
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::capabilities):
(WebCore::DisplayCaptureSourceCocoa::settings):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::updateFrameSize):
(WebCore::DisplayCaptureSourceCocoa::emitFrame):
(WebCore::DisplayCaptureSourceCocoa::Capturer::setLogger):
(WebCore::DisplayCaptureSourceCocoa::Capturer::logChannel const):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::createForMockDisplayCapturer):
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
* platform/mediastream/mac/ScreenDisplayCapturerMac.h: Added.
* platform/mediastream/mac/ScreenDisplayCapturerMac.mm: Added.
(WebCore::ScreenDisplayCapturerMac::create):
(WebCore::ScreenDisplayCapturerMac::ScreenDisplayCapturerMac):
(WebCore::ScreenDisplayCapturerMac::~ScreenDisplayCapturerMac):
(WebCore::ScreenDisplayCapturerMac::createDisplayStream):
(WebCore::ScreenDisplayCapturerMac::start):
(WebCore::ScreenDisplayCapturerMac::stop):
(WebCore::ScreenDisplayCapturerMac::generateFrame):
(WebCore::ScreenDisplayCapturerMac::startDisplayStream):
(WebCore::ScreenDisplayCapturerMac::commitConfiguration):
(WebCore::ScreenDisplayCapturerMac::displayWasReconfigured):
(WebCore::ScreenDisplayCapturerMac::displayReconfigurationCallBack):
(WebCore::ScreenDisplayCapturerMac::newFrame):
(WebCore::ScreenDisplayCapturerMac::screenCaptureDeviceWithPersistentID):
(WebCore::ScreenDisplayCapturerMac::screenCaptureDevices):
* platform/mediastream/mac/WindowDisplayCapturerMac.h: Added.
* platform/mediastream/mac/WindowDisplayCapturerMac.mm: ddedAdded.
(WebCore::WindowDisplayCapturerMac::create):
(WebCore::WindowDisplayCapturerMac::WindowDisplayCapturerMac):
(WebCore::WindowDisplayCapturerMac::windowImage):
(WebCore::WindowDisplayCapturerMac::generateFrame):
(WebCore::WindowDisplayCapturerMac::windowCaptureDeviceWithPersistentID):
(WebCore::WindowDisplayCapturerMac::windowCaptureDevices):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
(WebCore::MockDisplayCapturer::MockDisplayCapturer):
(WebCore::MockDisplayCapturer::start):
(WebCore::MockDisplayCapturer::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
(isType):
2020-04-22 Simon Fraser <simon.fraser@apple.com>
Make it possible to eagerly apply scrolling tree state from the main thread
https://bugs.webkit.org/show_bug.cgi?id=210883
Reviewed by Tim Horton.
Work towards fixing webkit.org/b/210884: at the beginning of Page::updateRendering(),
we are going to need to pull the current state of the scrolling tree back to the
main thread, so that JS-exposed scroll offsets match scrolling tree state.
To this end, expose a scrolling tree traversal function from ScrollingTree, which
takes the lock and then calls a visitor function for each node. For scrolling nodes,
the visitor gets the scroll position and optional layout viewport origin. These
match the data passed back currently via AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll().
The new code is not called yet.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::synchronizeStateFromScrollingTree):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::traverseScrollingTree):
(WebCore::ScrollingTree::traverseScrollingTreeRecursive):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::currentScrollPositionChanged): applyLayerPositions() calls these two
functions, so just call it instead.
2020-04-22 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260535.
https://bugs.webkit.org/show_bug.cgi?id=210897
Causes crashes in WK1 (Requested by smfr on #webkit).
Reverted changeset:
"[ Mac wk2 ] imported/w3c/web-platform-tests/notifications
/event-onclose.html is flaky failing."
https://bugs.webkit.org/show_bug.cgi?id=209483
https://trac.webkit.org/changeset/260535
2020-04-22 Darin Adler <darin@apple.com>
[Cocoa] Build with UChar as char16_t even in builds that use Apple's internal SDK
https://bugs.webkit.org/show_bug.cgi?id=210845
Reviewed by Anders Carlsson.
* Configurations/WebCore.xcconfig: Move ICU-configuring macros to Platform.h.
* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::connect): Get rid of an obsolete cast to unsigned to work
around uint16_t not being treated as a number by makeString.
* rendering/svg/SVGTextLayoutEngineBaseline.cpp:
(WebCore::SVGTextLayoutEngineBaseline::calculateGlyphOrientationAngle const):
Remove deprecated U_EA_COUNT.
2020-04-22 Andres Gonzalez <andresg_22@apple.com>
Add logging to core accessibility.
https://bugs.webkit.org/show_bug.cgi?id=210564
<rdar://problem/61863477>
Reviewed by Simon Fraser and Chris Fleizach.
- Use LOG and LOG_WITH_STREAM macros instead of WTF::Logger directly.
- Added logging of AXCoreObjects.
* accessibility/AXLogger.cpp:
(WebCore::AXLogger::AXLogger):
(WebCore::AXLogger::~AXLogger):
(WebCore::AXLogger::log):
(WebCore::operator<<):
* accessibility/AXLogger.h:
* accessibility/AccessibilityObjectInterface.h:
2020-04-22 Daniel Bates <dabates@apple.com>
Support toggling debug overlay for touch action region and editable element region independent from non-fast scrollable region
https://bugs.webkit.org/show_bug.cgi?id=210774
Reviewed by Dean Jackson.
Break out the touch action region and editable element region debug overlays into their own
flags that can be passed to Settings::setVisibleDebugOverlayRegions() to toggle these overlays,
respectively. Currently both of these overlays piggyback on whether the engine will paint the
non-fast scrollable region.
* page/SettingsBase.h: Add two more enumerators.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::invalidateEventRegion const): Update the code to be more precise now that
we can target the update paint overlay hack to when we are painting touch-action or editable
element regions.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintDebugOverlays): Condition the painting of touch action region
on one enumerator and the painting of editable element region on another.
(WebCore::RenderLayerBacking::paintContents): Update the code to be more precise.
2020-04-22 Chris Dumez <cdumez@apple.com>
[ Mac wk2 ] imported/w3c/web-platform-tests/notifications/event-onclose.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=209483
<rdar://problem/60830377>
Reviewed by Geoffrey Garen.
Align garbage collection of Notification JS wrapper with the specification:
- https://notifications.spec.whatwg.org/#garbage-collection [1]
In particular, the following changes were made:
1. Instead of using the legacy setPendingActivity() / unsetPendingActivity(), override
ActiveDOMObject::virtualHasPendingActivity() to implement the behavior documented
in the specification.
2. Keep the wrapper alive as long as the notification is showing and as long as there
are relevant event listeners, as per [1]. Previously, we failed to check for event
listeners, which was suboptimal.
3. Update the constructor to queue a task on the event loop in order to show the
notification asynchronously, instead of relying on a SuspendableTimer for this
purpose. Previously, the JS wrapper could get collected between construction and
the notification getting shown, which was leading to the test flakiness.
No new tests, unskipped existing test.
* Modules/notifications/Notification.cpp:
(WebCore::Notification::Notification):
(WebCore::Notification::show):
(WebCore::Notification::finalize):
(WebCore::Notification::dispatchShowEvent):
(WebCore::Notification::dispatchClickEvent):
(WebCore::Notification::dispatchCloseEvent):
(WebCore::Notification::dispatchErrorEvent):
(WebCore::Notification::eventListenersDidChange):
(WebCore::Notification::virtualHasPendingActivity const):
* Modules/notifications/Notification.h:
2020-04-22 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WebCoreTestSupport target
https://bugs.webkit.org/show_bug.cgi?id=210867
Reviewed by Michael Catanzaro.
Add the WebKit::WebCoreTestSupport target. Modify WebCoreTestSupport to only
have a dependency on WebCore if WebCore is built as a shared library.
* CMakeLists.txt:
2020-04-22 Eric Carlson <eric.carlson@apple.com>
fast/events/event-handler-detached-document-dispatchEvent.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=210859
<rdar://problem/62072269>
Reviewed by Jer Noble.
A media session may not have a Page when it is created, so register with the MediaUsageManager
in inActiveDocumentChanged if necessary.
No new tests, fixes an existing test.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::~MediaElementSession):
(WebCore::MediaElementSession::addedMediaUsageManagerSessionIfNecessary):
(WebCore::MediaElementSession::inActiveDocumentChanged):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* html/MediaElementSession.h:
2020-04-22 Antti Koivisto <antti@apple.com>
REGRESSION (r249160): Deleting newline after pasting text ending in a newline results in a discontinuity
https://bugs.webkit.org/show_bug.cgi?id=210677
<rdar://problem/61954169>
Reviewed by Zalan Bujtas.
Test: fast/text/delete-line-break-in-pre.html
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::dirtyRange):
r249160 changed InlineTextBox end offset to be consistently first-past-end.
The code here that updates lineBreakPos needs to take this into account too.
2020-04-22 Antoine Quint <graouts@apple.com>
[Web Animations] Coordinate "update animations and send events" procedure across multiple timelines
https://bugs.webkit.org/show_bug.cgi?id=202109
<rdar://problem/59470821>
Reviewed by Dean Jackson.
So far, although we did manage multiple animation timelines per document, we mostly operated
under the assumption that there really was a single timeline. In this patch we make the
"update animations and send events" procedure, which is central to the lifecycle of animations,
work with multiple timelines such that a single microtask checkpoint is performed even with multiple
timelines, whereas we would perform one per timeline before. To do this, we move much of the logic
DocumentTimeline::updateAnimationsAndSendEvents() to DocumentTimelinesController where each step is
run across each timeline, rather than running all steps for each timeline one after the other,
respecting the single microtask checkpoint in the middle of the process.
To minimize code churn at this stage, we still keep a fair bit of logic in DocumentTimeline and,
while we remove updateAnimationsAndSendEvents(), internalUpdateAnimationsAndSendEvents() and
updateCurrentTime(), we expose three methods that allow to run the pre-flight sequence in
documentWillUpdateAnimationsAndSendEvents(), collect pending events in
prepareForPendingAnimationEventsDispatch() and run the post-flight sequence
in documentDidUpdateAnimationsAndSendEvents().
None of the logic changes, this is just moving code around. In the future, more patches will move
code from DocumentTimeline up to DocumentTimelinesController such that events are enqueued there,
and animation scheduling as well. But this already lets us pass a new test that used to flakily
reject promises in the WPT test web-animations/timing-model/timelines/update-and-send-events.html.
* animation/AnimationTimeline.h:
(WebCore::AnimationTimeline::relevantAnimations const):
(WebCore::AnimationTimeline::allAnimations const):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::documentWillUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::documentDidUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::prepareForPendingAnimationEventsDispatch):
(WebCore::DocumentTimeline::updateCurrentTime): Deleted.
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Deleted.
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents): Deleted.
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp:
(WebCore::DocumentTimelinesController::DocumentTimelinesController):
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/DocumentTimelinesController.h:
* animation/WebAnimationTypes.h:
* dom/Document.cpp:
(WebCore::Document::ensureTimelinesController):
2020-04-22 Eric Carlson <eric.carlson@apple.com>
[iOS] Add a quirk to keep gizmodo videos visible when playing in fullscreen.
https://bugs.webkit.org/show_bug.cgi?id=210857
<rdar://problem/58875327>
Reviewed by Jer Noble.
* page/Quirks.cpp:
(WebCore::Quirks::needsFullscreenDisplayNoneQuirk const):
* page/Quirks.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Drive-by fix: always
set the layer name to make debugging in release builds easier.
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer): Ditto.
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustForSiteSpecificQuirks const): Change `display:none` into
`display:block` on div with class "instream-native-video--mobile" when child video
element with id "vjs_video_3_html5_api" is in fullscreen.
2020-04-22 Chris Dumez <cdumez@apple.com>
Unreviewed, commit updated xcfilelist files.
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
2020-04-22 Chris Dumez <cdumez@apple.com>
Unreviewed, reverting r259116.
Broke login flow on some apple-internal sites
(rdar://problem/61905262)
Reverted changeset:
"Move applyUserAgentIfNeeded calls to a more central place"
https://bugs.webkit.org/show_bug.cgi?id=209587
https://trac.webkit.org/changeset/259116
2020-04-22 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Introduce TableFormattingContext::computeAndDistributeExtraVerticalSpace
https://bugs.webkit.org/show_bug.cgi?id=210830
Reviewed by Antti Koivisto.
Add a dedicated function to compute preferred heights for the table rows.
This is in preparation for the 2 pass layout required to finalize row height.
* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::computeBorderAndPadding):
* layout/FormattingContext.h:
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::computedPadding const):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraVerticalSpace):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
(WebCore::Layout::TableFormattingContext::positionTableCells): Deleted.
* layout/tableformatting/TableFormattingContext.h:
2020-04-22 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Several fixes to GdkEvent APIs for GTK4
https://bugs.webkit.org/show_bug.cgi?id=210856
Reviewed by Carlos Garcia Campos.
No tests needed.
Several fixes to GdkEvent API changes for GTK4. This is far from
complete but it allows the GTK4 build to move forward. When
possible, add GTK3-API replacements to GtkVersioning.h to avoid
#ifdef blocks, where the API changes are too complex, just #ifdef.
* platform/gtk/GtkUtilities.cpp:
(WebCore::wallTimeForEvent):
* platform/gtk/GtkVersioning.h:
(gdk_event_get_state):
(gdk_event_get_coords):
(gdk_event_get_root_coords):
(gdk_event_is_scroll_stop_event):
(gdk_event_get_scroll_direction):
(gdk_event_get_scroll_deltas):
(gdk_event_get_button):
(gdk_keymap_get_for_display): Deleted as it was wrong and
it's not needed.
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::currentCapsLockState):
(WebCore::PlatformKeyboardEvent::getCurrentModifierState):
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):
2020-04-22 Youenn Fablet <youenn@apple.com>
Simplify SWServerWorker::whenActivated logic
https://bugs.webkit.org/show_bug.cgi?id=210795
Reviewed by Alex Christensen.
Improve logging and ensure whenActivated can be called whatever the worker state is.
No change of behavior.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::didFinishInstall):
(WebCore::SWServer::fireInstallEvent):
(WebCore::SWServer::fireActivateEvent):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::whenActivated):
2020-04-22 Enrique Ocaña González <eocanha@igalia.com>
[GStreamer][MSE] Youtube 'live stream'/H264 URLs fail to play, VP8/9 URLs play OK
https://bugs.webkit.org/show_bug.cgi?id=209119
Reviewed by Xabier Rodriguez-Calvar.
The fix consists of removing the initial avoiding of seeking and just
issuing the proper segment instead of seeking (seeks in GStreamer can't
be done before prerolling anyway). Appsrc doesn't make easy to emit our
own custom segment, so what I did was to use a segment fixer probe to
modify the original [0, infinity] segment issued by appsrc and use
a [startTime, stopTime] with proper values depending on the seek target
and rate.
Covered by existing tests.
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::checkShouldDelaySeek): Don't hold seeks on startup, when changing from READY to PAUSED.
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Refactored seek delay condition. Also, don't do a regular
gst_element_seek() for initial seeks, just proceed with a special case in that situation.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
(initialSeekSegmentFixerProbe): Probe that fixes the segment.
(webKitMediaSrcPrepareInitialSeek): Behave much like a regular seek, but also compute the right GstSegment, install
the segment fixer probe and setReadyForMoreSamples() on the SourceBufferPrivates.
* platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.h:
2020-04-21 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Test IDLs and stubs
https://bugs.webkit.org/show_bug.cgi?id=209859
Reviewed by Dean Jackson and Youenn Fablet.
WebXR testing is hard as it might involve interaction with actual
devices. That's why the WebXR testing
API (https://immersive-web.github.io/webxr-test-api/) was
proposed. In fact, all the current WebXR tests from
web-platform-tests are using that testing API. This new testing
API supplements navigator.xr and is accessed through
navigator.xr.test.
In order not to expose the API to the web we're adding the XRTest
interface to Internals instead. The mapping from internals.xrTest to
navigator.xr.test happens in the WPT code.
We're adding the required IDLs and very basic (mostly empty)
implementations for testing methods. We're adding testing
infrastructure, adding tests make no sense for this change.
* CMakeLists.txt: Added new files.
* DerivedSources.make: Ditto.
* Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code.
* Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/WebCoreBuiltinNames.h: Added some new macros.
* testing/FakeXRBoundsPoint.h: Added.
* testing/FakeXRBoundsPoint.idl: Added.
* testing/FakeXRButtonStateInit.h: Added.
* testing/FakeXRButtonStateInit.idl: Added.
* testing/FakeXRInputSourceInit.h: Added.
* testing/FakeXRInputSourceInit.idl: Added.
* testing/FakeXRRigidTransformInit.h: Added.
* testing/FakeXRRigidTransformInit.idl: Added.
* testing/FakeXRViewInit.h: Added.
* testing/FakeXRViewInit.idl: Added.
* testing/Internals.cpp:
(WebCore::Internals::xrTest): Added WebXRTest to Internals.
* testing/Internals.h: Added xrTest() accessor.
* testing/Internals.idl: Added xrTest attribute.
* testing/WebFakeXRDevice.cpp: Added.
(WebCore::WebFakeXRDevice::setViews):
(WebCore::WebFakeXRDevice::disconnect):
(WebCore::WebFakeXRDevice::setViewerOrigin):
(WebCore::WebFakeXRDevice::clearViewerOrigin):
(WebCore::WebFakeXRDevice::simulateVisibilityChange):
(WebCore::WebFakeXRDevice::setBoundsGeometry):
(WebCore::WebFakeXRDevice::setFloorOrigin):
(WebCore::WebFakeXRDevice::clearFloorOrigin):
(WebCore::WebFakeXRDevice::simulateResetPose):
(WebCore::WebFakeXRDevice::simulateInputSourceConnection):
* testing/WebFakeXRDevice.h: Added.
* testing/WebFakeXRDevice.idl: Added.
* testing/WebFakeXRInputController.cpp: Added.
(WebCore::WebFakeXRInputController::setHandedness):
(WebCore::WebFakeXRInputController::setTargetRayMode):
(WebCore::WebFakeXRInputController::setProfiles):
(WebCore::WebFakeXRInputController::setGripOrigin):
(WebCore::WebFakeXRInputController::clearGripOrigin):
(WebCore::WebFakeXRInputController::setPointerOrigin):
(WebCore::WebFakeXRInputController::disconnect):
(WebCore::WebFakeXRInputController::reconnect):
(WebCore::WebFakeXRInputController::startSelection):
(WebCore::WebFakeXRInputController::endSelection):
(WebCore::WebFakeXRInputController::simulateSelect):
(WebCore::WebFakeXRInputController::setSupportedButtons):
(WebCore::WebFakeXRInputController::updateButtonState):
* testing/WebFakeXRInputController.h: Added.
* testing/WebFakeXRInputController.idl: Added.
* testing/WebXRTest.cpp: Added.
(WebCore::WebXRTest::simulateDeviceConnection const):
(WebCore::WebXRTest::simulateUserActivation):
(WebCore::WebXRTest::disconnectAllDevices):
* testing/WebXRTest.h: Added.
(WebCore::WebXRTest::create):
* testing/WebXRTest.idl: Added.
* testing/XRSimulateUserActivationFunction.h: Added.
* testing/XRSimulateUserActivationFunction.idl: Ditto.
2020-04-21 Antoine Quint <graouts@apple.com>
[Web Animations] Add a supporting object for Document to manage timelines
https://bugs.webkit.org/show_bug.cgi?id=210817
Reviewed by Dean Jackson.
Add a new DocumentTimelinesController object owned by Document to manage DocumentTimelines created for it. This simple piece of refactoring is the first
step towards a coordinated "update animations and send events" procedure where all timelines are updated at once with a single microtask checkpoint instead
of each timeline running one.
No change in behavior, so no new tests.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::~DocumentTimeline):
(WebCore::DocumentTimeline::controller const):
(WebCore::DocumentTimeline::detachFromDocument):
* animation/DocumentTimeline.h:
* animation/DocumentTimelinesController.cpp: Added.
(WebCore::DocumentTimelinesController::DocumentTimelinesController):
(WebCore::DocumentTimelinesController::~DocumentTimelinesController):
(WebCore::DocumentTimelinesController::addTimeline):
(WebCore::DocumentTimelinesController::removeTimeline):
(WebCore::DocumentTimelinesController::detachFromDocument):
(WebCore::DocumentTimelinesController::updateAnimationsAndSendEvents):
* animation/DocumentTimelinesController.h: Added.
* dom/Document.cpp:
(WebCore::Document::commonTeardown):
(WebCore::Document::ensureTimelinesController):
(WebCore::Document::updateAnimationsAndSendEvents): Deleted.
(WebCore::Document::addTimeline): Deleted.
(WebCore::Document::removeTimeline): Deleted.
* dom/Document.h:
(WebCore::Document::timelinesController const):
* page/Page.cpp:
(WebCore::Page::updateRendering):
2020-04-21 Cathie Chen <cathiechen@igalia.com>
REGRESSION (r254790): No longer get smooth scrolling on music.apple.com
https://bugs.webkit.org/show_bug.cgi?id=210634
Reviewed by Darin Adler.
The page uses the access of "scrollBehavior" in CSSStyleDeclaration as the support of scroll-behavior.
If supported, it will use scroll-behavior. Otherwise, it will perform a JS smooth scroll.
Currently, "scrollBehavior" is still available when CSSOMViewSmoothScrolling is off, only the value
"smooth" is invalidated.
In order to fix this, CSSStyleDeclaration will take account of CSSOMViewSmoothScrolling in Settings.
This patch also tries to provide an interface which let flags in Settings can enable/disable a property.
However, it is not complete, for there are some scenarios that Settings isn't accessible. By adding
"settings-flag" to CSSProperties.json, it would be effective to control the property access in CSSStyleDeclaration.
Tests: fast/scrolling/scroll-behavior-invalidate-if-disabled.html
fast/scrolling/scroll-behavior-validate-if-enabled.html
* css/CSSProperties.json:
* css/CSSStyleDeclaration.cpp:
(WebCore::CSSStyleDeclaration::getCSSPropertyIDFromJavaScriptPropertyName):
(WebCore::CSSStyleDeclaration::namedItem):
(WebCore::CSSStyleDeclaration::setNamedItem):
(WebCore::CSSStyleDeclaration::supportedPropertyNames const):
* css/makeprop.pl:
(addProperty):
* css/parser/CSSPropertyParser.cpp:
(WebCore::cssPropertyID):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyle::collectProperties const):
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2020-04-21 Yusuke Suzuki <ysuzuki@apple.com>
Canonicalize JSBigInt generated by structured-cloning by calling rightTrim
https://bugs.webkit.org/show_bug.cgi?id=210816
Reviewed by Keith Miller and Darin Adler.
Let's assume that the serialized data is slightly different. JSBigInt's internal representation has various invariants. For example, if JSBigInt is zero, it should have zero length,
and its sign should be false. But there are various ways of representing zero JSBigInt in serialization format. For example, we can set sign = true, length = 0. Current code strongly
assumes that dumped data meets this JSBigInt's internal invariant. This is not good: for example, if we add a new invariant into JSBigInt, already serialized data would not meet this
invariant.
In this patch, we call `JSBigInt::rightTrim(VM&)` when finishing JSBigInt deserialization. This means that we canonicalize JSBigInt when finishing creation, and this makes this serialization
format free from JSBigInt's internal invariants. This makes JSBigInt serialization/deserialization robust. And we also add lengthInUint64 == 0 path not to call rightTrim when it is zero.
This makes deserialization robust for zero-length & signed corrupted JSBigInt zero.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpBigInt32Data):
(WebCore::CloneDeserializer::readBigInt):
2020-04-21 Peng Liu <peng.liu6@apple.com>
platform/mac/media/audio-session-category-audio-autoplay.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=210826
Reviewed by Jer Noble.
For WebKitLegacy, AudioSession::setCategory() needs to set the category when
m_routingArbitrationClient is nullptr. This patch also fixes an error regarding
setupArbitrationOngoing.
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSession::setCategory):
2020-04-21 Peng Liu <peng.liu6@apple.com>
Fix MACCATALYST build failures
https://bugs.webkit.org/show_bug.cgi?id=210815
Reviewed by Tim Horton.
No new tests, no functional change.
* Configurations/FeatureDefines.xcconfig:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
2020-04-19 Darin Adler <darin@apple.com>
[Cocoa] Use createNSArray in many more places that build NSArray objects from C++ collections
https://bugs.webkit.org/show_bug.cgi?id=210702
Reviewed by Alex Christensen.
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilityFlowToElements]): Use createNSArray.
(-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]): Ditto.
(-[WebAccessibilityObjectWrapper rectsForSelectionRects:]): Deleted. Merged into
the method above.
* accessibility/mac/WebAccessibilityObjectWrapperBase.h: Take const references
instead of references when passing Path and FloatRect.
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(convertMathPairsToNSArray): Use createNSArray. Also use arrays on the stack
to create NSDictionary rather than using NSMutableDictionary.
(addChildToArray): Deleted.
(convertToNSArray): Uses createNSArray. Rolled addChildToArray in.
(-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Take const
reference instead of reference.
(-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]): Ditto.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
Use createNSArray.
* editing/cocoa/FontAttributesCocoa.mm:
(WebCore::FontAttributes::createDictionary const): Ditto.
* page/ios/FrameIOS.mm:
(WebCore::Frame::interpretationsForCurrentRoot const): Ditto.
* platform/cocoa/SearchPopupMenuCocoa.mm:
(WebCore::saveRecentSearches): Ditto.
* platform/cocoa/SharedBufferCocoa.mm:
(WebCore::SharedBuffer::createNSDataArray const): Ditto.
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update): Ditto.
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::update): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::PlatformCAAnimationCocoa::setValues): Ditto.
(WebCore::PlatformCAAnimationCocoa::setKeyTimes): Ditto.
(WebCore::PlatformCAAnimationCocoa::setTimingFunctions): Ditto.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
(WebCore::PlatformCAFilters::setFiltersOnLayer): Moved almost the whole
function into a call to createNSArray. Removed the default case from
the switch so we get a warning if we miss any filter operation types.
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(WebCore::PlatformCALayerCocoa::setSublayers): Use createNSArray.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write): Ditto.
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::mediaSelectionOptions): Ditto.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::write): Ditto.
* platform/mac/WebPlaybackControlsManager.mm:
(mediaSelectionOptions): Ditto.
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::setCookies): Ditto.
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest): Ditto.
* platform/network/cocoa/WebCoreNSURLSession.h:
Use the Objective-C type WebCoreNSURLSessionDataTask in the _dataTasks
set rather than using CFTypeRef.
* platform/network/cocoa/WebCoreNSURLSession.mm:
(-[WebCoreNSURLSession dealloc]): Remove now-unneeded typecast.
(-[WebCoreNSURLSession taskCompleted:]): Ditto.
(-[WebCoreNSURLSession finishTasksAndInvalidate]): Use a more idiomatic
form of capturing strongSelf in a lambda.
(-[WebCoreNSURLSession invalidateAndCancel]): Updated the type on a
local variable and removed now-unneeded typecast.
(-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Use RetainPtr
to cut down on autorelease. Use createNSArray, taking advantage of the
fact that it works on HashSet. Removed now-unneeded typecast.
(-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
(-[WebCoreNSURLSession dataTaskWithRequest:]): Remove now-unneeded typecast.
(-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
2020-04-21 Alexey Shvayka <shvaikalesh@gmail.com>
The visibilitychange event should bubble
https://bugs.webkit.org/show_bug.cgi?id=210829
Reviewed by Darin Adler.
This change makes `visibilitychange` event bubble as per spec [1], aligning WebKit
with Blink and Gecko. Also fixes broken spec link to `visibilityState` attribute.
[1] https://w3c.github.io/page-visibility/#dfn-now-visible-algorithm (step 2)
Test: fast/events/page-visibility-transition-test.html
* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):
(WebCore::Document::visibilityState const):
2020-04-21 Simon Fraser <simon.fraser@apple.com>
Composited layers are misplaced inside RTL overflow scroller with visible scrollbar
https://bugs.webkit.org/show_bug.cgi?id=210820
Reviewed by Zalan Bujtas.
RenderLayerBacking::computeParentGraphicsLayerRect() used renderBox.paddingBoxRectIncludingScrollbar()
to position layers inside composited overflow scroll, but this is wrong if the RTL left-side
scrollbar takes space.
Fix by making some static functions that we can call from the various places that ask
about box geometry, and using them.
Test: compositing/scrolling/async-overflow-scrolling/position-inside-rtl-overflow.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::overflowClipRect const):
(WebCore::RenderBox::clipRect const):
(WebCore::RenderBox::overflowClipRect): Deleted.
(WebCore::RenderBox::clipRect): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::overflowClipRectForChildLayers const):
(WebCore::RenderBox::overflowClipRectForChildLayers): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::scrollContainerLayerBox):
(WebCore::clippingLayerBox):
(WebCore::overflowControlsHostLayerBox):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::clipBox): Deleted.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::overflowClipRect const):
(WebCore::RenderTable::overflowClipRect): Deleted.
* rendering/RenderTable.h:
2020-04-21 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] Overflow that's hidden on one axis is scrollable on that axis
https://bugs.webkit.org/show_bug.cgi?id=210771
<rdar://problem/62080331>
Reviewed by Tim Horton.
eventCanScrollContents() should check the presence of enabled scrollbars, like
ScrollAnimator::handleWheelEvent() does.
Test: fast/scrolling/mac/async-scroll-overflow-hidden-on-one-axis.html
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
2020-04-21 Daniel Bates <dabates@apple.com>
[iOS] -_didFinishTextInteractionInTextInputContext should only zoom to reveal focused element if it changed
https://bugs.webkit.org/show_bug.cgi?id=210697
<rdar://problem/60997530>
Reviewed by Wenson Hsieh.
For now, add a comment about the return value of setFocusedElement: it returns
whether focus was blocked. If focused wasn't blocked then it will return true
even if the element wasn't actually focused. For example, it will return true
for non-focusable elements: <input disabled>.
I was tempted to fix setFocusedElement() to return true when it actually focused
the element or if the element was already focused, but I decided to defer this
until I audit the callers and run some tests.
* dom/Document.h:
2020-04-21 Andres Gonzalez <andresg_22@apple.com>
Fix for remoteParentObject and platformWidget not being stored properly in the AXIsolatedObject attributes variant.
https://bugs.webkit.org/show_bug.cgi?id=210809
Reviewed by Chris Fleizach.
Adding these properties to the AXIsolatedObject attributes variant as
WeakPtr<void*> fails. So they are now cached as member variables.
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::platformWidget const):
* accessibility/isolatedtree/AXIsolatedObject.h:
(WebCore::AXIsolatedObject::propertyValue const): Deleted.
* accessibility/isolatedtree/mac/AXIsolatedObjectMac.mm:
(WebCore::AXIsolatedObject::initializePlatformProperties):
(WebCore::AXIsolatedObject::remoteParentObject const):
2020-04-20 Simon Fraser <simon.fraser@apple.com>
Horizontal overflow overlay scrollbar is misplaced in RTL
https://bugs.webkit.org/show_bug.cgi?id=210673
<rdar://problem/61950751>
Reviewed by Antti Koivisto.
Code for positioning RenderLayer overflow controls (scrollbars and scroll corner)
was scattered across lots of different functions, making it hard to follow,
and prone to bugs.
Fix by making one source of truth, overflowControlsRects(), which computes
rects for the two scrollbars, the "scroll corner" (the square in the corner which
shows, only for non-overlay scrollbars, when both scrollbars or the resize control
is visible), and the resize control which shows when style specifies the "resize" property.
Call this function in all the places that need to know about overflow control
geometry. RenderLayer::hitTestResizerInFragments() is a little tricky because it wants
the resize control relative to the fragment rect; achieve this by computing the position
of the resizer rect relative to the border box, then shifting it into position relative
to the fragment bounds (which include border).
Test: compositing/overflow/rtl-scrollbar-layer-positioning.html
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollCornerRect const):
(WebCore::RenderLayer::overflowControlsRects const):
(WebCore::RenderLayer::scrollbarOffset const):
(WebCore::RenderLayer::invalidateScrollbarRect):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::overflowControlsIntersectRect const):
(WebCore::RenderLayer::paintResizer):
(WebCore::RenderLayer::isPointInResizeControl const):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::hitTestResizerInFragments const):
(WebCore::cornerStart): Deleted.
(WebCore::cornerRect): Deleted.
(WebCore::resizerCornerRect): Deleted.
(WebCore::RenderLayer::scrollCornerAndResizerRect const): Deleted.
(WebCore::RenderLayer::rectForHorizontalScrollbar const): Deleted.
(WebCore::RenderLayer::rectForVerticalScrollbar const): Deleted.
(WebCore::RenderLayer::verticalScrollbarStart const): Deleted.
(WebCore::RenderLayer::horizontalScrollbarStart const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
(WebCore::RenderLayerBacking::positionOverflowControlsLayers):
(WebCore::RenderLayerBacking::paintContents):
2020-04-21 Sergio Villar Senin <svillar@igalia.com>
Unreviewed, reverting r260432.
Broke WPE build
Reverted changeset:
"[WebXR] Test IDLs and stubs"
https://bugs.webkit.org/show_bug.cgi?id=209859
https://trac.webkit.org/changeset/260432
2020-04-21 Chris Dumez <cdumez@apple.com>
REGRESSION (r256808): “A problem repeatedly occurred” when attempting to load https://bungalow.com/listings/bay-area
https://bugs.webkit.org/show_bug.cgi?id=210801
<rdar://problem/61658940>
Reviewed by Antti Koivisto.
Even though the page uses the 'async' attribute on the mapbox-gl.js script, deferring the execution of this
script gets the page into a bad state, causing it to use a lot of CPU & memory until the process crashes.
Since we don't have any other evidence of breakage from r256808 yet and since r256808 was a massive PLT
progression, I am opting to add a quirk to disable the async script optimization on bungalow.com for now.
* dom/Document.cpp:
(WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
* page/Quirks.cpp:
(WebCore::Quirks::shouldBypassAsyncScriptDeferring const):
* page/Quirks.h:
* platform/RegistrableDomain.h:
(WebCore::RegistrableDomain::operator== const):
2020-04-16 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Test IDLs and stubs
https://bugs.webkit.org/show_bug.cgi?id=209859
Reviewed by Dean Jackson and Youenn Fablet.
WebXR testing is hard as it might involve interaction with actual
devices. That's why the WebXR testing
API (https://immersive-web.github.io/webxr-test-api/) was
proposed. In fact, all the current WebXR tests from
web-platform-tests are using that testing API. This new testing
API supplements navigator.xr and is accessed through
navigator.xr.test.
In order not to expose the API to the web we're adding the XRTest
interface to Internals instead. The mapping from internals.xrTest to
navigator.xr.test happens in the WPT code.
We're adding the required IDLs and very basic (mostly empty)
implementations for testing methods. We're adding testing
infrastructure, adding tests make no sense for this change.
* CMakeLists.txt: Added new files.
* DerivedSources.make: Ditto.
* Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code.
* Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods.
* Sources.txt: Added new files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/WebCoreBuiltinNames.h: Added some new macros.
* testing/FakeXRBoundsPoint.h: Added.
* testing/FakeXRBoundsPoint.idl: Added.
* testing/FakeXRButtonStateInit.h: Added.
* testing/FakeXRButtonStateInit.idl: Added.
* testing/FakeXRInputSourceInit.h: Added.
* testing/FakeXRInputSourceInit.idl: Added.
* testing/FakeXRRigidTransformInit.h: Added.
* testing/FakeXRRigidTransformInit.idl: Added.
* testing/FakeXRViewInit.h: Added.
* testing/FakeXRViewInit.idl: Added.
* testing/Internals.cpp:
(WebCore::Internals::xrTest): Added WebXRTest to Internals.
* testing/Internals.h: Added xrTest() accessor.
* testing/Internals.idl: Added xrTest attribute.
* testing/WebFakeXRDevice.cpp: Added.
(WebCore::WebFakeXRDevice::setViews):
(WebCore::WebFakeXRDevice::disconnect):
(WebCore::WebFakeXRDevice::setViewerOrigin):
(WebCore::WebFakeXRDevice::clearViewerOrigin):
(WebCore::WebFakeXRDevice::simulateVisibilityChange):
(WebCore::WebFakeXRDevice::setBoundsGeometry):
(WebCore::WebFakeXRDevice::setFloorOrigin):
(WebCore::WebFakeXRDevice::clearFloorOrigin):
(WebCore::WebFakeXRDevice::simulateResetPose):
(WebCore::WebFakeXRDevice::simulateInputSourceConnection):
* testing/WebFakeXRDevice.h: Added.
* testing/WebFakeXRDevice.idl: Added.
* testing/WebFakeXRInputController.cpp: Added.
(WebCore::WebFakeXRInputController::setHandedness):
(WebCore::WebFakeXRInputController::setTargetRayMode):
(WebCore::WebFakeXRInputController::setProfiles):
(WebCore::WebFakeXRInputController::setGripOrigin):
(WebCore::WebFakeXRInputController::clearGripOrigin):
(WebCore::WebFakeXRInputController::setPointerOrigin):
(WebCore::WebFakeXRInputController::disconnect):
(WebCore::WebFakeXRInputController::reconnect):
(WebCore::WebFakeXRInputController::startSelection):
(WebCore::WebFakeXRInputController::endSelection):
(WebCore::WebFakeXRInputController::simulateSelect):
(WebCore::WebFakeXRInputController::setSupportedButtons):
(WebCore::WebFakeXRInputController::updateButtonState):
* testing/WebFakeXRInputController.h: Added.
* testing/WebFakeXRInputController.idl: Added.
* testing/WebXRTest.cpp: Added.
(WebCore::WebXRTest::simulateDeviceConnection const):
(WebCore::WebXRTest::simulateUserActivation):
(WebCore::WebXRTest::disconnectAllDevices):
* testing/WebXRTest.h: Added.
(WebCore::WebXRTest::create):
* testing/WebXRTest.idl: Added.
* testing/XRSimulateUserActivationFunction.h: Added.
* testing/XRSimulateUserActivationFunction.idl: Ditto.
2020-04-21 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Adapt to GtkIconTheme API changes
https://bugs.webkit.org/show_bug.cgi?id=210745
Reviewed by Adrian Perez de Castro.
No new tests needed.
GtkIconTheme changes in GTK and since we're no longer following
the theme we can drop the missing image from the icon theme, so remove
now unnecessary code.
* platform/graphics/gtk/ImageGtk.cpp:
(WebCore::Image::loadPlatformResource): Directly load image from compiled
GResource.
(WebCore::loadResourceSharedBuffer): Deleted.
(WebCore::loadMissingImageIconFromTheme): Deleted.
2020-04-21 Rob Buis <rbuis@igalia.com>
Exit early in FrameLoader::loadURL when redirecting to another frame
https://bugs.webkit.org/show_bug.cgi?id=210751
Reviewed by Geoffrey Garen.
Exit early in FrameLoader::loadURL when redirecting to another frame, previously we were preparing
request needlessly, doing it twice in case of frame redirecting. Also move some variables to
where they are actually used.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
* loader/FrameLoader.h:
2020-04-21 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove PlatformMouseEventGtk
https://bugs.webkit.org/show_bug.cgi?id=210743
Reviewed by Adrian Perez de Castro.
It's unused, we no longer create PlatformMouseEvent from a GdkEvent since WebKit2.
* SourcesGTK.txt:
* platform/PlatformMouseEvent.h:
* platform/gtk/PlatformMouseEventGtk.cpp: Removed.
2020-04-21 Claudio Saavedra <csaavedra@igalia.com>
[GTK4] Fix platform GDK includes
https://bugs.webkit.org/show_bug.cgi?id=210746
Reviewed by Carlos Garcia Campos.
* platform/graphics/PlatformDisplay.cpp: Wayland, X11, etc.
platform includes changed path, so update accordingly.
2020-04-21 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes late February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=210767
Unreviewed build fix.
No new tests needed.
* css/MediaQueryListEvent.cpp: Add missing wtf/IsoMallocInlines.h header.
* css/MediaQueryMatcher.cpp: Add missing MediaQueryListEvent.h header.
* platform/graphics/FloatQuad.cpp: Add missing wtf/text/TextStream.h header.
2020-04-20 Ross Kirsling <ross.kirsling@sony.com>
Classes marked final should not use protected access specifier
https://bugs.webkit.org/show_bug.cgi?id=210775
Reviewed by Daniel Bates.
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
* Modules/applepay/ApplePayValidateMerchantEvent.h:
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h:
* Modules/webaudio/BiquadDSPKernel.h:
* Modules/webaudio/WaveShaperDSPKernel.h:
* Modules/websockets/WebSocketChannel.h:
* Modules/websockets/WorkerThreadableWebSocketChannel.h:
* Modules/webxr/WebXRSession.h:
* Modules/webxr/WebXRSystem.h:
* accessibility/AccessibilityARIAGridCell.h:
* accessibility/AccessibleSetValueEvent.h:
* animation/CSSAnimation.h:
* bindings/js/ReadableStream.h:
* bridge/objc/objc_runtime.h:
* bridge/runtime_array.h:
* css/CSSImageSetValue.h:
* html/HTMLKeygenElement.cpp:
* html/canvas/WebGLBuffer.h:
* html/canvas/WebGLFramebuffer.h:
* html/canvas/WebGLProgram.h:
* html/canvas/WebGLQuery.h:
* html/canvas/WebGLRenderbuffer.h:
* html/canvas/WebGLSampler.h:
* html/canvas/WebGLSync.h:
* html/canvas/WebGLTransformFeedback.h:
* html/canvas/WebGLUniformLocation.h:
* html/shadow/TextControlInnerElements.h:
* inspector/InspectorStyleSheet.h:
* inspector/WebInjectedScriptManager.h:
* loader/cache/CachedCSSStyleSheet.h:
* page/Frame.h:
* page/FrameView.h:
* page/PageConsoleClient.h:
* page/animation/KeyframeAnimation.h:
* page/scrolling/nicosia/ScrollingTreeOverflowScrollProxyNode.h:
* platform/audio/AudioBus.h:
* platform/cocoa/PlaybackSessionModelMediaElement.h:
* platform/graphics/BitmapImage.h:
* platform/graphics/CrossfadeGeneratedImage.h:
* platform/graphics/NamedImageGeneratedImage.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
* platform/graphics/ca/win/PlatformCAAnimationWin.h:
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/iso/ISOOriginalFormatBox.h:
* platform/graphics/iso/ISOProtectionSchemeInfoBox.h:
* platform/graphics/iso/ISOSchemeInformationBox.h:
* platform/graphics/iso/ISOSchemeTypeBox.h:
* platform/graphics/iso/ISOTrackEncryptionBox.h:
* platform/graphics/iso/ISOVTTCue.cpp:
* platform/graphics/iso/ISOVTTCue.h:
* platform/graphics/win/ImageDecoderDirect2D.h:
* platform/mediastream/mac/AVCaptureDeviceManager.h:
* platform/mock/mediasource/MockBox.h:
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* rendering/RenderFullScreen.h:
* rendering/RenderGrid.h:
* rendering/RenderMultiColumnSet.h:
* rendering/RenderRuby.h:
* rendering/RenderScrollbarPart.h:
* rendering/RenderScrollbarTheme.h:
* rendering/RenderTableCell.h:
* rendering/RenderTableSection.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderView.h:
* rendering/svg/RenderSVGResourceClipper.h:
* svg/SVGTextPathElement.h:
* workers/WorkerConsoleClient.h:
* worklets/Worklet.h:
2020-04-20 Peng Liu <peng.liu6@apple.com>
Fix build failures when video fullscreen and picture-in-picture is disabled
https://bugs.webkit.org/show_bug.cgi?id=210777
Reviewed by Eric Carlson.
Wrap video fullscreen and picture-in-picture related code with "#if ENABLE(VIDEO_PRESENTATION_MODE)".
* Configurations/FeatureDefines.xcconfig:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.h:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
(WebCore::VideoLayerManagerObjC::setVideoLayer):
(WebCore::VideoLayerManagerObjC::requiresTextTrackRepresentation const):
(WebCore::VideoLayerManagerObjC::syncTextTrackBounds):
(WebCore::VideoLayerManagerObjC::setTextTrackRepresentation):
2020-04-20 Nikos Mouchtaris <nmouchtaris@apple.com>
WK2 Quicklook for attachments
https://bugs.webkit.org/show_bug.cgi?id=208891
Reviewed by Darin Adler.
Added to HTMLAttachmentElement to have member image representing
QuickLook thumbnail. Added code to render this image on both iOS and Mac.
No new tests. Test will be added after additions to test infrastructure.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::updateThumbnailRepresentation):
Allow setting of thumbnail member.
* html/HTMLAttachmentElement.h:
* rendering/RenderThemeIOS.mm:
Added rendering of image member of attachment element.
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
(WebCore::paintAttachmentIcon):
(WebCore::RenderThemeIOS::paintAttachment):
* rendering/RenderThemeMac.mm:
(WebCore::paintAttachmentIcon):
2020-04-20 Yusuke Suzuki <ysuzuki@apple.com>
Add more structure-cloning tests for BigInt
https://bugs.webkit.org/show_bug.cgi?id=210765
Reviewed by Mark Lam.
This patch adds safe-guard for future JSC primitive extension for structure-cloning.
We throw DataCloneError if we see unknown primitive value, which can happen if JSC
extends primitive value.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImmediate):
(WebCore::CloneSerializer::dumpIfTerminal):
2020-04-20 Simon Fraser <simon.fraser@apple.com>
Scrolling with background-attachment: fixed needs to trigger repaints
https://bugs.webkit.org/show_bug.cgi?id=193893
<rdar://problem/47587017>
Reviewed by Dean Jackson.
When scrolling an overflow scroll which has "background-atttachment:fixed" in the content,
the node will have non-empty synchronous scrolling reasons. In this case we need to
send the scroll to the main thread, and trigger a repaint on scroll.
If handling the wheel event on the scrolling thread determines that the scroll must be sent
to the main thread, EventDispatcher::wheelEvent() does so in the callback function.
To trigger the repaint, RenderLayer::scrollTo() asks the composited layers backing whether
the node has synchronous scrolling reasons; this is implemented by asking the scrolling
coordinator.
Test: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-repaint.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::hasSynchronousScrollingReasons const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::hasSynchronousScrollingReasons const):
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::hasSynchronousScrollingReasons const):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::currentScrollPositionChanged):
* page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
(WebCore::ScrollingTreeOverflowScrollingNodeMac::handleWheelEvent): Return SendToMainThread if this node
needs to do synchronous scrolling.
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::needsRepaintOnCompositedScroll const):
(WebCore::RenderLayerBacking::setRequiresOwnBackingStore):
(WebCore::RenderLayerBacking::setContentsNeedDisplay):
* rendering/RenderLayerBacking.h:
2020-04-20 Fujii Hironori <Hironori.Fujii@sony.com>
MSVC: LayoutUnits.h(248): warning C4245: 'argument': conversion from 'const int' to 'size_t', signed/unsigned mismatch
https://bugs.webkit.org/show_bug.cgi?id=210592
Reviewed by Zalan Bujtas.
* layout/LayoutUnits.h:
(WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
Use std::numeric_limits<size_t>::max() for empty and deleted
values instead of WebCore::intMinForLayoutUnit.
2020-04-20 Wenson Hsieh <wenson_hsieh@apple.com>
Text manipulation sometimes fails to replace text in title elements
https://bugs.webkit.org/show_bug.cgi?id=210750
<rdar://problem/61066103>
Reviewed by Tim Horton and Darin Adler.
Internal clients using WebKit text manipulation APIs currently fail to replace text in title and option elements
in the case where text manipulation has been completed with more than one token. These are elements for which we
want to replace the entire text as a single token, even if the text manipulation client ends up breaking the
token into multiple chunks.
To handle this case, pull the `title || option` check out into a helper function, and consult it when completing
text manipulation in the case where the manipulation data lacks either start or end positions. If
`canPerformTextManipulationByReplacingEntireTextContent` is true and there are multiple replacement tokens,
allow ourselves to process the replacement by combining the replacement tokens into a space-separated string.
Test: TextManipulation.CompleteTextManipulationShouldReplaceTextContentWithMultipleTokens
* editing/TextManipulationController.cpp:
(WebCore::canPerformTextManipulationByReplacingEntireTextContent):
(WebCore::TextManipulationController::observeParagraphs):
(WebCore::TextManipulationController::replace):
2020-04-20 Andres Gonzalez <andresg_22@apple.com>
The rect for the primary screen should be retrieved on the main thread.
https://bugs.webkit.org/show_bug.cgi?id=210760
Reviewed by Chris Fleizach.
- Call to screenRectForPrimaryScreen is dispatched to main thread.
- This value is cached since it is very unlikely to change in normal
usage and this would avoid hitting the main thread repeatedly.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper primaryScreenHeight]):
2020-04-15 Sergio Villar Senin <svillar@igalia.com>
[WebXR] Update WebXRSession and WebXRSystem interfaces
https://bugs.webkit.org/show_bug.cgi?id=210553
Reviewed by Žan Doberšek.
Update WebXRSession and WebXRSystem to the latest changes in the specs.
* Modules/webxr/WebXRSession.idl: Added 3 new events.
* Modules/webxr/WebXRSystem.idl: Interface name is XR not XRSystem.
* bindings/js/WebCoreBuiltinNames.h: Renamed macro.
* dom/EventNames.h: Added 3 new events.
2020-04-20 Chris Dumez <cdumez@apple.com>
Sending beacons when Fetch KeepAlive feature is disabled crashes the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=210753
<rdar://problem/61896221>
Reviewed by Geoffrey Garen.
Test: http/wpt/beacon/beacon-legacy-code-path.html
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setFetchAPIKeepAliveEnabled):
* testing/InternalSettings.h:
* testing/InternalSettings.idl:
Add internal settings to disable Fetch Keep Alive for layout testing.
2020-04-20 Youenn Fablet <youenn@apple.com>
MediaPlayerPrivateMediaStreamAVFObjC should start play a newly added audio track if it is playing
https://bugs.webkit.org/show_bug.cgi?id=210740
Reviewed by Eric Carlson.
Before the patch, MediaPlayerPrivateMediaStreamAVFObjC was not calling play on the audio renderer when the audio renderer
was added after the MediaPlayerPrivateMediaStreamAVFObjC was asked to play.
This patch makes it so that, on configuration of an audio track, it will be asked to play if its MediaPlayerPrivateMediaStreamAVFObjC is playing.
Add internals API to be able to write a test.
Test: fast/mediastream/play-newly-added-audio-track.html
* html/track/AudioTrack.h:
* html/track/AudioTrack.idl:
* platform/graphics/AudioTrackPrivate.h:
(WebCore::AudioTrackPrivate::isBackedByMediaStreamTrack const):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
* platform/mediastream/AudioTrackPrivateMediaStream.cpp:
(WebCore::AudioTrackPrivateMediaStream::play):
* platform/mediastream/AudioTrackPrivateMediaStream.h:
(isType):
* testing/Internals.cpp:
(WebCore::Internals::isMockRealtimeMediaSourceCenterEnabled):
(WebCore::Internals::shouldAudioTrackPlay):
* testing/Internals.h:
* testing/Internals.idl:
2020-04-20 Youenn Fablet <youenn@apple.com>
Use a WeakHashSet to store MediaStreamPrivate observers
https://bugs.webkit.org/show_bug.cgi?id=210494
Reviewed by Eric Carlson.
Remove observers from the MediaStream and migrate existing client (MediaRecorder) to MediaStreamPrivate::Observer.
Make use of WeakHashSet in MediaStreamPrivate to improve robustness of the code.
Any time the MediaStreamPrivate tracks are modified, observers will be notified.
MediaStream needs now to decide when to send an event when its MediaStreamPrivate notifies of new/deleted tracks,
Modernize a bit the code to use more references.
Covered by existing tests.
* Modules/mediarecorder/MediaRecorder.cpp:
(WebCore::MediaRecorder::MediaRecorder):
(WebCore::MediaRecorder::~MediaRecorder):
(WebCore::MediaRecorder::handleTrackChange):
* Modules/mediarecorder/MediaRecorder.h:
* Modules/mediastream/MediaStream.cpp:
(WebCore::createTrackPrivateVector):
(WebCore::MediaStream::MediaStream):
(WebCore::MediaStream::~MediaStream):
(WebCore::MediaStream::addTrack):
(WebCore::MediaStream::removeTrack):
(WebCore::MediaStream::getTrackById):
(WebCore::MediaStream::didAddTrack):
(WebCore::MediaStream::didRemoveTrack):
(WebCore::MediaStream::addTrackFromPlatform):
(WebCore::MediaStream::internalAddTrack):
(WebCore::MediaStream::internalTakeTrack):
* Modules/mediastream/MediaStream.h:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::MediaStreamPrivate):
(WebCore::MediaStreamPrivate::addObserver):
(WebCore::MediaStreamPrivate::removeObserver):
(WebCore::MediaStreamPrivate::forEachObserver):
(WebCore::MediaStreamPrivate::computeActiveState):
(WebCore::MediaStreamPrivate::updateActiveState):
(WebCore::MediaStreamPrivate::addTrack):
(WebCore::MediaStreamPrivate::removeTrack):
(WebCore::MediaStreamPrivate::trackEnded):
* platform/mediastream/MediaStreamPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::removeMediaStreamTrack):
2020-04-19 Simon Fraser <simon.fraser@apple.com>
Content disappears on CSS parallax example
https://bugs.webkit.org/show_bug.cgi?id=210732
<rdar://problem/61997636>
Reviewed by Darin Adler.
If scrolling affects the computation of coverage rect of a TiledBacking, we plumb
that expanded coverage back into TransformState which is maintained during GraphicsLayer flushing,
and it's used to compute coverage rect for descendants.
It's passed into TransformState::setLastPlanarSecondaryQuad(), which has to map it back into
the coordinate system of the last flattening ancestor. However, TransformState::mapQuad()
had a missing return and the quad mapping was wrong. The new code is now the same as
TransformState::mappedPoint() (you can see where the copy/paste error came from).
Test: compositing/tiling/coverage-adjustment-secondary-quad-mapping.html
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::mapQuad const):
(WebCore::TransformState::flattenWithTransform):
2020-04-20 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for border-collapse: collapse.
https://bugs.webkit.org/show_bug.cgi?id=210747
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-flex-width-border-collapse.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
2020-04-20 Wenson Hsieh <wenson_hsieh@apple.com>
Oversized caret and selection rects in text fields on ganji.com and netflix.com/login
https://bugs.webkit.org/show_bug.cgi?id=210622
<rdar://problem/45945636>
Reviewed by Darin Adler.
Currently, selection and caret rects in text fields on some web pages can be excessively tall. This patch makes
a small adjustment to allow the top of the caret or selection rect to snap to the top of the inline box instead
of being at the end of the previous line, in the case where there is no previous inline box.
In the case where we compute the caret rect for an empty renderer (i.e. no children), we make an additional
tweak so that the caret rect's height is based on the computed font height instead of line height, and then we
ensure that the caret is (logically) vertically centered.
See below for more details.
Test: editing/selection/selection-and-caret-do-not-extend-to-line-height.html
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::positionForPointWithInlineChildren):
Specify ForHitTesting::Yes when asking for selectionTop().
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::localCaretRectForEmptyElement):
Use FontMetric's height when computing the height of the caret rect, and then center it vertically in the
renderer.
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::positionForPoint):
Specify ForHitTesting::Yes when asking for selectionTop(). See below for more information.
* rendering/RenderTextLineBoxes.cpp:
(WebCore::RenderTextLineBoxes::positionForPoint const):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::selectionTop const):
When computing selectionTop(), we currently fall back to using the top of the containing RenderBlockFlow
(`blockFlow().borderAndPaddingBefore()`) in the case where there is no previous root box. However, this can lead
to selection and caret rects being taller than expected; instead, we can use the max of the `selectionTop`
(that is, the top of the line box, adjusted for annotations) and the top of the RenderBlockFlow. This has the
effect of allowing the caret and selection to visually snap to the top of a run of text, provided there is not
already a line of text that precedes it. Taking the maximum of the two values ensures that we don't
unintentionally make the selection or caret rects even larger, if the line top is above the top of the block.
Note that we also avoid shrinking the selection and caret rects when hit-testing renderers for positions and
ranges. This allows users to still click and drag to select text in the extra line-height area above a piece of
text, even if the selection is only painted over the text (and not in the region containing the line-height).
This behavior was established in the fix for webkit.org/b/14911, and is covered by the layout test
`editing/selection/inline-closest-leaf-child.html`.
* rendering/RootInlineBox.h:
2020-04-20 Darin Adler <darin@apple.com>
Use #import instead of #include in Objective-C and don't use #pragma once
https://bugs.webkit.org/show_bug.cgi?id=210724
Reviewed by David Kilzer.
* page/cocoa/SettingsBaseCocoa.mm:
(WebCore::sansSerifTraditionalHanFontFamily): Deleted.
(WebCore::sansSerifSimplifiedHanFontFamily): Deleted.
(WebCore::SettingsBase::initializeDefaultFontFamilies): Just use font name
strings directly since there are no conditionals any more.
* Modules/applepay/PaymentRequestValidator.mm:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
* accessibility/mac/AXObjectCacheMac.mm:
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.h:
* bridge/objc/WebScriptObjectPrivate.h:
* bridge/objc/objc_class.mm:
* bridge/testbindings.mm:
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
* editing/cocoa/WebArchiveResourceFromNSAttributedString.h:
* editing/cocoa/WebArchiveResourceWebResourceHandler.h:
* editing/cocoa/WebContentReaderCocoa.mm:
* history/mac/HistoryItemMac.mm:
* loader/cocoa/DiskCacheMonitorCocoa.mm:
* loader/cocoa/SubresourceLoaderCocoa.mm:
* loader/mac/ResourceLoaderMac.mm:
* page/cocoa/MemoryReleaseCocoa.mm:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
* page/cocoa/ResourceUsageThreadCocoa.mm:
* page/ios/WebEventRegion.h:
* page/mac/ChromeMac.mm:
* page/mac/EventHandlerMac.mm:
* page/mac/WheelEventDeltaFilterMac.mm:
* page/scrolling/cocoa/ScrollingStateNode.mm:
* page/scrolling/mac/ScrollingCoordinatorMac.mm:
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
* page/scrolling/mac/ScrollingStateScrollingNodeMac.mm:
* page/scrolling/mac/ScrollingThreadMac.mm:
* page/scrolling/mac/ScrollingTreeMac.mm:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
* platform/audio/mac/AudioSampleDataSource.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.mm:
* platform/cocoa/PasteboardCocoa.mm:
* platform/cocoa/ScrollSnapAnimatorState.mm:
* platform/cocoa/SystemVersion.mm:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
* platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
* platform/graphics/avfoundation/objc/VideoLayerManagerObjC.mm:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/graphics/ca/cocoa/WebSystemBackdropLayer.h:
* platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
* platform/graphics/ca/cocoa/WebVideoContainerLayer.h:
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
* platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
* platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
* platform/graphics/cocoa/WebGPULayer.h:
* platform/graphics/cocoa/WebGPULayer.mm:
* platform/graphics/cv/ImageRotationSessionVT.mm:
* platform/graphics/cv/ImageTransferSessionVT.mm:
* platform/graphics/cv/TextureCacheCV.mm:
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
* platform/graphics/gpu/cocoa/GPUComputePassEncoderMetal.mm:
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
* platform/graphics/mac/FloatPointMac.mm:
* platform/graphics/mac/FloatSizeMac.mm:
* platform/graphics/mac/IntPointMac.mm:
* platform/graphics/mac/IntSizeMac.mm:
* platform/graphics/mac/WebLayer.h:
* platform/graphics/mac/WebLayer.mm:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileGrid.mm:
* platform/ios/LegacyTileGridTile.mm:
* platform/ios/LegacyTileLayer.h:
* platform/ios/LegacyTileLayer.mm:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/LocalCurrentTraitCollection.mm:
* platform/ios/LocalizedDeviceModel.mm:
* platform/ios/ScrollbarThemeIOS.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebItemProviderPasteboard.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.h:
* platform/mac/LocalCurrentGraphicsContext.mm:
* platform/mac/LocalDefaultSystemAppearance.mm:
* platform/mac/LoggingMac.mm:
* platform/mac/PlatformEventFactoryMac.mm:
* platform/mac/RemoteCommandListenerMac.mm:
* platform/mac/ScrollAnimatorMac.mm:
* platform/mac/SerializedPlatformDataCueMac.mm:
* platform/mac/WebCoreFullScreenPlaceholderView.mm:
* platform/mac/WebCoreFullScreenWarningView.h:
* platform/mac/WebCoreFullScreenWarningView.mm:
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreObjCExtras.mm:
* platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
* platform/mediasession/mac/MediaSessionInterruptionProviderMac.mm:
* platform/mediastream/ios/AVAudioSessionCaptureDevice.mm:
* platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.mm:
* platform/mediastream/mac/RealtimeVideoUtilities.mm:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
* platform/network/cocoa/CertificateInfoCocoa.mm:
* platform/network/cocoa/WebCoreNSURLSession.h:
* platform/network/mac/BlobDataFileReferenceMac.mm:
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/SynchronousLoaderClient.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/text/cocoa/LocaleCocoa.mm:
* testing/ServiceWorkerInternals.mm:
* testing/cocoa/WebViewVisualIdentificationOverlay.h:
More #import, less #pragma once.
2020-04-20 Youenn Fablet <youenn@apple.com>
Safari doesn't apply frameRate limit when request stream from Camera
https://bugs.webkit.org/show_bug.cgi?id=210186
<rdar://problem/61452794>
Reviewed by Eric Carlson.
Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source.
This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate.
Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource.
Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource.
Fix mock capture source to update its frame rate when asked by applyConstraints.
Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html
fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-increasing.html
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
* platform/mediastream/RealtimeVideoCaptureSource.h:
(WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource):
(WebCore::m_source):
(WebCore::RealtimeVideoSource::adaptVideoSample):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
* testing/Internals.cpp:
(WebCore::Internals::observeMediaStreamTrack):
2020-04-20 Antoine Quint <graouts@apple.com>
WebAnimations API doesn't properly apply keyframe easings to transforms
https://bugs.webkit.org/show_bug.cgi?id=210526
<rdar://problem/61800424>
Reviewed by Antti Koivisto.
GraphicsLayerCA has code that determines whether an animation can be accelerated looking at the timing function of its keyframes and excluding
animations that use a steps timing function as one of its values. However, we we would fail to set the timing function on the KeyframeValue for
each keyframe in the KeyframeList we create for a JS-originated animation. We now do this correctly.
Test: webanimations/transform-animation-with-steps-timing-function-not-accelerated.html
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::updateBlendingKeyframes):
2020-04-20 Yusuke Suzuki <ysuzuki@apple.com>
StructuredClone algorithm should be aware of BigInt
https://bugs.webkit.org/show_bug.cgi?id=210728
Reviewed by Mark Lam.
This patch adds structured-cloning for BigInt and BigIntObject.
The logic is adding BigIntTag & BigIntObjectTag. And then we put content of BigInt with length.
And deserialization reads them to reconstruct BigInt or BigIntObject.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpImmediate):
(WebCore::CloneSerializer::dumpBigIntData):
(WebCore::CloneSerializer::dumpBigInt32Data):
(WebCore::CloneSerializer::dumpHeapBigIntData):
(WebCore::CloneSerializer::dumpIfTerminal):
(WebCore::CloneDeserializer::readBigInt):
(WebCore::CloneDeserializer::readTerminal):
2020-04-20 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Enable resource load statistics
https://bugs.webkit.org/show_bug.cgi?id=210184
Reviewed by Žan Doberšek.
* platform/network/soup/NetworkStorageSessionSoup.cpp:
(WebCore::NetworkStorageSession::setCookiesFromDOM const): Return early if cookies are blocked and update the
persistent cookies expiration if needed.
(WebCore::NetworkStorageSession::deleteCookiesForHostnames): Implement this when receiving
IncludeHttpOnlyCookies parameter.
(WebCore::NetworkStorageSession::hasCookies const): Implement this.
(WebCore::NetworkStorageSession::getRawCookies const): Honor shouldAskITP parameter.
(WebCore::cookiesForSession): Ditto.
(WebCore::NetworkStorageSession::cookiesForDOM const): Ditto.
(WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const): Ditto.
2020-04-19 Simon Fraser <simon.fraser@apple.com>
Use Optional<FloatQuad> in TransformState
https://bugs.webkit.org/show_bug.cgi?id=144226
Reviewed by Sam Weinig.
Use Optional<> instead of pointers in TransformState, make it loggable, make FloatQuad loggable.
* platform/graphics/FloatQuad.cpp:
(WebCore::operator<<):
* platform/graphics/FloatQuad.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::flushCompositingState):
(WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
* platform/graphics/transforms/TransformState.cpp:
(WebCore::TransformState::operator=):
(WebCore::TransformState::mappedSecondaryQuad const):
(WebCore::TransformState::setLastPlanarSecondaryQuad):
(WebCore::TransformState::flattenWithTransform):
(WebCore::operator<<):
* platform/graphics/transforms/TransformState.h:
(WebCore::TransformState::setSecondaryQuad):
(WebCore::TransformState::lastPlanarSecondaryQuad const):
(WebCore::TransformState::isMappingSecondaryQuad const):
(WebCore::TransformState::accumulatedTransform const):
2020-04-19 Rob Buis <rbuis@igalia.com>
Remove unneeded code from FrameLoader::loadURL
https://bugs.webkit.org/show_bug.cgi?id=210696
Reviewed by Darin Adler.
Remove unneeded code from FrameLoader::loadURL, since the only way the load type can be Reload
is if loadFrameRequest set it, and the only way loadFrameRequest can set it is if cachePolicy
is ReloadIgnoringCacheData, so no need to set it again in FrameLoader::loadURL.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
2020-04-19 Brady Eidson <beidson@apple.com>
Add WKScriptMessageHandler API that asynchronously responds with a promise.
rdar://problem/57243492 and https://bugs.webkit.org/show_bug.cgi?id=206398
Reviewed by Andy Estes.
Covered by new API tests.
Updated for moving an #include into implementation files:
* bindings/js/JSDOMPromiseDeferred.cpp:
* bindings/js/JSDOMPromiseDeferred.h:
* html/HTMLMediaElement.cpp:
* page/DOMWindow.cpp:
* workers/service/ServiceWorkerGlobalScope.cpp:
* page/UserMessageHandler.cpp:
(WebCore::UserMessageHandler::postMessage): Return a promise to be fulfilled by the API client.
* page/UserMessageHandler.h:
* page/UserMessageHandler.idl:
* page/UserMessageHandlerDescriptor.h:
2020-04-19 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add column spanning support for flexible table width
https://bugs.webkit.org/show_bug.cgi?id=210713
Reviewed by Antti Koivisto.
Test: fast/layoutformattingcontext/table-flex-width-colspans.html
This patch slightly changes the extra space distribution logic by using either the minimum or
the maximum width as the base initial width for the columns.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::computeColumnWidths):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace): Deleted.
* layout/tableformatting/TableFormattingContext.h:
2020-04-19 Emilio Cobos Álvarez <emilio@crisal.io>
Don't use the inherited custom properties to store environment variables.
https://bugs.webkit.org/show_bug.cgi?id=210707
Reviewed by Antti Koivisto.
It leaks this implementation detail when enumerating the computed style.
Tests: imported/w3c/web-platform-tests/css/css-cascade/all-prop-initial-xml.xhtml
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
* css/CSSVariableReferenceValue.cpp:
(WebCore::resolveVariableReference):
(WebCore::resolveTokenRange):
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2020-04-19 Antti Koivisto <antti@apple.com>
[CSS selectors] :is() / :where() should not allow pseudo-elements at parse-time
https://bugs.webkit.org/show_bug.cgi?id=210701
Reviewed by Anders Carlsson.
https://drafts.csswg.org/selectors/#matches:
"Pseudo-elements cannot be represented by the matches-any pseudo-class; they are not valid within :is()."
Test: fast/selectors/pseudo-element-in-is-where.html
* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumePseudo):
2020-04-19 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Take border spacing into account when distributing column spanners width.
https://bugs.webkit.org/show_bug.cgi?id=210712
Reviewed by Antti Koivisto.
While distributing the column spanner extra space among individual columns,
the spacing between these columns (set by border-spacing) should be taken into
account and subtract it from the width to distribute.
<table style="border-spacing: 50px"><tr><td colspan=2>long long text</td></tr><tr><td>lo</td><td>xt</td><tr></table>
[long long text]
[lo] [xt]
The individual columns don't require any extra space from the spanner.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator+=):
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::horizontalSpacing const):
(WebCore::Layout::TableGrid::totalHorizontalSpacing const): Deleted.
2020-04-19 Emilio Cobos Álvarez <emilio@crisal.io>
Fix the logic to decide whether a property is enumerated in a computed style declaration.
https://bugs.webkit.org/show_bug.cgi?id=210695
Reviewed by Antti Koivisto.
Fix the logic to decide whether a property is enumerated in a computed
style declaration.
Logical properties don't need stylebuilder code, but still should be
generated. Using the specification->category for this seems a bit
hacky, but unclear if it's worse than adding a new flag.
Tests: fast/css/getComputedStyle/computed-style-enumeration.html
imported/w3c/web-platform-tests/css/cssom/getComputedStyle-logical-enumeration.html
* css/makeprop.pl:
(skippedFromComputedStyle):
(isLogical):
(sortWithPrefixedPropertiesLast):
2020-04-18 Antti Koivisto <antti@apple.com>
[CSS selectors] Support :where() pseudo class
https://bugs.webkit.org/show_bug.cgi?id=210690
Reviewed by Sam Weinig.
"The Specificity-adjustment pseudo-class, :where(), is a functional pseudo-class with the same
syntax and functionality as :is(). Unlike :is(), neither the :where pseudo-class, nor any of
its arguments contribute to the specificity of the selector—its specificity is always zero.
This is useful for introducing filters in a selector while keeping the associated style
declarations easy to override."
https://drafts.csswg.org/selectors-4/#zero-matches
In terms of implementation this is just another alias for :is() with different (always 0) specificity.
Test: fast/selectors/where-specificity.html
* css/CSSSelector.cpp:
(WebCore::simpleSelectorSpecificityInternal):
Here is where it differs from PseudoClassIs.
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/parser/CSSSelectorParser.cpp:
(WebCore::isOnlyPseudoClassFunction):
(WebCore::CSSSelectorParser::consumePseudo):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
2020-04-18 Rob Buis <rbuis@igalia.com>
Reduce parameter list of the FrameLoadRequest constructor
https://bugs.webkit.org/show_bug.cgi?id=210668
Reviewed by Darin Adler.
Reduce parameter list of the FrameLoadRequest constructor by
instead using various setters. By choosing the most common
defaults the actual number of setters to call are minimized.
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::openInNewTab):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::navigate):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::handleProvisionalLoadFailureFromContentFilter):
* loader/FrameLoadRequest.cpp:
(WebCore::FrameLoadRequest::FrameLoadRequest):
* loader/FrameLoadRequest.h:
(WebCore::FrameLoadRequest::FrameLoadRequest):
(WebCore::FrameLoadRequest::disableShouldReplaceDocumentIfJavaScriptURL):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::changeLocation):
(WebCore::FrameLoader::loadURLIntoChildFrame):
* loader/NavigationScheduler.cpp:
(WebCore::NavigationScheduler::scheduleLocationChange):
* page/ContextMenuController.cpp:
(WebCore::openNewWindow):
(WebCore::ContextMenuController::contextMenuItemSelected):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
2020-04-18 David Kilzer <ddkilzer@apple.com>
Attempt #3 to fix tvOS build
Unreviewed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
- Use !PLATFORM(APPLETV) to comment out functions declared within
ENABLE(VIDEO_PRESENTATION_MODE) from r260307 and r260308.
2020-04-18 Yusuke Suzuki <ysuzuki@apple.com>
[WTF] Move DataRef.h from WebCore to WTF to utilize it in JSC
https://bugs.webkit.org/show_bug.cgi?id=210689
Reviewed by Anders Carlsson.
No behavior change, just moving header from WebCore to WTF.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* rendering/style/NinePieceImage.h:
* rendering/style/RenderStyle.h:
* rendering/style/SVGRenderStyle.h:
* rendering/style/StyleRareInheritedData.cpp:
* rendering/style/StyleRareInheritedData.h:
* rendering/style/StyleRareNonInheritedData.h:
2020-04-18 David Kilzer <ddkilzer@apple.com>
Attempt #2 to fix tvOS build
Unreviewed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
- Add #if ENABLE(VIDEO_PRESENTATION_MODE)/#endif to protect
methods defined in MediaPlayerPrivate.h.
- The previous commit was (r260307) also to fix tvOS, not watchOS.
2020-04-18 David Kilzer <ddkilzer@apple.com>
Attempt to fix watchOS build
Unreviewed.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
- Add #if ENABLE(VIDEO_PRESENTATION_MODE)/#endif to protect
methods defined in MediaPlayerPrivate.h.
2020-04-17 Simon Fraser <simon.fraser@apple.com>
Group overflow controls layers into a single container layer
https://bugs.webkit.org/show_bug.cgi?id=210675
Reviewed by Zalan Bujtas.
Overflow control layers are going to change z-order in a future change. To make this
easier, group the overflow controls layer into their own container layer.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateDebugIndicators):
(WebCore::RenderLayerBacking::updateGeometry): Size the overflow controls layer using paddingBoxRectIncludingScrollbar().
(WebCore::RenderLayerBacking::updateInternalHierarchy): New parenting.
(WebCore::RenderLayerBacking::updateOverflowControlsLayers): Some refactoring with a nice lambda.
(WebCore::RenderLayerBacking::positionOverflowControlsLayers): Lovely lambda here. Nice.
* rendering/RenderLayerBacking.h:
2020-04-17 Kate Cheney <katherine_cheney@apple.com>
Enable service workers for app-bound domains
https://bugs.webkit.org/show_bug.cgi?id=210451
<rdar://problem/61479474>
Reviewed by Brent Fulgham.
SWServer now retrieves the app-bound domains from the UI Process and
only continues with the load if the proper entitlement is present
or the load is coming from an app-bound domain.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::validateRegistrationDomain):
(WebCore::SWServer::scheduleJob):
* workers/service/server/SWServer.h:
2020-04-17 Dean Jackson <dino@apple.com>
[WebGL] Confirm there are no errors when setting up framebuffers
https://bugs.webkit.org/show_bug.cgi?id=210632
<rdar://problem/61916680>
Reviewed by Simon Fraser.
We're seeing crashes on macOS inside GraphicsContextGL::reshape().
Specifically when we submit work at the end of the function via
glFlush.
At the moment the cause is a mystery, because we should bail out
before then if the multisample renderbuffer was not complete. In
the hope that it helps somewhat, add a call to glGetError to double
check that there isn't anything horribly wrong before we talk to
the GPU.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::WebGL2RenderingContext): If the underlying
GCGL context was marked as "LOST" during initialization, skip the rest of our
initialization.
* html/canvas/WebGLRenderingContext.cpp: Ditto.
(WebCore::WebGLRenderingContext::WebGLRenderingContext):
* html/canvas/WebGLRenderingContextBase.cpp: Ditto.
(WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
* platform/graphics/angle/GraphicsContextGLANGLE.cpp: Check for a GL error during
setup and, if there is one, skip directly into a LOST state.
(WebCore::GraphicsContextGLOpenGL::reshape):
* platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
(WebCore::GraphicsContextGLOpenGL::reshape):
2020-04-17 Peng Liu <peng.liu6@apple.com>
Cleanup the macros for video fullscreen and picture-in-picture
https://bugs.webkit.org/show_bug.cgi?id=210638
Reviewed by Eric Carlson.
A follow-up patch to fix build failures of r260259.
* platform/ios/VideoFullscreenInterfaceAVKit.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
2020-04-17 David Kilzer <ddkilzer@apple.com>
REGRESSION (r234105): [iOS] WKColorButton leaks a UIColor
<https://webkit.org/b/210658>
<rdar://problem/61938137>
Reviewed by Darin Adler.
* html/ColorInputType.cpp:
(WebCore::ColorInputType::isKeyboardFocusable const):
* page/Chrome.cpp:
(WebCore::Chrome::createColorChooser):
- Drive-by fix of unreachable code on PLATFORM(IOS_FAMILY).
2020-04-17 Don Olmstead <don.olmstead@sony.com>
[CMake] Add WebKit::WebCore target
https://bugs.webkit.org/show_bug.cgi?id=210445
Reviewed by Michael Catanzaro.
Add a WebKit::WebCore target. Remove the WebCoreHeaderInterface target since
the WebKit::WebCore target is functionaly the same.
* CMakeLists.txt:
2020-04-17 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r260245.
The tests added with this change are frequently failing on
macOS bots.
Reverted changeset:
"Safari doesn't apply frameRate limit when request stream from
Camera"
https://bugs.webkit.org/show_bug.cgi?id=210186
https://trac.webkit.org/changeset/260245
2020-04-17 Per Arne Vollan <pvollan@apple.com>
Unreviewed build fix.
* platform/cocoa/AGXCompilerService.cpp:
2020-04-17 Antoine Quint <graouts@apple.com>
Stop including style rules related to media controls in the UA style sheet when Modern Media Controls are enabled
https://bugs.webkit.org/show_bug.cgi?id=210606
Reviewed by Antti Koivisto and Daniel Bates.
There is no need to insert style rules related to media controls in the UA stylesheet when Modern Media Controls are enabled.
There is one rule from mediaControlsApple.css for the default sizing of <audio> that makes sense broadly for content on the Web
so we move that to html.css. We also set the background-color property for media documents in html.css.
* Modules/mediacontrols/mediaControlsApple.css:
(audio): Deleted.
(body:-webkit-full-page-media): Deleted.
* Modules/mediacontrols/mediaControlsiOS.css:
(body:-webkit-full-page-media): Deleted.
* Modules/modern-media-controls/controls/media-document.css:
(:host(.media-document)):
* css/html.css:
(body:-webkit-full-page-media):
(audio):
* css/mediaControls.css:
(body:-webkit-full-page-media): Deleted.
* style/UserAgentStyle.cpp:
(WebCore::Style::UserAgentStyle::ensureDefaultStyleSheetsForElement):
2020-04-17 Peng Liu <peng.liu6@apple.com>
Cleanup the macros for video fullscreen and picture-in-picture
https://bugs.webkit.org/show_bug.cgi?id=210638
Reviewed by Eric Carlson.
Replace some "#if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))"
and all "#if (PLATFORM(IOS_FAMILY) && HAVE(AVKIT)) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))"
with "#if ENABLE(VIDEO_PRESENTATION_MODE)".
No new tests, no functional change.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaEngineWasUpdated):
(WebCore::HTMLMediaElement::setVideoFullscreenStandby):
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
* html/HTMLVideoElement.h:
* platform/PictureInPictureSupport.h:
* platform/cocoa/VideoFullscreenChangeObserver.h:
* platform/cocoa/VideoFullscreenModel.h:
* platform/cocoa/VideoFullscreenModelVideoElement.h:
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
* platform/graphics/MediaPlayer.cpp:
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(WebCore::supportsPictureInPicture):
2020-04-17 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Resolve the minimum width for overlapping spanner columns
https://bugs.webkit.org/show_bug.cgi?id=210654
Reviewed by Antti Koivisto.
The extra horizontal space distribution is based on the columns' minimum widths.
In case of column spanners, first we need to distribute the spanner's minimum
width across the columns using the non-spanning minimum widths as the distribution ratio.
When there's no non-spanning minimum width for a column (all rows have column spanners for tbis particular column)
the minimum width gets distributed equally across the spanned columns. This distribution starts with the shortest columns spans
so that we can use these resolved column widths to compute the wider ones.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
2020-04-17 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Update for GdkKeymap API changes
https://bugs.webkit.org/show_bug.cgi?id=210642
Reviewed by Adrian Perez de Castro.
No new tests needed.
gdk_keymap_get_default() is deprecated in GTK+ 3.22, so use
gdk_keymap_get_for_display() instead. Since in GTK4 this method is
removed to gdk_display_get_keymap(), add a helper to
GtkVersioning.h to avoid cluttering with ifdefs all over the
place.
* platform/gtk/GtkVersioning.h:
(gdk_keymap_get_for_display):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::currentCapsLockState):
(WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
2020-04-17 Oriol Brufau <obrufau@igalia.com>
Revert "[css-grid] Exclude implicit grid tracks from the resolved value"
https://bugs.webkit.org/show_bug.cgi?id=210617
Reviewed by Manuel Rego Casasnovas.
Revert r254561 since it appears to be breaking site authoring tools
which were relying on the previous behaviour.
Tests: fast/css-grid-layout/grid-auto-columns-rows-get-set.html
fast/css-grid-layout/grid-columns-rows-get-set.html
fast/css-grid-layout/grid-template-shorthand-get-set.html
fast/css-grid-layout/mark-as-infinitely-growable.html
fast/css-grid-layout/named-grid-lines-computed-style-implicit-tracks.html
fast/css-grid-layout/negative-growth-share-as-infinity-crash.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-flexible-lengths-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-grid-template-columns-rows-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-named-grid-lines-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-support-repeat-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-template-columns-rows-resolved-values-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-flexible-lengths-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-grid-template-columns-rows-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-named-grid-lines-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-support-repeat-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-template-columns-rows-resolved-values-001.html
imported/w3c/web-platform-tests/css/css-grid/grid-layout-properties.html
imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-columns-computed-withcontent.html
imported/w3c/web-platform-tests/css/css-grid/parsing/grid-template-rows-computed-withcontent.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForGridTrackList):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::trackSizesForComputedStyle const):
2020-04-17 Per Arne Vollan <pvollan@apple.com>
[iOS] Deny iokit open access to graphics related classes
https://bugs.webkit.org/show_bug.cgi?id=210616
Reviewed by Darin Adler.
Deny iokit open access to graphics related classes in the WebContent process on iOS, but issue
extensions for these for some devices which still need access to them.
API test: WebKit.IOKitOpenSandboxAccessForDeviceWithAGXCompilerService
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/AGXCompilerService.cpp: Added.
(WebCore::setDeviceHasAGXCompilerServiceForTesting):
(WebCore::deviceHasAGXCompilerService):
* platform/cocoa/AGXCompilerService.h: Added.
* testing/Internals.cpp:
(WebCore::Internals::hasSandboxIOKitOpenAccessToClass):
* testing/Internals.h:
* testing/Internals.idl:
* testing/Internals.mm:
(WebCore::Internals::hasSandboxIOKitOpenAccessToClass):
2020-04-17 Youenn Fablet <youenn@apple.com>
Safari doesn't apply frameRate limit when request stream from Camera
https://bugs.webkit.org/show_bug.cgi?id=210186
<rdar://problem/61452794>
Reviewed by Eric Carlson.
Add support to RealtimeVideoSource to decimate the video samples based on the observed frame rate of its capture source.
This allows supporting two tracks using the same capture device, one track being low frame rate and the other one high frame rate.
Clean-up refactoring to make RealtimeVideoSource directly inherit from RealtimeVideoCaptureSource.
Migrate size and format of frame adaptation from RealtimeVideoCaptureSource to RealtimeVideoSource.
Fix mock capture source to update its frame rate when asked by applyConstraints.
Tests: fast/mediastream/mediastreamtrack-video-frameRate-clone-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-clone-increasing.html
fast/mediastream/mediastreamtrack-video-frameRate-decreasing.html
fast/mediastream/mediastreamtrack-video-frameRate-increasing.html
* platform/mediastream/RealtimeVideoCaptureSource.cpp:
(WebCore::RealtimeVideoCaptureSource::dispatchMediaSampleToObservers):
(WebCore::RealtimeVideoCaptureSource::clientUpdatedSizeAndFrameRate):
* platform/mediastream/RealtimeVideoCaptureSource.h:
(WebCore::RealtimeVideoCaptureSource::observedFrameRate const):
* platform/mediastream/RealtimeVideoSource.cpp:
(WebCore::RealtimeVideoSource::RealtimeVideoSource):
(WebCore::m_source):
(WebCore::RealtimeVideoSource::adaptVideoSample):
(WebCore::RealtimeVideoSource::videoSampleAvailable):
* platform/mediastream/RealtimeVideoSource.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::setFrameRateWithPreset):
* testing/Internals.cpp:
(WebCore::Internals::observeMediaStreamTrack):
2020-04-17 Alexey Shvayka <shvaikalesh@gmail.com>
MediaQueryList should extend EventTarget
https://bugs.webkit.org/show_bug.cgi?id=203288
Reviewed by Darin Adler.
Initially, CSSOM View Module specification [1] had a custom callback mechanism with addListener() and removeListener(),
and the callback was invoked with the associated MediaQueryList as argument.
Now the normal event mechanism [2] is used instead. For backwards compatibility, addListener() and removeListener()
methods are basically aliases for addEventListener() and removeEventListener(), respectively, and the "change" event
masquerades as a MediaQueryList.
This patch implements new event mechanism, aligning WebKit with Blink and SpiderMonkey, and also fixes
a few minor spec incompatibilities: mandatory listener argument, "handleEvent" support, and listeners call order.
[1]: https://www.w3.org/TR/2011/WD-cssom-view-20110804/#mediaquerylist
[2]: https://www.w3.org/TR/cssom-view-1/#mediaquerylist
Tests: fast/media/media-query-list-07.html
web-platform-tests/css/cssom-view/MediaQueryList-addListener-handleEvent.html
web-platform-tests/css/cssom-view/MediaQueryList-addListener-removeListener.html
web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget.html
web-platform-tests/css/cssom-view/MediaQueryList-extends-EventTarget-interop.html
web-platform-tests/css/cssom-view/MediaQueryListEvent.html
web-platform-tests/css/cssom-view/idlharness.html
web-platform-tests/css/cssom-view/matchMedia.html
* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/scripts/test/JS/*: Updated.
* css/MediaQueryList.cpp:
(WebCore::MediaQueryList::MediaQueryList):
(WebCore::MediaQueryList::create):
(WebCore::MediaQueryList::~MediaQueryList):
(WebCore::MediaQueryList::addListener):
(WebCore::MediaQueryList::removeListener):
* css/MediaQueryList.h:
* css/MediaQueryList.idl:
* css/MediaQueryListEvent.cpp: Added.
(WebCore::MediaQueryListEvent::MediaQueryListEvent):
* css/MediaQueryListEvent.h: Added.
* css/MediaQueryListEvent.idl: Added.
* css/MediaQueryListListener.h: Removed.
* css/MediaQueryListListener.idl: Removed.
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::documentDestroyed):
(WebCore::MediaQueryMatcher::addMediaQueryList):
(WebCore::MediaQueryMatcher::removeMediaQueryList):
(WebCore::MediaQueryMatcher::matchMedia):
(WebCore::MediaQueryMatcher::evaluateAll):
(WebCore::MediaQueryMatcher::addListener): Deleted.
(WebCore::MediaQueryMatcher::removeListener): Deleted.
* css/MediaQueryMatcher.h:
* dom/EventNames.in:
* dom/EventTarget.h:
(WebCore::EventTarget::removeEventListener):
* dom/EventTargetFactory.in:
2020-04-17 Adrian Perez de Castro <aperez@igalia.com>
Unreviewed build fix after r260123
No new tests needed.
* platform/gtk/CursorGtk.cpp:
(WebCore::createCustomCursor): Pass missing pixel buffer data pointer to gdk_memory_texture_new().
2020-04-17 Youenn Fablet <youenn@apple.com>
Make use of WeakHashSet for MediaStreamTrackPrivate and RealtimeMediaSource observers
https://bugs.webkit.org/show_bug.cgi?id=210492
Reviewed by Geoffrey Garen.
We are making use of WeakHashSet to improve the robustness of the code.
For that purpose we use the new WeakHashSet::forEach method.
No change of behavior.
* Modules/mediarecorder/MediaRecorder.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::forEachObserver const):
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::forEachObserver):
(WebCore::MediaStreamTrackPrivate::addObserver):
(WebCore::MediaStreamTrackPrivate::removeObserver):
(WebCore::MediaStreamTrackPrivate::forEachObserver const): Deleted.
* platform/mediastream/MediaStreamTrackPrivate.h:
(WebCore::MediaStreamTrackPrivate::hasObserver const): Deleted.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::addAudioSampleObserver):
(WebCore::RealtimeMediaSource::removeAudioSampleObserver):
(WebCore::RealtimeMediaSource::addObserver):
(WebCore::RealtimeMediaSource::removeObserver):
(WebCore::RealtimeMediaSource::forEachObserver):
(WebCore::RealtimeMediaSource::notifyMutedObservers):
(WebCore::RealtimeMediaSource::requestToEnd):
(WebCore::RealtimeMediaSource::forEachObserver const): Deleted.
(WebCore::RealtimeMediaSource::notifyMutedObservers const): Deleted.
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.h:
2020-04-17 Rob Buis <rbuis@igalia.com>
Move allowPlugins to FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=205876
Reviewed by Darin Adler.
Move allowPlugins to FrameLoader to reduce
pointer dereferences and lessen dependency
on SubframeLoader. Also rename to
arePluginsEnabled since the method is asking
the Setting with the same name.
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* html/HTMLElement.cpp:
(WebCore::HTMLElement::rendererIsEverNeeded):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::arePluginsEnabled):
* loader/FrameLoader.h:
* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::createJavaAppletWidget):
(WebCore::SubframeLoader::allowPlugins): Deleted.
* loader/SubframeLoader.h:
* plugins/DOMMimeType.cpp:
(WebCore::DOMMimeType::enabledPlugin const):
2020-04-17 Tomoki Imai <Tomoki.Imai@sony.com>
Fix an integer overflow in WebCrypto AES-CTR Mac implementation, which may detect a false loop
https://bugs.webkit.org/show_bug.cgi?id=210540
(1 << counterLength) causes an integer overflow, and the undefined behavior.
The longest valid counterLength on 64 bit machine is 63,
and the literal 1 is considered as 32-bit signed integer.
Left shifting 1 beyond or to sign-bit is undefined behavior in C++ spec.
- https://en.cppreference.com/w/cpp/language/integer_literal
- https://en.cppreference.com/w/cpp/language/operator_arithmetic#Bitwise_shift_operators
This issue is originally found in https://bugs.webkit.org/show_bug.cgi?id=208186#c2
Reviewed by Jiewen Tan.
Test: crypto/subtle/aes-ctr-import-key-encrypt.html
* crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
(WebCore::transformAES_CTR):
2020-04-16 Simon Fraser <simon.fraser@apple.com>
Scrolling-tree hit-testing is off by top content inset
https://bugs.webkit.org/show_bug.cgi?id=210629
<rdar://problem/61848883>
Reviewed by Tim Horton.
r259936 added a point conversion from the superlayer of the root content layer,
to fix RTL, but this also pulled in top content inset, which we don't want.
Instead, do the RTL fix by factoring in scroll origin.
Test: fast/scrolling/mac/async-scroll-overflow-top-inset.html
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::scrollingNodeForPoint):
2020-04-16 Sergio Villar Senin <svillar@igalia.com>
Unreviewed build fix for non unified builds.
* html/OffscreenCanvas.cpp: Added missing include.
* html/canvas/CanvasRenderingContext2DBase.cpp: Ditto.
* layout/tableformatting/TableFormattingContextGeometry.cpp: Ditto.
* workers/WorkerAnimationController.cpp:
(WebCore::WorkerAnimationController::requestAnimationFrame): Added namespace.
* workers/WorkerAnimationController.h: Added missing include.
2020-04-16 Simon Fraser <simon.fraser@apple.com>
A slow-starting swipe always latches on the root node
https://bugs.webkit.org/show_bug.cgi?id=210618
Reviewed by Tim Horton.
If the first event in a wheel event gesture had zero delta, scrolling thread logic would
always latch on the root node and the rest of the gesture would scroll the document.
Fix by not latching for events with zero delta.
Test: scrollingcoordinator/mac/latching/zero-delta-began-should-not-latch.html
* page/scrolling/ScrollingTreeLatchingController.cpp:
(WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::canScrollWithWheelEvent const):
(WebCore::ScrollingTreeScrollingNode::eventCanScrollContents const):
(WebCore::ScrollingTreeScrollingNode::scrollLimitReached const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::shouldConsiderLatching const): FIXME comment. Ideally this would
check delta() that that's too scarey at the moment.
2020-04-16 Jer Noble <jer.noble@apple.com>
Unreviewed build-fix after r260182; guard call to fullscreenManager() for ports which do not
ENABLE(FULLSCREEN_API).
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
2020-04-16 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Deprecation-guards fixes
https://bugs.webkit.org/show_bug.cgi?id=210600
Reviewed by Adrian Perez de Castro.
No new tests needed.
* platform/gtk/RenderThemeGadget.cpp:
(WebCore::RenderThemeGadget::backgroundColor const): Add missing
deprecation guards for deprecated GtkStyleContext API.
* platform/gtk/ThemeGtk.cpp:
(WebCore::ThemeGtk::ensurePlatformColors const): Switch to WK
deprecation guards from glib ones.
2020-04-16 Jack Lee <shihchieh_lee@apple.com>
ASSERTION FAILED: candidate.isCandidate() in WebCore::canonicalizeCandidate
https://bugs.webkit.org/show_bug.cgi?id=130844
<rdar://59535009>
Reviewed by Geoffrey Garen.
Call Position::isCandidate() in PositionIterator::isCandidate so behavior of
candidate search become identical in both classes.
Test: editing/inserting/insert-in-br.html
* dom/PositionIterator.cpp:
(WebCore::PositionIterator::isCandidate const):
2020-04-16 Rob Buis <rbuis@igalia.com>
Remove outdated comment from FrameLoader
https://bugs.webkit.org/show_bug.cgi?id=210607
Reviewed by Darin Adler.
Remove comment from FrameLoader that is not valid/important anymore because
addExtraFieldsToRequest does not set the Origin header since r259036.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadDifferentDocumentItem):
2020-04-16 Chris Fleizach <cfleizach@apple.com>
AX: Need method for setting selected range from NSRange
https://bugs.webkit.org/show_bug.cgi?id=210593
Reviewed by Darin Adler.
Allow setSelection to work outside of text controls.
Test: accessibility/ios-simulator/non-textcontrol-set-selection.html
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetSelectedTextRange:]):
2020-04-16 Jer Noble <jer.noble@apple.com>
[macOS] Update ScreenTime as playback state changes
https://bugs.webkit.org/show_bug.cgi?id=210518
<rdar://problem/61181092>
Reviewed by Eric Carlson.
Follow up to r260182; Pass a WeakPtr into our task queue in sessionWillEndPlayback rather than a bare pointer.
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback):
2020-04-16 Said Abou-Hallawa <sabouhallawa@apple.com>
Captured ThreadedScrollingTree should check its m_scrollingCoordinator before calling its methods
https://bugs.webkit.org/show_bug.cgi?id=210570
Reviewed by Simon Fraser.
m_scrollingCoordinator may be nullified before asynchronously calling its
method scheduleUpdateScrollPositionAfterAsyncScroll(). Check if it is
not null before calling this method.
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
2020-04-16 Zalan Bujtas <zalan@apple.com>
Crash in IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded when min-size can not be resolved
https://bugs.webkit.org/show_bug.cgi?id=210584
<rdar://problem/56685237>
Reviewed by Manuel Rego Casasnovas.
Use the initial value of 0 when the min-height can't be resolved.
Test: fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded const):
2020-04-16 Adrian Perez de Castro <aperez@igalia.com>
Non-unified build fixes mid April 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=210599
Unreviewed build fix.
No new tests needed.
* bindings/js/JSNavigatorCustom.cpp: Add missing JavaScriptCore/JSCJSValue.h header.
(WebCore::JSNavigator::getUserMedia): Prefix with the JSC:: namespace where needed.
* dom/ShadowRoot.cpp: Add missing WebAnimation.h header.
* dom/SimpleRange.cpp: Add missing NodeTraversal.h header.
* editing/RemoveNodePreservingChildrenCommand.cpp: Add missing Editing.h header.
* page/MemoryRelease.cpp: Add missing JavaScriptCore/VM.h header.
* page/PageConfiguration.cpp: Add missing UserContentURLPattern.h header.
* page/scrolling/ScrollingTree.h: Add missing EventTrackingRegions.h header.
* page/scrolling/ScrollingTreeLatchingController.cpp: Add missing Logging.h header.
* page/scrolling/ScrollingTreeLatchingController.h: Add missing ScrollTypes.h header,
and forward declaration for WebCore::PlatformWheelEvent.
* workers/service/server/SWServerJobQueue.cpp: Add missing Logging.h header.
2020-04-16 Simon Fraser <simon.fraser@apple.com>
[Async overflow scrolling] Slow-repaint overflow scroll have force their enclosing scrollers to be slow too
https://bugs.webkit.org/show_bug.cgi?id=210591
Reviewed by Antti Koivisto.
If an overflow:scroll has background-attachment:fixed in the contents, then both it and all its containing-block
scrolling ancestors have to be slow-scrolling too, because scrolling any of them affects the local geometry
of the fixed backgrounds which paint on scroll.
Implement this by having the scrolling tree do a post-commit pass over the nodes with sync scrolling reasons
(which we collect during the commit phase). For each slow-scrolling node, walk its ancestor chain (via
proxy nodes when necessary) and mark the scrolling node ancestors with the "DescendantScrollersHaveSynchronousScrolling"
reason.
For testing, expose internals.scrollingTreeAsText(), which needs a bit of synchronization via
waitForScrollingTreeCommit() since the commit happens on the scrolling thread.
Tests: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-non-cb-overflow.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-overflow.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-nested-overflow2.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText const):
(WebCore::AsyncScrollingCoordinator::scrollingTreeAsText const):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::scrollingStateTreeAsText const):
(WebCore::ScrollingCoordinator::scrollingTreeAsText const):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText):
* page/scrolling/ScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinatorTypes.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitTreeState):
(WebCore::ScrollingTree::updateTreeFromStateNodeRecursive):
(WebCore::ScrollingTree::propagateSynchronousScrollingReasons):
(WebCore::ScrollingTree::updateTreeFromStateNode): Deleted.
* page/scrolling/ScrollingTree.h:
(WebCore::ScrollingTree::waitForScrollingTreeCommit):
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateAfterChildren):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/ThreadedScrollingTree.cpp:
(WebCore::ThreadedScrollingTree::waitForScrollingTreeCommit):
* page/scrolling/ThreadedScrollingTree.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollingTreeAsText const):
* testing/Internals.h:
* testing/Internals.idl:
2020-04-16 Claudio Saavedra <csaavedra@igalia.com>
Clean a couple of unused-parameters warnings
https://bugs.webkit.org/show_bug.cgi?id=210596
Unreviewed.
No new tests needed.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const): Remove
a spurious UNUSED_PARAM() for an actually used parameter.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::updateSecurityDiscCharacters):
2020-04-16 Eric Carlson <eric.carlson@apple.com>
[macOS] Update ScreenTime as playback state changes
https://bugs.webkit.org/show_bug.cgi?id=210518
<rdar://problem/61181092>
Reviewed by Jer Noble.
Test: media/media-usage-state.html
Pass media element state to the UI process whenever it changes.
* Headers.cmake:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaSessionUniqueIdentifier const):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::~MediaElementSession):
(WebCore::MediaElementSession::updateMediaUsageIfChanged):
* html/MediaElementSession.h:
* page/ChromeClient.h:
(WebCore::ChromeClient::addMediaUsageManagerSession):
(WebCore::ChromeClient::updateMediaUsageManagerSessionState):
(WebCore::ChromeClient::removeMediaUsageManagerSession):
* platform/audio/PlatformMediaSession.cpp:
(WebCore::PlatformMediaSession::PlatformMediaSession):
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::updateMediaUsageIfChanged):
(WebCore::PlatformMediaSession::mediaSessionIdentifier const):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary):
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::scheduleUpdateSessionStatus):
(WebCore::PlatformMediaSessionManager::sessionDidEndRemoteScrubbing):
(WebCore::PlatformMediaSessionManager::scheduleUpdateNowPlayingInfo): Deleted.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(WebCore::MediaSessionManagerCocoa::scheduleUpdateSessionStatus):
(WebCore::MediaSessionManagerCocoa::sessionWillBeginPlayback):
(WebCore::MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(WebCore::MediaSessionManagerCocoa::removeSession):
(WebCore::MediaSessionManagerCocoa::sessionWillEndPlayback):
(WebCore::MediaSessionManagerCocoa::clientCharacteristicsChanged):
(WebCore::MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(WebCore::MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
* platform/graphics/MediaUsageInfo.h: Added.
(WebCore::MediaUsageInfo::operator== const):
(WebCore::MediaUsageInfo::operator!= const):
(WebCore::MediaUsageInfo::encode const):
(WebCore::MediaUsageInfo::decode):
* testing/Internals.cpp:
(WebCore::Internals::setMediaElementRestrictions):
(WebCore::Internals::mediaUsageState const):
* testing/Internals.h:
* testing/Internals.idl:
2020-04-16 Yusuke Suzuki <ysuzuki@apple.com>
[JSC] Implement JSMapIterator/JSSetIterator with JSInternalFieldObjectImpl
https://bugs.webkit.org/show_bug.cgi?id=210023
Reviewed by Keith Miller.
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
2020-04-16 Philippe Normand <pnormand@igalia.com>
Unreviewed, fix GStreamer build warnings.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached):
* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::handleErrorConditionFromStreamingThread):
2020-04-16 Carlos Alberto Lopez Perez <clopez@igalia.com>
[GTK] MiniBrowser opens new windows too small causing failures on some WPT tests
https://bugs.webkit.org/show_bug.cgi?id=210206
Reviewed by Carlos Garcia Campos.
Some WPT tests (when executed with the WPT runner via WebDriver)
open new browser windows via JavaScript invoking Window.open()
and then run the test on this new window.
The size of the new window is not specified, and we were failing
to provide a default window size, so it was using the minimum of
100x100 which its just too small for some test that later call
document.elementFromPoint() on some coordinates
that are outside of that size.
To fix that provide the size of the default GTK window to WebCore
if the application sets one via gtk_window_set_default_size().
And if not, then use the size of the previous window.
Also change the way we position the new window to work better when
the system uses more than one monitor. Previously to get the default
coordinates of the new window we were using gdk_display_get_monitor()
with just the first monitor available.
This causes issues in the calculation of the available space when
using several monitors. Instead get the monitor in use by looking
at the current GDK root window.
Tests: TestWebKitAPI/WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/open-window-default-size
and TestWebKitAPI/WebKit2Gtk/TestUIClient:/webkit/WebKitWebView/open-window-no-default-size
* loader/FrameLoader.cpp:
(WebCore::createWindow):
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::getCurrentScreenMonitor):
(WebCore::screenRect):
(WebCore::screenAvailableRect):
2020-04-16 Tomoki Imai <Tomoki.Imai@sony.com>
TextureMapper renders video element with "object-fit: cover" incorrectly
https://bugs.webkit.org/show_bug.cgi?id=210544
Reviewed by Žan Doberšek.
Propagate GraphicsLayer::contentsClippingRect information to TextureMapperLayer
to properly clip the outside of DOM element when the element has "object-fit: cover".
Unfortunately, the test is disabled on WebKitGTK due to bug 177536, bug 163528.
Test: compositing/video/video-object-fit.html
* platform/graphics/nicosia/NicosiaPlatformLayer.h:
(Nicosia::CompositionLayer::flushState):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelf): Clip using propagated contentsClippingRect when rendering m_contentsLayer.
(WebCore::TextureMapperLayer::setContentsClippingRect):
* platform/graphics/texmap/TextureMapperLayer.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::setContentsClippingRect):
(WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2020-04-15 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Password obscuring dots drawn with the system font are too small
https://bugs.webkit.org/show_bug.cgi?id=209692
<rdar://problem/60788385>
Reviewed by Darin Adler.
The system font's U+2022 BULLET glyph got smaller. Instead, we should match
the native platform's behavior of using U+F79A. However, U+F79A is a PUA
character, meaning different fonts will draw it in arbitrary different ways.
Therefore, we should only use this character if we're drawing it with the
system font. Otherwise, we can take the old codepath and use U+2022 BULLET.
Tests: fast/text/text-security-disc-bullet-pua.html
platform/mac/fast/text/text-security-disc-bullet-pua-mac.html
platform/ios/fast/text/text-security-disc-bullet-pua-ios-new.html
platform/ios/fast/text/text-security-disc-bullet-pua-ios-old.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::text const):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::constructTextRun):
* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseForStyle):
* rendering/SimpleLineLayoutCoverage.cpp:
(WebCore::SimpleLineLayout::printReason):
* rendering/SimpleLineLayoutCoverage.h:
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::computeTextSecurityDiscShouldUsePUACodePoint const):
* rendering/style/RenderStyle.h:
2020-04-15 Jer Noble <jer.noble@apple.com>
REGRESSION (r260102): ASSERTION FAILED: m_arbitrators.contains(proxy) in WebKit::SharedArbitrator::endRoutingArbitrationForArbitrator
https://bugs.webkit.org/show_bug.cgi?id=210589
<rdar://problem/61844208>
Reviewed by Eric Carlson.
Track whether the session successfully entered routing arbitration and only call
leaveRoutingAbritration() if entering was sucessful.
* platform/audio/mac/AudioSessionMac.mm:
(WebCore::AudioSession::setCategory):
2020-04-15 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] background-attachment:fixed needs to disable async overflow scrolling
https://bugs.webkit.org/show_bug.cgi?id=210581
Reviewed by Zalan Bujtas.
Start setting synchronousScrollingReasons on overflow scrolling nodes if the scrolling would move content
that has background-attachment:fixed (we can't use async scrolling there, because such content needs painting
on each scroll).
When style changes, we call FrameView::{add|remove}SlowRepaintObject(). That sets the "needsScrollingTreeUpdate"
compositing bit on the enclosing RenderLayer (note, any RenderLayer, not necessarily a scrolling one).
Setting that bit will ensure that RenderLayerCompositor does an "update backing and hierarchy" traversal,
and during this traversal, if we see a layer with the bit set, scrollingTreeState.needSynchronousScrollingReasonsUpdate
becomes true. At the end of the traversal this is used as a signal to call updateSynchronousScrollingNodes().
updateSynchronousScrollingNodes() needs to clear synchronousScrollingReasons on nodes that no longer need
to slow-scroll, and set it on those that do. To achieve this we use the set of slow-repaint renders from
FrameView, and the set of layers with scrolling nodes from RenderLayerCompositor, starting with the set of
all nodes, and pruning those known to be slow. synchronousScrollingReasons are cleared on the remainder.
Tests: scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow-dynamic.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-in-overflow.html
scrollingcoordinator/mac/fixed-backgrounds/fixed-background-on-overflow.html
* page/FrameView.cpp:
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::removeSlowRepaintObject):
* page/FrameView.h:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateSynchronousScrollingNodes):
* rendering/RenderLayerCompositor.h:
2020-04-15 Andres Gonzalez <andresg_22@apple.com>
Add logging to core accessibility.
https://bugs.webkit.org/show_bug.cgi?id=210564
Reviewed by Chris Fleizach.
Added AXLogger class and AXTRACE macro. Used them in AXIsolatedTree.
* Headers.cmake:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/AXLogger.cpp: Added.
(WebCore::AXLogger::AXLogger):
(WebCore::AXLogger::~AXLogger):
* accessibility/AXLogger.h: Added.
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::AXIsolatedTree):
(WebCore::AXIsolatedTree::~AXIsolatedTree):
(WebCore::AXIsolatedTree::create):
(WebCore::AXIsolatedTree::nodeInTreeForID):
(WebCore::AXIsolatedTree::treeForID):
(WebCore::AXIsolatedTree::createTreeForPageID):
(WebCore::AXIsolatedTree::removeTreeForPageID):
(WebCore::AXIsolatedTree::treeForPageID):
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::objectsForIDs const):
(WebCore::AXIsolatedTree::generateSubtree):
(WebCore::AXIsolatedTree::createSubtree):
(WebCore::AXIsolatedTree::updateNode):
(WebCore::AXIsolatedTree::updateSubtree):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::focusedUIElement):
(WebCore::AXIsolatedTree::rootNode):
(WebCore::AXIsolatedTree::setRootNode):
(WebCore::AXIsolatedTree::setFocusedNode):
(WebCore::AXIsolatedTree::setFocusedNodeID):
(WebCore::AXIsolatedTree::removeNode):
(WebCore::AXIsolatedTree::removeSubtree):
(WebCore::AXIsolatedTree::appendNodeChanges):
(WebCore::AXIsolatedTree::applyPendingChanges):
* platform/Logging.h:
2020-04-15 Simon Fraser <simon.fraser@apple.com>
Lay the groundwork for SynchronousScrollingReason on overflow nodes
https://bugs.webkit.org/show_bug.cgi?id=210565
Reviewed by Tim Horton.
Make setSynchronousScrollingReasons() public on ScrollingCoordinator because we're going
to be calling it for overflow scrolling nodes.
Call ScrollingCoordinator::slowRepaintObjectsDidChange() not just when we go between
none some some slow-repaint objects, but whenever the set changes. slowRepaintObjectsDidChange()
is lightweight.
Minor cleanup in FrameView to avoid testing Page* nullness every time.
* page/FrameView.cpp:
(WebCore::FrameView::prepareForDetach):
(WebCore::FrameView::isScrollSnapInProgress const):
(WebCore::FrameView::usesAsyncScrolling const):
(WebCore::FrameView::addSlowRepaintObject):
(WebCore::FrameView::removeSlowRepaintObject):
(WebCore::FrameView::addViewportConstrainedObject):
(WebCore::FrameView::removeViewportConstrainedObject):
(WebCore::FrameView::scrollingCoordinator const):
(WebCore::FrameView::shouldUpdateCompositingLayersAfterScrolling const):
(WebCore::FrameView::isRubberBandInProgress const):
(WebCore::FrameView::requestScrollPositionUpdate):
(WebCore::FrameView::layoutOrVisualViewportChanged):
(WebCore::FrameView::performPostLayoutTasks):
(WebCore::FrameView::scrollableAreaSetChanged):
(WebCore::FrameView::wheelEvent):
(WebCore::FrameView::setScrollPinningBehavior):
* page/FrameView.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::slowRepaintObjectsDidChange):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsForFrameView const):
(WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons):
(WebCore::ScrollingCoordinator::shouldUpdateScrollLayerPositionSynchronously const):
(WebCore::ScrollingCoordinator::synchronousScrollingReasonsAsText const):
(WebCore::ScrollingCoordinator::frameViewHasSlowRepaintObjectsDidChange): Deleted.
(WebCore::ScrollingCoordinator::synchronousScrollingReasons const): Deleted.
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setSynchronousScrollingReasons):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking):
2020-04-15 Jack Lee <shihchieh_lee@apple.com>
ASSERTION FAILED: !selectionToDelete.isNone() in TypingCommand::forwardDeleteKeyPressed
when deleting a UserSelect::None element.
https://bugs.webkit.org/show_bug.cgi?id=210530
<rdar://problem/58591480>
Reviewed by Geoffrey Garen.
Quit forwardDeleteKeyPressed() if FrameSelection::modify() returns empty selection.
Test: editing/deleting/forward-delete-UserSelect-None-element.html
* editing/TypingCommand.cpp:
(WebCore::TypingCommand::forwardDeleteKeyPressed):
2020-04-15 Peng Liu <peng.liu6@apple.com>
Video elements don't return to the correct position when exiting fullscreen
https://bugs.webkit.org/show_bug.cgi?id=210529
Reviewed by Jer Noble.
Add WEBCORE_EXPORT to the function setNeedsDOMWindowResizeEvent().
* dom/Document.h:
2020-04-15 Wenson Hsieh <wenson_hsieh@apple.com>
[iPadOS] Some pages indefinitely zoom in and out due to idempotent text autosizing
https://bugs.webkit.org/show_bug.cgi?id=210551
<rdar://problem/56820674>
Reviewed by Tim Horton.
Rename m_initialScale and initialScale() on Page to m_initialScaleIgnoringContentSize and
initialScaleIgnoringContentSize(), respectively. See WebKit/ChangeLog for more details.
Test: fast/text-autosizing/ios/idempotentmode/idempotent-autosizing-reaches-stable-state.html
* page/Page.cpp:
(WebCore::Page::setInitialScaleIgnoringContentSize):
(WebCore::Page::setInitialScale): Deleted.
* page/Page.h:
(WebCore::Page::initialScaleIgnoringContentSize const):
(WebCore::Page::initialScale const): Deleted.
* style/StyleAdjuster.cpp:
(WebCore::Style::Adjuster::adjustmentForTextAutosizing):
2020-04-15 Chris Dumez <cdumez@apple.com>
REGRESSION (r258977): Crash under Document::visibilityStateChanged
https://bugs.webkit.org/show_bug.cgi?id=210555
Reviewed by Youenn Fablet.
Re-introduce null check of page in Document::visibilityStateChanged() which got inadvertently
dropped in r258977.
* dom/Document.cpp:
(WebCore::Document::visibilityStateChanged):
2020-04-15 Zalan Bujtas <zalan@apple.com>
REGRESSION( r260114): [ Mac and iOS ] imported/w3c/web-platform-tests/web-animations/timing-model/timelines/document-timelines.html is failing.
https://bugs.webkit.org/show_bug.cgi?id=210549
<rdar://problem/61828495>
Unreviewed.
Partial revert of r260114. See webkit.org/b/210559 for details.
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
2020-04-15 Antoine Quint <graouts@apple.com>
[Web Animations] Add support for `pseudoElement` on `KeyframeEffect` and `KeyframeEffectOptions`
https://bugs.webkit.org/show_bug.cgi?id=207290
<rdar://problem/59199003>
Reviewed by Antti Koivisto.
We add the required IDL bindings such that JS-originated Web Animations can target pseudo-elements, either via the KeyframeEffect.pseudoElement
property, or via the KeyframeEffectOptions.pseudoElement property, which is set on the object passed to the KeyframeEffect constrcutor and
Element.animate().
This means that a PseudoElement can be targeted by an animation even if it's not been created through style resolution by virtue of a ::before
or ::after selector and a "content" style rule. This means that when either the "target" or "pseudoElement" property of KeyframeEffect is set,
we ensure a PseudoElement is created and set on the host element if required. And additionally, we ensure that during style resolution, animations
are applied to such pseudo-elements with a new PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement() method that indicates that a
JS-originated KeyframeEffect targets this pseudo-element.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Handle the new KeyframeEffectOptions.pseudoElement property in the KeyframeEffect constructor.
(WebCore::KeyframeEffect::targetsPseudoElement const): Indicates whether this effect targets a pseudo-element and not a regular
element or a null target.
(WebCore::KeyframeEffect::targetElementOrPseudoElement const): Use the new targetsPseudoElement() method to determine whether a
pseudo-element is targeted. We also remove an assertion that only made sense when m_pseudoId could only be set via a CSS-originated
animation and another one when the only possible m_pseudoId values were PseudoId::Before and PseudoId::After.
(WebCore::KeyframeEffect::setTarget): Call the new didChangeTargetElementOrPseudoElement() method if the provided value differs
from the stored value for m_target.
(WebCore::KeyframeEffect::pseudoElement const): Return the matching normalized string with a `::` prefix for m_pseudoId if the target
is a pseudo-element. Note that PseudoElement::pseudoElementNameForEvents() will only return a string for "::before" and "::after" since
we only know how to animate these pseudo-elements.
(WebCore::KeyframeEffect::setPseudoElement): Determine a matching PseudoId, if any, for the provided string, and call the new
didChangeTargetElementOrPseudoElement() method if the provided value differs from the stored value for m_pseudoId.
(WebCore::KeyframeEffect::didChangeTargetElementOrPseudoElement): New method called when either m_target or m_pseudoId is changed
such that we can ensure the required PseudoElement is created if the animation targets a pseudo-element. Then we run the same logic
that we used to in KeyframeEffect::setTarget().
(WebCore::KeyframeEffect::requiresPseudoElement const): Indicates whether a PseudoElement must remain created for this KeyframeEffect,
which is only necessary for JS-originated effects targeting a pseudo-element.
* animation/KeyframeEffect.h:
* animation/KeyframeEffect.idl:
* animation/KeyframeEffectOptions.h:
* animation/KeyframeEffectOptions.idl:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::requiresPseudoElement const): Indicates whether one or more JS-originated keyframe effects in the stack target
the PseudoElement owning this stack.
* animation/KeyframeEffectStack.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::commitStyles): Use KeyframeEffect::targetsPseudoElement() to determine whether the animation's effect's target is a
pseudo-element, in which case we need to throw a NoModificationAllowedError exception.
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::rendererIsNeeded): Return true also when one or more JS-originated keyframe effects in the stack target this pseudo-element.
(WebCore::PseudoElement::isTargetedByKeyframeEffectRequiringPseudoElement): Return true when one or more JS-originated keyframe effects in the stack
target this pseudo-element.
* dom/PseudoElement.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::createContentRenderers): Remove the assertion that the "content" property was set since it's valid for this function to now be called
due to JS-originated keyframe effects targeting the given pseudo-element. Instead we add an assertion that there are such keyframe effects in
case no "content" property was set.
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement): Only remove pseudo-elements if there are no JS-originated keyframe effects
targeting the specified pseudo-element.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle): Allow animated style resolution for pseudo-elements targeted by JS-originated keyframe effects.
2020-04-15 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK4] Fix use of gtk init functions
https://bugs.webkit.org/show_bug.cgi?id=210550
Reviewed by Adrian Perez de Castro.
Add gtk_init and gtk_init_check receiving parameters to GtkVersioning.
* PlatformGTK.cmake:
* platform/graphics/PlatformDisplay.cpp:
* platform/gtk/GtkVersioning.h:
(gtk_init):
(gtk_init_check):
2020-04-15 Yusuke Suzuki <ysuzuki@apple.com>
import.meta.url: baseURL for a module script should be response URL, not request URL
https://bugs.webkit.org/show_bug.cgi?id=205294
Reviewed by Youenn Fablet.
The module should expose response URL as `import.meta.url` instead of request URL.
If redirection happens, this URL should be redirected one.
* bindings/js/ScriptModuleLoader.cpp:
(WebCore::ScriptModuleLoader::resolve):
(WebCore::ScriptModuleLoader::responseURLFromRequestURL):
(WebCore::ScriptModuleLoader::createImportMetaProperties):
(WebCore::ScriptModuleLoader::notifyFinished):
* bindings/js/ScriptModuleLoader.h:
2020-04-15 Jer Noble <jer.noble@apple.com>
isNullFunctionPointer() can fail for symbols not explicitly marked as weakly linked.
https://bugs.webkit.org/show_bug.cgi?id=210532
Reviewed by Tim Horton.
Symbols whose declarations are explicitly marked as weakly imported are guaranteed to be
NULL when the library containing those symbols is not available at runtime, or when the
symbol itself isn't present in the version of the library which is available at runtime. For
symbols which are not explicitly marked as weakly imported (because, e.g., the framework
itself is weakly imported), this technique can fail. Rather than test the nullity of a
random static C++ class method with isNullFunctionPointer(), explicitly mark as weak_import
a utility method added by the WebKit project, which conveniently is already used from within
LibWebRTCProviderCocoa, and test the nullity of that method instead.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable):
2020-04-15 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Make PlatformScreen::screenDPI() GTK4-ready
https://bugs.webkit.org/show_bug.cgi?id=210543
Reviewed by Adrian Perez de Castro.
No new tests needed.
This method is using deprecated and removed APIs
from GDK. Guard the removed API usage so that it's only
used in GTK3 and update to use the replacement APIs otherwise.
Also, make it to also use the gtk-xft-dpi GtkSettings property.
This method is mostly used in response to a change in this
property, so ignoring its value doesn't seem a good idea.
The following priority is used:
1. (GTK3 only) query gdk_screen_get_resolution().
2. Use the GtkSettings::gtk-xft-dpi property.
3. Calculate the actual DPI from the monitor 0's properties.
4. If none of these succeed, use the default DPI, 96.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDPI):
2020-04-15 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Remove IconGtk
https://bugs.webkit.org/show_bug.cgi?id=210546
Reviewed by Adrian Perez de Castro.
It's currently unused in GTK port since we never show an icon for file uploads.
* SourcesGTK.txt:
* platform/graphics/Icon.cpp:
* platform/graphics/Icon.h:
* platform/graphics/gtk/IconGtk.cpp: Removed.
2020-04-15 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Provide an alternative to gtk_widget_{get,is}_toplevel()
https://bugs.webkit.org/show_bug.cgi?id=210463
Reviewed by Carlos Garcia Campos.
Adapt utility functions to GTK4, and provide replacement implementations for the
gtk_widget_get_tolevel() and gtk_widget_is_toplevel() functions for GTK4 builds.
No new tests needed.
* platform/gtk/GtkUtilities.cpp:
(WebCore::gtkWindowGetOrigin): Added.
(WebCore::convertWidgetPointToScreenPoint): Move code used to find the window position
into a separate function, and use it to avoid the USE(GTK4) conditional here.
(WebCore::widgetIsOnscreenToplevelWindow): Adapt to make it work with GTK4.
* platform/gtk/GtkVersioning.h: Added.
(gtk_widget_is_toplevel): Alternative implementation for GTK4.
(gtk_widget_get_toplevel): Ditto.
(gtk_window_get_position): Ditto.
2020-04-15 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Adapt to cursor API changes
https://bugs.webkit.org/show_bug.cgi?id=210453
Reviewed by Carlos Garcia Campos.
No new tests needed.
* platform/gtk/CursorGtk.cpp:
(WebCore::fallbackCursor): Utility function which returns the "default" cursor for GTK4.
(WebCore::createNamedCursor): Adapt to the changes in the gdk_cursor_new_from_name().
(WebCore::createCustomCursor): Create a GdkTexture directly when the given Cairo surface is
in one of the pixel formats supported by gdk_memory_texture_new(), otherwise convert first;
then create a GdkCursor from the GdkTexture.
2020-04-14 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] Backgrounds missing on gmail sometimes
https://bugs.webkit.org/show_bug.cgi?id=210506
<rdar://problem/60523869>
Reviewed by Zalan Bujtas.
When painting the scrolled contents layers of accelerated overflow:scroll, RenderBlock::paint()
needs to not short-circuit when the dirty rect is outside a clipping rect, because accelerated
overflow involves overdraw for tiles outside the visible area.
There were two code paths that made this mostly work: overflowRectForPaintRejection() tested for
usesCompositedScrolling(), and the #if PLATFORM(IOS_FAMILY) made it work on iOS.
For content involving flexbox, overflowRectForPaintRejection() gave the wrong answer because
flex layout would sometimes clear m_overflow, even on an overflow:scroll element.
So remove overflowRectForPaintRejection(), and instead revert to the simple visualOverflowRect(),
but first check a bit that's passed down from compositing code that indicates that
we're painting the contents of composited scroll
Test: compositing/scrolling/async-overflow-scrolling/mac/overflow-in-flex-empty-tiles.html
* rendering/PaintPhase.h:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::overflowRectForPaintRejection const): Deleted.
* rendering/RenderBox.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintLayerContents):
(WebCore::RenderLayer::paintForegroundForFragments):
2020-04-14 Zalan Bujtas <zalan@apple.com>
Content expanding is broken on icourse163.org
https://bugs.webkit.org/show_bug.cgi?id=210510
<rdar://problem/45951820>
Reviewed by Simon Fraser.
www.icourse163.org's animation code expects a decimal point in the rAF timestamp (millisecond resolution).
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
* page/Quirks.cpp:
(WebCore::Quirks::needsMillisecondResolutionForHighResTimeStamp const):
* page/Quirks.h:
2020-04-14 Peng Liu <peng.liu6@apple.com>
Adopt interface AVAudioRoutingArbiter for Mac
https://bugs.webkit.org/show_bug.cgi?id=210167
Reviewed by Eric Carlson.
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::categoryName): Deleted.
* platform/audio/mac/AudioSessionMac.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSessionMac.cpp.
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::categoryOverride const):
(WebCore::AudioSession::setCategoryOverride):
Fix unified build failures.
* platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.h:
2020-04-14 Youenn Fablet <youenn@apple.com>
ReadableStreamDefaultController::enqueue should check for worker terminated exception
https://bugs.webkit.org/show_bug.cgi?id=210485
Reviewed by Mark Lam.
Make sure to not assert in case of enqueue exception if we are in a terminating worker.
This is covered by WPT fetch/api/basic/stream-response.any.worker.html and fetch/api/basic/stream-safe-creation.any.worker.html.
* bindings/js/ReadableStreamDefaultController.h:
(WebCore::ReadableStreamDefaultController::enqueue):
2020-04-14 Youenn Fablet <youenn@apple.com>
Protect MediaStreamTrackPrivate and RealtimeMediaSource when iterating its observers
https://bugs.webkit.org/show_bug.cgi?id=210488
Reviewed by Eric Carlson.
Making sure explicitly that the track private and source remain alive while looping from its observers.
* platform/mediastream/MediaStreamTrackPrivate.cpp:
(WebCore::MediaStreamTrackPrivate::forEachObserver const):
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::forEachObserver const):
2020-04-14 James Craig <jcraig@apple.com>
AX: Smart Invert doesn't handle the picture elements on foxnews.com
<https://webkit.org/b/210472>
Reviewed by Chris Fleizach.
Tests: accessibilty/smart-invert.html
accessibilty/smart-invert-reference.html
Filled out more variants in the test cases, and removed the unnecessary :not() selector.
* css/html.css:
(@media (inverted-colors) img, picture, video):
(@media (inverted-colors) img:not(picture>img), picture, video): Deleted.
2020-04-14 Wenson Hsieh <wenson_hsieh@apple.com>
[iPadOS] Wikipedia articles lay out incorrectly in 1/3 multitasking window
https://bugs.webkit.org/show_bug.cgi?id=210501
<rdar://problem/54856323>
Reviewed by Tim Horton.
In a 1/3 multitasking window, Safari currently uses the `-[WKWebView _allowsViewportShrinkToFit]` SPI to force
pages to shrink down by fitting the content width to the view width. This legacy method of shrinking to fit
involves laying the page out at the normal view width (320px in 1/3 multitasking), and then scaling the page
down such that any amount of horizontal overflow fits within the view.
In iOS 13, a new style of shrinking to fit was introduced in support of two new features: page zoom controls
(accessible via the page formatting menu), and on-by-default page scaling when loading desktop sites on certain
models of iPad where the page width is less than cutoffs of 1112px (in landscape) and 1024px (in portrait). This
new method of shrinking to fit involves laying out at a larger width (computed from a combination of the minimum
effective device width and layout size scale factor), and scaling to fit the effective layout size scale factor
instead of the entire contents of the page. This means that while we may still get horizontal scrolling after
shrinking to fit, the overall layout of the page is preserved.
Currently, in 1/3 multitasking, Safari still relies on the former to scale pages down to fit, which means that
Wikipedia articles (among other websites) do not lay out sensibly. Moreover, even if Safari adopted the second
mechanism for shrinking to fit, layout issues would still exist (albeit to a lesser degree), since we'd still
attempt to shrink the content width down to fit due to the fact that the desktop version of Wikipedia doesn't
have a meta viewport. While we wouldn't get a broken layout, we'd still have a blank column running down the
right side of the page, which is less than ideal.
It's clear that in this case, attempting to shrink page content down to fit the view is suboptimal (at best, it
leads to a large portion of the page being blank; at worst, it completely breaks page layout). To address this
bug for now, add a parallel minimumEffectiveDeviceWidth value that takes effect when ignoring scaling
constraints (i.e. when we're in a multitasking window), and scale the page down to fit this value instead of
fitting the full content width when computing initial scale in `ViewportConfiguration::initialScaleFromSize`.
Maintaining this value separately from m_minimumEffectiveDeviceWidth makes it much easier to ensure that the
effects of this change are only ever active when the quirk is applied, and also when the view is embedded in a
multitasking window.
* page/Quirks.cpp:
(WebCore::Quirks::shouldLayOutAtMinimumWindowWidthWhenIgnoringScalingConstraints const):
Introduce a quirk to fix layout issues in multitasking mode on the desktop version of Wikipedia.
* page/Quirks.h:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::initialScaleFromSize const):
(WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidth):
(WebCore::ViewportConfiguration::setMinimumEffectiveDeviceWidthWhenIgnoringScalingConstraints):
* page/ViewportConfiguration.h:
Add a minimum effective device width value that only takes effect when ignoring scaling constraints, and update
`shouldIgnoreMinimumEffectiveDeviceWidth()` and `minimumEffectiveDeviceWidth()` to not always return `true` and
`0` (respectively) when ignoring scaling constraints, if m_minimumEffectiveDeviceWidthWhenIgnoringScalingConstraints
is set.
(WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const):
(WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const):
(WebCore::ViewportConfiguration::shouldShrinkToFitMinimumEffectiveDeviceWidthWhenIgnoringScalingConstraints const):
2020-04-14 Antoine Quint <graouts@apple.com>
Factor PseudoElement creation calls into a single Element::ensurePseudoElement(pseudoId) method
https://bugs.webkit.org/show_bug.cgi?id=210495
Reviewed by Antti Koivisto.
To support webkit.org/b/207290 we need a way to ensure a PseudoElement is available for ::before and ::after
pseudo-elements on a given Element. We now use a Element::ensurePseudoElement(pseudoId) method to do this and
replace existing places where we would do something similar.
* dom/Element.cpp:
(WebCore::Element::ensurePseudoElement):
* dom/Element.h:
* rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolvePseudoStyle):
2020-04-14 Simon Fraser <simon.fraser@apple.com>
Scroll snap in subframes is often broken
https://bugs.webkit.org/show_bug.cgi?id=210503
Reviewed by Darin Adler.
RenderBox::findEnclosingScrollableContainer() incorrectly consulted the scrollability
of the main frame, causing snapping in subframes to be broken any time the main frame
was not scrollable.
Test: tiled-drawing/scrolling/scroll-snap/scroll-snap-async-iframe.html
* rendering/RenderBox.cpp:
(WebCore::RenderBox::findEnclosingScrollableContainer const):
2020-04-14 Andres Gonzalez <andresg_22@apple.com>
Make WTR::AccessibilityUIElements calls to accessibilitySetValue run on AX secondary thread. web content
https://bugs.webkit.org/show_bug.cgi?id=210500
Reviewed by Chris Fleizach.
Removed _accessibilitySetTestValue since it is no longer used, use
_accessibilitySetValue instead.
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper _accessibilitySetTestValue:forAttribute:]): Deleted.
2020-04-14 David Kilzer <ddkilzer@apple.com>
Add WARN_UNUSED_RETURN to decode methods in Source/WebCore
<https://webkit.org/b/210416>
<rdar://problem/61693462>
Reviewed by Alex Christensen.
* Modules/geolocation/GeolocationPositionData.h:
* Modules/indexeddb/IDBGetAllResult.h:
* Modules/indexeddb/IDBGetResult.h:
* Modules/indexeddb/IDBKeyData.h:
* Modules/indexeddb/IDBKeyRangeData.h:
* Modules/indexeddb/server/IDBSerialization.cpp:
(WebCore::decodeKey):
* Modules/indexeddb/shared/IDBCursorInfo.h:
* Modules/indexeddb/shared/IDBCursorRecord.h:
* Modules/indexeddb/shared/IDBDatabaseInfo.h:
* Modules/indexeddb/shared/IDBError.h:
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:
* Modules/indexeddb/shared/IDBGetRecordData.h:
* Modules/indexeddb/shared/IDBIndexInfo.h:
* Modules/indexeddb/shared/IDBIterateCursorData.h:
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:
* Modules/indexeddb/shared/IDBRequestData.h:
* Modules/indexeddb/shared/IDBResourceIdentifier.h:
* Modules/indexeddb/shared/IDBTransactionInfo.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::decodeTimeComparator):
* dom/EventInit.h:
* dom/ExceptionData.h:
* dom/SecurityPolicyViolationEvent.h:
* editing/FontAttributeChanges.h:
* editing/FontShadow.h:
* loader/CanvasActivityRecord.h:
* loader/FetchOptions.h:
(WebCore::FetchOptions::decodePersistent):
* platform/ContentFilterUnblockHandler.h:
* platform/DragItem.h:
* platform/KeyedCoding.h:
* platform/LinkIcon.h:
* platform/ThreadSafeDataBuffer.h:
* platform/audio/mac/CAAudioStreamDescription.h:
* platform/cf/KeyedDecoderCF.h:
* platform/generic/KeyedDecoderGeneric.h:
* platform/glib/KeyedDecoderGlib.h:
* platform/graphics/Region.h:
* platform/graphics/RemoteVideoSample.h:
(WebCore::RemoteVideoSample::decode):
* platform/mediastream/MediaConstraints.h:
(WebCore::MediaConstraint::decode):
(WebCore::NumericConstraint::decode):
(WebCore::StringConstraint::decode):
* platform/mediastream/RealtimeMediaSourceCapabilities.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
* platform/network/HTTPHeaderMap.h:
* platform/network/NetworkLoadMetrics.h:
* platform/network/ResourceRequestBase.h:
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::decode):
* platform/network/SameSiteInfo.h:
* platform/network/SocketStreamError.h:
* platform/network/curl/ResourceRequest.h:
* platform/network/soup/ResourceRequest.h:
* platform/network/soup/ResourceResponse.h:
* rendering/EventRegion.h:
* workers/service/ServiceWorkerFetchResult.h:
- Add WARN_UNUSED_RETURN to all decode functions.
2020-04-14 Antoine Quint <graouts@apple.com>
[Web Animations] Store an Element / PseudoId pair to define the KeyframeEffect target
https://bugs.webkit.org/show_bug.cgi?id=210491
Reviewed by Antti Koivisto.
In preparation for webkit.org/b/207290 where we will expose the `pseudoElement` JS API on KeyframeEffect we now
use an Element / PseudoId (m_target / m_pseudoId) pair to specify an effect's target. In the cases where it matters,
such as accessing the various animation collections exposed through Element and the KeyframeEffectStack, we now use
the new KeyframeEffect::targetElementOrPseudoElement() method to access the Element or PseudoElement targeted with
the Element / PseudoId pair.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::removeAnimation):
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize):
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::transitionDidComplete):
(WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange):
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::copyPropertiesFromSource):
(WebCore::KeyframeEffect::getKeyframes):
(WebCore::KeyframeEffect::forceLayoutIfNeeded):
(WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes):
(WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes):
(WebCore::KeyframeEffect::animationTimelineDidChange):
(WebCore::KeyframeEffect::updateEffectStackMembership):
(WebCore::KeyframeEffect::targetElementOrPseudoElement const):
(WebCore::KeyframeEffect::setTarget):
(WebCore::KeyframeEffect::apply):
(WebCore::KeyframeEffect::invalidate):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::applyPendingAcceleratedActions):
(WebCore::KeyframeEffect::document const):
(WebCore::KeyframeEffect::renderer const):
* animation/KeyframeEffect.h:
* animation/KeyframeEffectStack.cpp:
(WebCore::KeyframeEffectStack::addEffect):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setEffectInternal):
(WebCore::WebAnimation::setTimeline):
(WebCore::WebAnimation::persist):
* dom/Document.cpp:
(WebCore::Document::matchingAnimations):
* inspector/agents/InspectorAnimationAgent.cpp:
(WebCore::buildObjectForKeyframes):
(WebCore::InspectorAnimationAgent::requestEffectTarget):
2020-04-14 Simon Fraser <simon.fraser@apple.com>
[Async overflow scroll] Custom scrollbars on gmail don't show
https://bugs.webkit.org/show_bug.cgi?id=210438
<rdar://problem/61722541>
Reviewed by Tim Horton.
Custom scrollbars painted into the backing store of the scrolling element, but that
might have become an empty "simple container layer" causing the scroll bars to not
be painted anywhere.
Fix by making compositing layers for custom scrollbars. This is better than giving
backing store to the scroller's element, because that might be huge.
Test: scrollbars/async-overflow-custom-scrollbar.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::requiresLayerForScrollbar const):
(WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const):
(WebCore::RenderLayerBacking::requiresScrollCornerLayer const):
* rendering/RenderLayerBacking.h:
2020-04-14 Claudio Saavedra <csaavedra@igalia.com>
[GTK] Adapt to GdkVisual deprecation and removal
https://bugs.webkit.org/show_bug.cgi?id=210489
Reviewed by Adrian Perez de Castro.
No new tests needed.
Update the GdkVisual used to get the screen depth per component in
GTK3 and use default values for GTK4, as visuals as an abstraction
are gone from GTK4. The use in WK is very limited so there's no
much gain from peeking into backend-specific values.
* platform/gtk/PlatformScreenGtk.cpp:
(WebCore::screenDepth): Guard GdkVisual call and leave
default value for GTK4.
(WebCore::screenDepthPerComponent): Update API and ditto.
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK][WPE] Scrollbar handle has no minimum size
https://bugs.webkit.org/show_bug.cgi?id=209962
Reviewed by Adrian Perez de Castro.
Set a minimum thumb length.
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
(WebCore::ScrollbarThemeAdwaita::minimumThumbLength):
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] New scrollbar click behavior
https://bugs.webkit.org/show_bug.cgi?id=210002
Reviewed by Adrian Perez de Castro.
Use the same bahavior for mouse events when not rendering native scrollbars.
* platform/gtk/ScrollbarThemeGtk.cpp:
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2020-04-14 Antti Koivisto <antti@apple.com>
[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes
https://bugs.webkit.org/show_bug.cgi?id=210419
Reviewed by Simon Fraser.
CSS selector specification drafts at some point had a concept of "dynamic specificity" where
the specificity of a selector depended on the element it matched. It was only ever used with
:matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity
can now always be computed statically.
There is a ton of code to support this obsolete feature. Remove it.
https://drafts.csswg.org/selectors-4/#specificity-rules
"The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity
of the most specific complex selector in its selector list argument.
Analogously, the specificity of an :nth-child() or :nth-last-child() selector is the specificity
of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the
most specific complex selector in its selector list argument (if any)."
* css/html.css:
Reorganize a :matches rule into a selector list to keep the exact specificites.
It matters here to select between listbox and menulist correctly based on the 'size' and 'multiple' attributes.
* css/CSSSelector.cpp:
(WebCore::selectorSpecificity):
(WebCore::maxSpecificity):
(WebCore::simpleSelectorSpecificityInternal):
(WebCore::CSSSelector::simpleSelectorSpecificity const):
Also handle nth here.
(WebCore::CSSSelector::specificity const):
(WebCore::simpleSelectorFunctionalPseudoClassStaticSpecificity): Deleted.
(WebCore::functionalPseudoClassStaticSpecificity): Deleted.
(WebCore::staticSpecificityInternal): Deleted.
(WebCore::CSSSelector::staticSpecificity const): Deleted.
Rename to just computeSpecificity(), there is no other kind than static.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match const):
(WebCore::SelectorChecker::matchHostPseudoClass const):
(WebCore::SelectorChecker::matchRecursively const):
(WebCore::SelectorChecker::checkOne const):
(WebCore::SelectorChecker::matchSelectorList const):
SelectorChecker doesn't need to deal with specificity anymore.
* css/SelectorChecker.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addNthChildType):
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
Neither does SelectorCompiler.
* cssjit/SelectorCompiler.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::selectorMatches const):
(WebCore::SelectorDataList::selectorClosest const):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
(WebCore::hasDynamicSpecificity): Deleted.
* inspector/InspectorStyleSheet.h:
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::ruleMatches):
Switch to get the specificity from the selector instead of computing it during selector checking.
* style/ElementRuleCollector.h:
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GLIB] Fix race condition in FileMonitor implementation
https://bugs.webkit.org/show_bug.cgi?id=210483
Reviewed by Adrian Perez de Castro.
This is causing flaky timeouts when running resource load statistics layout tests. The problem is that we assume
FileMonitor has the last reference of the platform monitor and it's deleted on g_object_unref(), but GLib keeps
another reference that is released later on a different thread if the monitor is still active. We just need to
ensure we cancel the monitor before calling g_object_unref().
* platform/FileMonitor.h:
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::~FileMonitor):
(WebCore::FileMonitor::didChange):
(WebCore::FileMonitor::cancel):
2020-04-14 Charlie Turner <cturner@igalia.com>
[EME][CDMProxy] Fix waitingForKey logic
https://bugs.webkit.org/show_bug.cgi?id=210437
Reviewed by Xabier Rodriguez-Calvar.
startedWaitingForKey() was incorrectly flagged. It needs to signal on
the 0->1 transition, here it was only signalling on N->N+1 where N>0.
Also break ASSERTs into separate statements, it makes it easier in a
crash dump to see which conjuct fired.
Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-waiting-for-a-key.https.html
* platform/encryptedmedia/CDMProxy.cpp:
(WebCore::CDMInstanceProxy::startedWaitingForKey):
(WebCore::CDMInstanceProxy::stoppedWaitingForKey):
2020-04-14 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Bring back support for rendering scrollbars using the system appearance
https://bugs.webkit.org/show_bug.cgi?id=209805
Reviewed by Michael Catanzaro.
Bring back ScrollbarThemeGtk, RenderThemeGadget and RenderThemeWidget (renamed as RenderThemeScrollbar),
including only the code needed to render the scrollbars. ScrollbarThemeGtk inherits from ScrollbarThemeAdwaita
that is used when system appearance is disabled.
* PlatformGTK.cmake:
* SourcesGTK.txt:
* platform/adwaita/ScrollbarThemeAdwaita.cpp:
* platform/adwaita/ScrollbarThemeAdwaita.h:
* platform/gtk/RenderThemeGadget.cpp: Added.
(WebCore::RenderThemeGadget::create):
(WebCore::createStyleContext):
(WebCore::appendElementToPath):
(WebCore::RenderThemeGadget::RenderThemeGadget):
(WebCore::RenderThemeGadget::marginBox const):
(WebCore::RenderThemeGadget::borderBox const):
(WebCore::RenderThemeGadget::paddingBox const):
(WebCore::RenderThemeGadget::contentsBox const):
(WebCore::RenderThemeGadget::color const):
(WebCore::RenderThemeGadget::backgroundColor const):
(WebCore::RenderThemeGadget::opacity const):
(WebCore::RenderThemeGadget::state const):
(WebCore::RenderThemeGadget::setState):
(WebCore::RenderThemeGadget::minimumSize const):
(WebCore::RenderThemeGadget::preferredSize const):
(WebCore::RenderThemeGadget::render):
(WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget):
(WebCore::RenderThemeBoxGadget::preferredSize const):
(WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget):
(WebCore::RenderThemeScrollbarGadget::renderStepper):
* platform/gtk/RenderThemeGadget.h: Added.
(WebCore::RenderThemeGadget::context const):
* platform/gtk/RenderThemeScrollbar.cpp: Added.
(WebCore::widgetMap):
(WebCore::RenderThemeScrollbar::getOrCreate):
(WebCore::RenderThemeScrollbar::clearCache):
(WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
(WebCore::RenderThemeScrollbar::stepper):
* platform/gtk/RenderThemeScrollbar.h: Added.
(WebCore::RenderThemeScrollbar::scrollbar const):
(WebCore::RenderThemeScrollbar::contents const):
(WebCore::RenderThemeScrollbar::slider const):
(WebCore::RenderThemeScrollbar::trough const):
* platform/gtk/ScrollbarThemeGtk.cpp: Added.
(WebCore::ScrollbarTheme::nativeTheme):
(WebCore::themeChangedCallback):
(WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
(WebCore::ScrollbarThemeGtk::setUseSystemAppearance):
(WebCore::ScrollbarThemeGtk::themeChanged):
(WebCore::ScrollbarThemeGtk::updateThemeProperties):
(WebCore::ScrollbarThemeGtk::hasButtons):
(WebCore::scrollbarPartStateFlags):
(WebCore::widgetTypeForScrollbar):
(WebCore::contentsRectangle):
(WebCore::ScrollbarThemeGtk::trackRect):
(WebCore::ScrollbarThemeGtk::backButtonRect):
(WebCore::ScrollbarThemeGtk::forwardButtonRect):
(WebCore::ScrollbarThemeGtk::paint):
(WebCore::ScrollbarThemeGtk::handleMousePressEvent):
(WebCore::ScrollbarThemeGtk::scrollbarThickness):
(WebCore::ScrollbarThemeGtk::minimumThumbLength):
* platform/gtk/ScrollbarThemeGtk.h: Added.
2020-04-14 Youenn Fablet <youenn@apple.com>
Add a timer to AVVideoCaptureSource to verify reception of frames
https://bugs.webkit.org/show_bug.cgi?id=210335
Reviewed by Eric Carlson.
Count the number of frames being captured.
Add a timer repeating every 3 seconds.
Timer starts/stops based on whether the session is running/is interrupted.
If the number of frames did not increase, fail the source.
Manually tested.
* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::captureFailed):
Explicitly call stop() instead of just setting m_isProducingData.
This ensures we release all resources and that we may not restart capturing after captureFailed().
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
(WebCore::AVVideoCaptureSource::verifyIsCapturing):
(WebCore::AVVideoCaptureSource::updateVerifyCapturingTimer):
(WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
(WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
2020-04-14 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260024.
https://bugs.webkit.org/show_bug.cgi?id=210480
Regressed performance due to loss of specificity caching
(Requested by anttik on #webkit).
Reverted changeset:
"[CSS Selectors] Selectors Level 4 specificity calculation for
pseudo classes"
https://bugs.webkit.org/show_bug.cgi?id=210419
https://trac.webkit.org/changeset/260024
2020-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260052.
https://bugs.webkit.org/show_bug.cgi?id=210479
Breaks iOS tests, needs more work (Requested by smfr on
#webkit).
Reverted changeset:
"Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for
non-Cocoa platforms"
https://bugs.webkit.org/show_bug.cgi?id=210460
https://trac.webkit.org/changeset/260052
2020-04-13 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Use ThemeAdwaita instead of ThemeGtk
https://bugs.webkit.org/show_bug.cgi?id=210334
Reviewed by Carlos Garcia Campos.
No new tests needed.
* platform/adwaita/ThemeAdwaita.cpp: Build the Theme::singleton() factory also with USE(GTK4).
* platform/gtk/ThemeGtk.cpp: Conditionally build if !USE(GTK4).
(WebCore::ThemeGtk::ensurePlatformColors const): Add deprecation ignore guards.
* platform/gtk/ThemeGtk.h: Conditionally build if !USE(GTK4).
2020-04-13 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Get scroll-snap working with async overflow scrolling on macOS
https://bugs.webkit.org/show_bug.cgi?id=210471
<rdar://problem/61643199>
Reviewed by Wenson Hsieh.
Obey the FIXME and move scroll-snap related code to the delegate so that it works for
both frame and overflow nodes.
Tests: tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-async-overflow-stateless.html
tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-async-overflow.html
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
(WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
(WebCore::convertToLayoutUnits): Deleted.
* page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
(WebCore::convertToLayoutUnits):
(WebCore::ScrollingTreeScrollingNodeDelegateMac::updateFromStateNode):
2020-04-13 Zalan Bujtas <zalan@apple.com>
Do not cache definite height against perpendicular flex items.
https://bugs.webkit.org/show_bug.cgi?id=207603
<rdar://problem/59135373>
Reviewed by Simon Fraser.
RenderFlexibleBox::m_hasDefiniteHeight should not be set when the child we check against is a perpendicular item
because a perpendicular box's height is resolved against the containing block's width.
Test: fast/flexbox/unresolved-height-percentage-crash.html
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
2020-04-13 David Kilzer <ddkilzer@apple.com>
Replace use of Checked<size_t, RecordOverflow> with CheckedSize
<https://webkit.org/b/210461>
Reviewed by Mark Lam.
* platform/audio/ios/AudioFileReaderIOS.cpp:
(WebCore::createAudioBufferList):
* platform/graphics/ImageBufferBackend.cpp:
(WebCore::ImageBufferBackend::calculateBackendSize):
* platform/graphics/win/Direct2DUtilities.cpp:
(WebCore::Direct2D::createDirect2DImageSurfaceWithData):
* platform/graphics/win/ImageBufferDirect2DBackend.cpp:
(WebCore::ImageBufferDirect2DBackend::copyNativeImage const):
2020-04-13 Simon Fraser <simon.fraser@apple.com>
Add ENABLE_CUSTOM_SCROLLBARS and define it for macOS and for non-Cocoa platforms
https://bugs.webkit.org/show_bug.cgi?id=210460
Reviewed by Tim Horton.
Wrap all custom scrollbar and custom scroll corner code in ENABLE(CUSTOM_SCROLLBARS).
* page/FrameView.cpp:
(WebCore::FrameView::createScrollbar):
(WebCore::FrameView::updateScrollCorner):
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::createScrollbar):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::createScrollbar):
* rendering/RenderMenuList.cpp:
(RenderMenuList::createScrollbar):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock const):
* rendering/RenderObject.h:
* rendering/RenderScrollbar.cpp:
* rendering/RenderScrollbar.h:
* rendering/RenderScrollbarPart.cpp:
* rendering/RenderScrollbarPart.h:
* rendering/RenderScrollbarTheme.cpp:
* rendering/RenderScrollbarTheme.h:
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::createScrollbar):
* rendering/RenderTextControlSingleLine.cpp:
* style/StyleResolver.cpp:
2020-04-13 Kenneth Russell <kbr@chromium.org>
Clean up more resources during WebGLLayer teardown
https://bugs.webkit.org/show_bug.cgi?id=210222
Reviewed by Dean Jackson.
Release OpenGL resources just before destruction of the underlying
OpenGL context.
* platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
(WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer releaseGLResources]):
(-[WebGLLayer dealloc]): Deleted.
2020-04-13 Noam Rosenthal <noam@webkit.org>
Background images should figure into visually non empty heuristic
https://bugs.webkit.org/show_bug.cgi?id=208501
Reviewed by Simon Fraser.
This makes the visually non-empty heuristic treat background images the same
as it treats regular images. This is in line with first contentful paint spec in paint timing:
https://w3c.github.io/paint-timing/.
Note that the pixel count is computed based on the image size rather than the box size, as the box size might not be known at this time.
This is equivalent to the pixel reporting done for RenderImage.
Border-images and masks are excluded, as per the spec.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::imageChanged):
Call incrementVisuallyNonEmptyPixelCountIfNeeded for background images
* rendering/RenderElement.cpp:
(WebCore::RenderElement::RenderElement):
* rendering/RenderBox.cpp:
(WebCore::RenderElement::incrementVisuallyNonEmptyPixelCountIfNeeded):
* rendering/RenderBox.h:
* rendering/RenderImage.cpp:
(WebCore::RenderImage::incrementVisuallyNonEmptyPixelCountIfNeeded): Deleted.
* rendering/RenderImage.h:
Moved incrementVisuallyNonEmptyPixelCountIfNeeded from RenderImage to RenderElement
2020-04-13 Yusuke Suzuki <ysuzuki@apple.com>
module's default cross-origin value should be "anonymous"
https://bugs.webkit.org/show_bug.cgi?id=210326
Reviewed by Sam Weinig.
Tests: http/tests/security/cookie-module-import-propagate.html
http/tests/security/cookie-module-import.html
http/tests/security/cookie-module-propagate.html
http/tests/security/cookie-module.html
The original spec was using "omit" crossorigin for modules when crossorigin is not set / empty.
However, the spec is changed to sending requests with "same-origin" credentials ("anonymous" crossorigin mode)
by default. We should follow it.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptElementCachedScriptFetcher.h:
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script): While this is not directly related to this patch, added new tests found that we are returning
null StringView if the resource is zero byte. This totally works, but JSC::Parser has assertion that this is non-null
StringView. For zero byte CachedScript resource, we should return non-null empty StringView instead.
2020-04-13 Dean Jackson <dino@apple.com>
Add Apple's Reality files to AR System Preview
https://bugs.webkit.org/show_bug.cgi?id=210449
<rdar://problem/61732793>
Reviewed by Sam Weinig.
Add support for Apples .reality AR files - both the vendor MIME
Type and our UTI. These have been supported by WebKitAdditions for
a while. Move them into Open Source.
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
* platform/network/mac/UTIUtilities.mm:
(WebCore::UTIFromUnknownMIMEType):
2020-04-13 Per Arne Vollan <pvollan@apple.com>
[iOS] Remove unused UTType swizzler code
https://bugs.webkit.org/show_bug.cgi?id=210435
Unreviewed rollout of r258120.
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/UTTypeRecordSwizzler.h: Removed.
* platform/cocoa/UTTypeRecordSwizzler.mm: Removed.
2020-04-13 Commit Queue <commit-queue@webkit.org>
Unreviewed, reverting r260003.
https://bugs.webkit.org/show_bug.cgi?id=210441
Avoid using basic-authentication for tests (Requested by
yusukesuzuki on #webkit).
Reverted changeset:
"module's default cross-origin value should be "anonymous""
https://bugs.webkit.org/show_bug.cgi?id=210326
https://trac.webkit.org/changeset/260003
2020-04-13 Antti Koivisto <antti@apple.com>
[CSS Selectors] Selectors Level 4 specificity calculation for pseudo classes
https://bugs.webkit.org/show_bug.cgi?id=210419
Reviewed by Simon Fraser.
CSS selector specification drafts at some point had a concept of "dynamic specificity" where
the specificity of a selector depended on the element it matched. It was only ever used with
:matches and :nth-child pseudo classes and has subsequently been removed. Selector specificity
can now always be computed statically.
There is a ton of code to support this obsolete feature. Remove it.
https://drafts.csswg.org/selectors-4/#specificity-rules
"The specificity of an :is(), :not(), or :has() pseudo-class is replaced by the specificity
of the most specific complex selector in its selector list argument.
Analogously, the specificity of an :nth-child() or :nth-last-child() selector is the specificity
of the pseudo class itself (counting as one pseudo-class selector) plus the specificity of the
most specific complex selector in its selector list argument (if any)."
* css/html.css:
Reorganize a :matches rule into a selector list to keep the exact specificites.
It matters here to select between listbox and menulist correctly based on the 'size' and 'multiple' attributes.
* css/CSSSelector.cpp:
(WebCore::selectorSpecificity):
(WebCore::maxSpecificity):
(WebCore::simpleSelectorSpecificityInternal):
(WebCore::CSSSelector::simpleSelectorSpecificity const):
Also handle nth here.
(WebCore::CSSSelector::specificity const):
(WebCore::simpleSelectorFunctionalPseudoClassStaticSpecificity): Deleted.
(WebCore::functionalPseudoClassStaticSpecificity): Deleted.
(WebCore::staticSpecificityInternal): Deleted.
(WebCore::CSSSelector::staticSpecificity const): Deleted.
Rename to just computeSpecificity(), there is no other kind than static.
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::match const):
(WebCore::SelectorChecker::matchHostPseudoClass const):
(WebCore::SelectorChecker::matchRecursively const):
(WebCore::SelectorChecker::checkOne const):
(WebCore::SelectorChecker::matchSelectorList const):
SelectorChecker doesn't need to deal with specificity anymore.
* css/SelectorChecker.h:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addNthChildType):
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::constructFragmentsInternal):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
Neither does SelectorCompiler.
* cssjit/SelectorCompiler.h:
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::selectorMatches const):
(WebCore::SelectorDataList::selectorClosest const):
* inspector/InspectorStyleSheet.cpp:
(WebCore::buildObjectForSelectorHelper):
(WebCore::selectorsFromSource):
(WebCore::InspectorStyleSheet::buildObjectForSelector):
(WebCore::InspectorStyleSheet::buildObjectForSelectorList):
(WebCore::InspectorStyleSheet::buildObjectForRule):
(WebCore::InspectorStyleSheet::buildArrayForRuleList):
(WebCore::hasDynamicSpecificity): Deleted.
* inspector/InspectorStyleSheet.h:
* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::setRuleSelector):
(WebCore::InspectorCSSAgent::addRule):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightSelector):
* style/ElementRuleCollector.cpp:
(WebCore::Style::ElementRuleCollector::ruleMatches):
(WebCore::Style::ElementRuleCollector::collectMatchingRulesForList):
Switch to get the specificity from the selector instead of computing it during selector checking.
* style/ElementRuleCollector.h:
* style/RuleData.cpp:
(WebCore::Style::computeMatchesBasedOnRuleHash):
(WebCore::Style::RuleData::RuleData):
(WebCore::Style::computeMatchBasedOnRuleHash): Deleted.
* style/RuleData.h:
(WebCore::Style::RuleData::matchesBasedOnRuleHash const):
(WebCore::Style::RuleData::matchBasedOnRuleHash const): Deleted.
This can be a bit instead of an enum since there is no need to communicate specificity.
2020-04-13 David Kilzer <ddkilzer@apple.com>
KeyedDecoder functions in ResourceLoadStatistics.{cpp,h} should return bool and use WARN_UNUSED_RETURN
<https://webkit.org/b/210414>
<rdar://problem/61693118>
Reviewed by Alex Christensen.
* loader/ResourceLoadStatistics.cpp:
(WebCore::decodeHashCountedSet):
(WebCore::decodeHashSet):
(WebCore::decodeOptionSet):
(WebCore::decodeFontHashSet):
(WebCore::decodeCanvasActivityRecord):
(WebCore::ResourceLoadStatistics::decode):
* loader/ResourceLoadStatistics.h:
- Change decode functions to return `bool`.
- Add WARN_UNUSED_RETURN to all decode functions.
- Check the return value of all decode functions.
2020-04-13 Said Abou-Hallawa <sabouhallawa@apple.com>
When drawing an image srcRect and imageRect have to be in the orientation of destRect
https://bugs.webkit.org/show_bug.cgi?id=210364
Reviewed by Darin Adler.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::drawImage):
Use the renderer to get the orientation of the image if it is available.
Otherwise fall back to computedStyle().
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
For async image decoding, we will use the none oriented size as the
sizeForDrawing. imageRect must be in the same orientation as destRect.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::drawImage):
srcRect must be in the same orientation as destRect.
2020-04-13 Joonghun Park <jh718.park@samsung.com>
Unreviewed. Remove redundant move in return statement.
Return statement already returns rvalue,
so we don't need move here.
This patch removes the build warning below since r259922.
warning: redundant move in return statement [-Wredundant-move]
No new tests, no new behaviours.
* page/csp/ContentSecurityPolicyResponseHeaders.h:
(WebCore::ContentSecurityPolicyResponseHeaders::decode):
* platform/network/cf/CertificateInfoCFNet.cpp:
(WTF::Persistence::decodeSecTrustRef):
2020-04-13 Youenn Fablet <youenn@apple.com>
Fix mute/unmute of CoreAudioCapture sources after revision 257914
https://bugs.webkit.org/show_bug.cgi?id=210381
Reviewed by Eric Carlson.
Revert part of revision 257914 since we still need the active source registration/unregistration when capturing in web process.
Make sure mock factory delegates all active source handling to CoreAudioCaptureSourceFactory,
now that the mock factory is using CoreAudioCaptureSources with a mock share dunit.
Tests: platform/ios/mediastream/audio-muted-in-background-tab-gpu-process.html
platform/ios/mediastream/getUserMedia-single-capture-gpu-process.html
* platform/mediastream/RealtimeMediaSourceFactory.h:
* platform/mediastream/mac/CoreAudioCaptureSource.cpp:
(WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
(WebCore::CoreAudioCaptureSource::startProducingData):
* platform/mock/MockRealtimeMediaSourceCenter.cpp:
2020-04-13 Michael Catanzaro <mcatanzaro@gnome.org>
Fix various build warnings
https://bugs.webkit.org/show_bug.cgi?id=210429
Reviewed by Mark Lam.
Fix -Wunused-parameter warning.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::texImage2DBase):
2020-04-13 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Pre-fill columnIntrinsicWidths vector
https://bugs.webkit.org/show_bug.cgi?id=210415
Reviewed by Antti Koivisto.
Vector<ColumnMinimumWidth> has a fixed number of entries (number of columns in the table).
(This patch also flips the shouldFlex flag to isFixedWidth. It reads better in the context of minimum _widths_).
Test: fast/layoutformattingcontext/table-with-column-spanner-first-row.html
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
2020-04-13 Adrian Perez de Castro <aperez@igalia.com>
[GTK4] Fix usage of GDK event functions in PlatformWheelEventGtk
https://bugs.webkit.org/show_bug.cgi?id=210160
Reviewed by Michael Catanzaro.
No new tests needed.
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent): Conditionally
use the new GDK event functions when building with GTK4.
2020-04-13 Yusuke Suzuki <ysuzuki@apple.com>
module's default cross-origin value should be "anonymous"
https://bugs.webkit.org/show_bug.cgi?id=210326
Reviewed by Sam Weinig.
The original spec was using "omit" crossorigin for modules when crossorigin is not set / empty.
However, the spec is changed to sending requests with "same-origin" credentials ("anonymous" crossorigin mode)
by default. We should follow it.
* dom/ScriptElement.cpp:
(WebCore::ScriptElement::requestModuleScript):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptElementCachedScriptFetcher.h:
* html/parser/HTMLResourcePreloader.cpp:
(WebCore::PreloadRequest::resourceRequest):
* loader/cache/CachedScript.cpp:
(WebCore::CachedScript::script): While this is not directly related to this patch, added new tests found that we are returning
null StringView if the resource is zero byte. This totally works, but JSC::Parser has assertion that this is non-null
StringView. For zero byte CachedScript resource, we should return non-null empty StringView instead.
2020-04-13 Charlie Turner <cturner@igalia.com>
[EME][GStreamer] remove m_cdmInstance ASSERT in cdmInstanceDetached
https://bugs.webkit.org/show_bug.cgi?id=210331
Reviewed by Xabier Rodriguez-Calvar.
In tests that reset the src very quickly, the MediaKeys can be
installed and then the src is reset before an attachment message
is sent. Hence, detachment can result in no CDM currently
existing.
Covered by imported/w3c/web-platform-tests/encrypted-media.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::cdmInstanceDetached): Only
assert if the CDM instance has been set before detachment.
(WebCore::MediaPlayerPrivateGStreamer::attemptToDecryptWithInstance):
Do not need the .get(), the operator== overload in RefPtr does
this for us, and it makes the code more consistent.
2020-04-13 Rob Buis <rbuis@igalia.com>
Remove return parameter from FrameLoader::closeURL
https://bugs.webkit.org/show_bug.cgi?id=210404
Reviewed by Manuel Rego Casasnovas.
Remove return parameter from FrameLoader::closeURL since it always
returns true and is never tested.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::closeURL):
* loader/FrameLoader.h:
2020-04-13 Rob Buis <rbuis@igalia.com>
Remove addExtraFieldsToSubresourceRequest
https://bugs.webkit.org/show_bug.cgi?id=210407
Reviewed by Darin Adler.
Remove addExtraFieldsToSubresourceRequest since it can be replaced by
calling addExtraFieldsToRequest. The loadType parameter is not taken
into account by defaultRequestCachingPolicy so FrameLoadType::Standard
rather than m_loadType is passed.
This patch also replaces the isMainResource boolean parameter with an enum.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::addExtraFieldsToRequest):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::loadResourceSynchronously):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::addExtraFieldsToSubresourceRequest): Deleted.
* loader/FrameLoader.h:
* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage):
(WebCore::PingLoader::sendPing):
(WebCore::PingLoader::sendViolationReport):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
2020-04-12 Darin Adler <darin@apple.com>
Fix a few mispellings of descendant and propagation
https://bugs.webkit.org/show_bug.cgi?id=210409
Reviewed by Mark Lam.
* dom/Element.cpp:
(WebCore::Element::dispatchWheelEvent): "propagation"
* dom/TreeScopeOrderedMap.cpp:
(WebCore::TreeScopeOrderedMap::getAllElementsById const):
"descendants". Also refactored this function a bit.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const):
"descendants"
* rendering/RenderFrameSet.cpp:
(WebCore::resetFrameRendererAndDescendants): "descendants"
(WebCore::RenderFrameSet::positionFrames): "descendants"
(WebCore::RenderFrameSet::positionFramesWithFlattening): "descendants"
2020-04-12 Darin Adler <darin@apple.com>
Refactor and tighten up the CSSVariableReferenceValue class
https://bugs.webkit.org/show_bug.cgi?id=210406
Reviewed by Anders Carlsson.
* css/CSSCustomPropertyValue.h: Remove uneeded forward declaration of
CSSVariableReferenceValue, since it's not used here. Added inclde of
CSSVariableData.h since the use of Variant in this class does require
that header, which we were getting indirectly before from
CSSVariableReferenceValue.h in some translation units.
* css/CSSVariableReferenceValue.cpp:
(WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue): Moved here
from the header.
(WebCore::CSSVariableReferenceValue::create): Ditto.
(WebCore::CSSVariableReferenceValue::equals const): Ditto.
(WebCore::CSSVariableReferenceValue::customCSSText const): Use non-null to
indicate this is not serialized.
* css/CSSVariableReferenceValue.h: Reduced includes, inlining, marked
constructor explicit, removed unneeded m_serialized boolean.
* rendering/style/StyleCustomPropertyData.h: Remove unneeded include
of CSSVariableReferenceValue.h, not used here.
2020-04-12 Darin Adler <darin@apple.com>
Fix some strange uses of start/endOfDocument
https://bugs.webkit.org/show_bug.cgi?id=210408
Reviewed by Wenson Hsieh.
* editing/VisibleSelection.cpp:
(WebCore::VisibleSelection::setStartAndEndFromBaseAndExtentRespectingGranularity):
Call startOfDocument and endOfDocument without unnecessarily turning a Position
into a VisiblePostion, since those functions just require any node from the document.
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for column spanners
https://bugs.webkit.org/show_bug.cgi?id=210403
Reviewed by Antti Koivisto.
Table width constraint computation with spanner support is as follows:
1. Collect each cells' width constraints.
2. Collect fixed column widths set by <colgroup>'s and <col>s.
3. Find the min/max width for each columns using the cell constraints and the <col> fixed widths but ignore column spans.
4. Distribute column spanning cells min/max widths.
5. Add them all up and return the computed min/max widths.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Columns::hasFixedColumnsOnly const):
* layout/tableformatting/TableGrid.h:
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Column, Row and Cell boxes are always ContainerBoxes
https://bugs.webkit.org/show_bug.cgi?id=210402
Reviewed by Antti Koivisto.
These boxes are always ContainerBox types.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::Column):
(WebCore::Layout::TableGrid::Columns::addColumn):
(WebCore::Layout::TableGrid::Rows::addRow):
(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::appendCell):
(WebCore::Layout::TableGrid::insertCell):
(WebCore::Layout::TableGrid::removeCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Column::box const):
(WebCore::Layout::TableGrid::Row::box const):
(WebCore::Layout::TableGrid::Cell::box const):
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add support for fixed width columns
https://bugs.webkit.org/show_bug.cgi?id=210401
Reviewed by Antti Koivisto.
This is in preparation for adding support for spanner cells.
Fixed width columns (<col> and <td>) don't participate in the spanner width distribution.
* layout/FormattingContext.h:
(WebCore::Layout::FormattingContext::IntrinsicWidthConstraints::operator-=):
* layout/Verification.cpp:
(WebCore::Layout::areEssentiallyEqual):
(WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree):
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computedIntrinsicWidthConstraints):
(WebCore::Layout::TableFormattingContext::computedPreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns): Deleted.
(WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableFormattingContextGeometry.cpp:
(WebCore::Layout::TableFormattingContext::Geometry::intrinsicWidthConstraintsForCell):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::isFixedWidth const):
(WebCore::Layout::TableGrid::Cell::isFixedWidth const):
(WebCore::Layout::TableGrid::Slot::Slot):
(WebCore::Layout::TableGrid::appendCell):
(WebCore::Layout::TableGrid::Column::setWidthConstraints): Deleted.
(WebCore::Layout::TableGrid::Column::widthConstraints const): Deleted.
(WebCore::Layout::TableGrid::Column::hasFixedWidth const): Deleted.
(WebCore::Layout::TableGrid::widthConstraints): Deleted.
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::setWidthConstraints):
(WebCore::Layout::TableGrid::widthConstraints):
(WebCore::Layout::TableGrid::Column::setHasFixedWidthCell):
(WebCore::Layout::TableGrid::Column::hasFixedWidthCell const):
(WebCore::Layout::TableGrid::Slot::cell const):
(WebCore::Layout::TableGrid::Slot::cell):
(WebCore::Layout::TableGrid::Slot::widthConstraints const):
(WebCore::Layout::TableGrid::Slot::setWidthConstraints):
(WebCore::Layout::TableGrid::Slot::hasColumnSpan const):
(WebCore::Layout::TableGrid::Slot::hasRowSpan const):
(WebCore::Layout::TableGrid::Slot::isColumnSpanned const):
(WebCore::Layout::TableGrid::Slot::isRowSpanned const):
(WebCore::Layout::TableGrid::hasComputedWidthConstraints const): Deleted.
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Introduce dedicated SlotPosition/CellSpan structs
https://bugs.webkit.org/show_bug.cgi?id=210399
Reviewed by Antti Koivisto.
SlotPosition.column/row and CellSpan.column/row read better.
* layout/LayoutUnits.h:
(WebCore::Layout::SlotPosition::SlotPosition):
(WebCore::Layout::operator==):
(WTF::SlotPositionHash::hash):
(WTF::SlotPositionHash::equal):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::emptyValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::constructDeletedValue):
(WTF::HashTraits<WebCore::Layout::SlotPosition>::isDeletedValue):
* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::setRowSpan):
(WebCore::Layout::Box::setColumnSpan):
(WebCore::Layout::Box::rowSpan const):
(WebCore::Layout::Box::columnSpan const):
* layout/layouttree/LayoutBox.h:
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::appendCell):
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::Cell::startColumn const):
(WebCore::Layout::TableGrid::Cell::endColumn const):
(WebCore::Layout::TableGrid::Cell::startRow const):
(WebCore::Layout::TableGrid::Cell::endRow const):
(WebCore::Layout::TableGrid::Cell::columnSpan const):
(WebCore::Layout::TableGrid::Cell::rowSpan const):
(WebCore::Layout::TableGrid::Cell::span const):
(WebCore::Layout::TableGrid::Cell::size const): Deleted.
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Add table support to BlockFormattingContext::Geometry::inFlowWidthAndMargin
https://bugs.webkit.org/show_bug.cgi?id=210400
Reviewed by Antti Koivisto.
Use a slightly modified shrink-to-fit logic to compute the table width.
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2020-04-12 Zalan Bujtas <zalan@apple.com>
[LFC][TFC] Cleanup class/struct/variable names in TableGrid/TableFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=210397
Reviewed by Antti Koivisto.
This is in preparation for the column spanner work.
* layout/tableformatting/TableFormattingContext.cpp:
(WebCore::Layout::TableFormattingContext::layoutInFlowContent):
(WebCore::Layout::TableFormattingContext::layoutCell):
(WebCore::Layout::TableFormattingContext::positionTableCells):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForRows):
(WebCore::Layout::TableFormattingContext::setComputedGeometryForSections):
(WebCore::Layout::TableFormattingContext::ensureTableGrid):
(WebCore::Layout::TableFormattingContext::computePreferredWidthForColumns):
(WebCore::Layout::TableFormattingContext::computeAndDistributeExtraHorizontalSpace):
(WebCore::Layout::TableFormattingContext::useAsContentLogicalWidth):
(WebCore::Layout::TableFormattingContext::layoutTableCellBox): Deleted.
* layout/tableformatting/TableFormattingContext.h:
* layout/tableformatting/TableGrid.cpp:
(WebCore::Layout::TableGrid::Column::Column):
(WebCore::Layout::TableGrid::Column::hasFixedWidth const):
(WebCore::Layout::TableGrid::Columns::addColumn):
(WebCore::Layout::TableGrid::Columns::addAnonymousColumn):
(WebCore::Layout::TableGrid::Rows::addRow):
(WebCore::Layout::TableGrid::Row::Row):
(WebCore::Layout::TableGrid::Cell::Cell):
(WebCore::Layout::TableGrid::Slot::Slot):
(WebCore::Layout::TableGrid::slot):
(WebCore::Layout::TableGrid::appendCell):
(WebCore::Layout::TableGrid::insertCell):
(WebCore::Layout::TableGrid::removeCell):
(WebCore::Layout::TableGrid::widthConstraints):
(WebCore::Layout::TableGrid::ColumnsContext::addColumn): Deleted.
(WebCore::Layout::TableGrid::CellInfo::CellInfo): Deleted.
(WebCore::Layout::TableGrid::SlotInfo::SlotInfo): Deleted.
* layout/tableformatting/TableGrid.h:
(WebCore::Layout::TableGrid::totalHorizontalSpacing const):
(WebCore::Layout::TableGrid::hasComputedWidthConstraints const):
(WebCore::Layout::TableGrid::Column::box const):
(WebCore::Layout::TableGrid::Columns::list):
(WebCore::Layout::TableGrid::Columns::list const):
(WebCore::Layout::TableGrid::Columns::size const):
(WebCore::Layout::TableGrid::Columns::logicalWidth const):
(WebCore::Layout::TableGrid::Row::logicalBottom const):
(WebCore::Layout::TableGrid::Row::box const):
(WebCore::Layout::TableGrid::Rows::list):
(WebCore::Layout::TableGrid::Rows::rowList const):
(WebCore::Layout::TableGrid::Rows::size const):
(WebCore::Layout::TableGrid::Cell::startColumn const):
(WebCore::Layout::TableGrid::Cell::endColumn const):
(WebCore::Layout::TableGrid::Cell::startRow const):
(WebCore::Layout::TableGrid::Cell::endRow const):
(WebCore::Layout::TableGrid::Cell::columnSpan const):
(WebCore::Layout::TableGrid::Cell::rowSpan const):
(WebCore::Layout::TableGrid::Cell::position const):
(WebCore::Layout::TableGrid::Cell::size const):
(WebCore::Layout::TableGrid::Cell::box const):
(WebCore::Layout::TableGrid::columns const):
(WebCore::Layout::TableGrid::columns):
(WebCore::Layout::TableGrid::rows const):
(WebCore::Layout::TableGrid::rows):
(WebCore::Layout::TableGrid::cells):
(WebCore::Layout::TableGrid::CellInfo::startColumn const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::endColumn const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::startRow const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::endRow const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::columnSpan const): Deleted.
(WebCore::Layout::TableGrid::CellInfo::rowSpan const): Deleted.
(WebCore::Layout::TableGrid::Column::columnBox const): Deleted.
(WebCore::Layout::TableGrid::ColumnsContext::columns): Deleted.
(WebCore::Layout::TableGrid::ColumnsContext::columns const): Deleted.
(WebCore::Layout::TableGrid::ColumnsContext::logicalWidth const): Deleted.
(WebCore::Layout::TableGrid::columnsContext const): Deleted.
(WebCore::Layout::TableGrid::columnsContext): Deleted.
2020-04-11 Jack Lee <shihchieh_lee@apple.com>
Infinite loop in InsertListCommand::doApply()
https://bugs.webkit.org/show_bug.cgi?id=210354
<rdar://problem/61427778>
Reviewed by Darin Adler.
Function startOfNextParagraph may return an empty position. Added null check to exit the while loop
and stop looking for next paragraph.
Test: editing/inserting/insert-list-end-of-table.html
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
2020-04-11 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK1] Touch Bar flashes when typing in Vietnamese in Mail
https://bugs.webkit.org/show_bug.cgi?id=210394
<rdar://problem/60099560>
Reviewed by Tim Horton.
See WebKitLegacy/mac/ChangeLog for more details.
Currently, many users of TemporarySelectionChange use it to temporarily avoid propagating selection changes to
the client layer during temporary selection changes. This involves creating a TemporarySelectionChange without
a new selection, but with the `IgnoreSelectionChanges` option specified, which makes us call `Editor::
setIgnoreSelectionChanges` to suppress selection change notifications.
Do a bit of cleanup in this area by introducing IgnoreSelectionChangeForScope, which wraps a
TemporarySelectionChange and makes it easier for a handful of call sites that currently use
TemporarySelectionChange to hide selection changes from the client layer to get their desired behavior.
Test: CandidateTests.DoNotHideCandidatesDuringTextReplacement
* editing/Editor.cpp:
(WebCore::Editor::respondToChangedSelection):
* editing/Editor.h:
(WebCore::TemporarySelectionChange::TemporarySelectionChange):
(WebCore::IgnoreSelectionChangeForScope::IgnoreSelectionChangeForScope):
* page/DragController.cpp:
(WebCore::DragController::performDragOperation):
(WebCore::DragController::insertDroppedImagePlaceholdersAtCaret):
Replace these:
`TemporarySelectionChange ignoreSelectionChanges { frame, WTF::nullopt, TemporarySelectionOption::IgnoreSelectionChanges };`
...with these instead:
`IgnoreSelectionChangeForScope ignoreSelectionChanges { *frame };`
2020-04-11 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Can't scroll overflow:scroll in sideways-scrollable RTL document
https://bugs.webkit.org/show_bug.cgi?id=210389
Reviewed by Tim Horton.
ScrollingTree::handleWheelEvent() converts the event coordinates from view to "content"
coordinates, but we then jump into hit-testing on CALayers. In a sideways-scrollable
RTL document, the root content layer has a negative X offset which corresponds to
scrollOrigin; we need to map the point into the coordinate space of this layer
before entering layer-based hit-testing.
Tests: fast/scrolling/mac/async-scroll-overflow-rtl-zoomed.html
fast/scrolling/mac/async-scroll-overflow-rtl.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
* page/scrolling/mac/ScrollingTreeMac.mm:
(ScrollingTreeMac::scrollingNodeForPoint):
2020-04-10 Darin Adler <darin@apple.com>
Move more from live range to SimpleRange: callers of absoluteTextRects
https://bugs.webkit.org/show_bug.cgi?id=210369
Reviewed by Anders Carlsson.
* dom/Node.cpp:
(WebCore::Node::textRects const): Deleted.
* dom/Node.h: Updated for the above.
* dom/Range.cpp:
(WebCore::Range::absoluteBoundingBox const): Updated since absoluteTextRects
no longer has a RangeInFixedPosition* argument.
(WebCore::Range::absoluteTextRects const): Removed the unused RangeInFixedPosition*
argument.
* dom/Range.h: Got rid of unused RangeInFixedPosition type and also removed
RangeInFixedPosition* argument from the absoluteTextRects function. Later will
remove absoluteTextRects entirely.
* editing/Editor.cpp:
(WebCore::Editor::firstRectForRange const): Use RenderObject::absoluteTextQuads
and unitedBoundingBoxes rather than using RenderObject::absoluteBoundingBoxRectForRange.
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::detectContentInRange): Use SimpleRange rather than
live ranges.
* html/HTMLTextFormControlElement.cpp:
(WebCore::setContainerAndOffsetForRange): Moved from int to unsigned.
(WebCore::HTMLTextFormControlElement::selection const): Return Optional<SimpleRange>
rather than a live range.
* html/HTMLTextFormControlElement.h: Updated for the change above.
* page/TextIndicator.cpp:
(WebCore::initializeIndicator): Updated since absoluteTextRects no longer takes
a RangeInFixedPosition* argument.
* rendering/HighlightData.h: Removed stray obsolete declaration.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::absoluteBoundingBoxRectForRange): Deleted. Callers can
use absoluteTextQuads directly. We need to cut down on the number of separate
functions that are not really separate concepts, and this was used in only one place.
(WebCore::RenderObject::absoluteTextRects): Added. Replaces Range::absoluteTextRects
for all callers outside the live range class and will eventually replace it entirely.
* rendering/RenderObject.h: Updated for the above.
2020-04-11 Devin Rousso <drousso@apple.com>
REGRESSION (Safari 13.1?): Web Inspector: Debugger hang at breakpoint when using Keyboard Maestro
https://bugs.webkit.org/show_bug.cgi?id=210177
<rdar://problem/61485723>
Reviewed by Joseph Pecoraro.
Partial revert of r251036 <https://webkit.org/b/202716> to go back to using AppKit APIs
instead of `CFRunLoopRunInMode`. Only seems to affect WebKitLegacy.
* inspector/PageScriptDebugServer.h:
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::runEventLoopWhilePausedInternal):
(WebCore::PageScriptDebugServer::platformShouldContinueRunningEventLoopWhilePaused):
* inspector/mac/PageScriptDebugServerMac.mm: Added.
(WebCore::PageScriptDebugServer::platformShouldContinueRunningEventLoopWhilePaused):
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
2020-04-08 Darin Adler <darin@apple.com>
Use Node::length to replace Node::maxCharacterOffset and lastOffsetInNode; switch more offsets from int to unsigned
https://bugs.webkit.org/show_bug.cgi?id=210246
Reviewed by Antti Koivisto.
- The recently-added Node::length, which matches the DOM specification terminology
for node offsets as used in ranges, is the same as the existing maxCharacterOffset
and lastOffsetInNode functions. Deleted all uses of those and replaced them
with calls to Node::length. One of the benefits of this is that Node::length is
implemented more efficiently and is not a virtual function. Another is consistently
matching the DOM specification terminology.
- Many offsets, including the ones in live ranges, are currently implemented as signed
in WebKit, but are specified as unsigned in the DOM and HTML specifications. This
has very little observable effect from JavaScript that can affect website compatibility,
but it's still helpful to be consistent both with the specification and internally.
Accordingly, changed some of these to unsigned; more to come later.
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::previousBoundary): Use length instead of
maxCharacterOffset.
* dom/CharacterData.cpp:
(WebCore::CharacterData::maxCharacterOffset const): Deleted.
* dom/CharacterData.h: Deleted maxCharacterOffset override.
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::shiftMarkers): Use length instead of
maxCharacterOffset.
* dom/Node.cpp:
(WebCore::Node::maxCharacterOffset const): Deleted.
* dom/Node.h: Deleted maxCharacterOffset.
* dom/Position.cpp:
(WebCore::Position::computeOffsetInContainerNode const): Use length instead
of lastOffsetInNode.
* dom/Position.h:
(WebCore::lastOffsetInNode): Deleted.
(WebCore::lastPositionInNode): Use length instead of lastOffsetInNode.
(WebCore::minOffsetForNode): Use length instead of maxCharacterOffset.
(WebCore::offsetIsBeforeLastNodeOffset): Ditto.
* dom/RangeBoundaryPoint.h:
(WebCore::RangeBoundaryPoint::setToEndOfNode): Use length instead of
maxCharacterOffset.
* editing/ApplyBlockElementCommand.cpp:
(WebCore::isNewLineAtPosition): Use length instead of maxCharacterOffset.
(WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
Ditto.
* editing/ApplyStyleCommand.cpp:
(WebCore::ApplyStyleCommand::removeInlineStyle): Use length instead of
maxCharacterOffset.
* editing/Editing.cpp:
(WebCore::lastOffsetForEditing): Use length instead of mmaxCharacterOffset
and countChildNodes. Also improved the comment here.
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::styleAtSelectionStart): Use length instead of
maxCharacterOffset.
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApplyForSingleParagraph): Use length instead
of lastOffsetInNode.
* editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator):
USe length instead of lastOffsetInNode.
* editing/VisibleUnits.cpp:
(WebCore::previousBoundary): Use length instead of maxCharacterOffset.
2020-04-10 Alex Christensen <achristensen@webkit.org>
PersistentCoders should use modern decoding syntax
https://bugs.webkit.org/show_bug.cgi?id=207497
Reviewed by Darin Adler.
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::showCertificate):
* loader/FetchOptions.h:
(WebCore::FetchOptions::decodePersistent):
* page/csp/ContentSecurityPolicyResponseHeaders.h:
(WebCore::ContentSecurityPolicyResponseHeaders::encode const):
(WebCore::ContentSecurityPolicyResponseHeaders::decode):
* platform/PasteboardCustomData.cpp:
(WebCore::PasteboardCustomData::fromSharedBuffer):
* platform/network/ResourceLoadPriority.h:
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::encodeBase const):
(WebCore::ResourceRequestBase::decodeBase):
* platform/network/cf/CertificateInfo.h:
(WTF::Persistence::decodeCFData):
(WTF::Persistence::decodeSecTrustRef):
(WTF::Persistence::decodeCertificateChain):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
(WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
2020-04-10 Simon Fraser <simon.fraser@apple.com>
[macOS] Fix scrollbar display for async-scrolling overflow
https://bugs.webkit.org/show_bug.cgi?id=194101
Reviewed by Tim Horton.
We need to call positionOverflowControlsLayers() from RenderLayerBacking::updateGeometry(),
otherwise, on first load, scrollbar layers have no size because we try to position them
before we've created them.
Test: fast/scrolling/mac/overflow-scrollbars-should-be-visible.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::positionOverflowControls):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
2020-04-10 Simon Fraser <simon.fraser@apple.com>
[Async overflow] Can't scroll vertically while over a horizontal scroller in this content
https://bugs.webkit.org/show_bug.cgi?id=210356
<rdar://problem/60523731>
Reviewed by Tim Horton.
https://dozermapper.github.io/gitbook/documentation/customconverter.html has style
that triggers mismatched containing block and z-order layer trees, triggering the creation
of an "overflow scroll proxy node" in the scrolling tree.
If we encounter such a node in our ancestor tree walk while deciding which node to send
a wheel event too, we need to jump to the node that the proxy node is representing.
Test: fast/scrolling/mac/nested-overflow-proxy-node.html
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
2020-04-10 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, reverting r259764.
Causes layout test crashes under GuardMalloc
Reverted changeset:
"Release WebGLLayer earlier in ~GraphicsContextGLOpenGL"
https://bugs.webkit.org/show_bug.cgi?id=210213
https://trac.webkit.org/changeset/259764
2020-04-10 Peng Liu <peng.liu6@apple.com>
REGRESSION: (r259850)[ Mac wk1 Debug ] media/track/track-user-stylesheet.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=210350
Reviewed by Daniel Bates.
Revert the change in r259850.
* page/CaptionUserPreferences.cpp:
(WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
2020-04-10 Pinki Gyanchandani <pgyanchandani@apple.com>
Null ptr Deref in RadioButtonGroups::updateCheckedState
https://bugs.webkit.org/show_bug.cgi?id=210353
Reviewed by Chris Dumez.
This crash happened when the default checked setter was called for an input element and RadioButtonGroup was NULL.
Added condition to dereference the group only if it is non-null.
Test: fast/forms/input-element-default-checked-setter-crash.html
* dom/RadioButtonGroups.cpp:
(WebCore::RadioButtonGroups::updateCheckedState):
2020-04-10 Jack Lee <shihchieh_lee@apple.com>
ASSERTION FAILED: selection.isRange() in InsertListCommand::doApply
https://bugs.webkit.org/show_bug.cgi?id=210170
<rdar://problem/61410397>
Reviewed by Wenson Hsieh.
If selectionForParagraphIteration returns a non-range selection, there is no need for finding
multiple paragraphs. And since non-range selection is handled, the assertion can be removed.
Test: editing/inserting/insert-list-in-table-assert.html
* editing/InsertListCommand.cpp:
(WebCore::InsertListCommand::doApply):
2020-04-10 Antti Koivisto <antti@apple.com>
[CSS Shadow Parts] Bad style sharing between sibling elements with different part attributes
https://bugs.webkit.org/show_bug.cgi?id=210249
<rdar://problem/61547528>
Reviewed by Daniel Bates.
Style sharing optimization was unconditionally allowed for elements that were styled with part pseudo element.
This could lead to miscomputed style.
Test case by Justin Fagnani.
Test: fast/css/shadow-parts/shadow-part-style-sharing.html
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement):
Only allow style sharing if parts match.
== Rolled over to ChangeLog-2020-04-10 ==