WebKit-https.git
5 months agoUnreviewed build fix for WinCairo port
Hironori.Fujii@sony.com [Tue, 25 Feb 2020 07:37:45 +0000 (07:37 +0000)]
Unreviewed build fix for WinCairo port
https://bugs.webkit.org/show_bug.cgi?id=208112
<rdar://problem/59709701>

> WebCore\layout/inlineformatting/LineLayoutContext.cpp(337): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion
> WebCore\layout/inlineformatting/LineLayoutContext.cpp(361): error C2397: conversion from 'size_t' to 'WTF::Optional<unsigned int>' requires a narrowing conversion

* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::close): Changed the type of 'trailingInlineItemIndex' from 'auto' to 'unsigned'.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257297 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRefactor TextTrackCue to use more traditional design patterns
darin@apple.com [Tue, 25 Feb 2020 07:25:11 +0000 (07:25 +0000)]
Refactor TextTrackCue to use more traditional design patterns
https://bugs.webkit.org/show_bug.cgi?id=208114

Reviewed by Alex Christensen.

- Fixed is<VTTCue> to accurately match the class hierarchy. Before, TextTrackCueGeneric
  derived from VTTCue, but is<VTTCue> would return false. Normalizing this lets us use
  is<VTTCue> and downcast<VTTCue> in the conventional way.
- Made the TextTrackCue::isEqual function a non-virtual function that calls a virtual
  function TextTrackCue::cueContentsMatch. Before there was a mix of overridding both
  functions in derived classes, achieving the same thing in multiple ways with
  unneccessary additional virtual function call overhead.
- Made the TextTrackCue::toJSONString function a non-virtual function that calls a
  virtual funtion TextTrackCue::toJSON. Before there were two virtual functions and
  inconsistent patterns for which one was overridden.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::textTrackRemoveCue): Use downcast instead of toVTTCue.

* html/HTMLMediaElement.h: Removed some unneeded includes.

* html/shadow/MediaControlElements.cpp:
(WebCore::MediaControlTextTrackContainerElement::updateDisplay): Use downcast
instead of toVTTCue.
(WebCore::MediaControlTextTrackContainerElement::processActiveVTTCue): Removed
an assertion that no longer makes sense; guaranteed at runtime.

* html/shadow/MediaControls.h: Removed an unneeded include.

* html/track/DataCue.cpp:
(WebCore::toDataCue): Deleted. No need for this function since we can use
downcast<DataCue> instead.
(WebCore::DataCue::cueContentsMatch const): Removed unnecessary check of cueType.
The isEqual function checks cueType and only calls this function if it matches.
Use downcast instead of toDataCue.
(WebCore::DataCue::isEqual const): Deleted. Base class now handles this.
(WebCore::DataCue::doesExtendCue const): Deleted. Was never being called.
(WebCore::DataCue::toJSONString const): Deleted. Override toJSON instead.
(WebCore::DataCue::toJSON const): Moved the code here that used to be in toJSONString.

* html/track/DataCue.h: Reduced includes. Made overridden functions private
and final. Removed functions as mmentioned above. Changed WTF::LogArgument implementation
to just forward to TextTrackCue instead of reimplementing here.

* html/track/InbandDataTextTrack.cpp:
(WebCore::InbandDataTextTrack::removeCue): Use downcast instead of toDataCue.

* html/track/InbandGenericTextTrack.cpp: Removed an unneeded include.

* html/track/LoadableTextTrack.cpp:
(WebCore::LoadableTextTrack::LoadableTextTrack): Removed unneeded initialization of
m_isDefault, which is initialized in the class definition.
(WebCore::LoadableTextTrack::newCuesAvailable): Removed unneeded call to toVTTCue,
taking advantage of the better interface of getNewCues, which now returns
Vector<Ref<VTTCue>>, making the type explicit.

* html/track/TextTrack.cpp:
(WebCore::TextTrack::addCue): Use is<DataCue> instead of checking cueType.

* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::create): Fixed confusing naming that called the fragment the
cue is contained in "cueDocument"; call it cueFragment instead. This constructor
already required that the ScriptExecutionContext be a Document. Did the type cast
for that up front. In the future would be good to change the argument type to Document.
Also fixed how the newly-created fragment is passed to the constructor. The old code
tried to use DocumentFragment&& to pass ownership, but since this is a reference-counted
object it needs to be Ref<DocumentFragment>&&.
(WebCore::TextTrackCue::TextTrackCue):
(WebCore::TextTrackCue::scriptExecutionContext const): Moved this here from the header
file so we can compile without TextTrackCue.h including Document.h.
(WebCore::TextTrackCue::cueContentsMatch const): Removed the code that checks cueType.
It's now isEqual that is responsible for checking that the cueType matches, and
cueContentsMatch is only called when the types are the same.
(WebCore::TextTrackCue::isEqual const): Reordered the boolean checks a bit so it's
easier to see the logic; no need for a cascade of if statements.
(WebCore::TextTrackCue::doesExtendCue const): Deleted. Was never being called.
(WebCore::operator<<): Use downcast instead of toVTTCue.

* html/track/TextTrackCue.h: Made isEqual no longer virtual. The per-class behavior
is now all in the virtual cueContentsMatch function, only called by isEqual.
Removed uncalled doesExtendCue function. Added some argument names in cases where
the type alone did not make their purpose clear. Made some things more private.
Replaced m_scriptExecutionContext with m_document.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGeneric::create): Moved this function here from the header.
(WebCore::TextTrackCueGeneric::TextTrackCueGeneric): Initialized data members in the
class definition so they don't also need to be initialized here.
(WebCore::TextTrackCueGeneric::cueContentsMatch const): Rewrote using && rather than
castcading if statements, making the function shorter andd easier to read.
(WebCore::TextTrackCueGeneric::isEqual const): Deleted. Base class now handes this.
The old version had confusing logic to deal with checking cue type; can now do this
in a more straightforward way.
(WebCore::TextTrackCueGeneric::doesExtendCue const): Deleted. Was never called.
(WebCore::TextTrackCueGeneric::isOrderedBefore const): Use is<TextTrackCueGeneric>
and downcast<TextTrackCueGeneric>.
(WebCore::TextTrackCueGeneric::isPositionedAbove const): Ditto. Also merged two
if statements so there is less repeated logic.
(WebCore::TextTrackCueGeneric::toJSONString const): Deleted.
(WebCore::TextTrackCueGeneric::toJSON const): Moved code here that was in toJSONString.

* html/track/TextTrackCueGeneric.h: Made things more private. Changed WTF::LogArgument
implementation to just forward to TextTrackCue instead of reimplementing here.

* html/track/TextTrackCueList.cpp:
(WebCore::TextTrackCueList::create): Moved here from header.
* html/track/TextTrackCueList.h: Ditto.

* html/track/VTTCue.cpp: Moved undefinedPosition to be a private static constexpr
data member so it can be used in initialization.
(WebCore::VTTCueBox::applyCSSProperties): Use is<VTTCue> and downcast<VTTCue>.
(WebCore::VTTCue::create): Moved more overloads of this function here from the
header file.
(WebCore::VTTCue::VTTCue): Take Document instead of ScriptExecutionContext.
Also took the ScriptExecutionContext argument away from the initialize function.
(WebCore::VTTCue::initialize): Do less initialization here. This function is
only called in constructors, so it doesn't need to initialize anything that
is initialized in all constructors or initialized in the class definition.
What remains are things that require a little code to initialize and the
bitfields, which can't be initialized in the class definition.
(WebCore::VTTCue::setPosition): Rearranged the code a tiny bit.
(WebCore::copyWebVTTNodeToDOMTree): Made this a non-member function. Also changed
the argument types to use references.
(WebCore::VTTCue::getCueAsHTML): Updated for changes to copyWebVTTNodeToDOMTree.
(WebCore::VTTCue::removeDisplayTree): Check m_displayTree directly instead
of calling a hasDisplayTree function, since that's more a more straightforward
way to guard a subsequent line of code that then uses m_displayTree.
(WebCore::VTTCue::setCueSettings): Merged two if statements into one.
(WebCore::VTTCue::cueContentsMatch const): Rewrote using && rather than
castcading if statements, making the function shorter andd easier to read.
(WebCore::VTTCue::isEqual const): Deleted. Base class now handles this.
(WebCore::VTTCue::doesExtendCue const): Deleted. Was never called.
(WebCore::toVTTCue): Deleted.
(WebCore::VTTCue::toJSONString const): Deleted. Base class now handles this.
(WebCore::VTTCue::toJSON const): Added a comment.

* html/track/VTTCue.h: Moved create functions out of header, made some things
more private and final, initialized more data members in the class definition.
Removed toVTTCue. Changed WTF::LogArgument implementation to just forward to
TextTrackCue instead of reimplementing here. Corrected the isType function so
it knows about both cue types that result in a VTTCue object. This allows us
to use is<VTTCue> and downcast<VTTCue> in the normal way. Removed the FIXME
saying we should do that.

* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::getNewCues): Changed to return a Vector<Ref<VTTCue>>.
In modern C++ return value is better than an out argument for a function like
this, and the more-specific type helps us at the call sites.

* loader/TextTrackLoader.h: Updated for the above.

* page/CaptionUserPreferencesMediaAF.cpp: Removed unneeded include.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
Use #pragma once and removed some unneded includes and forward declarations.

* rendering/RenderVTTCue.cpp:
(WebCore::RenderVTTCue::RenderVTTCue): Use downcast<VTTCue>.
(WebCore::RenderVTTCue::layout): Removed unneeded call to toVTTCue.
(WebCore::RenderVTTCue::repositionGenericCue): Use downcast instead of
static_cast for TextTrackCueGeneric.

* style/RuleSet.cpp: Removed unneeded include.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257296 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WTF] Add tests for CompactRefPtrTuple
ysuzuki@apple.com [Tue, 25 Feb 2020 07:03:45 +0000 (07:03 +0000)]
[WTF] Add tests for CompactRefPtrTuple
https://bugs.webkit.org/show_bug.cgi?id=208172

Reviewed by Darin Adler.

Source/WTF:

Include Noncopyable.h.

* wtf/CompactRefPtrTuple.h:

Tools:

We copy tests from RefPtr for CompactRefPtrTuple to ensure that it is working correctly.
Many of tests are not necessary since currently CompactRefPtrTuple is non-copyable / non-movable.

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WTF/CompactRefPtrTuple.cpp: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257295 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoAX: Support relative frames for isolated trees correctly
cfleizach@apple.com [Tue, 25 Feb 2020 06:22:11 +0000 (06:22 +0000)]
AX: Support relative frames for isolated trees correctly
https://bugs.webkit.org/show_bug.cgi?id=208169
<rdar://problem/59746529>

Reviewed by Zalan Bujtas.

To support relative frames correctly for accessibility, we should:
  1) Only expose for isolated tree clients.
  2) Support FloatRects in the attribute variants.

This patch also fixes an issue where we weren't reserving capacity before using.

* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::setObjectVectorProperty):
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257294 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoDo not use target/icu.cmake
ysuzuki@apple.com [Tue, 25 Feb 2020 03:19:04 +0000 (03:19 +0000)]
Do not use target/icu.cmake
https://bugs.webkit.org/show_bug.cgi?id=208173

Reviewed by Don Olmstead.

icu.cmake is removed in r256731. Use find_package + ICU since WebKit offers find_package implementation
which can find appropriate system-installed ICU.

* Source/cmake/OptionsFTW.cmake:
* Source/cmake/OptionsJSCOnly.cmake:
* Source/cmake/OptionsMac.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257293 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoPS-2019-006: [GTK] WebKit - AXObjectCache - m_deferredFocusedNodeChange - UaF
changseok@webkit.org [Tue, 25 Feb 2020 03:02:03 +0000 (03:02 +0000)]
PS-2019-006: [GTK] WebKit - AXObjectCache - m_deferredFocusedNodeChange - UaF
https://bugs.webkit.org/show_bug.cgi?id=204342

Reviewed by Carlos Garcia Campos.

m_deferredFocusedNodeChange keeps pairs of a old node and a new one
to update a focused node later. When a node is removed in the document,
it is also removed from the pair vector. The problem is only comparing
the new node in each pair with a removed node decides the removal.
In the case where the removed node lives in m_deferredFocusedNodeChange
as an old node, a crash happens while we get a renderer of the removed node
to handle focused elements. To fix this, we find all entries of which old node
is matched to the removed node, and set their first value null.

No new tests since no functionality changed.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257292 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[LFC][IFC][Floats] Fix float boxes embedded to unbreakable inline runs.
zalan@apple.com [Tue, 25 Feb 2020 01:42:47 +0000 (01:42 +0000)]
[LFC][IFC][Floats] Fix float boxes embedded to unbreakable inline runs.
https://bugs.webkit.org/show_bug.cgi?id=208112
<rdar://problem/59709701>

Reviewed by Antti Koivisto.

This patch fixes the cases when the float is embedded to otherwise unbreakable inline content.
e.g. "text_<div style="float: left"></div>_content"

The logic goes like this:
1. collect the floats inside the unbreakable candidate content
2. mark them intrusive if they potentially influence the current line
3. at handleFloatsAndInlineContent(), adjust available width with the intrusive floats first
4. feed the inline content to the LineBreaker
6. commit the float content based on the line breaking result (commit none, partially, all).
(Note that this algorithm produces a different layout compared to WebKit trunk. It mostly matches FireFox though.)

* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
(WebCore::Layout::InlineFormattingContext::setDisplayBoxesForLine):
* layout/inlineformatting/InlineLineBuilder.cpp:
(WebCore::Layout::LineBuilder::moveLogicalLeft):
(WebCore::Layout::LineBuilder::moveLogicalRight):
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::isAtSoftWrapOpportunity):
(WebCore::Layout::nextWrapOpportunity):
(WebCore::Layout::LineCandidate::FloatContent::append):
(WebCore::Layout::LineLayoutContext::layoutLine):
(WebCore::Layout::LineLayoutContext::close):
(WebCore::Layout::LineLayoutContext::nextContentForLine):
(WebCore::Layout::LineLayoutContext::addIntrusiveFloats):
(WebCore::Layout::LineLayoutContext::revertIntrusiveFloats):
(WebCore::Layout::LineLayoutContext::handleFloatsAndInlineContent):
(WebCore::Layout::isLineConsideredEmpty): Deleted.
(WebCore::Layout::LineLayoutContext::tryAddingFloatContent): Deleted.
(WebCore::Layout::LineLayoutContext::tryAddingInlineItems): Deleted.
* layout/inlineformatting/LineLayoutContext.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRename the clashing WebOverlayLayer classes
simon.fraser@apple.com [Tue, 25 Feb 2020 01:38:47 +0000 (01:38 +0000)]
Rename the clashing WebOverlayLayer classes
https://bugs.webkit.org/show_bug.cgi?id=208156
rdar://problem/59739250

Reviewed by Tim Horton.

The name WebOverlayLayer was used in two places. Rename them both to more specific names.

Source/WebCore:

* page/cocoa/ResourceUsageOverlayCocoa.mm:
(-[WebResourceUsageOverlayLayer initWithResourceUsageOverlay:]):
(WebCore::ResourceUsageOverlay::platformInitialize):
(-[WebOverlayLayer initWithResourceUsageOverlay:]): Deleted.
(-[WebOverlayLayer drawInContext:]): Deleted.

Source/WebKitLegacy/mac:

* WebView/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController init]):
(-[WebOverlayLayer layoutSublayers]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257290 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoAdd canShare function for Web Share API v2
commit-queue@webkit.org [Tue, 25 Feb 2020 01:22:00 +0000 (01:22 +0000)]
Add canShare function for Web Share API v2
https://bugs.webkit.org/show_bug.cgi?id=207491

Patch by Nikos Mouchtaris <nmouchtaris@apple.com> on 2020-02-24
Reviewed by Tim Horton.

LayoutTests/imported/w3c:

Imported new web platform tests for canShare function.

* resources/import-expectations.json:
* web-platform-tests/web-share/OWNERS: Removed.
* web-platform-tests/web-share/idlharness.https.html: Removed.
* web-platform-tests/web-share/resources/manual-helper.js:
(setupManualShareTest):
(callWhenButtonClicked):
* web-platform-tests/web-share/resources/w3c-import.log:
* web-platform-tests/web-share/share-empty.https.html:
* web-platform-tests/web-share/share-url-invalid.https.html:
* web-platform-tests/web-share/share-without-user-gesture.https.html:
* web-platform-tests/web-share/w3c-import.log:

Source/WebCore:

Added files member to share data and canShare function to
navigator.cpp. Can share function should always be used
before call to share, and can be used to check if file
sharing is implemented by passing a share data object with
only files.

Imported new Web Platform Tests to test new function.

* page/Navigator.cpp:
(WebCore::Navigator::canShare): Will currently return false for
only file share data objects, since file sharing is currently
not implemented.
(WebCore::Navigator::share): Changed to use canShare to
determine if data is shareable.
* page/Navigator.h:
* page/NavigatorShare.idl:
* page/ShareData.h:
* page/ShareData.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257289 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[Win] Fix AppleWin build.
pvollan@apple.com [Tue, 25 Feb 2020 01:08:05 +0000 (01:08 +0000)]
[Win] Fix AppleWin build.
https://bugs.webkit.org/show_bug.cgi?id=208164

Unreviewed build fix.

Allow a warning which happens when building with older SDKs.

* Source/cmake/OptionsMSVC.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WTF] Attach WARN_UNUSED_RETURN to makeScopeExit and fix existing wrong usage
ysuzuki@apple.com [Tue, 25 Feb 2020 00:57:43 +0000 (00:57 +0000)]
[WTF] Attach WARN_UNUSED_RETURN to makeScopeExit and fix existing wrong usage
https://bugs.webkit.org/show_bug.cgi?id=208162

Reviewed by Robin Morisset.

Source/JavaScriptCore:

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseUnaryExpression):

Source/WebCore:

* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):

Source/WTF:

We should hold ScopeExit to call destructor when we exit from the scope actually.
Putting WARN_UNUSED_RETURN to fix existing misuse.

* wtf/Scope.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257285 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ews] commit-queue should check that patch have appropriate review flag
aakash_jain@apple.com [Tue, 25 Feb 2020 00:55:54 +0000 (00:55 +0000)]
[ews] commit-queue should check that patch have appropriate review flag
https://bugs.webkit.org/show_bug.cgi?id=208138

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(BugzillaMixin._is_patch_obsolete): Drive-by fix to set build properties for patch author, commiter and reviewer.
(BugzillaMixin._is_patch_cq_plus):
(BugzillaMixin._does_patch_have_acceptable_review_flag): Method to check if patch have r? or r- flag.
(ValidatePatch.start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257284 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WebGL] Unskip runnable WebGL 2.0.0 conformance suite for mac
justin_fan@apple.com [Tue, 25 Feb 2020 00:48:50 +0000 (00:48 +0000)]
[WebGL] Unskip runnable WebGL 2.0.0 conformance suite for mac
https://bugs.webkit.org/show_bug.cgi?id=208078

Unreviewed test gardening.

Actually run WebGL 2 tests. Update expectations for ANGLE backend.

* TestExpectations: Unskip non-DEQP WebGL 2.0.0 tests that do not crash nor timeout.
* platform/ios-wk2/TestExpectations: Continue to skip 2.0.0 on iOS WK2 until discrepancies can be addressed.
* webgl/2.0.0/conformance2/renderbuffers/framebuffer-object-attachment-expected.txt:
* webgl/2.0.0/conformance2/renderbuffers/invalidate-framebuffer-expected.txt:
* webgl/2.0.0/conformance2/renderbuffers/multisampled-renderbuffer-initialization-expected.txt:
* webgl/2.0.0/conformance2/rendering/blitframebuffer-test-expected.txt:
* webgl/2.0.0/conformance2/rendering/rgb-format-support-expected.txt:
* webgl/2.0.0/conformance2/textures/misc/tex-3d-size-limit-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257283 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mac wk2 Debug ] is inspector/dom-debugger/attribute-modified-style.html is flaky...
lawrence.j@apple.com [Tue, 25 Feb 2020 00:46:59 +0000 (00:46 +0000)]
[ Mac wk2 Debug ] is inspector/dom-debugger/attribute-modified-style.html is flaky crashing.
https://bugs.webkit.org/show_bug.cgi?id=208167

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257282 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION (r257126): fast/frames/flattening/iframe-tiny.html is flaky failing
zalan@apple.com [Tue, 25 Feb 2020 00:40:14 +0000 (00:40 +0000)]
REGRESSION (r257126): fast/frames/flattening/iframe-tiny.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=208055
<rdar://problem/59668089>

Reviewed by Simon Fraser.

In the frame flattening context when optional layout is delayed, getComputedStyle() might return
the un-flattened geometry unless the iframe element is forced to get laid out.
1. main frame content is loaded and laid out -> if the iframe content is not ready yet, we don't initiate iframe flattening.
2. iframe content is ready -> layout is scheduled.
3. getComputedStyle() is called which initiates a style update/layout on the main frame,
   but only dirty boxes trigger layout (the iframe renderer itself is not dirty <- this is where frame flattening fails: webkit.org/b/208161)
4. getComputedStyle() returns with the "stale" geometry.

* fast/frames/flattening/iframe-tiny.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257280 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUnreviewed, mark http/tests/cookies/document-cookie-after-showModalDialog.html as...
cdumez@apple.com [Tue, 25 Feb 2020 00:34:46 +0000 (00:34 +0000)]
Unreviewed, mark http/tests/cookies/document-cookie-after-showModalDialog.html as flaky on WK1.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257277 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoLLInt should fast path for jtrue/false on Symbols and Objects
keith_miller@apple.com [Mon, 24 Feb 2020 23:51:25 +0000 (23:51 +0000)]
LLInt should fast path for jtrue/false on Symbols and Objects
https://bugs.webkit.org/show_bug.cgi?id=208151

Reviewed by Yusuke Suzuki.

64-bit interpreter can fast path the case where an object or symbol
is passed to a jtrue or jfalse opcode. This is because these values
are always truthy.

Also, fix some weird indentation in LowLevelInterpreter.asm.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/JSType.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WebAuthn] Implement SPI for the platform authenticator
jiewen_tan@apple.com [Mon, 24 Feb 2020 23:51:17 +0000 (23:51 +0000)]
[WebAuthn] Implement SPI for the platform authenticator
https://bugs.webkit.org/show_bug.cgi?id=208087
<rdar://problem/59369305>

Reviewed by Brent Fulgham.

Source/WebCore:

Enhances AuthenticatorAssertionResponse to accommondate responses
returned from the platform authenticator.

Covered by API tests.

* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
(WebCore::AuthenticatorAssertionResponse::create):
(WebCore::AuthenticatorAssertionResponse::setAuthenticatorData):
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
* Modules/webauthn/AuthenticatorAssertionResponse.h:
(WebCore::AuthenticatorAssertionResponse::authenticatorData const):
(WebCore::AuthenticatorAssertionResponse::signature const):
(WebCore::AuthenticatorAssertionResponse::name const):
(WebCore::AuthenticatorAssertionResponse::displayName const):
(WebCore::AuthenticatorAssertionResponse::numberOfCredentials const):
(WebCore::AuthenticatorAssertionResponse::accessControl const):
(WebCore::AuthenticatorAssertionResponse::setSignature):
(WebCore::AuthenticatorAssertionResponse::setName):
(WebCore::AuthenticatorAssertionResponse::setDisplayName):
(WebCore::AuthenticatorAssertionResponse::setNumberOfCredentials):

Source/WebKit:

Here is the newly added SPI:
typedef NS_ENUM(NSInteger, _WKWebAuthenticationPanelUpdate) {
    ...
    _WKWebAuthenticationPanelUpdateLAError,
    _WKWebAuthenticationPanelUpdateLADuplicateCredential,
    _WKWebAuthenticationPanelUpdateLANoCredential,
};

typedef NS_ENUM(NSInteger, _WKWebAuthenticationTransport) {
    ...
    _WKWebAuthenticationTransportInternal,
};

@protocol _WKWebAuthenticationPanelDelegate <NSObject>
@optional
...
- (void)panel:(_WKWebAuthenticationPanel *)panel verifyUserWithAccessControl:(SecAccessControlRef)accessControl completionHandler:(void (^)(LAContext *))completionHandler;
@end

Illustrations:
1) _WKWebAuthenticationPanelUpdate: Three errors are added to help clients present meaningful error messages to users.
a) WKWebAuthenticationPanelUpdateLAError: An internal error, clients should inform users and terminate the platform
authentication process. This error can be returned at any time.
b) _WKWebAuthenticationPanelUpdateLADuplicateCredential: It means a credential is found to match an entry in the
excludeList. Clients should inform users and terminate the platform authentication process. This error will only be
returned during makeCredential and before verifyUserWithAccessControl delegate.
c) _WKWebAuthenticationPanelUpdateLANoCredential: It means no credentials are found. Clients should inform users and
terminate the platform authentication process. This error will only be returned during getAssertion and before
verifyUserWithAccessControl delegate.

2) _WKWebAuthenticationTransport: _WKWebAuthenticationTransportInternal is added such that clients can learn platform
authenticator will be used from _WKWebAuthenticationPanel.transports.

3) verifyUserWithAccessControl: A delegate that will be called during makeCredential or getAssertion when the platform
authenticator is involved. This delegate is used to obtain user verification from a LAContext. In addition, the LAContext
should evaluate the passed accessControl, such that the SEP protected credential private key can be used. A typical
example will be [LAContext evaluateAccessControl:accessControl operation:LAAccessControlOperationUseKeySign localizedReason:reply:].
Noted, for getAssertion, selectAssertionResponse will be called before verifyUserWithAccessControl. So users need to be
prompted to select a credential before the user verification.

In the scenario when both the platform authenticator and external authenticators are requested. Clients are advised to
wait until verifyUserWithAccessControl to show the combined UI. If any of the LAError states are received before
verifyUserWithAccessControl, clients should then only show the external authenticator UI. Also, platform authenticator and
external authenticators are being discovered at the same time, which means a user can plug in a security key at anytime.
If a valid response is received from the security key, the whole ceremony will be terminated.

Besides introducing the SPI, and all the necessary plumbing to make it happen. This patch also:
1) adds LocalAuthenticationSPI, which is used to check whether a given LAContext is unlocked or not;
2) improves MockLocalConnection such that mock testing can still be ran.

* Platform/spi/Cocoa/LocalAuthenticationSPI.h: Copied from Source/WebKit/UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h.
* UIProcess/API/APIWebAuthenticationPanel.cpp:
(API::WebAuthenticationPanel::WebAuthenticationPanel):
* UIProcess/API/APIWebAuthenticationPanelClient.h:
(API::WebAuthenticationPanelClient::verifyUser const):
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.h:
* UIProcess/API/Cocoa/_WKWebAuthenticationPanel.mm:
(wkWebAuthenticationTransport):
* UIProcess/WebAuthentication/Authenticator.h:
* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::verifyUser):
* UIProcess/WebAuthentication/AuthenticatorManager.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticationSoftLink.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.h:
* UIProcess/WebAuthentication/Cocoa/LocalAuthenticator.mm:
(WebKit::LocalAuthenticatorInternal::toNSData):
(WebKit::LocalAuthenticatorInternal::toArrayBuffer):
(WebKit::LocalAuthenticator::makeCredential):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterUserConsented):
(WebKit::LocalAuthenticator::continueMakeCredentialAfterAttested):
(WebKit::LocalAuthenticator::getAssertion):
(WebKit::LocalAuthenticator::continueGetAssertionAfterResponseSelected):
(WebKit::LocalAuthenticator::continueGetAssertionAfterUserConsented):
(WebKit::LocalAuthenticator::receiveException const):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.h:
(WebKit::LocalConnection::filterResponses const):
* UIProcess/WebAuthentication/Cocoa/LocalConnection.mm:
(WebKit::LocalConnection::isUnlocked const):
(WebKit::LocalConnection::getUserConsent const): Deleted.
(WebKit::LocalConnection::selectCredential const): Deleted.
* UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.h:
* UIProcess/WebAuthentication/Cocoa/WebAuthenticationPanelClient.mm:
(WebKit::WebAuthenticationPanelClient::WebAuthenticationPanelClient):
(WebKit::wkWebAuthenticationPanelUpdate):
(WebKit::WebAuthenticationPanelClient::selectAssertionResponse const):
(WebKit::WebAuthenticationPanelClient::verifyUser const):
* UIProcess/WebAuthentication/Mock/MockLocalConnection.h:
* UIProcess/WebAuthentication/Mock/MockLocalConnection.mm:
(WebKit::MockLocalConnection::isUnlocked const):
(WebKit::MockLocalConnection::filterResponses const):
(WebKit::MockLocalConnection::getUserConsent const): Deleted.
(WebKit::MockLocalConnection::selectCredential const): Deleted.
* UIProcess/WebAuthentication/WebAuthenticationFlags.h:
* WebKit.xcodeproj/project.pbxproj:

Tools:

Besides adding API tests, this patch also teaches TestWebKitAPI to use restricted entitlements.

* TestWebKitAPI/Configurations/TestWebKitAPI-macOS.entitlements:
* TestWebKitAPI/Configurations/TestWebKitAPI.xcconfig:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/_WKWebAuthenticationPanel.mm:
(-[TestWebAuthenticationPanelDelegate panel:updateWebAuthenticationPanel:]):
(-[TestWebAuthenticationPanelDelegate panel:selectAssertionResponse:completionHandler:]):
(-[TestWebAuthenticationPanelDelegate panel:verifyUserWithAccessControl:completionHandler:]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion-la.html: Copied from Tools/TestWebKitAPI/Tests/WebKitCocoa/web-authentication-get-assertion.html.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-la-duplicate-credential.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-la-error.html: Added.
* TestWebKitAPI/Tests/WebKitCocoa/web-authentication-make-credential-la.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257269 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRemove geometry information from the scrolling tree
simon.fraser@apple.com [Mon, 24 Feb 2020 23:45:30 +0000 (23:45 +0000)]
Remove geometry information from the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=208085

Reviewed by Sam Weinig.

The scrolling tree doesn't have enough information to do hit-testing because it has
no representation of layers that overlap scrollers. We'll have to do hit-testing another
way, so remove hit-testing-geometry data from the scrolling tree.

Source/WebCore:

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setRectRelativeToParentNode): Deleted.
* page/scrolling/ScrollingStateFrameHostingNode.cpp:
(WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
(WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
(WebCore::ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach): Deleted.
(WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect): Deleted.
* page/scrolling/ScrollingStateFrameHostingNode.h:
* page/scrolling/ScrollingStateScrollingNode.cpp:
(WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
(WebCore::ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach):
(WebCore::ScrollingStateScrollingNode::dumpProperties const):
(WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect): Deleted.
* page/scrolling/ScrollingStateScrollingNode.h:
(WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const): Deleted.
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::handleWheelEvent):
(WebCore::ScrollingTree::scrollingNodeForPoint):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
(WebCore::ScrollingTreeFrameHostingNode::parentToLocalPoint const): Deleted.
* page/scrolling/ScrollingTreeFrameHostingNode.h:
(WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::parentToLocalPoint const): Deleted.
(WebCore::ScrollingTreeFrameScrollingNode::localToContentsPoint const): Deleted.
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::ScrollingTreeNode):
(WebCore::ScrollingTreeNode::scrollingNodeForPoint const): Deleted.
* page/scrolling/ScrollingTreeNode.h:
(WebCore::ScrollingTreeNode::parentToLocalPoint const): Deleted.
(WebCore::ScrollingTreeNode::localToContentsPoint const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeScrollingNode::dumpProperties const):
(WebCore::ScrollingTreeScrollingNode::parentToLocalPoint const): Deleted.
(WebCore::ScrollingTreeScrollingNode::localToContentsPoint const): Deleted.
(WebCore::ScrollingTreeScrollingNode::scrollingNodeForPoint const): Deleted.
* page/scrolling/ScrollingTreeScrollingNode.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const): Deleted.
* rendering/RenderLayerCompositor.h:

Source/WebKit:

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameHostingNode>::encode):

LayoutTests:

* fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* scrollingcoordinator/scrolling-tree/absolute-in-nested-sc-scrollers-expected.txt:
* scrollingcoordinator/scrolling-tree/absolute-inside-stacking-in-scroller-expected.txt:
* scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/clipped-layer-in-overflow-nested-expected.txt:
* scrollingcoordinator/scrolling-tree/composited-in-absolute-in-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/composited-in-absolute-in-stacking-context-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/positioned-nodes-complex-expected.txt:
* scrollingcoordinator/scrolling-tree/positioned-nodes-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* scrollingcoordinator/scrolling-tree/sticky-in-overflow-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257268 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mac wk2 ] fast/scrolling/overflow-scroll-past-max.html is flaky failing
lawrence.j@apple.com [Mon, 24 Feb 2020 23:27:02 +0000 (23:27 +0000)]
[ Mac wk2 ] fast/scrolling/overflow-scroll-past-max.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=208160

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257265 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[iOS] Use one telemetry decoration for each sandbox rule
pvollan@apple.com [Mon, 24 Feb 2020 23:18:59 +0000 (23:18 +0000)]
[iOS] Use one telemetry decoration for each sandbox rule
https://bugs.webkit.org/show_bug.cgi?id=207897

Reviewed by Brent Fulgham.

Currently, we are using the decorations '(with telemetry)' and '(with telemetry-backtrace)' for some sandbox rules
in the WebContent process' sandbox. Only one of the two decorations should be used.

No new tests, no behavior change.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, mark several tests as flaky
dpino@igalia.com [Mon, 24 Feb 2020 23:15:10 +0000 (23:15 +0000)]
[GTK] Gardening, mark several tests as flaky
https://bugs.webkit.org/show_bug.cgi?id=208140

Unreviewed gardening.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257261 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUnreviewed, updating LLDB test for CompactPointerTuple.
ysuzuki@apple.com [Mon, 24 Feb 2020 22:46:02 +0000 (22:46 +0000)]
Unreviewed, updating LLDB test for CompactPointerTuple.
https://bugs.webkit.org/show_bug.cgi?id=207827

* lldb/lldb_webkit.py:
(WTFCompactPointerTupleProvider):
(WTFCompactPointerTupleProvider.update):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257257 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoChanged results due to ANGLE use
lawrence.j@apple.com [Mon, 24 Feb 2020 22:32:05 +0000 (22:32 +0000)]
Changed results due to ANGLE use
https://bugs.webkit.org/show_bug.cgi?id=207858

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257256 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WebAccessibilityObjectWrapper updateObjectBackingStore] should return the backing...
andresg_22@apple.com [Mon, 24 Feb 2020 22:18:59 +0000 (22:18 +0000)]
[WebAccessibilityObjectWrapper updateObjectBackingStore] should return the backing object.
https://bugs.webkit.org/show_bug.cgi?id=208153

Reviewed by Chris Fleizach.

Covered by existing tests.

Currently in many WebAccessibilityObjectWrapper's methods we call
updateObjectBackingStore followed by one or more calls to
axBackingObject. This patch eliminates this unnecessary call by making
updateObjectBackingStore return the backing object. It also cleans up
other unnecessary calls to axBackingObject and does some minor code
cleanup.

* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
(-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
(-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformPressAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
(-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
(-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
(-[WebAccessibilityObjectWrapper accessibilityReplaceRange:withText:]):
(-[WebAccessibilityObjectWrapper accessibilityInsertText:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
(-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
(-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257255 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoTemporarily disable in-process cookie cache as it seems to be causing hangs on iOS
cdumez@apple.com [Mon, 24 Feb 2020 22:08:30 +0000 (22:08 +0000)]
Temporarily disable in-process cookie cache as it seems to be causing hangs on iOS
https://bugs.webkit.org/show_bug.cgi?id=208152
<rdar://problem/59706587>

Reviewed by Alex Christensen.

* Shared/WebPreferences.yaml:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257254 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoContext menu platter animation is wrong occasionally when invoking it repeatedly...
timothy_horton@apple.com [Mon, 24 Feb 2020 21:51:49 +0000 (21:51 +0000)]
Context menu platter animation is wrong occasionally when invoking it repeatedly and rapidly
https://bugs.webkit.org/show_bug.cgi?id=208147
<rdar://problem/54436720>

Reviewed by Wenson Hsieh.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView contextMenuInteraction:willEndForConfiguration:animator:]):
If a new context menu interaction has started, don't remove the hint
container view out from under it when the previous animation finishes,
or the presentation animation will go crazy (in a variety of humorous
and unpredictable ways), because UIKit can't do coordinate conversion
through an unparented view.

Eventually the final animation will complete and unparent the view.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257242 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[JSC] 32-bits debug build broken after r257212
ticaiolima@gmail.com [Mon, 24 Feb 2020 21:42:35 +0000 (21:42 +0000)]
[JSC] 32-bits debug build broken after r257212
https://bugs.webkit.org/show_bug.cgi?id=208149

Reviewed by Yusuke Suzuki.

Changing `Structure::setCachedPrototypeChain` to use
`m_cachedPrototypeChainOrRareData.setMayBeNull`, since `chain` may be
null.

* runtime/StructureInlines.h:
(JSC::Structure::setCachedPrototypeChain):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUnreviewed, fix watchOS build
ysuzuki@apple.com [Mon, 24 Feb 2020 21:18:35 +0000 (21:18 +0000)]
Unreviewed, fix watchOS build
https://bugs.webkit.org/show_bug.cgi?id=207827

While watchOS does not use FTL at all, it still compiles.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileObjectKeys):
(JSC::FTL::DFG::LowerDFGToB3::compileCreatePromise):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
(JSC::FTL::DFG::LowerDFGToB3::loadStructureClassInfo):
(JSC::FTL::DFG::LowerDFGToB3::loadStructureCachedPrototypeChainOrRareData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257237 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[LFC][IFC][Floats] Fix float box handling inside unbreakable content
zalan@apple.com [Mon, 24 Feb 2020 21:15:21 +0000 (21:15 +0000)]
[LFC][IFC][Floats] Fix float box handling inside unbreakable content
https://bugs.webkit.org/show_bug.cgi?id=208109
<rdar://problem/59708646>

Reviewed by Antti Koivisto.

We've been handling float boxes and other inline items as mutually exclusive content (in the context of unbreakable candidate runs).
While this works in most cases, when the unbreakable content includes float boxes, the layout
ends up being incorrect.
This patch is in preparation for making sure we process the inline content and the associated float boxes as one entity.
(e.g "text_<div style="float: left"></div>_content" produces an unbreakable inline content of [text_][_content] and an associated float box)

* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::isAtSoftWrapOpportunity):
(WebCore::Layout::LineCandidate::FloatContent::append):
(WebCore::Layout::LineCandidate::FloatContent::list const):
(WebCore::Layout::LineCandidate::FloatContent::reset):
(WebCore::Layout::LineCandidate::reset):
(WebCore::Layout::LineLayoutContext::layoutLine):
(WebCore::Layout::LineLayoutContext::nextContentForLine):
(WebCore::Layout::LineLayoutContext::tryAddingFloatContent):
(WebCore::Layout::LineLayoutContext::tryAddingFloatItem): Deleted.
* layout/inlineformatting/LineLayoutContext.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257236 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoDocument / DOMWindow objects get leaked on CNN.com due to CSSTransitions
cdumez@apple.com [Mon, 24 Feb 2020 20:28:23 +0000 (20:28 +0000)]
Document / DOMWindow objects get leaked on CNN.com due to CSSTransitions
https://bugs.webkit.org/show_bug.cgi?id=208145

Reviewed by Antoine Quint.

Break reference cycles using WeakPtr so that CSSTransitions can no longer cause whole document / DOM trees to
get leaked.

* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
* animation/DocumentTimeline.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::setTarget):
* animation/KeyframeEffect.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257235 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoAdd a runtime flag dedicated to WebRTC codecs in GPUProcess
youenn@apple.com [Mon, 24 Feb 2020 20:06:24 +0000 (20:06 +0000)]
Add a runtime flag dedicated to WebRTC codecs in GPUProcess
https://bugs.webkit.org/show_bug.cgi?id=208136

Reviewed by Alex Christensen.

Source/WebCore:

Add a runtime flag for WebRTC codecs in GPUProcess.
Enable the flag by default for MacOS.

* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::webRTCPlatformCodecsInGPUProcessEnabled const):
(WebCore::RuntimeEnabledFeatures::setWebRTCPlatformCodecsInGPUProcessEnabled):
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
* platform/mediastream/libwebrtc/LibWebRTCProvider.h:
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):
(WebCore::Internals::setUseGPUProcessForWebRTC):

Source/WebKit:

Add a runtime flag dedicated to enabling WebRTC codecs in GPUProcess.
Use this flag instead of the media flag.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:
* WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
(WebKit::LibWebRTCProvider::createDecoderFactory):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoProvide alternate way to name Web Content process
commit-queue@webkit.org [Mon, 24 Feb 2020 19:17:15 +0000 (19:17 +0000)]
Provide alternate way to name Web Content process
https://bugs.webkit.org/show_bug.cgi?id=205224
rdar://57038084

Patch by Ellie Epskamp-Hunt <eepskamphunt@apple.com> on 2020-02-24
Reviewed by Alex Christensen.

Source/WebKit:

Test: TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm

Add the ability to set _processDisplayName on WKWebViewConfiguration to allow the name of the web
content process that appears in Activity Monitor to be set to a custom string.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/API/APIPageConfiguration.cpp:
(API::PageConfiguration::copy const):
* UIProcess/API/APIPageConfiguration.h:
(API::PageConfiguration::lsDisplayName const):
(API::PageConfiguration::setlsDisplayName):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _getDisplayNameWithCompletionHandler:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _lsDisplayName]):
(-[WKWebViewConfiguration _setlsDisplayName:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::getDisplayName):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::getDisplayName):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_lsDisplayName):
(WebKit::WebPage::close):
(WebKit::WebPage::didCommitLoad):
(WebKit::m_overriddenMediaType): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::updateActivePages):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::updateActivePages):

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/DisplayName.mm: Added.
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agofast/forms/ios/click-should-not-suppress-misspelling.html fails on iOS 13.4 beta
wenson_hsieh@apple.com [Mon, 24 Feb 2020 19:15:16 +0000 (19:15 +0000)]
fast/forms/ios/click-should-not-suppress-misspelling.html fails on iOS 13.4 beta
https://bugs.webkit.org/show_bug.cgi?id=208086
<rdar://problem/59631501>

Reviewed by Tim Horton.

In the iOS 13.4 beta, tapping near the caret rect in an editable text field causes the callout bar to toggle
visibility instead of triggering word-granularity spellchecking and changing the selection. This test in
particular dispatches two taps: the first at (100, 100), and the second at (300, 100) in content view
coordinates. However, since the page does not have a viewport, the entire page is scaled down on iPhone, such
that the second tap at (300, 100) ends up being very close to the caret rect.

To fix this, we simply make the text field take up 100% of the viewport width, and make the viewport use
device-width with an initial scale of 1. This ensures that the second tap will be somewhere near the end of the
misspelled word, which triggers spellchecking as intended by the test instead of just showing the callout bar.

* fast/forms/ios/click-should-not-suppress-misspelling-expected.txt:
* fast/forms/ios/click-should-not-suppress-misspelling.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoProtect WebProcessPool from null weak pointers in m_serviceWorkerProcesses map
youenn@apple.com [Mon, 24 Feb 2020 19:01:53 +0000 (19:01 +0000)]
Protect WebProcessPool from null weak pointers in m_serviceWorkerProcesses map
https://bugs.webkit.org/show_bug.cgi?id=208143
rdar://problem/58285589

Reviewed by Alex Christensen.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
(WebKit::WebProcessPool::updateServiceWorkerUserAgent):
(WebKit::WebProcessPool::updateProcessAssertions):
When iterating through the map, make sure it does not have a null entry.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoVersioning.
alancoon@apple.com [Mon, 24 Feb 2020 18:59:45 +0000 (18:59 +0000)]
Versioning.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257221 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoresults.webkit.org: Link to result archives
jbedard@apple.com [Mon, 24 Feb 2020 18:57:33 +0000 (18:57 +0000)]
results.webkit.org: Link to result archives
https://bugs.webkit.org/show_bug.cgi?id=207646
<rdar://problem/59395807>

Rubber-stamped by Aakash Jain.

* resultsdbpy/resultsdbpy/view/static/js/archiveRouter.js: Added.
(_ArchiveRouter): Retrieve json from archive-router endpoint.
(_ArchiveRouter.prototype._determineArgumentFromAncestry): Given an argument, default and ancestry values,
return the most specific value.
(_ArchiveRouter.prototype.hasArchive): Check if a suite and mode have an archive link.
(_ArchiveRouter.prototype.pathFor): Construct the path for archive access.
(_ArchiveRouter.prototype.labelFor): Return a label for an archive link.
* resultsdbpy/resultsdbpy/view/static/js/investigate.js:
(parametersForInstance): Extract from lambda function.
(testRunLink): Use parametersForInstance instead of a lambda function.
(archiveLink): Return an archive link for data.
(contentForData): Add archive link to view.
* resultsdbpy/resultsdbpy/view/static/js/timeline.js:
(TimelineFromEndpoint): Accept both suite and test.
(TimelineFromEndpoint.prototype.render.onDotEnterFactory): Add archive link to pop-over.
* resultsdbpy/resultsdbpy/view/templates/search.html: Pass suite and test to TimelineEndpoint.
* resultsdbpy/resultsdbpy/view/templates/suite_results.html: Pass suite to TimelineEndpoint.
* resultsdbpy/resultsdbpy/view/view_routes.py:
(ViewRoutes.__init__): Add archive_route dictionary.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257219 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[watchOS] Adopt UICollectionView-based SPI on PUICQuickboardListViewController
wenson_hsieh@apple.com [Mon, 24 Feb 2020 18:57:12 +0000 (18:57 +0000)]
[watchOS] Adopt UICollectionView-based SPI on PUICQuickboardListViewController
https://bugs.webkit.org/show_bug.cgi?id=208137
<rdar://problem/57756279>

Reviewed by Tim Horton.

Fixes deprecation warnings due to the main content area of PUICQuickboardListViewController becoming backed by a
UICollectionView rather than a UITableView. See below for more details.

* UIProcess/ios/forms/WKQuickboardListViewController.h:
* UIProcess/ios/forms/WKQuickboardListViewController.mm:
(-[WKQuickboardListCollectionViewItemCell topToLabelBaselineSpecValue]):
(-[WKQuickboardListCollectionViewItemCell baselineToBottomSpecValue]):

Add WKQuickboardListCollectionViewItemCell, a PUICQuickboardListCollectionViewItemCell subclass which will
replace WKQuickboardListItemCell.

* UIProcess/ios/forms/WKSelectMenuListViewController.mm:
(-[WKSelectMenuCollectionViewItemCell initWithFrame:]):
(-[WKSelectMenuCollectionViewItemCell imageView]):

Similarly, add WKSelectMenuCollectionViewItemCell, a collection view cell which replaces WKSelectMenuItemCell.

(-[WKSelectMenuListViewController didSelectListItem:]):
(-[WKSelectMenuListViewController didSelectListItemAtIndexPath:]):

Reimplement -didSelectListItem: using -didSelectListItemAtIndexPath:. The latter handles model updates when
the user interacts with select options in the Quickboard view controller that is collection-view-backed.

(-[WKSelectMenuListViewController listItemCellClass]):
(-[WKSelectMenuListViewController listItemCellReuseIdentifier]):
(-[WKSelectMenuListViewController itemCellForListItem:forIndexPath:]):
(-[WKSelectMenuListViewController collectionViewSectionIsRadioSection:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257218 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoWKWebViewConfiguration._corsDisablingPatterns should also disable CORS for non-Docume...
achristensen@apple.com [Mon, 24 Feb 2020 18:11:29 +0000 (18:11 +0000)]
WKWebViewConfiguration._corsDisablingPatterns should also disable CORS for non-DocumentThreadableLoader loading
https://bugs.webkit.org/show_bug.cgi?id=208035
<rdar://problem/58011337>

Reviewed by Tim Hatcher.

Source/WebCore:

Covered by an API test.

* loader/CrossOriginAccessControl.cpp:
(WebCore::createPotentialAccessControlRequest):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-1.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION (r248481): drag animation of a link starts from the incorrect location
wenson_hsieh@apple.com [Mon, 24 Feb 2020 18:05:20 +0000 (18:05 +0000)]
REGRESSION (r248481): drag animation of a link starts from the incorrect location
https://bugs.webkit.org/show_bug.cgi?id=208113
<rdar://problem/59448696>

Reviewed by Tim Horton.

For both dragging and context menu interactions, UIKit asks us for targeted previews, which are hosted under
container views provided by WebKit. These container views must be in the hierarchy (i.e. they must have a
UIWindow); otherwise, UIKit incorrectly computes some geometry when animating the previews. Prior to the fix for
<rdar://problem/57172514>, this caused targeted drag previews to animate in from a seemingly random location;
however, UIKit worked around this by falling back to the same codepath used for remotely hosted views, which
uses the last known touch location as an approximation of where to start the drag preview animation. This mostly
makes the bug go away, but the delta between the touch location and the actual location of the dragged element
in the page still causes some very minor visual differences.

Due to r248481, a separate UIView (_contextMenuHintContainerView) under the content view is used when generating
targeted previews for both drag and drop and context menu hints. This view is removed when the context menu
interaction ends; however, when starting a drag, the context menu interaction ends right before the drag session
actually begins, which means that when UIKit actually starts to animate the drag preview, the container view has
already been unparented.

To address this, introduce a separate _dragPreviewContainerView alongside _contextMenuHintContainerView, and use
this new view when generating targeted previews for dragging. This view is generated lazily and cleaned up
(unparented and cleared out) when the drag interaction has ended, in -cleanUpDragSourceSessionState.

* UIProcess/ios/WKContentViewInteraction.h:

Add _dragPreviewContainerView.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didCommitLoadForMainFrame]):
(-[WKContentView dataDetectionContextForPositionInformation:]):
(-[WKContentView containerForDragPreviews]):
(-[WKContentView containerForContextMenuHintPreviews]):

Split -containerViewForTargetedPreviews into -containerForDragPreviews and -containerForContextMenuHintPreviews,
and use them as appropriate.

(-[WKContentView _hideTargetedPreviewContainerViews]):

Renamed from _hideContextMenuHintContainer, since it hides both types of targeted preview containers now.

(-[WKContentView cleanUpDragSourceSessionState]):

Clear out and remove _dragPreviewContainerView here.

(-[WKContentView _deliverDelayedDropPreviewIfPossible:]):
(-[WKContentView dragInteraction:previewForLiftingItem:session:]):

Use -containerForDragPreviews when creating previews for dragging.

(-[WKContentView _createTargetedContextMenuHintPreviewIfPossible]):
(-[WKContentView contextMenuInteraction:previewForHighlightingMenuWithConfiguration:]):

Use -containerForContextMenuHintPreviews when creating previews for the context menu hint.

(-[WKContentView containerViewForTargetedPreviews]): Deleted.
(-[WKContentView _hideContextMenuHintContainer]): Deleted.
(-[WKContentView _createTargetedPreviewIfPossible]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[LFC][IFC] Remove redundant trailing line break handling.
zalan@apple.com [Mon, 24 Feb 2020 17:44:07 +0000 (17:44 +0000)]
[LFC][IFC] Remove redundant trailing line break handling.
https://bugs.webkit.org/show_bug.cgi?id=208108
<rdar://problem/59708620>

Reviewed by Antti Koivisto.

LineLayoutContext::layoutLine should be able to handle both cases of trailing line breaks.
(This patch also makes tryAddingInlineItems return explicit IsEndOfLine values.)

* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::layoutLine):
(WebCore::Layout::LineLayoutContext::tryAddingInlineItems):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUnreviewed, build fix for 32bit pointer architectures
ysuzuki@apple.com [Mon, 24 Feb 2020 17:42:20 +0000 (17:42 +0000)]
Unreviewed, build fix for 32bit pointer architectures
https://bugs.webkit.org/show_bug.cgi?id=207827

* runtime/Structure.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoVerify Prefetch and credential behavior
commit-queue@webkit.org [Mon, 24 Feb 2020 17:24:18 +0000 (17:24 +0000)]
Verify Prefetch and credential behavior
https://bugs.webkit.org/show_bug.cgi?id=200000

Patch by Rob Buis <rbuis@igalia.com> on 2020-02-24
Reviewed by Youenn Fablet.

Source/WebKit:

Cancel cross-origin prefetches for Vary: Cookie.

Test: http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
* NetworkProcess/cache/PrefetchCache.cpp:
(WebKit::PrefetchCache::take):

LayoutTests:

Add a test to verify that navigating to a prefetched main resource
that sets Vary: Cookie does send cookies.

* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie-expected.txt: Added.
* http/wpt/prefetch/link-prefetch-cross-origin-vary-cookie.html: Added.
* http/wpt/prefetch/resources/main-resource-cross-origin-set-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/main-resource-cross-origin-vary-cookie.py: Added.
(main):
* http/wpt/prefetch/resources/navigate-cross-origin-vary-cookie.html: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, update TestExpectations
dpino@igalia.com [Mon, 24 Feb 2020 17:07:52 +0000 (17:07 +0000)]
[GTK] Gardening, update TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=208128

Unreviewed gardening.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoProtect from null session in NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfN...
youenn@apple.com [Mon, 24 Feb 2020 16:42:17 +0000 (16:42 +0000)]
Protect from null session in NetworkDataTaskCocoa::restrictRequestReferrerToOriginIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=208127
rdar://problem/57937917

Reviewed by Chris Dumez.

In case of a data task whose session is destroyed, do not follow redirection early on.

* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[LFC][IFC][Floats] Move float handling out of LineBreaker
zalan@apple.com [Mon, 24 Feb 2020 16:12:51 +0000 (16:12 +0000)]
[LFC][IFC][Floats] Move float handling out of LineBreaker
https://bugs.webkit.org/show_bug.cgi?id=208107
<rdar://problem/59708575>

Reviewed by Antti Koivisto.

LineBreaker should only deal with inline content.

* layout/inlineformatting/InlineLineBreaker.cpp:
(WebCore::Layout::LineBreaker::shouldWrapFloatBox): Deleted.
* layout/inlineformatting/InlineLineBreaker.h:
* layout/inlineformatting/LineLayoutContext.cpp:
(WebCore::Layout::LineLayoutContext::tryAddingFloatItem):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRenderLayerBacking::notifyAnimationStarted calls directly into the old animation...
graouts@webkit.org [Mon, 24 Feb 2020 16:04:24 +0000 (16:04 +0000)]
RenderLayerBacking::notifyAnimationStarted calls directly into the old animation controller
https://bugs.webkit.org/show_bug.cgi?id=207979

Reviewed by Simon Fraser.

Only call into CSSAnimationController if the "Web Animations for CSS Animations" flag is disabled.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyAnimationStarted):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoHandle page closure for stale-while-revalidate revalidations
commit-queue@webkit.org [Mon, 24 Feb 2020 15:50:39 +0000 (15:50 +0000)]
Handle page closure for stale-while-revalidate revalidations
https://bugs.webkit.org/show_bug.cgi?id=204147

Patch by Rob Buis <rbuis@igalia.com> on 2020-02-24
Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Add test to verify that frame removal triggers revalidation cancellation.

* web-platform-tests/fetch/stale-while-revalidate/frame-removal-expected.txt: Added.
* web-platform-tests/fetch/stale-while-revalidate/frame-removal.html: Added.
* web-platform-tests/fetch/stale-while-revalidate/resources/stale-frame.py: Added.
(id_token):
(main):

Source/WebCore:

Add a new hook to LoaderStrategy to signal browsing context removal
and call it when the main frame stops all loaders.

Test: imported/w3c/web-platform-tests/fetch/stale-while-revalidate/frame-removal.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::stopAllLoaders):
* loader/LoaderStrategy.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::canUseCacheValidator const):

Source/WebKit:

Add a message for browsing context removal. When the message happens,
pass it down to the network cache to remove any pending
async revalidations for that page.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::browsingContextRemoved):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/cache/AsyncRevalidation.cpp:
(WebKit::NetworkCache::AsyncRevalidation::cancel):
* NetworkProcess/cache/AsyncRevalidation.h:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::startAsyncRevalidationIfNeeded):
(WebKit::NetworkCache::Cache::browsingContextRemoved):
* NetworkProcess/cache/NetworkCache.h:
(WebKit::NetworkCache::GlobalFrameID::hash const):
(WebKit::NetworkCache::operator==):
(WTF::GlobalFrameIDHash::hash):
(WTF::GlobalFrameIDHash::equal):
(WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::emptyValue):
(WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::constructDeletedValue):
(WTF::HashTraits<WebKit::NetworkCache::GlobalFrameID>::isDeletedValue):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
(WebKit::NetworkCache::SpeculativeLoad::cancel):
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::browsingContextRemoved):
* WebProcess/Network/WebLoaderStrategy.h:

Source/WebKitLegacy:

Provide empty stub for new method on LoaderStrategy.

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::browsingContextRemoved):
* WebCoreSupport/WebResourceLoadScheduler.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257206 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoFix for build: follow up to bug 208074.
andresg_22@apple.com [Mon, 24 Feb 2020 15:48:46 +0000 (15:48 +0000)]
Fix for build: follow up to bug 208074.
https://bugs.webkit.org/show_bug.cgi?id=208133

Unreviewed build fix.

No new tests needed.

* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::cellForColumnAndRow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION: (r256619) [ Mac wk1 Release ] legacy-animation-engine/fast/animation...
graouts@webkit.org [Mon, 24 Feb 2020 15:32:21 +0000 (15:32 +0000)]
REGRESSION: (r256619) [ Mac wk1 Release ] legacy-animation-engine/fast/animation/animation-mixed-transform-crash.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=208019
rdar://59676811

Reviewed by Antti Koivisto.

Since this test should be using the legacy animation engine, ensure that it does.

* legacy-animation-engine/fast/animation/animation-mixed-transform-crash.html:
* platform/mac-wk1/TestExpectations

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257204 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, update TestExpectations and baselines
dpino@igalia.com [Mon, 24 Feb 2020 11:43:06 +0000 (11:43 +0000)]
[GTK] Gardening, update TestExpectations and baselines
https://bugs.webkit.org/show_bug.cgi?id=208124

Unreviewed gardening.

* platform/gtk/TestExpectations:
* platform/gtk/fetch/fetch-url-serialization-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-serializable-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-transfer-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GStreamer][WPE] Add GstGLMemoryEGL support for the video-plane-display
philn@webkit.org [Mon, 24 Feb 2020 09:13:50 +0000 (09:13 +0000)]
[GStreamer][WPE] Add GstGLMemoryEGL support for the video-plane-display
https://bugs.webkit.org/show_bug.cgi?id=208046

Reviewed by Žan Doberšek.

The glupload element might fill EGL memories in some cases, so for
the video sink we can then directly access the corresponding
EGLImage and export it to DMABuf, instead of using the more
general GLMemory code path.

With this patch we also ensure that both DMABuf FD and stride are valid.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
(WebCore::GstVideoFrameHolder::handoffVideoDmaBuf):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[JSC] Shrink Structure
ysuzuki@apple.com [Mon, 24 Feb 2020 08:38:50 +0000 (08:38 +0000)]
[JSC] Shrink Structure
https://bugs.webkit.org/show_bug.cgi?id=207827

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch shrinks sizeof(Structure) from 112 to 96 (16 bytes) in architectures using 64 bit pointers.
Structure is one of the most frequently allocated JSCell in JSC. So it is worth doing
all the sort of bit hacks to make it compact as much as possible.

    1. Put outOfLineTypeFlags, maxOffset and transitionOffset into highest bits of m_propertyTableUnsafe,
       m_cachedPrototypeChain, m_classInfo, and m_transitionPropertyName. Do not use PackedPtr here since
       some of them are concurrently accessed by GC.
    2. Put m_inlineCapacity into lower 8 bits of m_propertyHash.
    3. Remove m_lock, and use Structure::cellLock() instead.
    4. Remove m_cachedPrototypeChain clearing from the concurrent collector since it is dead code, it was old code.
       We were setting m_cachedPrototypeChain only if Structure is for JSObject. Clearing happened only if it was not
       a Structure for JSObject.
    5. Previous Structure is held as StructureID m_previous. And m_previousOrRareData becomes m_cachedPrototypeChainOrRareData.

Many pairs are using CompactPointerTuple to make code clean.
Combining all of the above techniques saves us 16 bytes.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::create):
(JSC::AccessCase::propagateTransitions const):
* bytecode/AccessCase.h:
(JSC::AccessCase::structure const):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileCheckSubClass):
(JSC::DFG::SpeculativeJIT::compileObjectKeys):
(JSC::DFG::SpeculativeJIT::compileCreateThis):
(JSC::DFG::SpeculativeJIT::compileCreatePromise):
(JSC::DFG::SpeculativeJIT::compileCreateInternalFieldObject):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileObjectKeys):
(JSC::FTL::DFG::LowerDFGToB3::compileCreatePromise):
(JSC::FTL::DFG::LowerDFGToB3::compileCreateInternalFieldObject):
(JSC::FTL::DFG::LowerDFGToB3::compileCheckSubClass):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::emitLoadClassInfoFromStructure):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_create_this):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_create_this):
* jit/Repatch.cpp:
(JSC::tryCachePutByID):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::createStructure):
* runtime/ConcurrentJSLock.h:
(JSC::ConcurrentJSLockerBase::ConcurrentJSLockerBase):
(JSC::GCSafeConcurrentJSLockerImpl::GCSafeConcurrentJSLockerImpl):
(JSC::GCSafeConcurrentJSLockerImpl::~GCSafeConcurrentJSLockerImpl):
(JSC::ConcurrentJSLockerImpl::ConcurrentJSLockerImpl):
(JSC::GCSafeConcurrentJSLocker::GCSafeConcurrentJSLocker): Deleted.
(JSC::GCSafeConcurrentJSLocker::~GCSafeConcurrentJSLocker): Deleted.
(JSC::ConcurrentJSLocker::ConcurrentJSLocker): Deleted.
* runtime/JSCell.h:
* runtime/JSObject.cpp:
(JSC::JSObject::deleteProperty):
(JSC::JSObject::shiftButterflyAfterFlattening):
* runtime/JSObject.h:
(JSC::JSObject::getDirectConcurrently const):
* runtime/JSObjectInlines.h:
(JSC::JSObject::prepareToPutDirectWithoutTransition):
* runtime/JSType.cpp:
(WTF::printInternal):
* runtime/JSType.h:
* runtime/Structure.cpp:
(JSC::StructureTransitionTable::contains const):
(JSC::StructureTransitionTable::get const):
(JSC::StructureTransitionTable::add):
(JSC::Structure::dumpStatistics):
(JSC::Structure::Structure):
(JSC::Structure::create):
(JSC::Structure::findStructuresAndMapForMaterialization):
(JSC::Structure::materializePropertyTable):
(JSC::Structure::addPropertyTransitionToExistingStructureImpl):
(JSC::Structure::addPropertyTransitionToExistingStructureConcurrently):
(JSC::Structure::addNewPropertyTransition):
(JSC::Structure::removeNewPropertyTransition):
(JSC::Structure::changePrototypeTransition):
(JSC::Structure::attributeChangeTransition):
(JSC::Structure::toDictionaryTransition):
(JSC::Structure::takePropertyTableOrCloneIfPinned):
(JSC::Structure::nonPropertyTransitionSlow):
(JSC::Structure::flattenDictionaryStructure):
(JSC::Structure::pin):
(JSC::Structure::pinForCaching):
(JSC::Structure::allocateRareData):
(JSC::Structure::ensurePropertyReplacementWatchpointSet):
(JSC::Structure::copyPropertyTableForPinning):
(JSC::Structure::add):
(JSC::Structure::remove):
(JSC::Structure::visitChildren):
(JSC::Structure::canCachePropertyNameEnumerator const):
* runtime/Structure.h:
* runtime/StructureInlines.h:
(JSC::Structure::get):
(JSC::Structure::ruleOutUnseenProperty const):
(JSC::Structure::seenProperties const):
(JSC::Structure::addPropertyHashAndSeenProperty):
(JSC::Structure::forEachPropertyConcurrently):
(JSC::Structure::transitivelyTransitionedFrom):
(JSC::Structure::cachedPrototypeChain const):
(JSC::Structure::setCachedPrototypeChain):
(JSC::Structure::prototypeChain const):
(JSC::Structure::propertyReplacementWatchpointSet):
(JSC::Structure::checkOffsetConsistency const):
(JSC::Structure::add):
(JSC::Structure::remove):
(JSC::Structure::removePropertyWithoutTransition):
(JSC::Structure::setPropertyTable):
(JSC::Structure::clearPropertyTable):
(JSC::Structure::setOutOfLineTypeFlags):
(JSC::Structure::setInlineCapacity):
(JSC::Structure::setClassInfo):
(JSC::Structure::setPreviousID):
(JSC::Structure::clearPreviousID):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::createStructure):
(JSC::StructureRareData::create):
(JSC::StructureRareData::StructureRareData):
(JSC::StructureRareData::visitChildren):
* runtime/StructureRareData.h:
* runtime/StructureRareDataInlines.h:
(JSC::StructureRareData::setCachedPrototypeChain):
(JSC::StructureRareData::setPreviousID): Deleted.
(JSC::StructureRareData::clearPreviousID): Deleted.
* tools/JSDollarVM.cpp:
(JSC::JSDollarVMHelper::functionGetStructureTransitionList):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::jsCallEntrypointSlow):

Source/WTF:

Make CompactPointerTuple usable for storing 16 bits data.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CompactPointerTuple.h:
* wtf/CompactRefPtrTuple.h: Added.
* wtf/text/StringImpl.h:
* wtf/text/SymbolImpl.h:
(WTF::SymbolImpl::hashForSymbol const):
(WTF::SymbolImpl::SymbolImpl):

LayoutTests:

This test is half-broken since it relies on HashMap's order implicitly.
We changed SymbolImpl's hash code, so it makes the result different.

* inspector/debugger/tail-deleted-frames/tail-deleted-frames-this-value-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoAXIsolatedObject support for tables.
andresg_22@apple.com [Mon, 24 Feb 2020 00:54:42 +0000 (00:54 +0000)]
AXIsolatedObject support for tables.
https://bugs.webkit.org/show_bug.cgi?id=208074

Reviewed by Chris Fleizach.

Covered by existing tests.

AccessibilityObjectWrapper code and some utility functions in
AccessibilityObject.cpp assume that AX objects can be downcast to a
specialized subclass like AccessibilityTable. That is not true for
AXIsolatedObjects, and the reason why tables don’t work in IsolatedTree
mode.

To solve this problem, this patch exposes the AccessibilityTable
interface as part of the AXCoreObject. Thus it eliminates the need to
downcast an AX object to an AccessibilityTable. It also implements the
AccessibilityTable interface in the AXIsolatedObject class. The same
approach will be used in subsequent patches for other specialized
interfaces used by client code.

* accessibility/AccessibilityARIAGrid.cpp:
(WebCore::AccessibilityARIAGrid::addChildren):
* accessibility/AccessibilityARIAGrid.h:
* accessibility/AccessibilityARIAGridCell.cpp:
(WebCore::AccessibilityARIAGridCell::parentTable const):
(WebCore::AccessibilityARIAGridCell::rowIndexRange const):
(WebCore::AccessibilityARIAGridCell::columnIndexRange const):
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::disclosedRows):
(WebCore::AccessibilityARIAGridRow::disclosedByRow const):
(WebCore::AccessibilityARIAGridRow::parentTable const):
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::shouldUseAccessibilityObjectInnerText):
* accessibility/AccessibilityObject.cpp:
(WebCore::appendChildrenToArray): Use AXCoreObject interface instead of downcasting.
(WebCore::Accessibility::isAccessibilityObjectSearchMatchAtIndex): Use AXCoreObject interface instead of downcasting.
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityObjectInterface.h: AXCoreObject now exposes the table interface.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::ariaSelectedRows):
* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::AccessibilityTable):
(WebCore::AccessibilityTable::init):
(WebCore::AccessibilityTable::isExposable const):
(WebCore::AccessibilityTable::addChildren):
(WebCore::AccessibilityTable::headerContainer): Returns an AXCoreObject.

The following methods now return a vector of objects instead of taking
and out parameter. RVO guaranties that this does not cause extra copy.
(WebCore::AccessibilityTable::columns):
(WebCore::AccessibilityTable::rows):
(WebCore::AccessibilityTable::columnHeaders):
(WebCore::AccessibilityTable::rowHeaders):
(WebCore::AccessibilityTable::visibleRows):
(WebCore::AccessibilityTable::cells):

(WebCore::AccessibilityTable::tableLevel const):
(WebCore::AccessibilityTable::roleValue const):
(WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
(WebCore::AccessibilityTable::title const):
(WebCore::AccessibilityTable::isExposableThroughAccessibility const): Renamed to just isExposable.
* accessibility/AccessibilityTable.h:
(WebCore::AccessibilityTable::supportsSelectedRows): Deleted.
* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentTable const):
(WebCore::AccessibilityTableCell::isTableCell const):
(WebCore::AccessibilityTableCell::columnHeaders):
(WebCore::AccessibilityTableCell::rowHeaders):
* accessibility/AccessibilityTableCell.h:
* accessibility/AccessibilityTableColumn.cpp:
(WebCore::AccessibilityTableColumn::headerObject):
(WebCore::AccessibilityTableColumn::addChildren):
* accessibility/AccessibilityTableHeaderContainer.cpp:
(WebCore::AccessibilityTableHeaderContainer::addChildren):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::isTableRow const):
(WebCore::AccessibilityTableRow::parentTable const):
* accessibility/atk/WebKitAccessible.cpp:
(webkitAccessibleGetAttributes):
* accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
(webkitAccessibleTableGetColumnHeader):
(webkitAccessibleTableGetRowHeader):
* accessibility/atk/WebKitAccessibleInterfaceTableCell.cpp:
(webkitAccessibleTableCellGetColumnHeaderCells):
(webkitAccessibleTableCellGetRowHeaderCells):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper tableParent]):
(-[WebAccessibilityObjectWrapper accessibilityHeaderElements]):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
(WebCore::AXIsolatedObject::initializeAttributeData):
(WebCore::AXIsolatedObject::setObjectVectorProperty):
(WebCore::AXIsolatedObject::cellForColumnAndRow):
(WebCore::AXIsolatedObject::fillChildrenVectorForProperty const):
(WebCore::AXIsolatedObject::isAccessibilityTableInstance const):
(WebCore::AXIsolatedObject::isDataTable const): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::nodeForID const):
(WebCore::AXIsolatedTree::objectsForIDs const):
* accessibility/isolatedtree/AXIsolatedTree.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
In addition to replacing the downcast to AccessibilityTable, cleaned up
the unnecessary calls to self.axBackingObject. This used to be a macro,
but it is now a method that check for the execution thread and returns
the appropriate AX object.
(-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
(-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoNon-unified build fixes late February 2020 edition
aperez@igalia.com [Mon, 24 Feb 2020 00:31:16 +0000 (00:31 +0000)]
Non-unified build fixes late February 2020 edition
https://bugs.webkit.org/show_bug.cgi?id=208111

Unreviewed build fix.

Source/WebCore:

No new tests needed.

* dom/WindowEventLoop.cpp: Add missing include.
* html/HTMLEmbedElement.cpp: Ditto.
* html/HTMLFrameSetElement.cpp: Ditto.
* html/HTMLOptionElement.cpp: Ditto.
* html/HTMLTablePartElement.cpp: Ditto.
* html/HTMLTextFormControlElement.cpp: Ditto.
* html/RangeInputType.cpp: Ditto.
* inspector/agents/InspectorCSSAgent.cpp: Ditto.
* loader/ImageLoader.h: Add missing forward declration for WebCore::Document.
* platform/graphics/ImageBuffer.cpp: Add missing include.
* platform/graphics/filters/FilterEffect.cpp: Ditto.
* platform/wpe/ThemeWPE.h: Add missing include and forward declaration for WebCore::Path.
* svg/graphics/filters/SVGFilterBuilder.cpp: Add missing include.

Source/WebKit:

* NetworkProcess/NetworkSocketChannel.cpp: Add missing include.
* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::screenRectOfContents): Add missing namespace to usage of WebCore::IntRect.
(WebKit::WebFullScreenManager::didExitFullScreen): Add missing namespace to usage of
WebCore::FloatBoxExtent.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoFollow up element iterator work by reducing includes and using is<> in a few more...
darin@apple.com [Sun, 23 Feb 2020 21:41:42 +0000 (21:41 +0000)]
Follow up element iterator work by reducing includes and using is<> in a few more places
https://bugs.webkit.org/show_bug.cgi?id=207816

Reviewed by Antti Koivisto.

* accessibility/AccessibilityTableColumn.cpp: Removed unneeded includes.
* bindings/js/JSDOMWindowCustom.cpp: Ditto.
* dom/CustomElementRegistry.cpp: Ditto.
* dom/Node.cpp: Ditto.
* editing/markup.cpp: Ditto.
* html/GenericCachedHTMLCollection.cpp: Ditto.
* html/HTMLCollection.cpp: Ditto.
* html/HTMLFrameSetElement.cpp: Ditto.
* html/track/TextTrackCue.cpp: Ditto.
* page/scrolling/AxisScrollSnapOffsets.cpp: Ditto.

* platform/DataListSuggestionsClient.h: Reduced includes, use forward declarations.

* style/StyleResolver.cpp:
(WebCore::Style::isAtShadowBoundary): Use the is<ShadowRoot> function.

* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::pathOnlyClipping): Use is<RenderSVGText> and
is<SVGGraphicsElement>, tweak coding style a tiny bit, and fix wording of comments.

* svg/SVGAElement.cpp:
(WebCore::SVGAElement::createElementRenderer): Use is<SVGElement>.

* svg/SVGElement.cpp: Removed unneeded includes.
(WebCore::SVGElement::isOutermostSVGSVGElement): Use is<SVGElement> and
is<SVGForeignObjectElement>.
(WebCore::SVGElement::reportAttributeParsingError): Use is<SVGElement>.
(WebCore::SVGElement::updateRelativeLengthsInformation): Use
is<SVGGraphicsElement> and is<SVGElement>, and use an if statement instead of
a while loop since this doesn't loop.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Mark several async loading tests as failure
dpino@igalia.com [Sun, 23 Feb 2020 17:44:53 +0000 (17:44 +0000)]
[GTK] Mark several async loading tests as failure
https://bugs.webkit.org/show_bug.cgi?id=208105

Unreviewed gardening.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoFix HTMLDataListElement.options to include even options that are not suggestions
darin@apple.com [Sun, 23 Feb 2020 15:16:07 +0000 (15:16 +0000)]
Fix HTMLDataListElement.options to include even options that are not suggestions
https://bugs.webkit.org/show_bug.cgi?id=208102

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/forms/the-datalist-element/datalistoptions-expected.txt:
Expect this test to pass instead of failing.

Source/WebCore:

* html/ColorInputType.cpp:
(WebCore::ColorInputType::suggestedColors const): Use
HTMLDataListElement::suggestions instead of HTMLCollection, both for efficiency
and for correctness.

* html/GenericCachedHTMLCollection.cpp:
(WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const):
Removed code to filter out options that are not valid suggestions. This is not
called for in the HTML specification.

* html/HTMLDataListElement.cpp:
(WebCore::HTMLDataListElement::isSuggestion): Added.

* html/HTMLDataListElement.h: Added isSuggestion and suggestions functions so
logic about which datalist options are suggestions can be easily shared. The
suggestions uses the new filteredDescendants function template.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setupDateTimeChooserParameters): Use
HTMLDataListElement::suggestions instead of HTMLCollection.

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::suggestions):  Use
HTMLDataListElement::suggestions instead of HTMLCollection. Also added a FIXME
since this implementation uses case-insensitive ASCII but it's for user interface
and the current implementation might be insufficient for some lanagues.

* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::paintSliderTicks): Use
HTMLDataListElement::suggestions instead of HTMLCollection.

LayoutTests:

* fast/forms/datalist/datalist-expected.txt: Updated expectations.
* fast/forms/datalist/datalist.html: Updated test since the options collection
includes all options that are descendants, even ones that are not sugggestions.
The web platform tests already had this right; we had a failing test there.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257194 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GTK] Gardening, emit new baselines for WebGL tests
dpino@igalia.com [Sun, 23 Feb 2020 12:20:05 +0000 (12:20 +0000)]
[GTK] Gardening, emit new baselines for WebGL tests
https://bugs.webkit.org/show_bug.cgi?id=208103

Unreviewed gardening.

* platform/gtk/fast/canvas/webgl/copy-tex-image-and-sub-image-2d-bad-input-expected.txt: Added.
* platform/gtk/fast/canvas/webgl/draw-elements-out-of-bounds-uint-index-expected.txt: Added.
* platform/gtk/fast/canvas/webgl/drawElements-empty-vertex-data-expected.txt: Added.
* platform/gtk/fast/canvas/webgl/readPixels-float-expected.txt: Added.
* platform/gtk/fast/canvas/webgl/vertexAttribPointer-with-bad-offset-expected.txt: Added.
* platform/gtk/fast/canvas/webgl/webgl-drawarrays-crash-2-expected.txt: Added.
* platform/gtk/fast/canvas/webgl/webgl-drawarrays-crash-expected.txt: Added.
* platform/gtk/webgl/1.0.3/conformance/context/context-lost-restored-expected.txt: Added.
* platform/gtk/webgl/1.0.3/conformance/extensions/oes-texture-half-float-expected.txt: Added.
* platform/gtk/webgl/1.0.3/conformance/glsl/misc/shaders-with-name-conflicts-expected.txt: Added.
* platform/gtk/webgl/1.0.3/conformance/misc/webgl-specific-expected.txt: Added.
* platform/gtk/webgl/1.0.3/conformance/rendering/point-no-attributes-expected.txt: Added.
* platform/gtk/webgl/1.0.3/conformance/textures/texture-copying-feedback-loops-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257193 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRefine the DOM element iterator implementation
darin@apple.com [Sun, 23 Feb 2020 07:16:50 +0000 (07:16 +0000)]
Refine the DOM element iterator implementation
https://bugs.webkit.org/show_bug.cgi?id=208100

Reviewed by Antti Koivisto.

- Removed the duplicate descendant iterator, keeping the one that matches
  the style of the ancestor and child iterators.
- Removed the non-template elementAncestors, elementChildren, elementDescendants,
  and elementLineage functions and changed callers to use xxxOfType<Element> instead.
- Renamed "IteratorAdapter" templates to "Range", choosing that term to match the
  upcoming C++20 Ranges library and range-based for loops.
- Changed the iterators to use an actual "nullptr" for end, following the "sentinel"
  design pattern from the Ranges library. Still kept a tiny bit of using an iterator
  for end around, only so we can use iterator library functions like std::distance
  while waiting for std::ranges::distance, which is compatible with sentinels.
- Implemented const correctness by using const types instead of separate "Const"
  class templates. This cut down on source code size a lot. These element iterators
  don't need whole separate templates to implement the const correctness the way
  collection classes like HashMap do.
- Improved some other details, like using more const and constexpr on members.
  All the functions on a range are const, because the range itself doesn't ever
  get modified, and all functions on an iterator are also const, because only
  operations like ++ and -- actually modify the iterator.
- For now at least, removed extra code we don't need in practice. We never need to
  compare iterators to each other except when iterating a range, for example, so
  kept the != used for range iteration but not ==.
- Simplified the HTMLCollection implementations by taking advantage of the null-
  based and sentinel designs. There are various places where we can write
  simpler code and pass around fewer arguments.
- Added a new descendantsOfType template that takes a predicate and filters to only
  the elements that match that predicate. Similar concept to how we implement HTML
  collections, and possibly could be used even more eventually.
- Use std::iterator in ElementIterator so we don't need to do that in derived
  classes. Also made more of ElementIterator protected to make it more explicit
  that it's an abstract class template and not something to be used directly.

The most unusual clients of the elmeent ranges and iterators are HTMLCollection and
the related caches, and this patch includes changes to those to adopt the new model.

* Headers.cmake: Removed ElementDescendantIterator.h.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* dom/ChildNodeList.cpp:
(WebCore::ChildNodeList::ChildNodeList): Removed initialization of m_indexCache
since the constructor no longer requires arguments.
(WebCore::ChildNodeList::invalidateCache): Removed argument to
CollectionIndexCache::invalidate.
* dom/ChildNodeList.h: Removed collectionEnd, since it's no longer needed.

* dom/CollectionIndexCache.h: Removed the collection argument to the
constructor, hasValidCache, and invalidate functions. Updated algorithms to use
null style termination instead of actually relying on comparing with an end
iterator, since that works for our element iterators.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::childElementCount const):: Use an empty initializer
list instead of the result of the end function since std::distance requires
both begin and end iterators have the same type.

* dom/ElementAncestorIterator.h: Made the changes mentioned above, plus moved the
declarations of functions to the top of the file, since the classes are
implementation details, used downcast instead of static_cast.

* dom/ElementAndTextDescendantIterator.h: Renamed IteratorAdapter to Range,
mostly didn't make other changes since this is not one of the element iterators.

* dom/ElementChildIterator.h: Made the changes mentioned above, plus moved the
declarations of functions to the top of the file, since the classes are
implementation details.

* dom/ElementDescendantIterator.h: Removed.

* dom/ElementIterator.h: Made the changes mentioned above.

* dom/LiveNodeList.cpp: Removed some unneeded includes, including HTMLCollection.h.
(WebCore::LiveNodeList::LiveNodeList): Simplified a little bit.
(WebCore::LiveNodeList::rootNode): Moved to the header.

* dom/LiveNodeList.h: Updated since CollectionTraversal now uses the
more modern ElementDescendantIterator, not the older one that used a vector of
ancestors to do the iteration. Also use WTF_MAKE_ISO_NONALLOCATABLE since
LiveNodeList is an abstract class, and made some members protected. Removed
CachedLiveNodeList::rootNode since it was identical to LiveNodeList::rootNode,
and made LiveNodeList::rootNode protected so it can be called in
CachedLiveNodeList, and moved it to the header so it will still be inlined.
Simplified CachedListNodeList to use more final, to name long types less by
using "auto" and "using", and to not pass arguments to functions that don't
need them any more.

* dom/NameNodeList.cpp:
(WebCore::NameNodeList::create): Moved here from the header.
* dom/NameNodeList.h: Removed unneeded includes and comment, moved create
function out of the header.

* dom/TypedElementDescendantIterator.h: Made all the change mentioned above.
Also added a new filteredDescendants function, range, and iterator that uses
a filter function. Not used yet in this patch; use comes in a future one.

* html/CachedHTMLCollection.h: Updated includes, shortened type names,
and used auto to simplify the code a bit. Removed unneeded collection arguments
from various CollectionIndexCache functions.

* html/CollectionTraversal.h: Updated to use the new/typed version of
ElementDescendantIterator. Removed end functions. Use shorter type names.
Tweaked algorithms to use null termination for loops instead of end iterators.

* html/HTMLFormControlsCollection.h:
(WebCore::HTMLFormControlsCollection::item const): Removed unneeded class
template arguments.

* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::formElementIndex): Changed to use the null check
instead of comparing iterator with end.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::selectNextSourceChild): Ditto.

* html/HTMLTableSectionElement.cpp:
(WebCore::HTMLTableSectionElement::numRows const): Pass a default-constructed
iterator for end to std::distance. When we get C++20 we can clean this up by
using std::ranges::distances instead.

* html/LabelsNodeList.cpp:
(WebCore::LabelsNodeList::create): Moved here from the header.
* html/LabelsNodeList.h: Removed unneeded include, tweaked coding style a bit,
moved create function into the .cpp file.

* html/RadioNodeList.cpp: Removed unneeded include.
(WebCore::RadioNodeList::create): Moved this here from the header.
(WebCore::nonEmptyRadioButton): Renamed from toRadioButtonInputElement to make
a little clearer what the function does.
(WebCore::RadioNodeList::value const): Updated to use nonEmptyRadioButton and
straighten out the loop a tiny bit.
(WebCore::RadioNodeList::setValue): Ditto.
(WebCore::RadioNodeList::checkElementMatchesRadioNodeListFilter const): Deleted.
(WebCore::RadioNodeList::elementMatches const): Merged in the logic from
checkElementMatchesRadioNodeListFilter, since the separate function wasn't helpful.

* html/RadioNodeList.h: Removed unneeded includes. Moved the create function out
of the header. Removed unneeded override of the item function to tighten the
return type; not used in WebCore and not helpful for bindings. Made more private.

* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForDescendants): Use null checking
style for the loop rather than comparing with end.
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement): Remove an unneeded
local variable and braces.

* svg/SVGUseElement.cpp:
(WebCore::removeDisallowedElementsFromSubtree): Use null checking style rather than
comparing with end.
(WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto. Also use
dropAssertions rather than assigning to end with a comment saying it drops assertions.
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257192 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoFix some include mistakes and make some coding style tweaks to WebKit and WebKitTestR...
darin@apple.com [Sun, 23 Feb 2020 07:16:15 +0000 (07:16 +0000)]
Fix some include mistakes and make some coding style tweaks to WebKit and WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=208099

Reviewed by Antti Koivisto.

Source/WebKit:

* WebProcess/FullScreen/WebFullScreenManager.cpp: Removed some unneeded includes.

* WebProcess/WebCoreSupport/WebChromeClient.cpp: Removed some unneeded includes.
(WebKit::WebChromeClient::createDataListSuggestionPicker): Pass references.

* WebProcess/WebCoreSupport/WebDataListSuggestionPicker.cpp:
(WebKit::WebDataListSuggestionPicker::WebDataListSuggestionPicker): Take references
instead of pointers, since they must both be non-null.
(WebKit::WebDataListSuggestionPicker::handleKeydownWithIdentifier): Updated
to use reference.
(WebKit::WebDataListSuggestionPicker::didSelectOption): Ditto.
(WebKit::WebDataListSuggestionPicker::didCloseSuggestions): Ditto.
(WebKit::WebDataListSuggestionPicker::close): Ditto.
(WebKit::WebDataListSuggestionPicker::displayWithActivationType): Ditto.

* WebProcess/WebCoreSupport/WebDataListSuggestionPicker.h: Marked the class
final, made more functions private, use references instead of pointers,
renamed m_dataListSuggestionsClient to m_client since there is only one
client we are dealing with in this class.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setActiveDataListSuggestionPicker): Take reference.
* WebProcess/WebPage/WebPage.h: Updated for the above.

Source/WebKitLegacy/mac:

* DOM/DOMDocument.mm: Removed unneeded includes and re-sorted.
* DOM/DOMDocumentFragment.mm: Ditto.
* DOM/DOMHTMLFieldSetElement.mm: Ditto.

Tools:

* WebKitTestRunner/InjectedBundle/mac/AccessibilityNotificationHandler.mm:
Sorted includes the traditional way. Added an include of AccessibilityCommonMac.h
so we can use the -[NSString createJSStringRef] method.
(-[NSString createJSStringRef]): Deleted. This is a duplicate of the method
defined in AccessibilityCommonMac.mm, and was causing a linker warning.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoPut more of the datalist element implementation inside ENABLE(DATALIST_ELEMENT)
darin@apple.com [Sun, 23 Feb 2020 07:15:37 +0000 (07:15 +0000)]
Put more of the datalist element implementation inside ENABLE(DATALIST_ELEMENT)
https://bugs.webkit.org/show_bug.cgi?id=208098

Reviewed by Antti Koivisto.

Source/WebCore:

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::computeWillValidate const): Use
ancestorsOfType instead of a loop. Since this involves using the class
HTMLDataListElement, it's only implemented when ENABLE(DATALIST_ELEMENT)
is true. The old code would always do this validation for elements with
the datalist tag even if the element is not implemented, so this changes
behavior and affects some test results.

LayoutTests:

* platform/mac-wk1/TestExpectations: Removed some lines for tests that no longer
exist at the paths mentioned.

* platform/mac-wk1/fast/forms/form-pseudo-valid-style-expected.txt: Added.
* platform/mac-wk1/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-willValidate-expected.txt: Added.
* platform/win/fast/forms/form-pseudo-valid-style-expected.txt: Added.
Expect failure on the parts of these tests that are specific to datalist, since
datalist is not enabled in these configurations (mac-wk1) and (win). Before now,
the code wasn't properly conditionalized and some of the datalist behavior would
be active even when the feature was not enabled. Best longer term solution is to
turn this feature on for more platforms, perhaps all of them. For now, landed new
expected results for cases that EWS indicated; more may be necessary if there are
more platforms where this feature is not enabled.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257190 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoStop using QTKit for rendering WK1 video fullscreen controls
jer.noble@apple.com [Sun, 23 Feb 2020 05:45:57 +0000 (05:45 +0000)]
Stop using QTKit for rendering WK1 video fullscreen controls
https://bugs.webkit.org/show_bug.cgi?id=207795
<rdar://problem/48894915>

Reviewed by Jon Lee.

Source/WebCore:

Drive-by fixes:

- Don't set the video layer to not-visible when in video fullscreen mode.
- Export previously un-exported methods.
- Make some ios-only classes available on mac.
- Add a couple previously unimplemented properties to WebAVPlayerController needed by AVKit.
- WebCoreFullscreenWindow doesn't depend on FULLSCREEN_API.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::visibilityStateChanged):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::setVideoFullscreenLayer):
* platform/ios/PlaybackSessionInterfaceAVKit.h:
* platform/ios/PlaybackSessionInterfaceAVKit.mm:
(WebCore::PlaybackSessionInterfaceAVKit::externalPlaybackChanged):
* platform/ios/WebAVPlayerController.h:
* platform/ios/WebAVPlayerController.mm:
(-[WebAVPlayerController canSeekFrameBackward]):
(-[WebAVPlayerController canSeekFrameForward]):
* platform/mac/WebCoreFullScreenWindow.h:
* platform/mac/WebCoreFullScreenWindow.mm:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/spi/cocoa/AVKitSPI.h:
* pal/spi/mac/NSWindowSPI.h:
* pal/spi/mac/QTKitSPI.h: Removed.

Source/WebKit:

Use NSWindowSPI.h rather than declaring SPI in the source file.

* UIProcess/mac/WKFullScreenWindowController.mm:

Source/WebKitLegacy/mac:

Switch to using AVPlayerView instead of QTHUD to render our fullscreen controls.

In addition, switch to a modern NSWindow fullscreen API, with custom, smooth animations which
move the fullscreen window to a separate space. This requires subclassing AVPlayerView so that
fullscreen toggling will signal to the controller, so that our fullscreen button and the inline
version of same don't get out of sync. Because AVPlayerView requires an AVPlayer in order to
display the video layer, and we won't necessarily have an AVPlayer for MSE-backed videos, instead
install a custom overlay view inside the AVPlayerView in which to host the fullscreen video layer.

* WebView/WebVideoFullscreenController.h:
* WebView/WebVideoFullscreenController.mm:
(-[WebOverlayLayer layoutSublayers]):
(WebAVPlayerView_delegate):
(WebAVPlayerView_setDelegate):
(WebAVPlayerView_isFullScreen):
(WebAVPlayerView_enterFullScreen):
(WebAVPlayerView_exitFullScreen):
(allocWebAVPlayerViewInstance):
(-[WebVideoFullscreenController init]):
(-[WebVideoFullscreenController dealloc]):
(-[WebVideoFullscreenController fullscreenWindow]):
(-[WebVideoFullscreenController windowDidLoad]):
(-[WebVideoFullscreenController setVideoElement:]):
(-[WebVideoFullscreenController enterFullscreen:]):
(-[WebVideoFullscreenController exitFullscreen]):
(-[WebVideoFullscreenController applicationDidResignActive:]):
(-[WebVideoFullscreenController _requestExit]):
(-[WebVideoFullscreenController _requestEnter]):
(-[WebVideoFullscreenController cancelOperation:]):
(-[WebVideoFullscreenController playerViewIsFullScreen:]):
(-[WebVideoFullscreenController playerViewRequestEnterFullscreen:]):
(-[WebVideoFullscreenController playerViewRequestExitFullscreen:]):
(-[WebVideoFullscreenController customWindowsToEnterFullScreenForWindow:]):
(-[WebVideoFullscreenController window:startCustomAnimationToEnterFullScreenWithDuration:]):
(-[WebVideoFullscreenController customWindowsToExitFullScreenForWindow:]):
(-[WebVideoFullscreenController window:startCustomAnimationToExitFullScreenWithDuration:]):
(-[WebVideoFullscreenController windowDidEnterFullScreen:]):
(-[WebVideoFullscreenController windowWillExitFullScreen:]):
(-[WebVideoFullscreenController windowDidExitFullScreen:]):
(-[WebVideoFullscreenController clearFadeAnimation]): Deleted.
(-[WebVideoFullscreenController windowDidExitFullscreen]): Deleted.
(-[WebVideoFullscreenController windowDidEnterFullscreen]): Deleted.
(frameExpandedToRatioOfFrame): Deleted.
(createBackgroundFullscreenWindow): Deleted.
(-[WebVideoFullscreenController setupFadeAnimationIfNeededAndFadeIn:]): Deleted.
(-[WebVideoFullscreenController applicationDidChangeScreenParameters:]): Deleted.
(-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Deleted.
(-[WebVideoFullscreenController requestExitFullscreenWithAnimation:]): Deleted.
(-[WebVideoFullscreenController requestExitFullscreen]): Deleted.
(-[WebVideoFullscreenController fadeHUDIn]): Deleted.
(-[WebVideoFullscreenController observeValueForKeyPath:ofObject:change:context:]): Deleted.
(-[WebVideoFullscreenController rateChanged:]): Deleted.
(-[WebVideoFullscreenWindow initWithContentRect:styleMask:backing:defer:]): Deleted.
(-[WebVideoFullscreenWindow dealloc]): Deleted.
(-[WebVideoFullscreenWindow resignFirstResponder]): Deleted.
(-[WebVideoFullscreenWindow canBecomeKeyWindow]): Deleted.
(-[WebVideoFullscreenWindow mouseDown:]): Deleted.
(-[WebVideoFullscreenWindow cancelOperation:]): Deleted.
(-[WebVideoFullscreenWindow animatedResizeDidEnd]): Deleted.
(-[WebVideoFullscreenWindow animateFromRect:toRect:withSubAnimation:controllerAction:]): Deleted.
(-[WebVideoFullscreenWindow animationDidEnd:]): Deleted.
(-[WebVideoFullscreenWindow mouseMoved:]): Deleted.
* WebView/WebVideoFullscreenHUDWindowController.h: Removed.
* WebView/WebVideoFullscreenHUDWindowController.mm: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257189 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUse DOM element iterators more, and more consistently
darin@apple.com [Sun, 23 Feb 2020 04:56:03 +0000 (04:56 +0000)]
Use DOM element iterators more, and more consistently
https://bugs.webkit.org/show_bug.cgi?id=208097

Reviewed by Antti Koivisto.

Source/WebCore:

- Added uses of element iterators in many places that had hand-written loops.
- Eliminated most uses of elementAncestors, elementChildren, elementDescendants,
  and elementLineage functions and use ancestorsOfType<Element>,
  childrenOfType<Element>, descendantsOfType<Element> and lineageOfType<Element>
  instead. In particular, descendantsOfType<Element> uses a better traversal
  algorithm than elementDescendants does.

- Unrelated: Omit template arguments in various cases where the C++ language lets
  us just give the name of the class template without repeating the arguments.
- Unrelated: Remove some uses of the inefficient Node::nodeType function.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::mouseButtonListener const): Use
lineageOfType instead of elementLineage.

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest const):
Use ancestorsOfType instead of a handwritten loop.

* dom/AllDescendantsCollection.h:
(WebCore::AllDescendantsCollection::AllDescendantsCollection): Removed
class template arguments.
* dom/ClassCollection.h:
(WebCore::ClassCollection::ClassCollection): Ditto.

* dom/DocumentFragment.cpp:
(WebCore::DocumentFragment::getElementById const): Use
descendantsOfType insteadof elementDescendants.

* dom/Element.cpp:
(WebCore::Element::computeInheritedLanguage const): Use lineageOfType
instead of a handrwitten loop.

* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::closest const): Use lineageOfType instead of an
explicit loop.
(WebCore::elementsForLocalName): Use descendantsOfType instead of elementDescendants.
(WebCore::anyElement): Ditto.
(WebCore::SelectorDataList::executeSingleTagNameSelectorData const): Ditto.
(WebCore::SelectorDataList::executeSingleClassNameSelectorData const): Ditto.
(WebCore::SelectorDataList::executeSingleSelectorData const): Ditto.
(WebCore::SelectorDataList::executeSingleMultiSelectorData const): Ditto.
(WebCore::SelectorDataList::executeCompiledSimpleSelectorChecker const): Ditto.
(WebCore::SelectorDataList::executeCompiledSelectorCheckerWithCheckingContext const): Ditto.
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const): Ditto.

* dom/TagCollection.cpp:
(WebCore::TagCollectionNS::TagCollectionNS): Removed class template arguments.
(WebCore::TagCollection::TagCollection): Ditto.
(WebCore::HTMLTagCollection::HTMLTagCollection): Ditto.

* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToBodyElement const): Use the function
descendantsOfType<HTMLBodyElement> instead of getElementByTagName(bodyTag).
Also merged applyEditingStyleToElement in here.
(WebCore::Editor::applyEditingStyleToElement const): Deleted.

* editing/Editor.h: Deleted applyEditingStyleToElement.

* editing/FrameSelection.cpp:
(WebCore::scanForForm): Cleaned up descendantsOfType loop so there's no
explicit use of end. Also changed if nesting a little bit.

* editing/TextManipulationController.cpp:
(WebCore::ExclusionRuleMatcher::isExcluded): Use lineageOfType instead of
elementLineage.

* html/HTMLAllCollection.h: Removed class template arguments.

* html/HTMLElement.cpp:
(WebCore::elementAffectsDirectionality): Refactored so we get a more efficient
implementation when the type of the element is known.
(WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged):
Use lineageOfType instead of elementLineage.

* html/HTMLElement.h: Removed some uneeeded forward declarations.

* html/HTMLEmbedElement.cpp:
(WebCore::findWidgetRenderer): Use ancestorsOfType instead of a loop.

* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::enclosingFormControlElement): Deleted.

* html/HTMLFormControlElement.h: Deleted unused enclosingFormControlElement.

* html/HTMLFormControlsCollection.cpp:
(WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection): Removed
class template arguments.
(WebCore::HTMLFormControlsCollection::ownerNode const): Ditto.
(WebCore::HTMLFormControlsCollection::invalidateCacheForDocument): Ditto.

* html/HTMLOptGroupElement.cpp:
(WebCore::HTMLOptGroupElement::ownerSelectElement const): Use ancestorsOfType
instead of a hand-written loop.

* html/HTMLOptionElement.cpp:
(WebCore::HTMLOptionElement::parseAttribute): Use ancestorsOfType instead of
calling ownerDataListElement.
(WebCore::HTMLOptionElement::childrenChanged): Ditto.
(WebCore::HTMLOptionElement::ownerDataListElement const): Deleted. Since the
same option element can be used by multiple nested data list elements, the
concept of a single "owner" data list element isn't correct.
(WebCore::HTMLOptionElement::ownerSelectElement const): Use ancestorsOfType
instead of a hand-written loop.

* html/HTMLOptionElement.h: Deleted ownerDataListElement.

* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::HTMLOptionsCollection): Removed class
template arguments.

* html/HTMLTableCellElement.cpp:
(WebCore::HTMLTableCellElement::additionalPresentationAttributeStyle const):
Use auto since findParentTable now returns a const table pointer.
* html/HTMLTableColElement.cpp:
(WebCore::HTMLTableColElement::additionalPresentationAttributeStyle const):
Ditto.

* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::createSharedCellStyle): Made const.
(WebCore::HTMLTableElement::additionalCellStyle): Ditto.
(WebCore::HTMLTableElement::additionalGroupStyle): Ditto.

* html/HTMLTableElement.h: Made the functions const, and m_sharedCellStyle
mutable.

* html/HTMLTablePartElement.cpp:
(WebCore::HTMLTablePartElement::findParentTable const): Use ancestorsOfType
instead of a hand-written loop. Also revised return type to be const-consistent.

* html/HTMLTablePartElement.h: Updated return type.

* html/HTMLTableRowsCollection.cpp:
(WebCore::HTMLTableRowsCollection::HTMLTableRowsCollection): Removed class
template arguments.

* html/HTMLTextFormControlElement.cpp:
(WebCore::parentHTMLElement): Deleted.
(WebCore::HTMLTextFormControlElement::directionForFormData const): Use
lineageOfType rather than a hand-written loop. Also got rid of the multiple
strings in return paths since the function always returns one of two strings.

* inspector/InspectorAuditAccessibilityObject.cpp:
(WebCore::InspectorAuditAccessibilityObject::getElementsByComputedRole):
Use descendantsOfType instead of elementDescendants.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getMatchedStylesForNode): Use ancestorsOfType
instead of a hand-written loop.

* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::inspect): Use isElementNode and isDocumentNode
instead of the much slower nodeType.
(WebCore::InspectorDOMAgent::highlightMousedOverNode): Use isTextNode instead of
the much slower nodeType.

* page/DragController.cpp:
(WebCore::containingLinkElement): Added. Uses lineageOfType instead of elementLineage.
(WebCore::DragController::doSystemDrag): Updated for the above.

* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending):
Use ancestorsOfType instead of a hand-written loop.

* svg/SVGElement.h: Make computedStyle public so we can use it even after downcasting
to SVGElement or a class derived from it. This arises in the revised version of
SVGRenderSupport::updateMaskedAncestorShouldIsolateBlending, which will now be able
to compile a non-virtual call to the function as a bonus.

* xml/parser/XMLDocumentParser.cpp:
(WebCore::findXMLParsingNamespaces): Factored this function out from
parseDocumentFragment. Use lineageOfType instead of elementLineage. Also add a null
check that seems to have been needed before.
(WebCore::XMLDocumentParser::parseDocumentFragment): Use findXMLParsingNamespaces.

Source/WebKit:

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::containerElementForElement): Use ancestorsOfType to find the
HTMLDataListElement rather than an ownerDataListElement function.
While this behavior is correct as specified, the idea of an "owner"
data list element doesn't make sense since technically the same option
can be used for multiple nested data lists.

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::containsAnyFormElements const): Use childrenOfType
instead of NodeTraversal.
(WebKit::WebFrame::containsAnyFormControls const): Ditto.

* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::containingLinkAnchorElement): Renamed to add the word "anchor"
since this won't return link elements that aren't HTMLAnchorElement
instances. Use lineageOfType<HTMLAnchorElement> instead of elementLineage
with a separate type check.
(WebKit::elementPositionInformation): Updated for new name.
(WebKit::WebPage::performActionOnElement): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257188 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agofast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html is failing in...
wenson_hsieh@apple.com [Sun, 23 Feb 2020 02:30:07 +0000 (02:30 +0000)]
fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html is failing in iOS 13.4 beta
https://bugs.webkit.org/show_bug.cgi?id=208096
<rdar://problem/59632008>

Reviewed by Alexey Proskuryakov.

Tools:

In the iOS 13.4 beta, the fix for <rdar://problem/56422337> changed -[UIDatePicker setCalendar:], such that
if the new calendar locale matches that of the current calendar's locale (and several other properties of the
new NSCalendar are also unchanged), then the UIDatePicker's calendar will also avoid changing.

In our layout tests, the mechanism we use to simulate the user changing their preferred calendar is no longer
compatible with the above change since the swizzled NSCalendar instance does not have a locale set, so it will
default to the same locale as the one used in the original NSCalendar. This means the call to -setCalendar: ends
up being a no-op, so the test fails to override the simulated Japanese calendar type with a Gregorian calendar
in the credit card expiry field.

To fix this, additionally specify a calendar locale identifier when generating the mock NSCalendar.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.h:
(WTR::UIScriptController::setDefaultCalendarType):
* WebKitTestRunner/TestController.h:

Change m_overriddenCalendarIdentifier to m_overriddenCalendarAndLocaleIdentifiers, a pair of calendar
identifier and calendar locale identifier.

* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::swizzledCalendar):
(WTR::TestController::overriddenCalendarIdentifier const):
(WTR::TestController::overriddenCalendarLocaleIdentifier const):

Clean these up by returning the `NSString *` instead of making another `RetainPtr`.

(WTR::TestController::setDefaultCalendarType):

Plumb the new calendar's locale identifier through this method.

(WTR::TestController::cocoaResetStateToConsistentValues):
(WTR::TestController::getOverriddenCalendarIdentifier const): Deleted.
* WebKitTestRunner/cocoa/UIScriptControllerCocoa.h:
* WebKitTestRunner/cocoa/UIScriptControllerCocoa.mm:
(WTR::UIScriptControllerCocoa::setDefaultCalendarType):

LayoutTests:

Adjust the layout test to also set the mock calendar's locale.

* fast/forms/ios/force-gregorian-calendar-for-credit-card-expiry.html:
* resources/ui-helper.js:
(window.UIHelper.setDefaultCalendarType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoSome small improvements to DOM bindings for HTML collections
darin@apple.com [Sun, 23 Feb 2020 00:08:14 +0000 (00:08 +0000)]
Some small improvements to DOM bindings for HTML collections
https://bugs.webkit.org/show_bug.cgi?id=208092

Reviewed by Antti Koivisto.

* WebCore.xcodeproj/project.pbxproj: Added RadioNodeList.idl.

* html/HTMLAllCollection.idl: Specify [RequiresExistingAtomString] on the
argument to namedItem, and [AtomString] for the argument to item.
* html/HTMLCollection.idl: Ditto.
* html/HTMLFormControlsCollection.idl: Ditto.
* html/HTMLOptionsCollection.idl: Ditto.
* html/HTMLSelectElement.idl: Ditto.

* html/RadioNodeList.idl: Removed unneeded getter; the inherited one from NodeList
works correctly, and this isn't more efficient because of a more specific type.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoApp-bound domains should have separate Network Sessions
katherine_cheney@apple.com [Sat, 22 Feb 2020 03:43:15 +0000 (03:43 +0000)]
App-bound domains should have separate Network Sessions
https://bugs.webkit.org/show_bug.cgi?id=208026
<rdar://problem/59434006>

Reviewed by Brent Fulgham.

Source/WebKit:

Tests: http/tests/in-app-browser-privacy/app-bound-domain.html
       http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html

Supports network session switching for navigations to app-bound
domains. This requires updating the WebPage when a navigation occurs
to check whether it is to an app-bound destination. In case of a
process swap, this has to be done both in PolicyDecisionSender and
in the ProvisionalPageProxy::loadData and ProvisionalPageProxy::loadRequest
functions.

This patch also must send the In-App Browser privacy flag to the
Network process.

* NetworkProcess/NetworkDataTask.cpp:
(WebKit::NetworkDataTask::create):
* NetworkProcess/NetworkLoadParameters.h:
* NetworkProcess/NetworkResourceLoadParameters.cpp:
(WebKit::NetworkResourceLoadParameters::encode const):
(WebKit::NetworkResourceLoadParameters::decode):
* NetworkProcess/NetworkResourceLoadParameters.h:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::startNetworkLoad):
* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
Passes the isNavigatingToAppBoundDomain flag to the NetworkSession.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::hasAppBoundSession const):
(WebKit::NetworkProcess::setInAppBrowserPrivacyEnabled):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSession::hasAppBoundSession const):
(WebKit::NetworkSession::setInAppBrowserPrivacyEnabled):
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreHasAppBoundSession):
(WKWebsiteDataStoreSetInAppBrowserPrivacyEnabled):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _getWebViewCategoryFor:completionHandler:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasAppBoundSession):
(WebKit::NetworkProcessProxy::setInAppBrowserPrivacyEnabled):
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::hasAppBoundSession const):
(WebKit::WebsiteDataStore::setInAppBrowserPrivacyEnabled):
* UIProcess/WebsiteData/WebsiteDataStore.h:
A large portion of this patch is three functions for testing, one sets
the in-app browser privacy flag for the test case, one checks for an app-bound session, and one
checks to make sure the category was correctly set to app-bound domain.

* UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
(WebKit::WebsiteDataStore::parameters):
* NetworkProcess/NetworkSessionCreationParameters.cpp:
(WebKit::NetworkSessionCreationParameters::encode const):
(WebKit::NetworkSessionCreationParameters::decode):
* NetworkProcess/NetworkSessionCreationParameters.h:
Passes the In-app browser privacy flag value from NSUserDefaults to the network session.

* NetworkProcess/cocoa/NetworkSessionCocoa.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
(WebKit::NetworkSessionCocoa::sessionWrapperForTask):
(WebKit::NetworkSessionCocoa::appBoundSession):
(WebKit::NetworkSessionCocoa::hasAppBoundSession const):
(WebKit::NetworkSessionCocoa::invalidateAndCancel):
(WebKit::NetworkSessionCocoa::clearCredentials):
Creates a new session (or returns the existing app-bound session) if
the navigation is app-bound. This is the main change in this patch.

* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):
* Shared/LoadParameters.h:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::loadData):
(WebKit::ProvisionalPageProxy::loadRequest):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadRequest):
(WebKit::WebPageProxy::loadRequestWithNavigationShared):
(WebKit::WebPageProxy::loadData):
(WebKit::WebPageProxy::loadDataWithNavigationShared):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::loadRequest):
(WebKit::WebPage::loadDataImpl):
(WebKit::WebPage::loadData):
(WebKit::WebPage::loadAlternateHTML):
In the case of a process swap, we must add the
isNavigatingToAppBoundDomain boolean in LoadParameters to ensure it gets sent to
the new WebPage via the ProvisionalPageProxy.

(WebKit::WebPageProxy::PolicyDecisionSender::send):
Fixes a capitalization error.

(WebKit::WebPageProxy::isAppBoundDomain):
(WebKit::WebPageProxy::setIsNavigatingToAppBoundDomain):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::isNavigatingToAppBoundDomain):
These functions determine if the category is app-bound and update the
isNavigatingToAppBoundDomain boolean accordingly.

* Shared/PolicyDecision.h:
(WebKit::PolicyDecision::encode const):
(WebKit::PolicyDecision::decode):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNavigationActionSyncShared):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
For a non-process swap case, we can send the
isNavigatingToAppBoundDomain value in the
PolicyDecision struct.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
Sends the isNavigatingToAppBoundDomain boolean to the NetworkProcess
with the NetworkResourceLoadParameters.

(WebKit::WebPage::didReceivePolicyDecision):
(WebKit::WebPage::setIsNavigatingToAppBoundDomain):
* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::isNavigatingToAppBoundDomain):
The boolean value for isNavigatingToAppBoundDomain is stored
in the webPage so WebLoaderStrategy can access it to send to the
NetworkProcess.

Tools:

This patch is mostly test infrastructure involving 3 functions.
One sets in-app browser privacy as enabled in the network process
manually for the test. One ensures that setting the WebView category
works properly, and the last one checks for an app-bound session for
an app-bound navigation.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::getWebViewCategory):
(WTR::TestRunner::callDidReceiveWebViewCategoryCallback):
(WTR::TestRunner::hasAppBoundSession):
(WTR::TestRunner::setInAppBrowserPrivacyEnabled):
(WTR::TestRunner::callDidSetInAppBrowserPrivacyEnabledCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::ensureViewSupportsOptionsForTest):
Clearing the bundleID should happen right before setting a new one,
otherwise it clears the ID after it is set and returns a null ID.

(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::getWebViewCategory):
(WTR::InAppBrowserPrivacyCallbackContext::InAppBrowserPrivacyCallbackContext):
(WTR::inAppBrowserPrivacyBooleanResultCallback):
(WTR::inAppBrowserPrivacyVoidResultCallback):
(WTR::TestController::hasAppBoundSession):
(WTR::TestController::setInAppBrowserPrivacyEnabled):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):
(WTR::TestInvocation::didSetInAppBrowserPrivacyEnabled):
(WTR::TestInvocation::didReceivePrevalentDomains):
(WTR::TestInvocation::didReceiveWebViewCategory):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::getWebViewCategory):

LayoutTests:

Added two tests. One to test the proper categorization of app-bound
navigation, and one to check that switching sessions occurs when
navigating to an app-bound domain.

Since these tests use ITP to set user interaction, they should only
be run on iOS and mac-wk2.

* TestExpectations:
* http/tests/in-app-browser-privacy/app-bound-domain-expected.txt: Added.
* http/tests/in-app-browser-privacy/app-bound-domain.html: Added.
* http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain-expected.txt: Added.
* http/tests/in-app-browser-privacy/switch-session-on-navigation-to-app-bound-domain.html: Added.
* platform/ios/TestExpectations:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257185 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ iOS wk2 ] http/tests/workers/service/Client-properties-auxiliary.html is flaky...
lawrence.j@apple.com [Sat, 22 Feb 2020 00:40:04 +0000 (00:40 +0000)]
[ iOS wk2 ] http/tests/workers/service/Client-properties-auxiliary.html is flaky timing out.
https://bugs.webkit.org/show_bug.cgi?id=208081

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257182 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mac Debug ] legacy-animation-engine/animations/animation-welcome-safari.html is...
lawrence.j@apple.com [Sat, 22 Feb 2020 00:16:35 +0000 (00:16 +0000)]
[ Mac Debug ] legacy-animation-engine/animations/animation-welcome-safari.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=208077

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRemove telemetry from sandbox rules needed for basic WebKit logging
bfulgham@apple.com [Fri, 21 Feb 2020 22:25:17 +0000 (22:25 +0000)]
Remove telemetry from sandbox rules needed for basic WebKit logging
https://bugs.webkit.org/show_bug.cgi?id=208073
<rdar://problem/59658551>

Reviewed by Per Arne Vollan.

Now that we see the specific uses for the 'kern.osversion' sysctl and the need
for network-outbound connections for syslog, we can remove the telemetry.

* NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
* Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoBuild DumpRenderTree and WebKitTestRunner for macCatalyst
jbedard@apple.com [Fri, 21 Feb 2020 21:42:32 +0000 (21:42 +0000)]
Build DumpRenderTree and WebKitTestRunner for macCatalyst
https://bugs.webkit.org/show_bug.cgi?id=208068
<rdar://problem/59676596>

Reviewed by Tim Horton.

* DumpRenderTree/ios/TextInputControllerIOS.m: Import WebKitLegacy explicitly.
* DumpRenderTree/mac/Configurations/Base.xcconfig: Use cocoatouch instead of SDK.
* DumpRenderTree/mac/Configurations/DumpRenderTree.xcconfig: Ditto.
* DumpRenderTree/mac/Configurations/DumpRenderTreeApp.xcconfig: Ditto.
* DumpRenderTree/mac/Configurations/DumpRenderTreeLibrary.xcconfig: Ditto.
* DumpRenderTree/mac/Configurations/TestNetscapePlugIn.xcconfig: Ditto.
* DumpRenderTree/mac/EditingDelegate.mm: Import WebKitLegacy explicitly.
* DumpRenderTree/mac/EventSendingController.h: Ditto.
* DumpRenderTree/mac/ObjCPlugin.m: Ditto.
* DumpRenderTree/mac/ResourceLoadDelegate.mm: Ditto.
* Makefile: Add DumpRenderTree and WebKitTestRunner.
* WebKitTestRunner/Configurations/Base.xcconfig: Use cocoatouch instead of SDK.
* WebKitTestRunner/Configurations/InjectedBundle.xcconfig: Ditto.
* WebKitTestRunner/Configurations/WebKitTestRunner.xcconfig: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRemove an unused local variable after r256808
wenson_hsieh@apple.com [Fri, 21 Feb 2020 21:39:01 +0000 (21:39 +0000)]
Remove an unused local variable after r256808
https://bugs.webkit.org/show_bug.cgi?id=208072

Reviewed by Chris Dumez.

Remove scriptsToExecuteSoon.

* dom/ScriptRunner.cpp:
(WebCore::ScriptRunner::timerFired):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257160 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincremen...
lawrence.j@apple.com [Fri, 21 Feb 2020 21:36:17 +0000 (21:36 +0000)]
[ iOS ] imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.serviceworker.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=206934

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257159 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION (r255533) Null Deref of _sessionWrapper under [WKNetworkSessionDelegate...
cdumez@apple.com [Fri, 21 Feb 2020 21:19:12 +0000 (21:19 +0000)]
REGRESSION (r255533) Null Deref of _sessionWrapper under [WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]
https://bugs.webkit.org/show_bug.cgi?id=208029
<rdar://problem/59404381>

Reviewed by Tim Horton.

r255533 started dereferencing _sessionWrapper without null check in didReceiveChallenge. All other delegates in this file null check
_sessionWrapper before using it because it is a weak pointer. Add a null check to avoid crashing.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate sessionFromTask:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ews] Add build step to Validate ChangeLog for commit-queue
aakash_jain@apple.com [Fri, 21 Feb 2020 21:12:03 +0000 (21:12 +0000)]
[ews] Add build step to Validate ChangeLog for commit-queue
https://bugs.webkit.org/show_bug.cgi?id=208064

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(ValidateChangeLogAndReviewer): Build step to validate ChangeLog.
(ValidateChangeLogAndReviewer.start):
(ValidateChangeLogAndReviewer.evaluateCommand): If the validation fails, comment on bug and mark patch as cq-.
(SetCommitQueueMinusFlagOnPatch.start): End the build (after marking the patch cq-) if build_finish_summary property is set.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257157 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoCreate a new ImageBuffer type for drawing on a DisplayList
commit-queue@webkit.org [Fri, 21 Feb 2020 20:26:30 +0000 (20:26 +0000)]
Create a new ImageBuffer type for drawing on a DisplayList
https://bugs.webkit.org/show_bug.cgi?id=207109

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2020-02-21
Reviewed by Simon Fraser.

Source/WebCore:

DisplayList::ImageBuffer inherits ConcreteImageBuffer and DrawingContext.
The drawing context will be the context of DrawingContext. The operations
of ConcreteImageBuffer will have to ensure the recorded display-list is
replayed back before getting the pixels of the ImageBufferBackend.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContext2d):
(WebCore::HTMLCanvasElement::setUsesDisplayListDrawing):
(WebCore::HTMLCanvasElement::setTracksDisplayListReplay):
(WebCore::HTMLCanvasElement::displayListAsText const):
(WebCore::HTMLCanvasElement::replayDisplayListAsText const):
All the DisplayList operations will be routed to the DrawingContext of
the ImageBuffer.

(WebCore::HTMLCanvasElement::createImageBuffer const):
createImageBuffer() can decide the ImageBuffer type based on the settings
and the size of the canvas.

* html/HTMLCanvasElement.h:
* platform/graphics/ConcreteImageBuffer.h:
(WebCore::ConcreteImageBuffer::create):
The type of the ImageBuffer will be passed to this function such that
it can create instances of derived classes.

* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::create):
Create ImageBuffers which record the drawing commands to DisplayLists before
committing them to the back-ends.

* platform/graphics/ImageBuffer.h:
(WebCore::ImageBuffer::drawingContext):
(WebCore::ImageBuffer::flushDrawingContext):
Add virtual methods to support DisplayList in ImageBuffer.

* platform/graphics/PlatformImageBuffer.h:
* platform/graphics/RenderingMode.h:
Add DisplayList types to RenderingMode and define platform types for
DisplayList ImageBuffers.

* platform/graphics/displaylists/DisplayListDrawingContext.cpp: Added.
(WebCore::DisplayList::DrawingContext::DrawingContext):
(WebCore::DisplayList::DrawingContext::setTracksDisplayListReplay):
(WebCore::DisplayList::DrawingContext::replayDisplayList):
* platform/graphics/displaylists/DisplayListDrawingContext.h: Added.
(WebCore::DisplayList::DrawingContext::context const):
(WebCore::DisplayList::DrawingContext::displayList):
(WebCore::DisplayList::DrawingContext::displayList const):
(WebCore::DisplayList::DrawingContext::replayedDisplayList const):
DisplayList::DrawingContext holds a recording and an optional replaying
back DisplayLists. It also provides a recording GraphicsContext.

* platform/graphics/displaylists/DisplayListImageBuffer.h: Added.
(WebCore::DisplayList::ImageBuffer::create):
(WebCore::DisplayList::ImageBuffer::ImageBuffer):
(WebCore::DisplayList::ImageBuffer::~ImageBuffer):
Drawing commands will be recorded first because context() is overridden
to return the GraphicsContext of DrawingContext. These drawing commands
will be flushed before getting the pixels of the back-end because
flushDrawingContext() is overridden to replay back the recorded DisplayList
to the GraphicsContext of the back-end.

LayoutTests:

The extra commands are recorded by CanvasBase::setImageBuffer() which
used to issue these GraphicsContext commands directly to the backend.
With this patch, DisplayList::ImageBuffer does not allow access to the
backend context. So all the GraphicsContext commands has to be recorded.

* displaylists/canvas-display-list-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257156 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoAddress post-review feedback in webkit.org/b/207352
wenson_hsieh@apple.com [Fri, 21 Feb 2020 20:23:43 +0000 (20:23 +0000)]
Address post-review feedback in webkit.org/b/207352
https://bugs.webkit.org/show_bug.cgi?id=207352

Reviewed by Brian Weinstein.

Use m_mainFrame instead of going through Page, and also append the string "\n\n" instead of appending the
newline character twice.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getContentsAsString):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION: (r256764?) [ Mac wk1 Release ] legacy-animation-engine/fast/animation...
lawrence.j@apple.com [Fri, 21 Feb 2020 19:58:54 +0000 (19:58 +0000)]
REGRESSION: (r256764?) [ Mac wk1 Release ] legacy-animation-engine/fast/animation/animation-mixed-transform-crash.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=208019

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257154 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[Media in GPU process] Synchronize the properties of video layers in the GPU process...
ryanhaddad@apple.com [Fri, 21 Feb 2020 19:42:53 +0000 (19:42 +0000)]
[Media in GPU process] Synchronize the properties of video layers in the GPU process with the hosting layer in the web process
https://bugs.webkit.org/show_bug.cgi?id=206132

Patch by Peng Liu <peng.liu6@apple.com> on 2020-02-21
Reviewed by Eric Carlson.

A follow-up patch to fix Catalyst/watchOS/tvOS build failures related to unified build.

* WebProcess/GPU/media/cocoa/VideoLayerRemoteCocoa.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257153 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ macOS wk2 ] webgpu/whlsl/nested-loop.html is flaky failing
lawrence.j@apple.com [Fri, 21 Feb 2020 19:33:28 +0000 (19:33 +0000)]
[ macOS wk2 ] webgpu/whlsl/nested-loop.html is flaky failing
https://bugs.webkit.org/show_bug.cgi?id=207117

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257152 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[iOS] Issue extension of CoreMedia service to the WebContent process
pvollan@apple.com [Fri, 21 Feb 2020 19:21:18 +0000 (19:21 +0000)]
[iOS] Issue extension of CoreMedia service to the WebContent process
https://bugs.webkit.org/show_bug.cgi?id=208066
<rdar://problem/35864528>

Reviewed by Geoffrey Garen.

This service should also be added to the sandbox of the GPU process.

No new tests, covered by existing tests.

* Resources/SandboxProfiles/ios/com.apple.WebKit.GPU.sb:
* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::mediaRelatedMachServices):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257151 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[macOS] Large form controls are rendered at the wrong NSControlSize
wenson_hsieh@apple.com [Fri, 21 Feb 2020 19:03:29 +0000 (19:03 +0000)]
[macOS] Large form controls are rendered at the wrong NSControlSize
https://bugs.webkit.org/show_bug.cgi?id=208043
<rdar://problem/59659134>

Reviewed by Tim Horton.

Source/WebCore:

When painting form controls that are larger than a certain threshold (for the most part, 21px), use
NSControlSizeLarge instead of NSControlSizeRegular. This makes us choose a more appropriate appearance when
painting native large form controls, as long as the system supports it. Note that not all the metrics for
NSControlSizeLarge form controls are finalized, as noted in the per-method comments below.

With this patch alone, there is no change in behavior yet; in the near future, these changes will be covered by
new platform-specific baselines.

* platform/PopupMenuStyle.h: Add a new PopupMenuSizeLarge that corresponds to a popup that has NSControlSizeLarge.
* platform/mac/ThemeMac.h: Add a helper to check (at runtime) whether the new large form control size is enabled.
* platform/mac/ThemeMac.mm:
(WebCore::controlSizeForFont): Add a new font size breakpoint, for which we use NSControlSizeLarge instead of
NSControlSizeRegular.

(WebCore::sizeFromNSControlSize):
(WebCore::sizeFromFont):
(WebCore::controlSizeFromPixelSize):
(WebCore::setControlSize):
(WebCore::checkboxSizes): Reflect the fact that checkboxes with NSControlSizeLarge are 16 by 16.
(WebCore::checkboxMargins): Just match NSControlSizeRegular margins for now. These seem incorrect already, even
for NSControlSizeRegular in macOS 10.15.

(WebCore::radioSizes): Reflect the fact that radio buttons with NSControlSizeLarge are 16 by 16, and
NSControlSizeRegular radio buttons are 14 by 14.

(WebCore::radioMargins): Just match NSControlSizeRegular margins for now. These seem incorrect already, even for
NSControlSizeRegular in macOS 10.15.

(WebCore::buttonSizes): Reflect the fact that buttons with NSControlSizeLarge are 28px tall.
(WebCore::buttonMargins): Just match NSControlSizeRegular margins for now, and add a FIXME about updating them.
(WebCore::setUpButtonCell):
(WebCore::stepperSizes): NSControlSizeLarge matches NSControlSizeRegular at the moment.
(WebCore::stepperControlSizeForFont): Add a new font size breakpoint for using NSControlSizeLarge.
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::controlSizeForFont const):
(WebCore::RenderThemeMac::controlSizeForCell const):
(WebCore::RenderThemeMac::controlSizeForSystemFont const):
(WebCore::RenderThemeMac::popupButtonMargins const):
(WebCore::RenderThemeMac::popupButtonSizes const):
(WebCore::RenderThemeMac::popupButtonPadding const):

NSControlSizeLarge metrics for popup buttons cannot be determined yet.

(WebCore::RenderThemeMac::progressBarSizes const):
(WebCore::RenderThemeMac::progressBarMargins const):
(WebCore::RenderThemeMac::paintProgressBar):

NSControlSizeLarge matches NSControlSizeRegular at the moment.

(WebCore::menuListButtonSizes):
(WebCore::RenderThemeMac::popupMenuSize const):
(WebCore::RenderThemeMac::menuListSizes const):
(WebCore::RenderThemeMac::searchFieldSizes const):
(WebCore::RenderThemeMac::cancelButtonSizes const):
(WebCore::RenderThemeMac::resultsButtonSizes const):

Search field results and cancel buttons have the same size in NSControlSizeLarge as in NSControlSizeRegular.

Source/WebCore/PAL:

Import NSAppearance_Private.h in this SPI header. See WebCore ChangeLog for more details.

* pal/spi/mac/NSAppearanceSPI.h:

Source/WebKit:

See WebCore ChangeLog for more details.

* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):

Source/WebKitLegacy/mac:

See WebCore ChangeLog for more details.

* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257150 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mac wk1 Debug ] legacy-animation-engine/animations/animation-direction-normal.html...
lawrence.j@apple.com [Fri, 21 Feb 2020 18:52:24 +0000 (18:52 +0000)]
[ Mac wk1 Debug ] legacy-animation-engine/animations/animation-direction-normal.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=208065

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257149 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRemove WebPageProxy::machSendRightCallback as it is dead code
cdumez@apple.com [Fri, 21 Feb 2020 18:39:56 +0000 (18:39 +0000)]
Remove WebPageProxy::machSendRightCallback as it is dead code
https://bugs.webkit.org/show_bug.cgi?id=208057
<rdar://problem/59658805>

Reviewed by Geoffrey Garen.

* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257148 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ews] Add build step to set cq- flag on bugzilla patch
aakash_jain@apple.com [Fri, 21 Feb 2020 18:24:41 +0000 (18:24 +0000)]
[ews] Add build step to set cq- flag on bugzilla patch
https://bugs.webkit.org/show_bug.cgi?id=208021

Reviewed by Jonathan Bedard.

* BuildSlaveSupport/ews-build/steps.py:
(BugzillaMixin.set_cq_minus_flag_on_patch):
(SetCommitQueueMinusFlagOnPatch):
(SetCommitQueueMinusFlagOnPatch.start):
(SetCommitQueueMinusFlagOnPatch.getResultSummary):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257147 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mac wk2 ] http/wpt/fetch/disable-speculative-for-reload.html is flaky failing.
lawrence.j@apple.com [Fri, 21 Feb 2020 18:23:34 +0000 (18:23 +0000)]
[ Mac wk2 ] http/wpt/fetch/disable-speculative-for-reload.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=208062

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257146 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoRemove WebPasteBoardProxy::PasteboardCopy as it is dead code
cdumez@apple.com [Fri, 21 Feb 2020 18:18:51 +0000 (18:18 +0000)]
Remove WebPasteBoardProxy::PasteboardCopy as it is dead code
https://bugs.webkit.org/show_bug.cgi?id=208058
<rdar://problem/59658727>

Reviewed by Geoffrey Garen.

* UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
* UIProcess/WebPasteboardProxy.h:
* UIProcess/WebPasteboardProxy.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257145 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoStub repositories fail to upload some results due to missing head svn revision
jlewis3@apple.com [Fri, 21 Feb 2020 18:08:18 +0000 (18:08 +0000)]
Stub repositories fail to upload some results due to missing head svn revision
https://bugs.webkit.org/show_bug.cgi?id=207684

Reviewed by Jonathan Bedard.

* Scripts/webkitpy/common/host_mock.py: Added in call for creating stub repo checkout information for upload tests.
(MockHost.__init__):
* Scripts/webkitpy/layout_tests/models/test_run_results.py:
(summarize_results): Changed call to head_svn_revision to port.commits_for_upload() to bring
* Scripts/webkitpy/layout_tests/models/test_run_results_unittest.py:
(SummarizedResultsTest.setUp): Added in new required parameter for testing.
* Scripts/webkitpy/port/base.py:
(Port.commits_for_upload): Removed the forced movement up the systems tree that prevented us
from using mock SCMs and more
* Scripts/webkitpy/port/test.py: Added function to make the checkout_information.json for upload testing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257144 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[iOS][Legacy WebKit] Expose SPI for Page::revealCurrentSelection()
dbates@webkit.org [Fri, 21 Feb 2020 18:03:11 +0000 (18:03 +0000)]
[iOS][Legacy WebKit] Expose SPI for Page::revealCurrentSelection()
https://bugs.webkit.org/show_bug.cgi?id=207960
<rdar://problem/59604163>

Reviewed by Wenson Hsieh.

Together with <https://bugs.webkit.org/show_bug.cgi?id=207955> this allows a client to reveal
the current selection when it's ready to do so.

* WebView/WebView.mm:
(-[WebView revealCurrentSelection]): Added.
* WebView/WebViewPrivate.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257143 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoREGRESSION(r257072): MotionMark | Mac | -10%
antti@apple.com [Fri, 21 Feb 2020 17:51:40 +0000 (17:51 +0000)]
REGRESSION(r257072): MotionMark | Mac | -10%
https://bugs.webkit.org/show_bug.cgi?id=208054
<rdar://problem/59664582>

Reviewed by Geoffrey Garen.

With rAF and slow scripts, suspended functions may pile up in RunLoop because every cycle does a rendering update.

* wtf/RunLoop.cpp:
(WTF::RunLoop::performWork):
(WTF::RunLoop::suspendFunctionDispatchForCurrentCycle):

Don't suspend if there are already pending suspended functions.

* wtf/RunLoop.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257142 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[JSCOnly] Add --verbose flag when running JavaScriptCore tests
dpino@igalia.com [Fri, 21 Feb 2020 17:47:58 +0000 (17:47 +0000)]
[JSCOnly] Add --verbose flag when running JavaScriptCore tests
https://bugs.webkit.org/show_bug.cgi?id=208051

Reviewed by Carlos Alberto Lopez Perez.

Verbose flag prints out each test name executed. Without this flag
stdout prints out one or two periods.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunJavaScriptCoreTests.start):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257141 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mojave ] webaudio/audioparam-exponentialRampToValueAtTime.html is flaky crashing.
lawrence.j@apple.com [Fri, 21 Feb 2020 17:26:07 +0000 (17:26 +0000)]
[ Mojave ] webaudio/audioparam-exponentialRampToValueAtTime.html is flaky crashing.
https://bugs.webkit.org/show_bug.cgi?id=208061

Unreviewed test gardening.

* platform/mac/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[WPE][GTK] googleapis.com is a public suffix, defeating isGoogle() check in UserAgent...
commit-queue@webkit.org [Fri, 21 Feb 2020 17:22:38 +0000 (17:22 +0000)]
[WPE][GTK] googleapis.com is a public suffix, defeating isGoogle() check in UserAgentQuirks.cpp
https://bugs.webkit.org/show_bug.cgi?id=207984

Patch by Michael Catanzaro <mcatanzaro@gnome.org> on 2020-02-21
Reviewed by Daniel Bates.

Source/WebCore:

Fix the check for googleapis.com. Since it's now a public suffix, we can no longer check the
URL's base domain here. Instead, we can check endsWith().

I considered switching to endsWith() for all the checks in this file, to make our user agent
quirks robust to future changes in the public suffix list, but checking the base domain is
nicer and it seems unnecessary. We can continue to adjust our quirks in the future as
necessary.

The public suffix list:
https://github.com/publicsuffix/list/blob/7922d7c20e246552be418e8f72e577899fd30d99/public_suffix_list.dat#L11922

* platform/UserAgentQuirks.cpp:
(WebCore::isGoogle):

Tools:

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257139 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[Web Animations] Repeated animations on pseudo elements will fail to run after a...
simon.fraser@apple.com [Fri, 21 Feb 2020 17:21:45 +0000 (17:21 +0000)]
[Web Animations] Repeated animations on pseudo elements will fail to run after a while
https://bugs.webkit.org/show_bug.cgi?id=207993
Source/WebCore:

<rdar://problem/59428472>

Reviewed by Zalan Bujtas.

We failed to clear PseudoElement* from AnimationTimeline's various HashMaps on destruction,
causing animations to fail to run when those pointer addresses were reused.

Make DeclarativeAnimation::owningElement() be a WeakPtr<>.

Test: animations/many-pseudo-animations.html

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::willDestoryRendererForElement):
(WebCore::AnimationTimeline::elementWasRemoved):
* animation/AnimationTimeline.h:
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::DeclarativeAnimation):
(WebCore::DeclarativeAnimation::enqueueDOMEvent):
* animation/DeclarativeAnimation.h:
(WebCore::DeclarativeAnimation::owningElement const):
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement):
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):

LayoutTests:

Reviewed by Zalan Bujtas.

* animations/many-pseudo-animations-expected.txt: Added.
* animations/many-pseudo-animations.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257138 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoUpdate WPT tests for Intersection Observer
commit-queue@webkit.org [Fri, 21 Feb 2020 17:06:43 +0000 (17:06 +0000)]
Update WPT tests for Intersection Observer
https://bugs.webkit.org/show_bug.cgi?id=208053

Patch by Frederic Wang <fwang@igalia.com> on 2020-02-21
Reviewed by Daniel Bates.

LayoutTests/imported/w3c:

* web-platform-tests/intersection-observer/bounding-box.html:
* web-platform-tests/intersection-observer/client-rect.html:
* web-platform-tests/intersection-observer/containing-block.html:
* web-platform-tests/intersection-observer/cross-origin-iframe.sub-expected.txt: Added.
* web-platform-tests/intersection-observer/cross-origin-iframe.sub.html: Renamed from LayoutTests/imported/w3c/web-platform-tests/intersection-observer/cross-origin-iframe.html.
* web-platform-tests/intersection-observer/disconnect.html:
* web-platform-tests/intersection-observer/display-none.html:
* web-platform-tests/intersection-observer/document-scrolling-element-root-expected.txt: Added.
* web-platform-tests/intersection-observer/document-scrolling-element-root.html: Added.
* web-platform-tests/intersection-observer/edge-inclusive-intersection.html:
* web-platform-tests/intersection-observer/empty-root-margin.html:
* web-platform-tests/intersection-observer/iframe-no-root-with-wrapping-scroller-expected.txt: Added.
* web-platform-tests/intersection-observer/iframe-no-root-with-wrapping-scroller.html: Copied from LayoutTests/imported/w3c/web-platform-tests/intersection-observer/iframe-no-root.html.
* web-platform-tests/intersection-observer/iframe-no-root.html:
* web-platform-tests/intersection-observer/initial-observation-with-threshold.html:
* web-platform-tests/intersection-observer/inline-client-rect.html:
* web-platform-tests/intersection-observer/isIntersecting-change-events.html:
* web-platform-tests/intersection-observer/isIntersecting-threshold-expected.txt: Added.
* web-platform-tests/intersection-observer/isIntersecting-threshold.html: Added.
* web-platform-tests/intersection-observer/multiple-targets.html:
* web-platform-tests/intersection-observer/multiple-thresholds.html:
* web-platform-tests/intersection-observer/nested-cross-origin-iframe.sub-expected.txt: Added.
* web-platform-tests/intersection-observer/nested-cross-origin-iframe.sub.html: Added.
* web-platform-tests/intersection-observer/observer-attributes.html:
* web-platform-tests/intersection-observer/observer-exceptions.html:
* web-platform-tests/intersection-observer/observer-in-iframe.html:
* web-platform-tests/intersection-observer/observer-without-js-reference.html:
* web-platform-tests/intersection-observer/remove-element.html:
* web-platform-tests/intersection-observer/resources/cross-origin-child-iframe.sub.html: Added.
* web-platform-tests/intersection-observer/resources/cross-origin-subframe.html:
* web-platform-tests/intersection-observer/resources/intersection-observer-test-utils.js:
(waitForNotification):
(waitForFrame):
(runTestCycle):
(checkJsonEntry):
* web-platform-tests/intersection-observer/resources/nested-cross-origin-child-iframe.sub.html: Added.
* web-platform-tests/intersection-observer/resources/nested-cross-origin-grand-child-iframe.html: Added.
* web-platform-tests/intersection-observer/resources/same-origin-grand-child-iframe.html: Added.
* web-platform-tests/intersection-observer/resources/scaled-target-subframe.html: Added.
* web-platform-tests/intersection-observer/resources/v2-subframe.html: Added.
* web-platform-tests/intersection-observer/resources/w3c-import.log:
* web-platform-tests/intersection-observer/root-margin-rounding-expected.txt: Added.
* web-platform-tests/intersection-observer/root-margin-rounding.html: Added.
* web-platform-tests/intersection-observer/root-margin.html:
* web-platform-tests/intersection-observer/rtl-clipped-root-expected.txt: Added.
* web-platform-tests/intersection-observer/rtl-clipped-root.html: Added.
* web-platform-tests/intersection-observer/same-document-no-root.html:
* web-platform-tests/intersection-observer/same-document-root.html:
* web-platform-tests/intersection-observer/same-document-zero-size-target.html:
* web-platform-tests/intersection-observer/same-origin-grand-child-iframe.sub-expected.txt: Added.
* web-platform-tests/intersection-observer/same-origin-grand-child-iframe.sub.html: Added.
* web-platform-tests/intersection-observer/shadow-content.html:
* web-platform-tests/intersection-observer/target-in-different-window.html:
* web-platform-tests/intersection-observer/text-target.html:
* web-platform-tests/intersection-observer/timestamp.html:
* web-platform-tests/intersection-observer/unclipped-root.html:
* web-platform-tests/intersection-observer/v2/animated-occlusion-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/animated-occlusion.html: Added.
* web-platform-tests/intersection-observer/v2/blur-filter-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/blur-filter.html: Added.
* web-platform-tests/intersection-observer/v2/box-shadow-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/box-shadow.html: Added.
* web-platform-tests/intersection-observer/v2/cross-origin-effects.sub-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/cross-origin-occlusion.sub-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/delay-test-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/delay-test.html: Added.
* web-platform-tests/intersection-observer/v2/drop-shadow-filter-vertical-rl-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/drop-shadow-filter-vertical-rl.html: Added.
* web-platform-tests/intersection-observer/v2/iframe-target-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/iframe-target.html: Added.
* web-platform-tests/intersection-observer/v2/inline-occlusion-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/inline-occlusion.html: Added.
* web-platform-tests/intersection-observer/v2/position-relative-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/position-relative.html: Added.
* web-platform-tests/intersection-observer/v2/scaled-target-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/scaled-target.html: Added.
* web-platform-tests/intersection-observer/v2/simple-effects-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/simple-effects.html: Added.
* web-platform-tests/intersection-observer/v2/simple-occlusion-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/simple-occlusion-svg-foreign-object-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/simple-occlusion-svg-foreign-object.html: Added.
* web-platform-tests/intersection-observer/v2/simple-occlusion.html: Added.
* web-platform-tests/intersection-observer/v2/text-editor-occlusion-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/text-editor-occlusion.html: Added.
* web-platform-tests/intersection-observer/v2/text-shadow-expected.txt: Added.
* web-platform-tests/intersection-observer/v2/text-shadow.html: Added.
* web-platform-tests/intersection-observer/v2/w3c-import.log: Added.
* web-platform-tests/intersection-observer/w3c-import.log:
* web-platform-tests/intersection-observer/zero-area-element-hidden.html:
* web-platform-tests/intersection-observer/zero-area-element-visible.html:
* web-platform-tests/intersection-observer/v2/cross-origin-effects.sub.html: Added.
* web-platform-tests/intersection-observer/v2/cross-origin-occlusion.sub.html: Added.

LayoutTests:

Add iOS expectations and skip new tests timing out.

* TestExpectations:
* platform/ios/imported/w3c/web-platform-tests/intersection-observer/cross-origin-iframe.sub-expected.txt: Added.
* platform/ios/imported/w3c/web-platform-tests/intersection-observer/iframe-no-root-with-wrapping-scroller-expected.txt: Added.
* platform/ios/imported/w3c/web-platform-tests/intersection-observer/nested-cross-origin-iframe.sub-expected.txt: Remamed from platform/ios/imported/w3c/web-platform-tests/intersection-observer/nested-cross-origin-iframe.sub.txt.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257137 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[ Mac wk1 Debug ] legacy-animation-engine/compositing/transitions/add-remove-transiti...
lawrence.j@apple.com [Fri, 21 Feb 2020 16:43:33 +0000 (16:43 +0000)]
[ Mac wk1 Debug ] legacy-animation-engine/compositing/transitions/add-remove-transition.html is flaky failing.
https://bugs.webkit.org/show_bug.cgi?id=208059

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257136 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[iOS] Fix media related sandbox issues in the GPU process
pvollan@apple.com [Fri, 21 Feb 2020 16:27:53 +0000 (16:27 +0000)]
[iOS] Fix media related sandbox issues in the GPU process
https://bugs.webkit.org/show_bug.cgi?id=208033

Reviewed by Eric Carlson.

The mach lookup sandbox extension to 'com.apple.tccd' needs to be created with the method SandboxExtension::createHandleForMachLookup.
The file read-write sandbox extension to the media cache directory needs to be created with the parent folder of the actual cache folder,
since the media frameworks also seem to access files there.

No new tests, covered by existing tests.

* UIProcess/GPU/GPUProcessProxy.cpp:
(WebKit::GPUProcessProxy::singleton):
(WebKit::gpuProcessSessionParameters):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257135 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoMake support for bytecode caching more robust against file corruption.
mark.lam@apple.com [Fri, 21 Feb 2020 16:20:55 +0000 (16:20 +0000)]
Make support for bytecode caching more robust against file corruption.
https://bugs.webkit.org/show_bug.cgi?id=207972
<rdar://problem/59260595>

Reviewed by Yusuke Suzuki.

If a bytecode cache file is corrupted, we currently will always crash every time
we try to read it (in perpetuity as long as the corrupted cache file continues to
exist on disk).  To guard against this, we'll harden the bytecode caching mechanism
as follows:

1. Modify the writeCache operation to always write the cache file in a transactional
   manner i.e. we'll first write to a .tmp file, and then rename the .tmp file to
   the cache file only if the entire file has been written in completeness.

   This ensures that we won't get corrupted cache files due to interrupted writes.

2. Modify the writeCache operation to also compute a SHA1 hash of the cache file
   and append the hash at end of the file.  Modify the readCache operation to
   first authenticate the SHA1 hash before allowing the cache file to be used.
   If the hash does not match, the file is bad, and we'll just delete it.

   This ensures that we won't be crashing while decoding a corrupted cache file.

Manually tested with the following scenarios and ensuring that the client recovers
with no crashes:

1. no cache file on disk.
2. a 0-sized cache file on a disk.
3. a truncated cache file on disk.
4. a corrupted cache file on disk.
5. an uncorrupted cache file on disk.

Also added some static_asserts in CachedTypes.cpp to document some invariants that
the pre-existing code is dependent on.

* API/JSScript.mm:
(-[JSScript readCache]):
(-[JSScript writeCache:]):
* runtime/CachedTypes.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257134 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months ago[GStreamer] TextCombinerGStreamer is failing to compile with Gst1.14
lmoura@igalia.com [Fri, 21 Feb 2020 12:38:18 +0000 (12:38 +0000)]
[GStreamer] TextCombinerGStreamer is failing to compile with Gst1.14
https://bugs.webkit.org/show_bug.cgi?id=208041

Reviewed by Xabier Rodriguez-Calvar.

Replace usage of gst_clear_object and gst_clear_tag_list with previous
*_unref functions. The clear versions were added in 1.16 while Ubuntu
18.04 (current LTS) and Debian stable uses 1.14.

* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webkitTextCombinerPadDispose):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257133 268f45cc-cd09-0410-ab3c-d52691b4dbfc

5 months agoValue sanitization for input[type=text] should not truncate a value at a control...
clopez@igalia.com [Fri, 21 Feb 2020 11:22:39 +0000 (11:22 +0000)]
Value sanitization for input[type=text] should not truncate a value at a control character
https://bugs.webkit.org/show_bug.cgi?id=207900

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline the tests. Below its a summary of the number of FAIL and PASS lines changed for each test:

* web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-csiso2022jp-expected.txt:
  FAIL from 7312 to 374
  PASS from 17 to 6955
* web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-errors-han-expected.txt:
  FAIL from 21216 to 477
  PASS from 53 to 20792
* web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-errors-hangul-expected.txt:
  FAIL from 11155 to 0
  PASS from 28 to 11183
* web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-errors-misc-expected.txt:
  FAIL from 3422 to 46
  PASS from 9 to 3385
* web-platform-tests/encoding/legacy-mb-japanese/iso-2022-jp/iso2022jp-encode-form-expected.txt:
  FAIL from 7375 to 374
  PASS from 17 to 7018
* web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
  FAIL from 20 to 10
  PASS from 22 to 32

Source/WebCore:

Stop truncating value at a control character. The new behavior is compatible with Chrome and Firefox.
Inspired on Chromium patch https://codereview.chromium.org/189843008

Covered by existing tests: affected layout tests are modified to reflect the new behaviour.
This improves WPT pass-rate in around 49K new subtest passes for Japanesse encoding tests.

* html/TextFieldInputType.cpp:
(WebCore::limitLength):

LayoutTests:

Update layout tests to reflect the new behaviour.

* fast/forms/input-value-sanitization-expected.txt:
* fast/forms/input-value-sanitization.html:
* fast/forms/paste-multiline-text-input.html:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:
* platform/mac/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/valueMode-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@257132 268f45cc-cd09-0410-ab3c-d52691b4dbfc