WebKit-https.git
7 months ago[iOS] Expose SPI to access the current sentence boundary and selection state
wenson_hsieh@apple.com [Mon, 14 Jan 2019 20:09:58 +0000 (20:09 +0000)]
[iOS] Expose SPI to access the current sentence boundary and selection state
https://bugs.webkit.org/show_bug.cgi?id=193398
<rdar://problem/45893108>

Reviewed by Dean Jackson.

Source/WebKit:

Expose SPI on WKWebView for internal clients to grab information about attributes at the current selection; so
far, this only includes whether the selection is a caret or a range, and whether or not the start of the
selection is at the start of a new sentence.

Test: EditorStateTests.ObserveSelectionAttributeChanges

* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode const):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:

Add a new bit in EditorState on iOS to compute whether or not the start of the selection is at the start of a
new sentence. This is computed and set when sending post-layout data in `WebPageIOS.mm`.

* UIProcess/API/Cocoa/WKWebView.mm:
(selectionAttributes):
(-[WKWebView _didChangeEditorState]):
(-[WKWebView _selectionAttributes]):

Make the new SPI property support KVO by invoking `-willChangeValueForKey:` and `-didChangeValueForKey:`
whenever the selection attributes change.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState const):

Tools:

Add an API test to verify that an SPI client can observe changes in the `@"_selectionAttributes"` key path on
WKWebView, and that inserting text, deleting, and changing the selection cause selection attributes to change as
expected.

* TestWebKitAPI/EditingTestHarness.h:
* TestWebKitAPI/EditingTestHarness.mm:
(-[EditingTestHarness moveBackward]):
(-[EditingTestHarness moveForward]):
(-[EditingTestHarness moveForwardAndExpectEditorStateWith:]):

Add a couple of new helper methods on EditingTestHarness.

* TestWebKitAPI/Tests/WebKitCocoa/EditorStateTests.mm:
(-[SelectionChangeObserver initWithWebView:]):
(-[SelectionChangeObserver webView]):
(-[SelectionChangeObserver observeValueForKeyPath:ofObject:change:context:]):
(-[SelectionChangeObserver currentSelectionAttributes]):

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

7 months ago[WHLSL] Assorted cleanup
mmaxfield@apple.com [Mon, 14 Jan 2019 19:21:50 +0000 (19:21 +0000)]
[WHLSL] Assorted cleanup
https://bugs.webkit.org/show_bug.cgi?id=193389

Reviewed by Dean Jackson.

This is a bunch of non-behavior-changing cleanup.

- The compiler uses UniqueRef all over the place, and UniqueRef has an implicit operator T&. Therefore,
  we don't need to static_cast<T&> everywhere.
- ConstantExpressionEnumerationMemberReference is the exact same thing as EnumerationMemberLiteral, so
  this patch deletes the longer-named class in favor of the shorter-named class.
- Because of the header dependency tree, this patch moves EntryPointType into its own file so it can be
  used by files that FunctionDeclaration depends on. Same thing for AddressSpace.
- EnumTypes have to have non-null base types. The parser will make sure this is always true.

No new tests because there is no behavior change.

* Modules/webgpu/WHLSL/AST/WHLSLAddressSpace.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h:
(WebCore::WHLSL::AST::ArrayType::type const):
(WebCore::WHLSL::AST::ArrayType::type):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h:
(WebCore::WHLSL::AST::AssignmentExpression::left):
(WebCore::WHLSL::AST::AssignmentExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h:
(WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
(WebCore::WHLSL::AST::ConstantExpression::clone const):
(WebCore::WHLSL::AST::ConstantExpression::matches const):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Removed.
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h:
(WebCore::WHLSL::AST::DereferenceExpression::pointer):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h:
(WebCore::WHLSL::AST::DoWhileLoop::body):
(WebCore::WHLSL::AST::DoWhileLoop::conditional):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h:
(WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEntryPointType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h.
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h:
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
(WebCore::WHLSL::AST::EnumerationDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h:
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::wrap):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::left const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::right const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::clone const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationDefinition const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember const):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::setEnumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
(WebCore::WHLSL::AST::Expression::type):
(WebCore::WHLSL::AST::Expression::setType):
(WebCore::WHLSL::AST::Expression::addressSpace const):
(WebCore::WHLSL::AST::Expression::setAddressSpace):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp:
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h:
(WebCore::WHLSL::AST::FloatLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h:
(WebCore::WHLSL::AST::ForLoop::condition):
(WebCore::WHLSL::AST::ForLoop::increment):
(WebCore::WHLSL::AST::ForLoop::body):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
(WebCore::WHLSL::AST::FunctionDeclaration::type const):
(WebCore::WHLSL::AST::FunctionDeclaration::type):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h:
(WebCore::WHLSL::AST::IfStatement::conditional):
(WebCore::WHLSL::AST::IfStatement::body):
(WebCore::WHLSL::AST::IfStatement::elseBody):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h:
(WebCore::WHLSL::AST::IndexExpression::indexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h:
(WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h:
(WebCore::WHLSL::AST::LogicalExpression::left):
(WebCore::WHLSL::AST::LogicalExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h:
(WebCore::WHLSL::AST::LogicalNotExpression::operand):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h:
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h:
(WebCore::WHLSL::AST::MakePointerExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h:
(WebCore::WHLSL::AST::PropertyAccessExpression::base):
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h:
(WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h:
(WebCore::WHLSL::AST::ReferenceType::elementType const):
(WebCore::WHLSL::AST::ReferenceType::elementType):
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h:
(WebCore::WHLSL::AST::ResolvableType::resolvedType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h:
(WebCore::WHLSL::AST::Return::value):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h:
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h:
(WebCore::WHLSL::AST::StructureElement::type):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h:
(WebCore::WHLSL::AST::SwitchStatement::value):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h:
(WebCore::WHLSL::AST::TernaryExpression::predicate):
(WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
(WebCore::WHLSL::AST::TernaryExpression::elseExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h:
(WebCore::WHLSL::AST::TypeDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h:
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h:
(WebCore::WHLSL::AST::VariableDeclaration::type):
(WebCore::WHLSL::AST::VariableDeclaration::initializer):
(WebCore::WHLSL::AST::VariableDeclaration::isAnonymous const):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h:
(WebCore::WHLSL::AST::WhileLoop::conditional):
(WebCore::WHLSL::AST::WhileLoop::body):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp:
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp:
(WebCore::WHLSL::commit):
(WebCore::WHLSL::inferTypesForTypeArguments):
(WebCore::WHLSL::inferTypesForCall):
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp:
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h:
* Modules/webgpu/WHLSL/WHLSLParser.h:
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp:
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp:
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp:
(WebCore::WHLSL::Visitor::visit):
* Modules/webgpu/WHLSL/WHLSLVisitor.h:
* WebCore.xcodeproj/project.pbxproj:

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

7 months agoFix property access on ARM with the baseline JIT
dinfuehr@igalia.com [Mon, 14 Jan 2019 18:41:21 +0000 (18:41 +0000)]
Fix property access on ARM with the baseline JIT
https://bugs.webkit.org/show_bug.cgi?id=193393

Reviewed by Yusuke Suzuki.

Code was still using currentInstruction[4] to access the instruction's metadata.
Updated to use metadata.getPutInfo and metadata.resolveType.

* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):

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

7 months agoDOMCacheStorage: use-after-move in doSequentialMatch()
zandobersek@gmail.com [Mon, 14 Jan 2019 15:51:41 +0000 (15:51 +0000)]
DOMCacheStorage: use-after-move in doSequentialMatch()
https://bugs.webkit.org/show_bug.cgi?id=193396

Reviewed by Youenn Fablet.

Depending on the platform- and compiler-specific calling conventions,
the doSequentialMatch() code can move out the Vector<Ref<DOMCache>>
object into the callback lambda before the DOMCache object at the
specified index is retrieved for the DOMCache::doMatch() invocation.

This problem is now avoided by retrieving reference to the target
DOMCache object in an earlier expression.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::doSequentialMatch):

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

7 months ago[LFC][BFC] Add basic box-sizing support.
zalan@apple.com [Mon, 14 Jan 2019 15:42:21 +0000 (15:42 +0000)]
[LFC][BFC] Add basic box-sizing support.
https://bugs.webkit.org/show_bug.cgi?id=193392

Reviewed by Antti Koivisto.

Source/WebCore:

No min/max support yet.

Test: fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
(WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
* layout/blockformatting/BlockFormattingContextGeometry.cpp:
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
(WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/box-sizing-inflow-out-of-flow-simple-expected.txt: Added.
* fast/block/block-only/box-sizing-inflow-out-of-flow-simple.html: Added.

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

7 months ago[GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
commit-queue@webkit.org [Mon, 14 Jan 2019 15:22:43 +0000 (15:22 +0000)]
[GStreamer][WebRTC] Override DeviceType() in RealtimeMediaSource implementations
https://bugs.webkit.org/show_bug.cgi?id=193397

This was necessary but wasn't done.

Patch by Thibault Saunier <tsaunier@igalia.com> on 2019-01-14
Reviewed by Philippe Normand.

No test required as this fixes a regression in all WebRTC tests when built in debug mode.

* platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
* platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:

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

7 months agoUnreviewed WPE debug build fix after r239921.
zandobersek@gmail.com [Mon, 14 Jan 2019 15:09:56 +0000 (15:09 +0000)]
Unreviewed WPE debug build fix after r239921.

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fix the assert that checks the
size of the mapped buffer containing IV data.

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

7 months agoUnreviewed WPE gardening. Updating baselines for failures that in
zandobersek@gmail.com [Mon, 14 Jan 2019 12:41:36 +0000 (12:41 +0000)]
Unreviewed WPE gardening. Updating baselines for failures that in
majority of cases can be tracked down to the test fonts bump in r239436.

* platform/wpe/animations/lineheight-animation-expected.txt:
* platform/wpe/animations/simultaneous-start-transform-expected.txt:
* platform/wpe/animations/width-using-ems-expected.txt:
* platform/wpe/css1/font_properties/font-expected.txt:
* platform/wpe/css3/unicode-bidi-isolate-basic-expected.txt:
* platform/wpe/fast/css/line-height-determined-by-primary-font-expected.txt:
* platform/wpe/fast/css/rtl-ordering-expected.txt:
* platform/wpe/fast/css/text-overflow-ellipsis-bidi-expected.txt:
* platform/wpe/fast/css/text-overflow-ellipsis-expected.txt:
* platform/wpe/fast/css/text-overflow-ellipsis-strict-expected.txt:
* platform/wpe/fast/css/word-space-extra-expected.txt:
* platform/wpe/fast/dom/34176-expected.txt:
* platform/wpe/fast/dom/52776-expected.txt:
* platform/wpe/fast/inline/inline-box-background-expected.txt:
* platform/wpe/fast/inline/inline-box-background-long-image-expected.txt:
* platform/wpe/fast/inline/inline-box-background-repeat-x-expected.txt:
* platform/wpe/fast/inline/inline-box-background-repeat-y-expected.txt:
* platform/wpe/fast/inline/inline-content-with-float-and-margin-expected.txt: Added.
* platform/wpe/fast/inline/simple-inline-inflow-positioned-expected.txt: Added.
* platform/wpe/fast/inline/simple-inline-with-out-of-flow-descendant-expected.txt: Added.
* platform/wpe/fast/inline/simple-inline-with-out-of-flow-descendant2-expected.txt: Added.
* platform/wpe/svg/W3C-I18N/text-anchor-dirLTR-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirLTR-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirLTR-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirNone-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirNone-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirNone-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirRTL-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirRTL-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-dirRTL-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirLTR-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorEnd-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorMiddle-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-inherited-dirRTL-anchorStart-expected.txt:
* platform/wpe/svg/W3C-I18N/text-anchor-no-markup-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1-SE/svgdom-over-01-f-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1-SE/text-intro-02-b-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1-SE/text-intro-09-b-expected.txt:
* platform/wpe/svg/W3C-SVG-1.1/text-tselect-02-f-expected.txt:
* platform/wpe/svg/custom/glyph-selection-bidi-mirror-expected.txt:
* platform/wpe/svg/custom/svg-fonts-fallback-expected.txt:
* platform/wpe/svg/hixie/perf/007-expected.txt:
* platform/wpe/svg/text/bidi-embedded-direction-expected.txt:
* platform/wpe/svg/text/bidi-reorder-value-lists-expected.txt: Added.
* platform/wpe/svg/text/bidi-text-anchor-direction-expected.txt:
* platform/wpe/svg/text/text-tselect-02-f-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_layers-opacity-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_position-table-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-cell-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-column-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-column-group-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-row-expected.txt:
* platform/wpe/tables/mozilla/marvin/backgr_simple-table-row-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-cell-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-column-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-column-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-quirks-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-row-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_border-table-row-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_fixed-bg-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_layers-hide-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_layers-show-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-cell-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-column-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-column-group-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-row-expected.txt:
* platform/wpe/tables/mozilla_expected_failures/marvin/backgr_position-table-row-group-expected.txt:

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

7 months ago[WPE] API test gardening
cturner@igalia.com [Mon, 14 Jan 2019 12:41:01 +0000 (12:41 +0000)]
[WPE] API test gardening
https://bugs.webkit.org/show_bug.cgi?id=193319

Reviewed by Michael Catanzaro.

* TestWebKitAPI/glib/TestExpectations.json: Remove some now
passing tests.

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

7 months ago[GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
cturner@igalia.com [Mon, 14 Jan 2019 12:31:13 +0000 (12:31 +0000)]
[GStreamer] Add sharedBuffer utility to GstMappedBuffer, and a testsuite
https://bugs.webkit.org/show_bug.cgi?id=192977

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Add a utility method on GstMappedBuffer to return a SharedBuffer
view over the mapped data with no copies.

This patch also introduces a new gstreamer port API test
directory, and includes some tests for GstMappedBuffer.

New tests in the API section.

* platform/SharedBuffer.cpp: Add a new overload for
GstMappedBuffer that allows sharing the mapped GStreamer buffers
with zero copies.
(WebCore::SharedBuffer::create):
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::size const):
* platform/SharedBuffer.h:
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcAllocateBuffersAndRenderAudio): Update to new
API.
* platform/graphics/gstreamer/GStreamerCommon.cpp:
(WebCore::GstMappedBuffer::createSharedBuffer): Return a shared
buffer sharing this mapped buffer. The buffer must be shareable to
use this method.
* platform/graphics/gstreamer/GStreamerCommon.h:
(WebCore::GstMappedBuffer::create): Make GstMappedBuffer RefCounted
(WebCore::GstMappedBuffer::~GstMappedBuffer):
(WebCore::GstMappedBuffer::data):
(WebCore::GstMappedBuffer::data const):
(WebCore::GstMappedBuffer::size const):
(WebCore::GstMappedBuffer::isSharable const): New predicate to
check whether this buffer can be shared (i.e., is not writable)
(WebCore::GstMappedBuffer::GstMappedBuffer):
(WebCore::GstMappedBuffer::operator bool const): Deleted.
* platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
(WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
Update to use new API.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
(WebCore::InitData::InitData): Ditto.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorFindAndSetKey): Ditto.
(webKitMediaClearKeyDecryptorDecrypt): Ditto.
* platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp:
(WebCore::WrappedMockRealtimeAudioSource::render): Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Ditto.
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): Ditto.
* platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
(WebCore::GStreamerVideoEncoder::Fragmentize): Ditto.

Tools:

* TestWebKitAPI/PlatformGTK.cmake: Build the new GStreamer test harness
* TestWebKitAPI/PlatformWPE.cmake: Ditto.
* TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.cpp: Added.
(TestWebKitAPI::GStreamerTest::SetUp):
(TestWebKitAPI::GStreamerTest::TearDown):
* TestWebKitAPI/Tests/WebCore/gstreamer/GStreamerTest.h: Added.
* TestWebKitAPI/Tests/WebCore/gstreamer/GstMappedBuffer.cpp: Added.
(TestWebKitAPI::TEST_F):

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

7 months ago[WPE] Workaround for incorrect template specialization being selected when UChar...
cturner@igalia.com [Mon, 14 Jan 2019 10:59:06 +0000 (10:59 +0000)]
[WPE] Workaround for incorrect template specialization being selected when UChar=char16_t
https://bugs.webkit.org/show_bug.cgi?id=193332

Reviewed by Michael Catanzaro.

* TestWebKitAPI/Tests/WTF/StringConcatenate.cpp: When UChar is
defined as a char16_t, which changed in ICU 59, the
StringTypeAdapter<UnsignedInt, ...> overload catches casts to
unsigned short. This test is relying on the behaviour that
UChar=unsigned short, which doesn't hold across platforms and ICU
library versions. The full fix would be a special syntax for
literal characters so that these ambiguities do not arise. That
work is proposed in https://bugs.webkit.org/show_bug.cgi?id=193101.
(TestWebKitAPI::TEST):

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

7 months ago[GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
commit-queue@webkit.org [Mon, 14 Jan 2019 10:32:03 +0000 (10:32 +0000)]
[GTK][WPE] Graphic issue with invalidations on composited layers with subpixel positions
https://bugs.webkit.org/show_bug.cgi?id=193239

Patch by Karl Leplat <karl.leplat_ext@softathome.com> on 2019-01-14
Reviewed by Žan Doberšek.

Source/WebCore:

Test: compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html

* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::updateContentBuffers): Use enclosed dirty rect values
when invalidating the CoordinatedBackingStore areas.

LayoutTests:

* compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions.html: Added.
* platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/gtk/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
* platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/ios/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
* platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/mac/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.
* platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.png: Added.
* platform/wpe/compositing/repaint/invalidations-on-composited-layers-with-subpixel-positions-expected.txt: Added.

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

7 months agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release
carlosgc@webkit.org [Mon, 14 Jan 2019 09:28:29 +0000 (09:28 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.23.3 release

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers

Source/WebKit:

* gtk/NEWS: Add release notes for 2.23.3.

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

7 months agoUnreviewed. [GTK][WPE] Run distcheck with gtkdoc and MiniBrowser enabled
carlosgc@webkit.org [Mon, 14 Jan 2019 08:24:00 +0000 (08:24 +0000)]
Unreviewed. [GTK][WPE] Run distcheck with gtkdoc and MiniBrowser enabled

* Scripts/make-dist:
(Distcheck.configure):

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

7 months ago[FreeType] Support emoji modifiers
carlosgc@webkit.org [Mon, 14 Jan 2019 07:59:00 +0000 (07:59 +0000)]
[FreeType] Support emoji modifiers
https://bugs.webkit.org/show_bug.cgi?id=177040

Reviewed by Myles C. Maxfield.

Source/WebCore:

The problem only happens with emojis having the zero with joiner (U+200D) in the sequence. The sequence is
broken because createAndFillGlyphPage() in Font.cpp overwrites zero with joiner with zero width space (U+200B),
but the emoji font actually supports zero with joiner. This patch moves the control characters override from
createAndFillGlyphPage() to GlyphPage::fill() only for FreeType based ports. This way we can do the override
only for the cases where the code point is not supported by the font.

* platform/graphics/Font.cpp:
(WebCore::overrideControlCharacters): Helper function to override the control characters.
(WebCore::createAndFillGlyphPage): Call overrideControlCharacters() only when not using FreeType.
* platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
(WebCore::GlyphPage::fill): Use zero width space as fallback when the font doesn't support characters with
Default_Ignorable Unicode property.

LayoutTests:

Mark several emoji tests as passing now.

* platform/gtk/TestExpectations:

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

7 months agoTried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds.
mitz@apple.com [Mon, 14 Jan 2019 05:55:02 +0000 (05:55 +0000)]
Tried to fix USE(APPLE_INTERNAL_SDK) 32-bit builds.

* pal/spi/mac/QuickDrawSPI.h:

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

7 months agoMore build fixing.
mitz@apple.com [Mon, 14 Jan 2019 05:51:57 +0000 (05:51 +0000)]
More build fixing.

* editing/cocoa/DictionaryLookup.mm:

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

7 months agoFixed iOS builds after r239910.
mitz@apple.com [Mon, 14 Jan 2019 00:34:10 +0000 (00:34 +0000)]
Fixed iOS builds after r239910.

* Platform/spi/ios/PDFKitSPI.h:

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

7 months agoMinor optimization to RenderText::setRenderedText()
simon.fraser@apple.com [Mon, 14 Jan 2019 00:07:35 +0000 (00:07 +0000)]
Minor optimization to RenderText::setRenderedText()
https://bugs.webkit.org/show_bug.cgi?id=193388

Reviewed by Ryosuke Niwa.

Avoid the call to applyTextTransform() if TextTransform is None, so that we don't
have to call previousCharacter() and reassign m_text.

Similar optimization in RenderText::textWithoutConvertingBackslashToYenSymbol().

Speedometer profiles show a few samples here, but this isn't going to win any prizes.

* rendering/RenderText.cpp:
(WebCore::RenderText::setRenderedText):
(WebCore::RenderText::textWithoutConvertingBackslashToYenSymbol const):

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

7 months agoTried to fix the build.
mitz@apple.com [Sun, 13 Jan 2019 23:19:14 +0000 (23:19 +0000)]
Tried to fix the build.

Source/WebCore:

* editing/cocoa/DictionaryLookup.mm:

Source/WebKit:

* Platform/spi/ios/PDFKitSPI.h:

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

7 months agoTried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.
mitz@apple.com [Sun, 13 Jan 2019 23:13:46 +0000 (23:13 +0000)]
Tried to fix USE(APPLE_INTERNAL_SDK) builds after r239901.

Patch by Keith Rollin.

Source/WebCore:

* accessibility/mac/AXObjectCacheMac.mm:

Source/WebCore/PAL:

* pal/spi/cocoa/LaunchServicesSPI.h:
* pal/spi/mac/HIServicesSPI.h:
* pal/spi/mac/MetadataSPI.h:
* pal/spi/mac/SpeechSynthesisSPI.h:

Source/WebKit:

* Platform/IPC/mac/ConnectionMac.mm:
* Shared/mac/ChildProcessMac.mm:
(WebKit::ChildProcess::launchServicesCheckIn):

Source/WebKitLegacy/mac:

* WebView/PDFViewSPI.h:

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

7 months ago[ews-build] Update macOS queue configurations
aakash_jain@apple.com [Sun, 13 Jan 2019 21:45:35 +0000 (21:45 +0000)]
[ews-build] Update macOS queue configurations
https://bugs.webkit.org/show_bug.cgi?id=193365
<rdar://problem/47221073>

Unreviewed, renamed mac-high-sierra to mac-highsierra to match with build.webkit.org configuration.

* BuildSlaveSupport/ews-build/config.json:

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

7 months ago[LFC] Adjust assert for statically positioned fixed elements
zalan@apple.com [Sun, 13 Jan 2019 16:39:36 +0000 (16:39 +0000)]
[LFC] Adjust assert for statically positioned fixed elements
https://bugs.webkit.org/show_bug.cgi?id=193385

Reviewed by Antti Koivisto.

Source/WebCore:

While computing the static position and traversing the ancestor chain, we can surely hit a positioned container
(since we need to go all the way up to the initial containing block).

* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
(WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

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

7 months ago[WPE][MiniBrowser] Ephemeral WebContext leaks in automation mode
philn@webkit.org [Sun, 13 Jan 2019 16:06:31 +0000 (16:06 +0000)]
[WPE][MiniBrowser] Ephemeral WebContext leaks in automation mode
https://bugs.webkit.org/show_bug.cgi?id=193387

Reviewed by Carlos Garcia Campos.

* MiniBrowser/wpe/main.cpp:
(main):

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

7 months agoRelease assert with <img usemap> in shadow tree
antti@apple.com [Sun, 13 Jan 2019 13:15:11 +0000 (13:15 +0000)]
Release assert with <img usemap> in shadow tree
https://bugs.webkit.org/show_bug.cgi?id=193378

Reviewed by Ryosuke Niwa.

Source/WebCore:

When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try
to remove the map from the scope of the host.

* html/HTMLImageElement.cpp:
(WebCore::HTMLImageElement::parseAttribute):
(WebCore::HTMLImageElement::insertedIntoAncestor):
(WebCore::HTMLImageElement::removedFromAncestor):

Tree scope changes are relevant, not the connection to the document.

LayoutTests:

* fast/shadow-dom/image-map-tree-scope.html:

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

7 months agoHave prefers-color-scheme: light always match on macOS versions before Mojave.
timothy@apple.com [Sun, 13 Jan 2019 05:54:06 +0000 (05:54 +0000)]
Have prefers-color-scheme: light always match on macOS versions before Mojave.
https://bugs.webkit.org/show_bug.cgi?id=191655
rdar://problem/46074680

Reviewed by Megan Gardner.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.

Source/WebCore:

Tests: css-dark-mode/older-systems/prefers-color-scheme.html
       css-dark-mode/older-systems/supported-color-schemes-css.html
       css-dark-mode/older-systems/supported-color-schemes.html

Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code.
Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems.

* Configurations/FeatureDefines.xcconfig:
* dom/Document.cpp:
(WebCore::Document::useDarkAppearance const):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::enable):
* page/Page.cpp:
(WebCore::Page::setUseDarkAppearance):
(WebCore::Page::useDarkAppearance const):
(WebCore::Page::setUseDarkAppearanceOverride):
* platform/mac/LocalDefaultSystemAppearance.h:
(WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const):
* platform/mac/LocalDefaultSystemAppearance.mm:
(WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
(WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance):
* platform/mac/ScrollAnimatorMac.mm:
* rendering/RenderThemeMac.mm:
(-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
(-[WebListButtonCell drawWithFrame:inView:]):
(WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
(WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
(WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
(WebCore::RenderThemeMac::systemColor const):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::effectiveAppearanceIsDark):
* UIProcess/RemoteLayerTree/mac/ScrollerMac.mm:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* WebView/WebView.mm:
(-[WebView _effectiveAppearanceIsDark]):

Source/WTF:

* wtf/Platform.h: Define HAVE_OS_DARK_MODE_SUPPORT on macOS 10.14.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions.
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm:

LayoutTests:

* css-dark-mode/older-systems/prefers-color-scheme-expected.txt: Added.
* css-dark-mode/older-systems/prefers-color-scheme.html: Added.
* css-dark-mode/older-systems/supported-color-schemes-css-expected.txt: Added.
* css-dark-mode/older-systems/supported-color-schemes-css.html: Added.
* css-dark-mode/older-systems/supported-color-schemes-expected.txt: Added.
* css-dark-mode/older-systems/supported-color-schemes.html: Added.
* platform/mac/TestExpectations:

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

7 months ago[LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
zalan@apple.com [Sat, 12 Jan 2019 21:28:15 +0000 (21:28 +0000)]
[LFC] Block/InlinFormattingContext should take Block/InlineFormattingState
https://bugs.webkit.org/show_bug.cgi?id=193383

Reviewed by Antti Koivisto.

This is just a downcast really.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::formattingState const): Deleted.
* layout/FormattingContext.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::createFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::formattingState const):
(WebCore::Layout::BlockFormattingContext::blockFormattingState const): Deleted.
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
(WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const):
(WebCore::Layout::InlineFormattingContext::createFinalRuns const):
(WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const):
(WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
(WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const):
(WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const):
(WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
* layout/inlineformatting/InlineFormattingContext.h:
(WebCore::Layout::InlineFormattingContext::formattingState const):
(WebCore::Layout::InlineFormattingContext::inlineFormattingState const): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

7 months ago[WHLSL] Add native function synthesis passes
mmaxfield@apple.com [Sat, 12 Jan 2019 20:56:37 +0000 (20:56 +0000)]
[WHLSL] Add native function synthesis passes
https://bugs.webkit.org/show_bug.cgi?id=193360

Reviewed by Dean Jackson.

This patch includes all the passes in prepare() that are between the name resolver and the
type checker. It involves a few small pieces:

- CheckDuplicateFunctions which makes sure the same function isn't defined twice
- Intrinsics, which remembers all of the native types so they can be referred to by the
  rest of the compiler
- RecursiveTypeChecker which makes sure types don't refer to themselves
- SynthesizeArrayOperatorLength which creates operator.length() functions for arrays
- SynthesizeConstructors which creates copy constructors and default constructors for all
  types
- SynthesizeEnumerationFunctions which provides cast operators between enum types and their
  base types
- SynthesizeStructureAccessors which provides getters, setters, and anders for each member
  of a struct

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.cpp: Added.
(WebCore::WHLSL::checkDuplicateFunctions):
* Modules/webgpu/WHLSL/WHLSLCheckDuplicateFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLIntrinsics.cpp: Added.
(WebCore::WHLSL::Intrinsics::Intrinsics):
(WebCore::WHLSL::Intrinsics::add):
(WebCore::WHLSL::Intrinsics::addPrimitive):
(WebCore::WHLSL::Intrinsics::addVector):
(WebCore::WHLSL::Intrinsics::addMatrix):
(WebCore::WHLSL::Intrinsics::addFullTexture):
(WebCore::WHLSL::Intrinsics::addDepthTexture):
(WebCore::WHLSL::Intrinsics::addTexture):
* Modules/webgpu/WHLSL/WHLSLIntrinsics.h: Added.
(WebCore::WHLSL::Intrinsics::voidType const):
(WebCore::WHLSL::Intrinsics::boolType const):
(WebCore::WHLSL::Intrinsics::intType const):
(WebCore::WHLSL::Intrinsics::uintType const):
(WebCore::WHLSL::Intrinsics::samplerType const):
(WebCore::WHLSL::Intrinsics::floatType const):
(WebCore::WHLSL::Intrinsics::float3Type const):
(WebCore::WHLSL::Intrinsics::float4Type const):
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append):
(WebCore::WHLSL::Program::intrinsics):
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.cpp: Added.
(WebCore::WHLSL::checkRecursiveTypes):
* Modules/webgpu/WHLSL/WHLSLRecursiveTypeChecker.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.cpp: Added.
(WebCore::WHLSL::FindArrayTypes::takeArrayTypes):
(WebCore::WHLSL::synthesizeArrayOperatorLength):
* Modules/webgpu/WHLSL/WHLSLSynthesizeArrayOperatorLength.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.cpp: Added.
(WebCore::WHLSL::FindAllTypes::takeUnnamedTypes):
(WebCore::WHLSL::FindAllTypes::takeNamedTypes):
(WebCore::WHLSL::synthesizeConstructors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeConstructors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.cpp: Added.
(WebCore::WHLSL::synthesizeEnumerationFunctions):
* Modules/webgpu/WHLSL/WHLSLSynthesizeEnumerationFunctions.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.cpp: Added.
(WebCore::WHLSL::synthesizeStructureAccessors):
* Modules/webgpu/WHLSL/WHLSLSynthesizeStructureAccessors.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

7 months ago[Cocoa] Avoid importing directly from subumbrella frameworks
mitz@apple.com [Sat, 12 Jan 2019 20:36:08 +0000 (20:36 +0000)]
[Cocoa] Avoid importing directly from subumbrella frameworks
https://bugs.webkit.org/show_bug.cgi?id=186016
<rdar://problem/40591038>

Reviewed by Sam Weinig.

Source/WebCore:

* Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
  OTHER_CPLUSPLUSFLAGS.
* editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
* platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
* platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.

Source/WebCore/PAL:

* Configurations/PAL.xcconfig: Removed -iframework options from OTHER_CFLAGS and
  OTHER_CPLUSPLUSFLAGS.
* pal/spi/cg/CoreGraphicsSPI.h: Import ApplicationServices.h instead of ColorSync.h
  when using SDKs earlier than 10.13.
* pal/spi/mac/HIToolboxSPI.h: Import CarbonPriv.h instead of HIToolboxPriv.h.
* pal/spi/mac/QuickLookMacSPI.h: Import Quartz.h instead of a QuickLookUI header.

Source/WebKit:

* Configurations/BaseTarget.xcconfig: Removed -iframework options from OTHER_CFLAGS and
  OTHER_CPLUSPLUSFLAGS.
* UIProcess/Automation/mac/WebAutomationSessionMac.mm: Import Carbon.h instead of an
  HIToolbox header.
* UIProcess/Cocoa/WebViewImpl.mm: Ditto.
* UIProcess/mac/WKPrintingView.mm: Import Quartz.h instead of a PDFKit header.
* UIProcess/mac/WKTextInputWindowController.mm: Import Carbon.h instead of an HIToolbox
  header.
* WebProcess/Plugins/PDF/PDFAnnotationTextWidgetDetails.h: Import Quartz.h instead of a
  PDFKit header.
* WebProcess/Plugins/PDF/PDFLayerControllerSPI.h: Ditto.
* WebProcess/Plugins/PDF/PDFPlugin.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginAnnotation.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginPasswordField.mm: Ditto.
* WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm: Ditto.
* WebProcess/WebPage/mac/WebPageMac.mm: Ditto.

Source/WebKitLegacy/mac:

* Carbon/CarbonWindowAdapter.h: Import Carbon.h instead of HIToolbox headers.
* Carbon/CarbonWindowAdapter.mm: Ditto.
* Carbon/CarbonWindowFrame.m: Ditto.
* Carbon/HIViewAdapter.h: Ditto.
* Configurations/WebKitLegacy.xcconfig: Removed -iframework options from
  OTHER_CFLAGS_COCOA_TOUCH_NO.
* Plugins/WebNetscapePluginEventHandlerCarbon.mm: Import Carbon.h instead of CarbonEvents.h.
* WebView/WebPDFDocumentExtras.mm: Import Quartz.h instead of a PDFKit header.
* WebView/WebPDFView.h: Ditto.

Tools:

* DumpRenderTree/cg/PixelDumpSupportCG.cpp: Include CoreServices.h instead of a
  LaunchServices header.
* DumpRenderTree/mac/Configurations/BaseTarget.xcconfig: Removed -iframework options from
  OTHER_CFLAGS and OTHER_CPLUSPLUSFLAGS.
* DumpRenderTree/mac/LayoutTestHelper.m: Import ApplicationServices.h instead of ColorSync.h
  when using SDKs earlier than 10.13.
* TestWebKitAPI/Configurations/Base.xcconfig: Removed -iframework options from OTHER_CFLAGS
  and OTHER_CPLUSPLUSFLAGS.
* WebKitTestRunner/Configurations/BaseTarget.xcconfig: Removed -iframework options from
  OTHER_CFLAGS and OTHER_CPLUSPLUSFLAGS.
* WebKitTestRunner/cg/TestInvocationCG.cpp: Include CoreServices.h instead of a
  LaunchServices header.

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

7 months ago[LFC] Move formatting context creation from FormattingState to LayoutState
zalan@apple.com [Sat, 12 Jan 2019 16:56:55 +0000 (16:56 +0000)]
[LFC] Move formatting context creation from FormattingState to LayoutState
https://bugs.webkit.org/show_bug.cgi?id=193381

Reviewed by Antti Koivisto.

layoutState().createFormattingStateForFormattingRootIfNeeded(root).createFormattingContext(root) is not only mouthful
but also feels unintuitive. Use layoutState().createFormattingContext(root) instead.

* layout/FormattingContext.cpp:
(WebCore::Layout::FormattingContext::FormattingContext):
(WebCore::Layout::FormattingContext::~FormattingContext):
(WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
* layout/FormattingContextGeometry.cpp:
(WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
* layout/FormattingState.h:
* layout/LayoutState.cpp:
(WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
(WebCore::Layout::LayoutState::createFormattingContext):
* layout/LayoutState.h:
(WebCore::Layout::LayoutState::deregisterFormattingContext):
(WebCore::Layout::LayoutState::registerFormattingContext):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
(WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
* layout/blockformatting/BlockFormattingState.cpp:
(WebCore::Layout::BlockFormattingState::createFormattingContext): Deleted.
* layout/blockformatting/BlockFormattingState.h:
* layout/inlineformatting/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
* layout/inlineformatting/InlineFormattingState.cpp:
(WebCore::Layout::InlineFormattingState::createFormattingContext): Deleted.
* layout/inlineformatting/InlineFormattingState.h:

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

7 months ago[LFC][BFC][MarginCollapsing] Move estimatedMarginBefore flag from state/display box...
zalan@apple.com [Sat, 12 Jan 2019 15:30:55 +0000 (15:30 +0000)]
[LFC][BFC][MarginCollapsing] Move estimatedMarginBefore flag from state/display box to BlockFormattingContext
https://bugs.webkit.org/show_bug.cgi?id=193375

Reviewed by Antti Koivisto.

The estimated marginBefore is a pre-computed, temporary value. We need to keep it around until the final vertical margin value is computed.
Neither BlockFormattingState nor Display should hold temporary values.

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const):
(WebCore::Layout::BlockFormattingContext::hasPrecomputedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
(WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
(WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::setEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::hasEstimatedMarginBefore const):
(WebCore::Layout::hasPrecomputedMarginBefore): Deleted.
* layout/blockformatting/BlockFormattingContext.h:
(WebCore::Layout::BlockFormattingContext::removeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::estimatedMarginBefore const):
* layout/blockformatting/BlockFormattingState.h:
(WebCore::Layout::BlockFormattingState::setHasEstimatedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingState::clearHasEstimatedMarginBefore): Deleted.
(WebCore::Layout::BlockFormattingState::hasEstimatedMarginBefore const): Deleted.
* layout/displaytree/DisplayBox.cpp:
(WebCore::Display::Box::Box):
* layout/displaytree/DisplayBox.h:
(WebCore::Display::Box::setHasEstimatedMarginBefore):
(WebCore::Display::Box::invalidateEstimatedMarginBefore):
(WebCore::Display::Box::top const):
(WebCore::Display::Box::topLeft const):
(WebCore::Display::Box::setEstimatedMarginBefore): Deleted.
(WebCore::Display::Box::estimatedMarginBefore const): Deleted.
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

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

7 months agoUnreviewed, fix scope check assertions
yusukesuzuki@slowstart.org [Sat, 12 Jan 2019 09:49:17 +0000 (09:49 +0000)]
Unreviewed, fix scope check assertions
https://bugs.webkit.org/show_bug.cgi?id=193308

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::notifyLexicalBindingShadowing):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::notifyLexicalBindingShadowing):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::initializeGlobalProperties):

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

7 months agoEnable visual viewport API by default
rniwa@webkit.org [Sat, 12 Jan 2019 07:42:11 +0000 (07:42 +0000)]
Enable visual viewport API by default
https://bugs.webkit.org/show_bug.cgi?id=193376

Reviewed by Simon Fraser.

Source/WebKit:

Enable this feature by default since the remaining issue on iOS is mostly about test failures,
not an issue with the core functionality of the API.

* Shared/WebPreferences.yaml:

Source/WebKitLegacy/mac:

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):

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

7 months ago[WHLSL] Implement the NameResolver
mmaxfield@apple.com [Sat, 12 Jan 2019 06:26:20 +0000 (06:26 +0000)]
[WHLSL] Implement the NameResolver
https://bugs.webkit.org/show_bug.cgi?id=193007

Reviewed by Dean Jackson.

This is the base implementation for WHLSL's name resolver. The name resolver matches three kinds of things:
1. It matches VariableRefs to VariableDecls
2. It matches TypeRefs to NamedTypes
3. It matches CallExpressions to FunctionDeclarations

No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
of test. When enough of the compiler is present, I'll port the reference implementation's test suite.

* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Now that InferTypes.h exists, we can implement these
functions.
(WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Remove unnecessary function.
(WebCore::WHLSL::AST::FloatLiteralType::value const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement these
functions.
(WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Remove unnecessary function.
(WebCore::WHLSL::AST::IntegerLiteralType::value const): Deleted.
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Modifying Sources.txt caused the sources
to get shuffled around, so the #includes need to be fixed.
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Now that InferTypes.h exists, we can implement
these functions.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Remove unnecessary function.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::value const): Deleted.
* Modules/webgpu/WHLSL/WHLSLInferTypes.cpp: Added. This is the replacement for UnificationContext in the
reference compiler. It's much simpler (and we should remove UnificationContext in the reference compiler in
favor of this design). It has three sets of functions: Tell if two types are the same, tell if two types are
the same and commit the resolvable type, and run the above functions on type references or function arguments.
(WebCore::WHLSL::matches):
(WebCore::WHLSL::matchAndCommit):
(WebCore::WHLSL::commit):
(WebCore::WHLSL::inferTypesForTypeArguments):
(WebCore::WHLSL::inferTypesForCall):
* Modules/webgpu/WHLSL/WHLSLInferTypes.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
* Modules/webgpu/WHLSL/WHLSLNameContext.cpp: Added. This is the data structure that remembers NamedTypes,
FunctionDeclarations, and VariableDeclarations so NameResolver can work.
(WebCore::WHLSL::NameContext::NameContext):
(WebCore::WHLSL::NameContext::add):
(WebCore::WHLSL::NameContext::getTypes):
(WebCore::WHLSL::NameContext::getFunctions):
(WebCore::WHLSL::NameContext::getVariable):
(WebCore::WHLSL::NameContext::exists):
* Modules/webgpu/WHLSL/WHLSLNameContext.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
* Modules/webgpu/WHLSL/WHLSLNameResolver.cpp: Added. Use the NameContext to match up the three types of names.
(WebCore::WHLSL::NameResolver::NameResolver):
(WebCore::WHLSL::NameResolver::visit):
(WebCore::WHLSL::resolveNamesInTypes):
(WebCore::WHLSL::resolveNamesInFunctions):
* Modules/webgpu/WHLSL/WHLSLNameResolver.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h.
(WebCore::WHLSL::NameResolver::setCurrentFunctionDefinition):
* Modules/webgpu/WHLSL/WHLSLProgram.h:
(WebCore::WHLSL::Program::append): The parser needs to add all global declarations to the name context so the
name resolver is ready to go as soon as parsing is finished.
(WebCore::WHLSL::Program::nameContext):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.cpp: Added. Pick the appropriate FunctionDeclaration or
NamedType for a particular CallExpression or TypeReference.
(WebCore::WHLSL::conversionCost):
(WebCore::WHLSL::resolveFunctionOverloadImpl):
(WebCore::WHLSL::resolveTypeOverloadImpl):
* Modules/webgpu/WHLSL/WHLSLResolveOverloadImpl.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp.
* Modules/webgpu/WHLSL/WHLSLResolvingType.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp. This describes the two states that a type in the type resolver can be in: either an owned
UnnamedType, or a reference to a ResolvableType. This is because every expression needs to have a type
associated with it, but those types might be the type of a literal (aka a ResolvableType). Multiple
expressions might need to reference the same ResolvableType so when it gets resolved, all the expressions
get the result.
(WebCore::WHLSL::ResolvableTypeReference::ResolvableTypeReference):
(WebCore::WHLSL::ResolvableTypeReference::resolvableType):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

7 months agoAllow WebContent process access to some drawing-related IOKit properties
bfulgham@apple.com [Sat, 12 Jan 2019 03:40:11 +0000 (03:40 +0000)]
Allow WebContent process access to some drawing-related IOKit properties
https://bugs.webkit.org/show_bug.cgi?id=193086
<rdar://problem/46568088>

Reviewed by Eric Carlson.

Add one missing IOKit property, and revise the regexp used for another.

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

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

7 months agoFollow-up: WorkQueue::concurrentApply() passes a raw pointer to a temporary String...
ddkilzer@apple.com [Sat, 12 Jan 2019 03:07:47 +0000 (03:07 +0000)]
Follow-up: WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
https://bugs.webkit.org/show_bug.cgi?id=191350

* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply): Fix whitespace.

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

7 months ago[WHLSL] Add a Visitor class
mmaxfield@apple.com [Sat, 12 Jan 2019 02:46:08 +0000 (02:46 +0000)]
[WHLSL] Add a Visitor class
https://bugs.webkit.org/show_bug.cgi?id=192826

Reviewed by Dean Jackson.

This patch exposes a bunch of the private members of WHLSL's AST nodes so that Visitor can recurse on constituent nodes.
It also writes the recursion in Visitor.h. This is a virtual base class that gets subclassed for compiler passes.

I've split this part into its own patch to aid reviewing of the compiler.

* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
* Modules/webgpu/WHLSL/WHLSLVisitor.cpp: Added.
(WebCore::WHLSL::Visitor::visit):
(WebCore::WHLSL::Visitor::checkErrorAndVisit):
* Modules/webgpu/WHLSL/WHLSLVisitor.h: Added.
(WebCore::WHLSL::Visitor::setError):
(WebCore::WHLSL::Visitor::error const):
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

7 months agoREGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
jer.noble@apple.com [Sat, 12 Jan 2019 01:22:58 +0000 (01:22 +0000)]
REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC()
https://bugs.webkit.org/show_bug.cgi?id=193342
<rdar://problem/47119836>

Reviewed by Eric Carlson.

Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted.

* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
* platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
(WebCore::AudioSourceProviderAVFObjC::initCallback):
(WebCore::AudioSourceProviderAVFObjC::finalizeCallback):

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

7 months agoCompile out Web API Statistics Collection
wilander@apple.com [Sat, 12 Jan 2019 01:13:32 +0000 (01:13 +0000)]
Compile out Web API Statistics Collection
https://bugs.webkit.org/show_bug.cgi?id=193370
<rdar://problem/45388584>

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:
    Defined ENABLE_WEB_API_STATISTICS, off by default.

Source/WebCore:

No new tests. This patch disables functionality. The associated tests
are skipped.

These functions are now no-ops unless web API statistics is enabled.

* Configurations/FeatureDefines.xcconfig:
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFontLoad):
(WebCore::ResourceLoadObserver::logCanvasRead):
(WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
(WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
(WebCore::ResourceLoadObserver::logScreenAPIAccessed):
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const):
(WebCore::ResourceLoadStatistics::decode):
(WebCore::ResourceLoadStatistics::toString const):
(WebCore::ResourceLoadStatistics::merge):
* loader/ResourceLoadStatistics.h:
    The associated struct members are skipped unless web API
    statistics is enabled.

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:
    Defined ENABLE_WEB_API_STATISTICS, off by default.

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
    Defined ENABLE_WEB_API_STATISTICS, off by default.
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
    Skipped encoding of web API statistics.
(IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
    Skipped decoding of web API statistics.

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
    Defined ENABLE_WEB_API_STATISTICS, off by default.

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
    Defined ENABLE_WEB_API_STATISTICS, off by default.

LayoutTests:

* platform/ios-wk2/TestExpectations:
    http/tests/webAPIStatistics skipped.
* platform/mac-wk2/TestExpectations:
    http/tests/webAPIStatistics skipped.

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

7 months agoIndexedDB: leak WebIDBConnectionToClient for retain cycle
sihui_liu@apple.com [Sat, 12 Jan 2019 01:11:58 +0000 (01:11 +0000)]
IndexedDB: leak WebIDBConnectionToClient for retain cycle
https://bugs.webkit.org/show_bug.cgi?id=193097
<rdar://problem/46899601>

Reviewed by Brady Eidson.

Source/WebCore:

Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate.

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient):
(WebCore::IDBServer::IDBConnectionToClient::identifier const):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase):
(WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase):
(WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction):
(WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didCreateIndex):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex):
(WebCore::IDBServer::IDBConnectionToClient::didRenameIndex):
(WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd):
(WebCore::IDBServer::IDBConnectionToClient::didGetRecord):
(WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords):
(WebCore::IDBServer::IDBConnectionToClient::didGetCount):
(WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord):
(WebCore::IDBServer::IDBConnectionToClient::didOpenCursor):
(WebCore::IDBServer::IDBConnectionToClient::didIterateCursor):
(WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction):
(WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent):
(WebCore::IDBServer::IDBConnectionToClient::didStartTransaction):
(WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer):
(WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked):
(WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

Source/WebKit:

Let WebIDBConnectionToClient hold reference to IPC::Connection instead of NetworkConnectionToWebProcess to break
the cycle.

* NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::create):
(WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
(WebKit::WebIDBConnectionToClient::messageSenderConnection):
* NetworkProcess/IndexedDB/WebIDBConnectionToClient.h:
* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer):

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

7 months ago[WPE] Add gtk-doc
commit-queue@webkit.org [Sat, 12 Jan 2019 01:02:38 +0000 (01:02 +0000)]
[WPE] Add gtk-doc
https://bugs.webkit.org/show_bug.cgi?id=178900

Patch by Carlos Eduardo Ramalho <cadubentzen@gmail.com> on 2019-01-11
Reviewed by Michael Catanzaro.

Add Tools/gtkdoc to manifest.txt.in files.
This should have been done in r238853 and caused failure in building WebKitGTK+ unstable release 2.23.2.

* gtk/manifest.txt.in: Add Tools/gtkdoc directory.
* wpe/manifest.txt.in: Add Tools/gtkdoc directory and uncomment lines to move documentation artifacts.

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

7 months agoMake "Disable Web SQL" on by default
sihui_liu@apple.com [Sat, 12 Jan 2019 01:00:15 +0000 (01:00 +0000)]
Make "Disable Web SQL" on by default
https://bugs.webkit.org/show_bug.cgi?id=193354
<rdar://problem/46524584>

Reviewed by Geoffrey Garen.

* Shared/WebPreferences.yaml:

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

7 months agoFix style CFNetworkSPI style checker warnings from r239698
drousso@apple.com [Sat, 12 Jan 2019 00:40:14 +0000 (00:40 +0000)]
Fix style CFNetworkSPI style checker warnings from r239698
https://bugs.webkit.org/show_bug.cgi?id=193369

Reviewed by Joseph Pecoraro.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):

Source/WTF:

* wtf/Platform.h:

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

7 months agoFix the build after r239844
mmaxfield@apple.com [Sat, 12 Jan 2019 00:39:30 +0000 (00:39 +0000)]
Fix the build after r239844
https://bugs.webkit.org/show_bug.cgi?id=192991

Unreviewed.

* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp:
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp:

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

7 months agoDFG combined liveness can be wrong for terminal basic blocks
sbarati@apple.com [Sat, 12 Jan 2019 00:26:06 +0000 (00:26 +0000)]
DFG combined liveness can be wrong for terminal basic blocks
https://bugs.webkit.org/show_bug.cgi?id=193304
<rdar://problem/45268632>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/dfg-combined-liveness-consider-terminal-blocks-bytecode-liveness.js: Added.

Source/JavaScriptCore:

If a block doesn't have any successors, it can't rely on the typical
backwards liveness propagation that CombinedLiveness was doing. The phase
first got what was live in bytecode and IR at the heads of each block. Then
for each block, it made the live at tail the union of the live at head for
each successor. For a terminal block though, this could be wrong. We could
end up saying nothing is live even though many things may be live in bytecode.
We must account for what's bytecode live at the end of the block. Consider a
block that ends with:
```
ForceOSRExit
Unreachable
```

Things may definitely be live in bytecode at the tail. However, we'll
report nothing as being alive. This probably subtly breaks many analyses,
but we have a test case of it breaking the interference analysis that
the ArgumentsEliminationPhase performs.

* dfg/DFGBasicBlock.h:
(JSC::DFG::BasicBlock::last const):
* dfg/DFGCombinedLiveness.cpp:
(JSC::DFG::addBytecodeLiveness):
(JSC::DFG::liveNodesAtHead):
(JSC::DFG::CombinedLiveness::CombinedLiveness):
* dfg/DFGCombinedLiveness.h:

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

7 months ago[iOS] Precision drop state thrashes when dragging near the top edge of an editable...
wenson_hsieh@apple.com [Sat, 12 Jan 2019 00:21:49 +0000 (00:21 +0000)]
[iOS] Precision drop state thrashes when dragging near the top edge of an editable element
https://bugs.webkit.org/show_bug.cgi?id=193364
<rdar://problem/47214117>

Reviewed by Tim Horton.

Source/WebCore:

Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop
caret position. This is either the enclosing form control (in the case of text fields and text areas), or the
highest editable root. See WebKit ChangeLog for more details.

Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea

* editing/FrameSelection.cpp:
(WebCore::DragCaretController::editableElementRectInRootViewCoordinates const):
* editing/FrameSelection.h:

Source/WebKit:

On iOS, marking a UIDropProposal as precise offsets the hit-testing location of the drop by a small distance
either upwards or downwards from the actual location of the user's finger. When dragging over an editable
element, WebKit currently marks the drop proposal as precise; however, when dragging over the top edge of an
editable element, what happens is that the hit-testing location is offset to a location outside of the editable
element, which causes us to turn off precision drop mode; subsequently, turning off precision drop mode removes
the offset, which causes us to hit-test within the editable element once again and re-enable precision mode, and
the cycle continues.

In order to mitigate this, bail out of precision drop mode when dragging near the top or bottom edges of the
highest editable root that contains the current drop caret position (or, if the drop caret is inside of a text
form control, use the form control as the editable element instead).

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didPerformDragControllerAction):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::currentDragCaretEditableElementRect const):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView dropInteraction:sessionDidUpdate:]):

Avoid precise mode when we're less than 25pt away from the top and bottom edge of the editable element rect.
Since the drag location offset amount is a fixed offset in window coordinates, we first convert this minimum
distance to the content view's coordinate space by dividing by the content scale factor.

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

Tools:

Add a test to verify that dragging near the top of a textarea element does not flag the drop proposal as
precise, whereas dragging near the middle of the textarea does.

* TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm:
(TestWebKitAPI::TEST):

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

7 months agoREGRESSION (PSON): Firefox app lacks Open in New Tab in menu
timothy_horton@apple.com [Fri, 11 Jan 2019 23:30:07 +0000 (23:30 +0000)]
REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
https://bugs.webkit.org/show_bug.cgi?id=193366
<rdar://problem/46097212>

Reviewed by Simon Fraser.

Source/WebCore:

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isFirefox):
Add a Firefox Mobile bundle check.

Source/WebKit:

A pair of unrelated changes broke Firefox's use of WKWebView internals
to override the long-press menu. Maintain binary compatibility by
introducing linked-on-or-after checks.

* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createWebPage):
Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
Because gestures are very stateful, we always swap them out when swapping
processes (changing that behavior is fairly risky). Also, we don't always
inform the client when we swap processes (only when the process actually crashes),
so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.

* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]):
Synchronously install gesture recognizers under -init when linked against
an SDK before the version that introduces lazy gesture recognizer installation.
r237331 is an optimization that made us lazily install gestures when the
view is parented, but Firefox (and potentially other clients) depend
on them being installed synchronously in order to find and override them.

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

7 months ago[JSC] Global lexical bindings can shadow global variables if it is `configurable...
yusukesuzuki@slowstart.org [Fri, 11 Jan 2019 23:10:31 +0000 (23:10 +0000)]
[JSC] Global lexical bindings can shadow global variables if it is `configurable = true`
https://bugs.webkit.org/show_bug.cgi?id=193308
<rdar://problem/45546542>

Reviewed by Saam Barati.

JSTests:

* stress/const-lexical-binding-shadow-existing-global-property-ftl.js: Added.
(shouldThrow):
(shouldBe):
(foo):
(get shouldThrow):
* stress/const-lexical-binding-shadow-existing-global-property-tdz-ftl.js: Added.
(shouldThrow):
(shouldBe):
(foo):
(get shouldBe):
(get shouldThrow):
(get return):
* stress/const-lexical-binding-shadow-existing-global-property-tdz.js: Added.
(shouldThrow):
(shouldBe):
(foo):
(get shouldBe):
(get shouldThrow):
* stress/const-lexical-binding-shadow-existing-global-property.js: Added.
(shouldThrow):
(shouldBe):
(foo):
* stress/const-lexical-binding-shadowing-global-properties-and-eval-injection.js: Added.
(shouldThrow):
(shouldBe):
(foo):
* stress/global-add-function-should-not-be-shadowed-by-lexical-bindings.js: Added.
(shouldThrow):
* stress/global-static-variables-should-not-be-shadowed-by-lexical-bindings.js: Added.
(shouldThrow):
* stress/let-lexical-binding-shadow-existing-global-property-ftl.js: Added.
(shouldThrow):
(shouldBe):
(foo):
* stress/let-lexical-binding-shadow-existing-global-property-tdz-ftl.js: Added.
(shouldThrow):
(shouldBe):
(foo):
(get shouldBe):
(get shouldThrow):
(get return):
* stress/let-lexical-binding-shadow-existing-global-property-tdz.js: Added.
(shouldThrow):
(shouldBe):
(foo):
(get shouldBe):
(get shouldThrow):
* stress/let-lexical-binding-shadow-existing-global-property.js: Added.
(shouldThrow):
(shouldBe):
(foo):
* stress/let-lexical-binding-shadowing-global-properties-and-eval-injection.js: Added.
(shouldThrow):
(shouldBe):
(foo):

Source/JavaScriptCore:

Previously, we assumed that lexical bindings in JSGlobalLexicalEnvironment cannot shadow existing global properties.
However, it is wrong. According to the spec, we can shadow global properties if a property's attribute is configurable = true.
For example, we execute two scripts.

script1.js

    bar = 42;
    function load() { return bar; }
    print(bar); // 42
    print(load()); // 42

script2.js

    let bar = 0; // This lexical binding can shadow the global.bar defined in script1.js
    print(bar); // 0
    print(load()); // 0

In JSC, we cache GlobalProperty resolve type and its associated information in op_resolve_type, op_get_from_scope, and op_put_to_scope.
They attempt to load a property from JSGlobalObject directly. However, once the newly added lexical binding starts shadowing this, our existing instructions
become invalid since they do not respect JSGlobalLexicalEnvironment.

In this patch, we fix this issue by introducing the following mechanisms.

1. We have a HashMap<property name, watchpoint set> in JSGlobalObject. DFG and FTL create a watchpoint set with the property name if the generated code
depends on GlobalProperty condition of op_resolve_scope etc. These watchpoint will be fired when the shadowing happens, so that our generated DFG and FTL
code will be invalidated if it depends on the condition which is no longer valid.

2. When we detect shadowing, we iterate all the live CodeBlocks which globalObject is the target one. And we rewrite instructions in them from GlobalProperty
to GlobalLexicalVar (or Dynamic precisely). So, the subsequent LLInt code just works well. "Dynamic" conversion happens when your op_put_to_scope attempts to
put a value onto a const lexical binding. This fails and it should throw a type error.

3. GlobalProperty scope operations in Baseline JIT start checking ResolveType in metadata, and emit code for GlobalProperty and GlobalLexicalVar. Once the rewrite
happens, baseline JIT continues working because it checks the rewritten metadata's ResolveType.

We use this mechanism (which is similar to haveABadTime() thing) because,

1. Shadowing should be super rare. Before r214145, we made these cases as SytaxError. Thus, before r214145, this type of code cannot be executed in WebKit.
And the number of the live CodeBlocks for the given JSGlobalObject should be small. This supports introducing rather simple (but not so efficient) mechanism
instead of the complicated one.

2. Rewriting instructions immediately forces GlobalProperty => GlobalLexicalVar / Dynamic conversion in all the possible CodeBlock. This allows us to avoid
compilation failure loop in DFG and FTL: DFG and FTL codes are invalidated by the watchpoint, but we may attempt to compile the code with the invalidated watchpoint
and GlobalProperty status if we do not rewrite it. One possible other implementation is having and checking a counter in instruction, and every time we introduce
a new shadow binding, bump the counter. And eventually executed instruction will go to the slow path and rewrite itself. However, this way leaves the not-executed-again-yet
instructions as is, and DFG and FTL repeatedly fail to compile if we just watch the invalidated watchpoint for that. Rewriting all the existing GlobalProperty immediately
avoids this situation easily.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::notifyLexicalBindingShadowing):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::scriptMode const):
* bytecode/Watchpoint.h:
(JSC::WatchpointSet::create):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGDesiredGlobalProperties.cpp: Added.
(JSC::DFG::DesiredGlobalProperties::isStillValidOnMainThread):
(JSC::DFG::DesiredGlobalProperties::reallyAdd):
* dfg/DFGDesiredGlobalProperties.h: Added.
(JSC::DFG::DesiredGlobalProperties::addLazily):
We need this DesiredGlobalProperties mechanism since we do not want to ref() the UniquedStringImpl in DFG and FTL thread.
We keep JSGlobalObject* and identifierNumber, and materialize WatchpointSets for each JSGlobalObject's property referenced
from DFG and FTL and inject CodeBlock jettison watchpoints in the main thread.
* dfg/DFGDesiredGlobalProperty.h: Added.
(JSC::DFG::DesiredGlobalProperty::DesiredGlobalProperty):
(JSC::DFG::DesiredGlobalProperty::globalObject const):
(JSC::DFG::DesiredGlobalProperty::identifierNumber const):
(JSC::DFG::DesiredGlobalProperty::operator== const):
(JSC::DFG::DesiredGlobalProperty::operator!= const):
(JSC::DFG::DesiredGlobalProperty::isHashTableDeletedValue const):
(JSC::DFG::DesiredGlobalProperty::hash const):
(JSC::DFG::DesiredGlobalProperty::dumpInContext const):
(JSC::DFG::DesiredGlobalProperty::dump const):
(JSC::DFG::DesiredGlobalPropertyHash::hash):
(JSC::DFG::DesiredGlobalPropertyHash::equal):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::globalProperties):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::reallyAdd):
(JSC::DFG::Plan::isStillValidOnMainThread):
(JSC::DFG::Plan::finalizeWithoutNotifyingCallback):
(JSC::DFG::Plan::cancel):
* dfg/DFGPlan.h:
(JSC::DFG::Plan::globalProperties):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_resolve_scope):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emit_op_put_to_scope):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::addStaticGlobals):
(JSC::JSGlobalObject::notifyLexicalBindingShadowing):
(JSC::JSGlobalObject::getReferencedPropertyWatchpointSet):
(JSC::JSGlobalObject::ensureReferencedPropertyWatchpointSet):
* runtime/JSGlobalObject.h:
* runtime/ProgramExecutable.cpp:
(JSC::hasRestrictedGlobalProperty):
(JSC::ProgramExecutable::initializeGlobalProperties):

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

7 months agowebkitpy: Support alternate simctl device list output
jbedard@apple.com [Fri, 11 Jan 2019 22:48:15 +0000 (22:48 +0000)]
webkitpy: Support alternate simctl device list output
https://bugs.webkit.org/show_bug.cgi?id=193362
<rdar://problem/47122965>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/xcode/simulated_device.py:
(SimulatedDeviceManager.populate_available_devices):

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

7 months agoRelease assert when removing element with a map element in the shadow tree
antti@apple.com [Fri, 11 Jan 2019 22:38:24 +0000 (22:38 +0000)]
Release assert when removing element with a map element in the shadow tree
https://bugs.webkit.org/show_bug.cgi?id=193351
<rdar://problem/47208807>

Reviewed by Ryosuke Niwa.

Source/WebCore:

When a shadow host that has a map element in the shadow tree is removed from the document, we try
to remove the map from the scope of the host.

Test: fast/shadow-dom/image-map-tree-scope.html

* html/HTMLMapElement.cpp:
(WebCore::HTMLMapElement::insertedIntoAncestor):
(WebCore::HTMLMapElement::removedFromAncestor):

Add and remove image maps when the scope changes, not when the document changes.
This matches how id/name/etc updates work in the HTMLElement.

LayoutTests:

* fast/shadow-dom/image-map-tree-scope-expected.txt: Added.
* fast/shadow-dom/image-map-tree-scope.html: Added.

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

7 months ago[ews-build] Update macOS queue configurations
aakash_jain@apple.com [Fri, 11 Jan 2019 22:36:14 +0000 (22:36 +0000)]
[ews-build] Update macOS queue configurations
https://bugs.webkit.org/show_bug.cgi?id=193365

Reviewed by Lucas Forschler.

* BuildSlaveSupport/ews-build/config.json:

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

7 months agowebkitpy: Incorporate device type into baseline search path
jbedard@apple.com [Fri, 11 Jan 2019 22:26:06 +0000 (22:26 +0000)]
webkitpy: Incorporate device type into baseline search path
https://bugs.webkit.org/show_bug.cgi?id=193356
<rdar://problem/47215515>

Reviewed by Lucas Forschler.

We need a way to include device type in the baseline search path for iOS to support device specific test expectations.

* Scripts/webkitpy/port/base.py:
(Port.default_baseline_search_path): Allow device type to be passed in.
* Scripts/webkitpy/port/gtk.py:
(GtkPort.default_baseline_search_path): Ignore device type.
* Scripts/webkitpy/port/ios.py:
(IOSPort.default_baseline_search_path): Optionally allow device type to be incorporated into the baseline search path.
(IOSPort.test_expectations_file_position): Update index for the additional device-type specific baseline search path.
* Scripts/webkitpy/port/ios_device_unittest.py:
(IOSDeviceTest):
* Scripts/webkitpy/port/ios_simulator_unittest.py:
(IOSSimulatorTest):
* Scripts/webkitpy/port/mac.py:
(MacPort.default_baseline_search_path): Ignore device type.
* Scripts/webkitpy/port/watch.py:
(WatchPort.default_baseline_search_path): Ditto.
* Scripts/webkitpy/port/win.py:
(WinPort.default_baseline_search_path): Ditto.
(WinCairoPort.default_baseline_search_path): Ditto.
* Scripts/webkitpy/port/wpe.py:
(WPEPort.default_baseline_search_path): Ditto.

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

7 months agowebkitpy: Print abbreviated baseline search path that includes only folders that...
jbedard@apple.com [Fri, 11 Jan 2019 22:25:33 +0000 (22:25 +0000)]
webkitpy: Print abbreviated baseline search path that includes only folders that exist
https://bugs.webkit.org/show_bug.cgi?id=193352
<rdar://problem/47210736>

Reviewed by Lucas Forschler.

* Scripts/webkitpy/layout_tests/views/printing.py:
(Printer.print_config): Print list on only baseline search paths which exist.
* Scripts/webkitpy/layout_tests/views/printing_unittest.py:
(Testprinter.test_print_config):

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

7 months agoWorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread...
said@apple.com [Fri, 11 Jan 2019 22:01:07 +0000 (22:01 +0000)]
WorkQueue::concurrentApply() passes a raw pointer to a temporary String to Thread::create().
https://bugs.webkit.org/show_bug.cgi?id=191350

Reviewed by Brent Fulgham.

The non COCOA version of WorkQueue::concurrentApply() creates a temporary
String for the threadName and passes the raw pointer of this String to
Thread::create(). After freeing this String, Thread::entryPoint() uses
the raw char pointer to internally initialize the thread.

The fix is to use a single literal string for all the threads' names since
they are created for a thread-pool.

* wtf/WorkQueue.cpp:
(WTF::WorkQueue::concurrentApply):

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

7 months agoFix an assertion in UniqueIDBDatabase
sihui_liu@apple.com [Fri, 11 Jan 2019 21:57:46 +0000 (21:57 +0000)]
Fix an assertion in UniqueIDBDatabase
https://bugs.webkit.org/show_bug.cgi?id=193096

Reviewed by Brady Eidson.

m_objectStoreTransactionCounts.count(objectStore) == 1 in UniqueIDBDatabase::operationAndTransactionTimerFired()
is not necessarily true because m_objectStoreTransactionCounts may be cleared in immediateCloseForUserDelete.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):

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

7 months agoCleanup possible WK*Copy/Create leaks in WebKitTestRunner
commit-queue@webkit.org [Fri, 11 Jan 2019 21:04:09 +0000 (21:04 +0000)]
Cleanup possible WK*Copy/Create leaks in WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=193340

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-11
Reviewed by David Kilzer.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
Pull the strings out into a WKRetainPtr.

* WebKitTestRunner/WebNotificationProvider.cpp:
(WTR::WebNotificationProvider::closeWebNotification):
Adopt the created value into the WKRetainPtr.

* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::generateWhitelist):
Immediately adopt a created value to avoid potential mistakes.

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

7 months agoWeb Inspector: REGRESSION: deleting an audit puts selection in a selected but invisib...
mattbaker@apple.com [Fri, 11 Jan 2019 21:02:28 +0000 (21:02 +0000)]
Web Inspector: REGRESSION: deleting an audit puts selection in a selected but invisible state
https://bugs.webkit.org/show_bug.cgi?id=192917
<rdar://problem/46875285>

Reviewed by Devin Rousso.

SelectionController should not be notified of removed children until the
child items have been removed from the TreeOutline. Doing so at this stage
is unsafe, since this method checks `this.selectedTreeElement`, which could
return the adjusted index from the SelectionController before anything has
actually been removed from the TreeOutline.

The number of calls to SelectionController.prototype.didRemoveItems is also
reduced somewhat, since we're no longer calling it for every TreeElement.

* UserInterface/Views/TreeOutline.js:
(WI.TreeOutline.prototype.removeChildAtIndex):
(WI.TreeOutline.prototype.removeChildren):
(WI.TreeOutline.prototype._forgetTreeElement):
(WI.TreeOutline.prototype._indexesForSubtree): Added.

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

7 months ago[GTK] Garbled rendering on Youtube while scrolling under X11.
magomez@igalia.com [Fri, 11 Jan 2019 21:01:47 +0000 (21:01 +0000)]
[GTK] Garbled rendering on Youtube while scrolling under X11.
https://bugs.webkit.org/show_bug.cgi?id=192982

Reviewed by Carlos Garcia Campos.

When creating a GLX window context, try to get a GLXFBConfig that has depth and stencil buffers for
the default framebuffer.

* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::compatibleVisuals):
(WebCore::GLContextGLX::createWindowContext):

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

7 months agoEnable DFG on ARM/Linux again
dinfuehr@igalia.com [Fri, 11 Jan 2019 20:41:42 +0000 (20:41 +0000)]
Enable DFG on ARM/Linux again
https://bugs.webkit.org/show_bug.cgi?id=192496

Reviewed by Yusuke Suzuki.

JSTests:

Test wasn't really skipped before moving the line with skip
to the top.

* stress/regress-192717.js:

Source/JavaScriptCore:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux. Do not use register
r11 in compiled DFG mode since it is already used in LLInt as metadataTable
register. Also clean up code since ARM traditional isn't supported anymore.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer):
(JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::CallFrameShuffler):
* jit/GPRInfo.h:
(JSC::GPRInfo::toIndex):
* llint/LowLevelInterpreter32_64.asm:
* offlineasm/arm.rb:

Source/WTF:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux.

* wtf/Platform.h:

Tools:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux. Run again JIT-tests
on ARM by default.

* Scripts/run-jsc-stress-tests:

LayoutTests:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux. Disable tests that
run out of executable memory with LLInt disabled.

* js/script-tests/dfg-float32array.js:
* js/script-tests/dfg-float64array.js:
* js/script-tests/dfg-int16array.js:
* js/script-tests/dfg-int32array-overflow-values.js:
* js/script-tests/dfg-int32array.js:
* js/script-tests/dfg-int8array.js:
* js/script-tests/dfg-uint16array.js:
* js/script-tests/dfg-uint32array.js:
* js/script-tests/dfg-uint8array.js:

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

7 months agoUnreviewed, fix #ifdef in API test added in r239851.
timothy@apple.com [Fri, 11 Jan 2019 20:37:48 +0000 (20:37 +0000)]
Unreviewed, fix #ifdef in API test added in r239851.
https://bugs.webkit.org/show_bug.cgi?id=193327
rdar://problem/47093222

* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle_Bundle.mm:

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

7 months agoIndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
sihui_liu@apple.com [Fri, 11 Jan 2019 20:21:08 +0000 (20:21 +0000)]
IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests
https://bugs.webkit.org/show_bug.cgi?id=193167
<rdar://problem/46891688>

Reviewed by Geoffrey Garen.

Do some cleanup to break retain cycle when context is stopped.

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::cancelForStop):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::abortOnServerAndCancelRequests):
(WebCore::IDBTransaction::stop):
(WebCore::IDBTransaction::removeRequest):
* Modules/indexeddb/client/TransactionOperation.h:
(WebCore::IDBClient::TransactionOperation::doComplete):

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

7 months agoIntroduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
wenson_hsieh@apple.com [Fri, 11 Jan 2019 18:28:06 +0000 (18:28 +0000)]
Introduce IDL files for runtime-enabled UndoManager and UndoItem JavaScript API
https://bugs.webkit.org/show_bug.cgi?id=193109
<rdar://problem/44807048>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Adds new IDL files and stubs for UndoManager and UndoItem. This is an experimental DOM API that (in the near
future) is intended only for use in internal WebKit text editing clients. This API allows the page to
participate in the processes of undoing and redoing by defining custom undo and redo handlers, to be executed
when undo or redo is triggered.

Tests: editing/undo-manager/undo-manager-interfaces.html
       editing/undo-manager/undo-manager-keeps-wrapper-alive.html

* CMakeLists.txt:
* DerivedSources-input.xcfilelist:
* DerivedSources-output.xcfilelist:
* DerivedSources.make:
* Sources.txt:
* UnifiedSources-input.xcfilelist:
* WebCore.xcodeproj/project.pbxproj:

Add new source files.

* bindings/js/WebCoreBuiltinNames.h:

Add "UndoManager" and "UndoItem" names.

* dom/Document.cpp:
(WebCore::m_undoManager):

Have the document own a UndoManager.

* dom/Document.h:
(WebCore::Document::undoManager const):
* dom/Document.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setUndoManagerAPIEnabled):
(WebCore::RuntimeEnabledFeatures::undoManagerAPIEnabled const):

Guard the new bindings behind a runtime-enabled feature flag.

* page/UndoItem.h: Added.
(WebCore::UndoItem::create):
(WebCore::UndoItem::label const):
(WebCore::UndoItem::undoHandler const):
(WebCore::UndoItem::redoHandler const):
(WebCore::UndoItem::UndoItem):
* page/UndoItem.idl: Added.
* page/UndoManager.cpp: Added.
(WebCore::UndoManager::addItem):
* page/UndoManager.h: Added.
(WebCore::UndoManager::create):
(WebCore::UndoManager::document):
(WebCore::UndoManager::UndoManager):
* page/UndoManager.idl: Added.
* page/mac/WheelEventDeltaFilterMac.h:

Necessary (albeit unrelated) build fix to appease unified sources.

Source/WebKit:

Add a new SPI configuration flag to enable the UndoManager API. This is off by default.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _setUndoManagerAPIEnabled:]):
(-[WKWebViewConfiguration _undoManagerAPIEnabled]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:

Tools:

Introduce and respect a test option to enable the UndoManager API.

* WebKitTestRunner/TestController.cpp:
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::platformCreateWebView):

LayoutTests:

Add UndoManager tests to exercise new bindings, and verify that the JS wrapper for Document's UndoManager
survives garbage collection.

* TestExpectations:
* editing/undo-manager/undo-manager-interfaces-expected.txt: Added.
* editing/undo-manager/undo-manager-interfaces.html: Added.
* editing/undo-manager/undo-manager-keeps-wrapper-alive-expected.txt: Added.
* editing/undo-manager/undo-manager-keeps-wrapper-alive.html: Added.
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

7 months ago[LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
zalan@apple.com [Fri, 11 Jan 2019 16:19:41 +0000 (16:19 +0000)]
[LFC][BFC][MarginCollapsing] Adjust vertical position when box margin collapses through.
https://bugs.webkit.org/show_bug.cgi?id=193346

Reviewed by Antti Koivisto.

Source/WebCore:

If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
In this case, the position of the element depends on its relationship with the other elements whose margins are being collapsed.

1. If the element's margins are collapsed with its parent's top margin, the top border edge of the box is defined to be the same as the parent's.
2. Otherwise, either the element's parent is not taking part in the margin collapsing, or only the parent's bottom margin is involved.
   The position of the element's top border edge is the same as it would have been if the element had a non-zero bottom border.

Test: fast/block/block-only/collapsed-through-with-parent.html

* layout/MarginTypes.h:
(WebCore::Layout::EstimatedMarginBefore::usedValue const):
* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const):
(WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
* layout/blockformatting/BlockFormattingContext.h:
* layout/blockformatting/BlockMarginCollapse.cpp:
(WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
(WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeIgnoringCollapsingThrough):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/block-only/collapsed-through-with-parent-expected.txt: Added.
* fast/block/block-only/collapsed-through-with-parent.html: Added.

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

7 months agoUnreviewed GTK gardening. Rebaseline several tests after r239822.
carlosgc@webkit.org [Fri, 11 Jan 2019 13:17:29 +0000 (13:17 +0000)]
Unreviewed GTK gardening. Rebaseline several tests after r239822.

* platform/gtk/css2.1/t1202-counter-04-b-expected.png:
* platform/gtk/css2.1/t1202-counter-04-b-expected.txt:
* platform/gtk/css2.1/t1202-counters-04-b-expected.png:
* platform/gtk/css2.1/t1202-counters-04-b-expected.txt:
* platform/gtk/fast/text/combining-enclosing-keycap-expected.txt:
* platform/gtk/fast/text/fallback-traits-fixup-expected.png:
* platform/gtk/fast/text/fallback-traits-fixup-expected.txt:

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

7 months ago[WHLSL] Include the standard library
mmaxfield@apple.com [Fri, 11 Jan 2019 07:47:07 +0000 (07:47 +0000)]
[WHLSL] Include the standard library
https://bugs.webkit.org/show_bug.cgi?id=192994

Reviewed by Jon Lee.

A small section of the standard library is present in WHLSLStandardLibrary.txt. This gets turned into a header file containing
its raw data at build time by invoking our xxd.pl script (which WebCore already uses for other purposes). The standard
library is generated by running a JavaScript script, but currently there is no way to invoke JavaScript from our build
process, so this patch includes in the standard library's raw text instead. Once the parser is faster, we can include the
entire standard library.

No new tests because it isn't hooked up yet.

* DerivedSources.make:
* Modules/webgpu/WHLSL/WHLSLStandardLibrary.txt: Added.
* WebCore.xcodeproj/project.pbxproj:

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

7 months agoUnreviewed, fix typo that breaks dashboard link.
ryanhaddad@apple.com [Fri, 11 Jan 2019 06:23:47 +0000 (06:23 +0000)]
Unreviewed, fix typo that breaks dashboard link.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):

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

7 months agoUpdate macOS queue configurations
ryanhaddad@apple.com [Fri, 11 Jan 2019 06:07:26 +0000 (06:07 +0000)]
Update macOS queue configurations
https://bugs.webkit.org/show_bug.cgi?id=193329

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(table.queue-grid tr.platform.macos-sierra img.logo): Deleted.
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:

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

7 months agoWeb Inspector: Audit: allow audits to be enabled/disabled
drousso@apple.com [Fri, 11 Jan 2019 05:54:54 +0000 (05:54 +0000)]
Web Inspector: Audit: allow audits to be enabled/disabled
https://bugs.webkit.org/show_bug.cgi?id=192210
<rdar://problem/46423583>

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.get editing): Added.
(WI.AuditManager.prototype.set editing): Added.
(WI.AuditManager.prototype.stop):
(WI.AuditManager.prototype.addDefaultTestsIfNeeded):
Since default audits aren't stored, keep a list of disabled default tests in a `WI.Setting`.

* UserInterface/Models/AuditTestBase.js:
(WI.AuditTestBase):
(WI.AuditTestBase.prototype.get disabled): Added.
(WI.AuditTestBase.prototype.set disabled): Added.
(WI.AuditTestBase.prototype.async start):
(WI.AuditTestBase.prototype.stop):
(WI.AuditTestBase.toJSON):

* UserInterface/Models/AuditTestCase.js:
(WI.AuditTestCase):
(WI.AuditTestCase.async fromPayload):
(WI.AuditTestCase.prototype.toJSON):

* UserInterface/Models/AuditTestGroup.js:
(WI.AuditTestGroup):
(WI.AuditTestGroup.async fromPayload):
(WI.AuditTestGroup.prototype.get disabled): Added.
(WI.AuditTestGroup.prototype.set disabled): Added.
(WI.AuditTestGroup.prototype.toJSON):
(WI.AuditTestGroup.prototype.async run):
(WI.AuditTestGroup.prototype._handleTestDisabledChanged): Added.
(WI.AuditTestGroup.prototype._handleTestProgress):
Propagate `disabled` changes to all sub-tests, unless the change was caused by one of the
sub-tests, in which case we are now in an intermediate state.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel):
(WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
(WI.AuditNavigationSidebarPanel.prototype.initialLayout):
(WI.AuditNavigationSidebarPanel.prototype.hasCustomFilters): Added.
(WI.AuditNavigationSidebarPanel.prototype.matchTreeElementAgainstCustomFilters): Added.
(WI.AuditNavigationSidebarPanel.prototype._addTest):
(WI.AuditNavigationSidebarPanel.prototype._addResult):
(WI.AuditNavigationSidebarPanel.prototype._updateStartStopButtonNavigationItemState):
(WI.AuditNavigationSidebarPanel.prototype._updateEditButtonNavigationItemState): Added.
(WI.AuditNavigationSidebarPanel.prototype._handleAuditManagerEditingChanged): Added.
(WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
(WI.AuditNavigationSidebarPanel.prototype._handleAuditTestScheduled):
(WI.AuditNavigationSidebarPanel.prototype._treeSelectionDidChange):
(WI.AuditNavigationSidebarPanel.prototype._handleEditButtonNavigationItemClicked): Added.
* UserInterface/Views/AuditNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.audit > .content):
(.sidebar > .panel.navigation.audit > .content > .tree-outline): Added.
(.sidebar > .panel.navigation.audit > .content .edit-audits:not(.disabled):active): Added.
(.sidebar > .panel.navigation.audit > .content .edit-audits:not(.disabled).activated): Added.
(.sidebar > .panel.navigation.audit > .content .edit-audits:not(.disabled).activated:active): Added.
(.sidebar > .panel.navigation.audit > .content .edit-audits.disabled): Added.
(.finish-editing-audits-placeholder.message-text-view .navigation-item-help .navigation-bar): Added.
Leverage custom filters to ensure that disabled audits arent shown when not editing and that
result tree elements aren't shown while editing.

* UserInterface/Views/AuditTestGroupContentView.js:
(WI.AuditTestGroupContentView.prototype.shown):

* UserInterface/Views/AuditTreeElement.js:
(WI.AuditTreeElement.prototype.onattach):
(WI.AuditTreeElement.prototype.canSelectOnMouseDown): Added.
(WI.AuditTreeElement.prototype._updateTestGroupDisabled): Added.
(WI.AuditTreeElement.prototype._handleTestDisabledChanged): Added.
(WI.AuditTreeElement.prototype._handleManagerEditingChanged): Added.
* UserInterface/Views/AuditTreeElement.css:
(.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:not(:hover)): Added.
(.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded:not(.editing-audits) > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Added.
(.tree-outline .item.audit > .status:not(:hover) > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:not(:hover)): Deleted.
(.tree-outline .item.audit.manager-active > .status > img.show-on-hover, .tree-outline .item.audit.test-group.expanded > .status:hover > :not(img), .tree-outline .item.audit.test-group-result.expanded > .status): Deleted.
Prevent selection and running when editing.

* UserInterface/Views/TreeOutline.css:
(.tree-outline .children.expanded:not([hidden])): Added.
(.tree-outline .children.expanded): Deleted.

* UserInterface/Base/ObjectStore.js:
(WI.ObjectStore._open):
Batch operations together to help avoid multiple simultaneous `indexedDB.open` calls. This
should also help preserve the order of operations, as once the database is open, operations
are executed in the order they were enqueued.

(WI.ObjectStore.prototype.async.addObject):
Pass a unique `Symbol` to the `toJSON` call on the given object so that the object can save
additional values that wouldn't normally be saved. This doesn't conflict with normal usage
of `toJSON` (e.g. `JSON.stringify`) because that case also passes in a value:
 - `undefined`, if it was called directly on the object
 - the key for this object in the containing object
 - the index of this object in the containing array
In any case, the value can never equal the unique `Symbol`, so it's guaranteed that the code
will only run for `WI.ObjectStore` operations.

(WI.ObjectStore.prototype.async.clear): Added.

* Localizations/en.lproj/localizedStrings.js:

LayoutTests:

* inspector/unit-tests/objectStore/clear.html: Added.
* inspector/unit-tests/objectStore/clear-expected.txt: Added.

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

7 months ago<video> elements do not enter 'paused' state when playing to end over AirPlay
jer.noble@apple.com [Fri, 11 Jan 2019 04:46:23 +0000 (04:46 +0000)]
<video> elements do not enter 'paused' state when playing to end over AirPlay
https://bugs.webkit.org/show_bug.cgi?id=193295
<rdar://problem/46708670>

Reviewed by Eric Carlson.

Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting
for more data before playing. AirPlay devices report this state back from the remote device, and this allows the
MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling.

Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the
readyState > HAVE_ENOUGH as an intentional pause.

Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay()
until the first frame became available. But this code was entirely undermined by the previous
behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was
actually requested started making this code work for the first time, and broke some API tests.
Thus, we're removing this previously dead code.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
(WebCore::MediaPlayerPrivateAVFoundation::play):
(WebCore::MediaPlayerPrivateAVFoundation::pause):
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay):
(WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause):
(WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate):
(WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
(-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):

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

7 months agoMiniBrowser should be able to navigate to about:blank
commit-queue@webkit.org [Fri, 11 Jan 2019 04:39:23 +0000 (04:39 +0000)]
MiniBrowser should be able to navigate to about:blank
https://bugs.webkit.org/show_bug.cgi?id=193345

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-10
Reviewed by Simon Fraser.

* MiniBrowser/mac/BrowserWindowController.m:
(-[BrowserWindowController addProtocolIfNecessary:]):
Don't prepend "http://" to "about:" prefixed URLs like "about:blank".

* MiniBrowser/mac/WK1BrowserWindowController.m:
(-[WK1BrowserWindowController fetch:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController fetch:]):
Clean up the code that uses this to match style.

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

7 months agoRemove MiniBrowser custom "Process Swap" menu item which does not work
commit-queue@webkit.org [Fri, 11 Jan 2019 04:38:04 +0000 (04:38 +0000)]
Remove MiniBrowser custom "Process Swap" menu item which does not work
https://bugs.webkit.org/show_bug.cgi?id=193344

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-10
Reviewed by Simon Fraser.

There is a menu item under the Experimental menu that does work.

* MiniBrowser/mac/AppDelegate.m:
(defaultConfiguration):
* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController processSwapOnNavigationEnabled]): Deleted.
(-[SettingsController toggleProcessSwapOnNavigation:]): Deleted.

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

7 months agoFix the build after r239844
mmaxfield@apple.com [Fri, 11 Jan 2019 03:54:43 +0000 (03:54 +0000)]
Fix the build after r239844
https://bugs.webkit.org/show_bug.cgi?id=192991

Unreviewed.

* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp:
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp:
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp:
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp:
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):

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

7 months ago[WebGPU] WebGPUBindGroup and device::createBindGroup prototype
justin_fan@apple.com [Fri, 11 Jan 2019 02:12:57 +0000 (02:12 +0000)]
[WebGPU] WebGPUBindGroup and device::createBindGroup prototype
https://bugs.webkit.org/show_bug.cgi?id=193341

Reviewed by Myles C. Maxfield.

Source/WebCore:

Add *GPUBindGroup class stubs and the ability to create WebGPUBindGroups via the API.

Test: bind-groups.html

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:

* Modules/webgpu/WebGPUBindGroup.cpp:
(WebCore::WebGPUBindGroup::create):
(WebCore::WebGPUBindGroup::WebGPUBindGroup):
* Modules/webgpu/WebGPUBindGroup.h:
* Modules/webgpu/WebGPUBindGroup.idl: Enable createBindGroup().
* Modules/webgpu/WebGPUDevice.cpp:
(WebCore::BindingResourceVisitor::operator() const): Added. Validate and convert WebGPUBindGroupDescriptor to GPU* version.
(WebCore::WebGPUDevice::createBindGroup const): Added.
* Modules/webgpu/WebGPUDevice.h:
* platform/graphics/gpu/GPUBindGroup.cpp:
(WebCore::GPUBindGroup::create):
(WebCore::GPUBindGroup::GPUBindGroup):
* platform/graphics/gpu/GPUBindGroup.h:
* platform/graphics/gpu/GPUBufferBinding.h:
* platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
(WebCore::appendArgumentToArray): Pass RetainPtr by reference to actually update descriptor.

LayoutTests:

Small test that creates a WebGPUBindGroup.

* webgpu/bind-groups-expected.txt: Added.
* webgpu/bind-groups.html: Added.

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

7 months ago[WebAuthN] Change the nonce in the CTAP kInit command to weak random values
jiewen_tan@apple.com [Fri, 11 Jan 2019 01:42:34 +0000 (01:42 +0000)]
[WebAuthN] Change the nonce in the CTAP kInit command to weak random values
https://bugs.webkit.org/show_bug.cgi?id=192061
<rdar://problem/46471091>

Reviewed by Chris Dumez.

Change the nonce in the CTAP kInit command to weak random values as the nonce is mainly
for being a probabilistically unique global identifier for hand shakes, instead of
preventing replay attacks. Otherwise, it might exhaust system entropy unnecessarily.

The patch also removes all logging when debugging the test case flakiness.

* UIProcess/WebAuthentication/AuthenticatorManager.cpp:
(WebKit::AuthenticatorManager::respondReceived):
(WebKit::AuthenticatorManager::initTimeOutTimer):
(WebKit::AuthenticatorManager::timeOutTimerFired):
* UIProcess/WebAuthentication/Cocoa/HidService.mm:
(WebKit::HidService::deviceAdded):
* UIProcess/WebAuthentication/Mock/MockAuthenticatorManager.cpp:
(WebKit::MockAuthenticatorManager::respondReceivedInternal):
* UIProcess/WebAuthentication/Mock/MockHidConnection.cpp:
(WebKit::MockHidConnection::send):
* UIProcess/WebAuthentication/fido/CtapHidAuthenticator.cpp:
(WebKit::CtapHidAuthenticator::makeCredential):
(WebKit::CtapHidAuthenticator::getAssertion):
* UIProcess/WebAuthentication/fido/CtapHidDriver.cpp:
(WebKit::CtapHidDriver::Worker::write):
(WebKit::CtapHidDriver::Worker::read):
(WebKit::CtapHidDriver::Worker::returnMessage):
(WebKit::CtapHidDriver::transact):
(WebKit::CtapHidDriver::continueAfterChannelAllocated):
(WebKit::CtapHidDriver::continueAfterResponseReceived):

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

7 months agoAdd WKBundlePage SPI to temporarily force light or dark appearance on a page.
timothy@apple.com [Fri, 11 Jan 2019 01:11:57 +0000 (01:11 +0000)]
Add WKBundlePage SPI to temporarily force light or dark appearance on a page.
https://bugs.webkit.org/show_bug.cgi?id=193327
rdar://problem/47093222

Reviewed by Tim Horton.

Source/WebKit:

Tests: WebKit.ForceLightAppearanceInBundle API Test

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageSetUseDarkAppearance): Added.
(WKBundlePageIsUsingDarkAppearance): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm: Added.
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::didReceiveMessageFromInjectedBundle):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle_Bundle.mm: Added.
(TestWebKitAPI::ForceLightAppearanceInBundleTest::ForceLightAppearanceInBundleTest):
(TestWebKitAPI::ForceLightAppearanceInBundleTest::didCreatePage):
(TestWebKitAPI::ForceLightAppearanceInBundleTest::didReceiveMessage):
* TestWebKitAPI/Tests/WebKit/mac/dark-mode.html: Added.

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

7 months agoDeviceID hash salt manager can be NULL
eric.carlson@apple.com [Fri, 11 Jan 2019 00:49:23 +0000 (00:49 +0000)]
DeviceID hash salt manager can be NULL
https://bugs.webkit.org/show_bug.cgi?id=193334
<rdar://problem/47179650>

Reviewed by Youenn Fablet.

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): No need to
NULL-check websiteDataStore.deviceIdHashSaltStorage, it is a Ref.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::WebsiteDataStore): m_deviceIdHashSaltStorage is a Ref.
(WebKit::WebsiteDataStore::fetchDataAndApply): Ditto.
(WebKit::WebsiteDataStore::removeData): Ditto.
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::deviceIdHashSaltStorage): Ditto.

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

7 months agoLeak of WKWebProcessPlugInHitTestResult (160 bytes) in com.apple.WebKit.WebContent...
commit-queue@webkit.org [Thu, 10 Jan 2019 23:03:47 +0000 (23:03 +0000)]
Leak of WKWebProcessPlugInHitTestResult (160 bytes) in com.apple.WebKit.WebContent running layout tests
https://bugs.webkit.org/show_bug.cgi?id=193338
<rdar://problem/46664774>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-01-10
Reviewed by David Kilzer.

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForNavigationAction):

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

7 months agoFix rare crash under ScrollbarThemeMac::paintScrollCorner()
simon.fraser@apple.com [Thu, 10 Jan 2019 22:50:13 +0000 (22:50 +0000)]
Fix rare crash under ScrollbarThemeMac::paintScrollCorner()
https://bugs.webkit.org/show_bug.cgi?id=193337
rdar://problem/47179993

Reviewed by Zalan Bujtas.

Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint,
which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars()
which tried to get at the platform context, and then crashed.

So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified
that other scrollbar-related painting code paths were already protected.

Hard to test because it depends on async image decoding timing.

* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::paint):
(WebCore::ScrollbarThemeMac::paintScrollCorner):

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

7 months agoWeb Inspector: incorrect type signature used for protocol enums in async command...
bburg@apple.com [Thu, 10 Jan 2019 22:36:56 +0000 (22:36 +0000)]
Web Inspector: incorrect type signature used for protocol enums in async command results
https://bugs.webkit.org/show_bug.cgi?id=193331

Reviewed by Devin Rousso.

When an enum is returned by an async command, the type signature should be that of the
Inspector::Protocol::* generated enum, rather than the underlying primitive type (i.e., String).

* inspector/scripts/codegen/cpp_generator.py:
(CppGenerator.cpp_type_for_formal_async_parameter):
* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
Rebaseline generator test results.

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

7 months ago[macOS] Add name of IORegistry key in sandbox.
pvollan@apple.com [Thu, 10 Jan 2019 22:31:10 +0000 (22:31 +0000)]
[macOS] Add name of IORegistry key in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=193335
<rdar://problem/47184951>

Reviewed by Alexey Proskuryakov.

The property IOGVAHEVCDecodeCapabilities was added in https://bugs.webkit.org/show_bug.cgi?id=193324.
Also, the property IOGVAHEVCEncodeCapabilities needs to be added.

* WebProcess/com.apple.WebProcess.sb.in:

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

7 months ago[WHLSL] Implement parser AST nodes
mmaxfield@apple.com [Thu, 10 Jan 2019 22:17:58 +0000 (22:17 +0000)]
[WHLSL] Implement parser AST nodes
https://bugs.webkit.org/show_bug.cgi?id=192991

Reviewed by Alex Christensen.

This patch creates all the AST nodes which will be the result of running the parser.
This patch used to be a part of the "create a WHLSL parser" patch but I split them
out in order to aid reviewing.

The classes were mechanically created to match the result of the parser. There are
nodes for things like ForLoops, LogicalNotExpressions, DereferenceExpressions,
StructureDefinitions, and things like that. The classes don't actually have any logic
in them - they are currently just containers to hold the structure of the parsed
program. Some of these nodes (like constexprs) are just Variants of the various things
they can in the form of.

No new tests because the parser doesn't exist to create the new AST nodes yet.

* Modules/webgpu/WHLSL/AST/WHLSLArrayReferenceType.h: Added.
(WebCore::WHLSL::AST::ArrayReferenceType::ArrayReferenceType):
* Modules/webgpu/WHLSL/AST/WHLSLArrayType.h: Added.
(WebCore::WHLSL::AST::ArrayType::ArrayType):
(WebCore::WHLSL::AST::ArrayType::type const):
(WebCore::WHLSL::AST::ArrayType::type):
(WebCore::WHLSL::AST::ArrayType::numElements const):
* Modules/webgpu/WHLSL/AST/WHLSLAssignmentExpression.h: Added.
(WebCore::WHLSL::AST::AssignmentExpression::AssignmentExpression):
(WebCore::WHLSL::AST::AssignmentExpression::left):
(WebCore::WHLSL::AST::AssignmentExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLBaseFunctionAttribute.h: Added.
(WebCore::WHLSL::AST::BaseFunctionAttribute::BaseFunctionAttribute):
* Modules/webgpu/WHLSL/AST/WHLSLBaseSemantic.h: Added.
(WebCore::WHLSL::AST::BaseSemantic::BaseSemantic):
* Modules/webgpu/WHLSL/AST/WHLSLBlock.h: Added.
(WebCore::WHLSL::AST::Block::Block):
(WebCore::WHLSL::AST::Block::statements):
* Modules/webgpu/WHLSL/AST/WHLSLBooleanLiteral.h: Added.
(WebCore::WHLSL::AST::BooleanLiteral::BooleanLiteral):
(WebCore::WHLSL::AST::BooleanLiteral::value const):
(WebCore::WHLSL::AST::BooleanLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLBreak.h: Added.
(WebCore::WHLSL::AST::Break::Break):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.cpp: Added.
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::BuiltInSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h: Added.
(WebCore::WHLSL::AST::BuiltInSemantic::BuiltInSemantic):
(WebCore::WHLSL::AST::BuiltInSemantic::variable const):
(WebCore::WHLSL::AST::BuiltInSemantic::operator== const):
(WebCore::WHLSL::AST::BuiltInSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLCallExpression.h: Added.
(WebCore::WHLSL::AST::CallExpression::CallExpression):
(WebCore::WHLSL::AST::CallExpression::arguments):
(WebCore::WHLSL::AST::CallExpression::name):
(WebCore::WHLSL::AST::CallExpression::setCastData):
(WebCore::WHLSL::AST::CallExpression::isCast):
(WebCore::WHLSL::AST::CallExpression::castReturnType):
(WebCore::WHLSL::AST::CallExpression::hasOverloads const):
(WebCore::WHLSL::AST::CallExpression::overloads):
(WebCore::WHLSL::AST::CallExpression::setOverloads):
(WebCore::WHLSL::AST::CallExpression::setFunction):
* Modules/webgpu/WHLSL/AST/WHLSLCommaExpression.h: Added.
(WebCore::WHLSL::AST::CommaExpression::CommaExpression):
(WebCore::WHLSL::AST::CommaExpression::list):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpression.h: Added.
(WebCore::WHLSL::AST::ConstantExpression::ConstantExpression):
(WebCore::WHLSL::AST::ConstantExpression::integerLiteral):
(WebCore::WHLSL::AST::ConstantExpression::visit):
(WebCore::WHLSL::AST::ConstantExpression::visit const):
(WebCore::WHLSL::AST::ConstantExpression::clone const):
(WebCore::WHLSL::AST::ConstantExpression::matches const):
* Modules/webgpu/WHLSL/AST/WHLSLConstantExpressionEnumerationMemberReference.h: Added.
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::ConstantExpressionEnumerationMemberReference):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::left const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::right const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::clone const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationDefinition const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::enumerationMember const):
(WebCore::WHLSL::AST::ConstantExpressionEnumerationMemberReference::setEnumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLContinue.h: Added.
(WebCore::WHLSL::AST::Continue::Continue):
* Modules/webgpu/WHLSL/AST/WHLSLDereferenceExpression.h: Added.
(WebCore::WHLSL::AST::DereferenceExpression::DereferenceExpression):
(WebCore::WHLSL::AST::DereferenceExpression::pointer):
* Modules/webgpu/WHLSL/AST/WHLSLDoWhileLoop.h: Added.
(WebCore::WHLSL::AST::DoWhileLoop::DoWhileLoop):
(WebCore::WHLSL::AST::DoWhileLoop::body):
(WebCore::WHLSL::AST::DoWhileLoop::conditional):
* Modules/webgpu/WHLSL/AST/WHLSLDotExpression.h: Added.
(WebCore::WHLSL::AST::DotExpression::DotExpression):
(WebCore::WHLSL::AST::DotExpression::fieldName):
* Modules/webgpu/WHLSL/AST/WHLSLEffectfulExpressionStatement.h: Added.
(WebCore::WHLSL::AST::EffectfulExpressionStatement::EffectfulExpressionStatement):
(WebCore::WHLSL::AST::EffectfulExpressionStatement::effectfulExpression):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationDefinition.h: Added.
(WebCore::WHLSL::AST::EnumerationDefinition::EnumerationDefinition):
(WebCore::WHLSL::AST::EnumerationDefinition::type):
(WebCore::WHLSL::AST::EnumerationDefinition::add):
(WebCore::WHLSL::AST::EnumerationDefinition::memberByName):
(WebCore::WHLSL::AST::EnumerationDefinition::enumerationMembers):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMember.h: Added.
(WebCore::WHLSL::AST::EnumerationMember::EnumerationMember):
(WebCore::WHLSL::AST::EnumerationMember::origin const):
(WebCore::WHLSL::AST::EnumerationMember::name):
(WebCore::WHLSL::AST::EnumerationMember::value):
(WebCore::WHLSL::AST::EnumerationMember::setValue):
* Modules/webgpu/WHLSL/AST/WHLSLEnumerationMemberLiteral.h: Added.
(WebCore::WHLSL::AST::EnumerationMemberLiteral::EnumerationMemberLiteral):
(WebCore::WHLSL::AST::EnumerationMemberLiteral::enumerationMember):
* Modules/webgpu/WHLSL/AST/WHLSLExpression.h: Added.
(WebCore::WHLSL::AST::Expression::Expression):
(WebCore::WHLSL::AST::Expression::origin const):
(WebCore::WHLSL::AST::Expression::isAssignmentExpression const):
(WebCore::WHLSL::AST::Expression::isBooleanLiteral const):
(WebCore::WHLSL::AST::Expression::isCallExpression const):
(WebCore::WHLSL::AST::Expression::isCommaExpression const):
(WebCore::WHLSL::AST::Expression::isDereferenceExpression const):
(WebCore::WHLSL::AST::Expression::isDotExpression const):
(WebCore::WHLSL::AST::Expression::isFloatLiteral const):
(WebCore::WHLSL::AST::Expression::isIndexExpression const):
(WebCore::WHLSL::AST::Expression::isIntegerLiteral const):
(WebCore::WHLSL::AST::Expression::isLogicalExpression const):
(WebCore::WHLSL::AST::Expression::isLogicalNotExpression const):
(WebCore::WHLSL::AST::Expression::isMakeArrayReferenceExpression const):
(WebCore::WHLSL::AST::Expression::isMakePointerExpression const):
(WebCore::WHLSL::AST::Expression::isNullLiteral const):
(WebCore::WHLSL::AST::Expression::isPropertyAccessExpression const):
(WebCore::WHLSL::AST::Expression::isReadModifyWriteExpression const):
(WebCore::WHLSL::AST::Expression::isTernaryExpression const):
(WebCore::WHLSL::AST::Expression::isUnsignedIntegerLiteral const):
(WebCore::WHLSL::AST::Expression::isVariableReference const):
(WebCore::WHLSL::AST::Expression::isEnumerationMemberLiteral const):
* Modules/webgpu/WHLSL/AST/WHLSLFallthrough.h: Added.
(WebCore::WHLSL::AST::Fallthrough::Fallthrough):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteral.h: Added.
(WebCore::WHLSL::AST::FloatLiteral::FloatLiteral):
(WebCore::WHLSL::AST::FloatLiteral::type):
(WebCore::WHLSL::AST::FloatLiteral::value const):
(WebCore::WHLSL::AST::FloatLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.cpp: Added.
(WebCore::WHLSL::AST::FloatLiteralType::FloatLiteralType):
(WebCore::WHLSL::AST::FloatLiteralType::canResolve const):
(WebCore::WHLSL::AST::FloatLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLFloatLiteralType.h: Added.
(WebCore::WHLSL::AST::FloatLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLForLoop.h: Added.
(WebCore::WHLSL::AST::ForLoop::ForLoop):
(WebCore::WHLSL::AST::ForLoop::~ForLoop):
(WebCore::WHLSL::AST::ForLoop::initialization):
(WebCore::WHLSL::AST::ForLoop::condition):
(WebCore::WHLSL::AST::ForLoop::increment):
(WebCore::WHLSL::AST::ForLoop::body):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionAttribute.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h: Added.
(WebCore::WHLSL::AST::FunctionDeclaration::FunctionDeclaration):
(WebCore::WHLSL::AST::FunctionDeclaration::isFunctionDefinition const):
(WebCore::WHLSL::AST::FunctionDeclaration::isNativeFunctionDeclaration const):
(WebCore::WHLSL::AST::FunctionDeclaration::attributeBlock):
(WebCore::WHLSL::AST::FunctionDeclaration::entryPointType const):
(WebCore::WHLSL::AST::FunctionDeclaration::type const):
(WebCore::WHLSL::AST::FunctionDeclaration::type):
(WebCore::WHLSL::AST::FunctionDeclaration::name const):
(WebCore::WHLSL::AST::FunctionDeclaration::isCast const):
(WebCore::WHLSL::AST::FunctionDeclaration::parameters const):
(WebCore::WHLSL::AST::FunctionDeclaration::parameters):
(WebCore::WHLSL::AST::FunctionDeclaration::semantic):
(WebCore::WHLSL::AST::FunctionDeclaration::isOperator const):
* Modules/webgpu/WHLSL/AST/WHLSLFunctionDefinition.h: Added.
(WebCore::WHLSL::AST::FunctionDefinition::FunctionDefinition):
(WebCore::WHLSL::AST::FunctionDefinition::block):
(WebCore::WHLSL::AST::FunctionDefinition::restricted const):
* Modules/webgpu/WHLSL/AST/WHLSLIfStatement.h: Added.
(WebCore::WHLSL::AST::IfStatement::IfStatement):
(WebCore::WHLSL::AST::IfStatement::conditional):
(WebCore::WHLSL::AST::IfStatement::body):
(WebCore::WHLSL::AST::IfStatement::elseBody):
* Modules/webgpu/WHLSL/AST/WHLSLIndexExpression.h: Added.
(WebCore::WHLSL::AST::IndexExpression::IndexExpression):
(WebCore::WHLSL::AST::IndexExpression::indexExpression):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.cpp: Added.
(WebCore::WHLSL::AST::IntegerLiteral::valueForSelectedType const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteral.h: Added.
(WebCore::WHLSL::AST::IntegerLiteral::IntegerLiteral):
(WebCore::WHLSL::AST::IntegerLiteral::type):
(WebCore::WHLSL::AST::IntegerLiteral::value const):
(WebCore::WHLSL::AST::IntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.cpp: Added.
(WebCore::WHLSL::AST::IntegerLiteralType::IntegerLiteralType):
(WebCore::WHLSL::AST::IntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::IntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLIntegerLiteralType.h: Added.
(WebCore::WHLSL::AST::IntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalExpression.h: Added.
(WebCore::WHLSL::AST::LogicalExpression::LogicalExpression):
(WebCore::WHLSL::AST::LogicalExpression::type const):
(WebCore::WHLSL::AST::LogicalExpression::left):
(WebCore::WHLSL::AST::LogicalExpression::right):
* Modules/webgpu/WHLSL/AST/WHLSLLogicalNotExpression.h: Added.
(WebCore::WHLSL::AST::LogicalNotExpression::LogicalNotExpression):
(WebCore::WHLSL::AST::LogicalNotExpression::operand):
* Modules/webgpu/WHLSL/AST/WHLSLMakeArrayReferenceExpression.h: Added.
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::MakeArrayReferenceExpression):
(WebCore::WHLSL::AST::MakeArrayReferenceExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLMakePointerExpression.h: Added.
(WebCore::WHLSL::AST::MakePointerExpression::MakePointerExpression):
(WebCore::WHLSL::AST::MakePointerExpression::lValue):
* Modules/webgpu/WHLSL/AST/WHLSLNamedType.h: Added.
(WebCore::WHLSL::AST::NamedType::NamedType):
(WebCore::WHLSL::AST::NamedType::origin const):
(WebCore::WHLSL::AST::NamedType::name):
(WebCore::WHLSL::AST::NamedType::isTypeDefinition const):
(WebCore::WHLSL::AST::NamedType::isStructureDefinition const):
(WebCore::WHLSL::AST::NamedType::isEnumerationDefinition const):
(WebCore::WHLSL::AST::NamedType::isNativeTypeDeclaration const):
(WebCore::WHLSL::AST::NamedType::unifyNode const):
(WebCore::WHLSL::AST::NamedType::unifyNode):
* Modules/webgpu/WHLSL/AST/WHLSLNativeFunctionDeclaration.h: Added.
(WebCore::WHLSL::AST::NativeFunctionDeclaration::NativeFunctionDeclaration):
(WebCore::WHLSL::AST::NativeFunctionDeclaration::restricted const):
* Modules/webgpu/WHLSL/AST/WHLSLNativeTypeDeclaration.h: Added.
(WebCore::WHLSL::AST::NativeTypeDeclaration::NativeTypeDeclaration):
(WebCore::WHLSL::AST::NativeTypeDeclaration::name const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::name):
(WebCore::WHLSL::AST::NativeTypeDeclaration::typeArguments):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isInt const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isNumber const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isFloating const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isVector const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isMatrix const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isTexture const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::isSigned const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<bool const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::std::function<int64_t const):
(WebCore::WHLSL::AST::NativeTypeDeclaration::iterateAllValues):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsInt):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsNumber):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsFloating):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsVector):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsMatrix):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsTexture):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIsSigned):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentUnsignedInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setCanRepresentFloat):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setSuccessor):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setFormatValueFromUnsignedInteger):
(WebCore::WHLSL::AST::NativeTypeDeclaration::setIterateAllValues):
* Modules/webgpu/WHLSL/AST/WHLSLNode.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteral.h: Added.
(WebCore::WHLSL::AST::NullLiteral::NullLiteral):
(WebCore::WHLSL::AST::NullLiteral::type):
(WebCore::WHLSL::AST::NullLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.cpp: Added.
(WebCore::WHLSL::AST::NullLiteralType::canResolve const):
(WebCore::WHLSL::AST::NullLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLNullLiteralType.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLNumThreadsFunctionAttribute.h: Added.
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::NumThreadsFunctionAttribute):
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::width const):
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::height const):
(WebCore::WHLSL::AST::NumThreadsFunctionAttribute::depth const):
* Modules/webgpu/WHLSL/AST/WHLSLPointerType.h: Added.
(WebCore::WHLSL::AST::PointerType::PointerType):
* Modules/webgpu/WHLSL/AST/WHLSLPropertyAccessExpression.h: Added.
(WebCore::WHLSL::AST::PropertyAccessExpression::PropertyAccessExpression):
(WebCore::WHLSL::AST::PropertyAccessExpression::possibleGetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::possibleSetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::possibleAndOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleGetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleSetOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::setPossibleAndOverloads):
(WebCore::WHLSL::AST::PropertyAccessExpression::base):
* Modules/webgpu/WHLSL/AST/WHLSLQualifier.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLReadModifyWriteExpression.h: Added.
(WebCore::WHLSL::AST::ReadModifyWriteExpression::create):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::setNewValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::setResultExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::oldVariableReference):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newVariableReference):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::lValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::oldValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValue):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::newValueExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::resultExpression):
(WebCore::WHLSL::AST::ReadModifyWriteExpression::ReadModifyWriteExpression):
* Modules/webgpu/WHLSL/AST/WHLSLReferenceType.h: Added.
(WebCore::WHLSL::AST::ReferenceType::ReferenceType):
(WebCore::WHLSL::AST::ReferenceType::addressSpace const):
(WebCore::WHLSL::AST::ReferenceType::elementType const):
(WebCore::WHLSL::AST::ReferenceType::elementType):
* Modules/webgpu/WHLSL/AST/WHLSLResolvableType.h: Added.
(WebCore::WHLSL::AST::ResolvableType::isFloatLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::isIntegerLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::isNullLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::isUnsignedIntegerLiteralType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType const):
(WebCore::WHLSL::AST::ResolvableType::resolvedType):
(WebCore::WHLSL::AST::ResolvableType::resolve):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.cpp: Added.
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::ResourceSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLResourceSemantic.h: Added.
(WebCore::WHLSL::AST::ResourceSemantic::ResourceSemantic):
(WebCore::WHLSL::AST::ResourceSemantic::mode const):
(WebCore::WHLSL::AST::ResourceSemantic::index const):
(WebCore::WHLSL::AST::ResourceSemantic::space const):
(WebCore::WHLSL::AST::ResourceSemantic::operator== const):
(WebCore::WHLSL::AST::ResourceSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLReturn.h: Added.
(WebCore::WHLSL::AST::Return::Return):
(WebCore::WHLSL::AST::Return::value):
(WebCore::WHLSL::AST::Return::function):
(WebCore::WHLSL::AST::Return::setFunction):
* Modules/webgpu/WHLSL/AST/WHLSLSemantic.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.cpp: Added.
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLSpecializationConstantSemantic.h: Added.
(WebCore::WHLSL::AST::SpecializationConstantSemantic::SpecializationConstantSemantic):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::operator== const):
(WebCore::WHLSL::AST::SpecializationConstantSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.cpp: Added.
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableType const):
(WebCore::WHLSL::AST::StageInOutSemantic::isAcceptableForShaderItemDirection const):
* Modules/webgpu/WHLSL/AST/WHLSLStageInOutSemantic.h: Added.
(WebCore::WHLSL::AST::StageInOutSemantic::StageInOutSemantic):
(WebCore::WHLSL::AST::StageInOutSemantic::index const):
(WebCore::WHLSL::AST::StageInOutSemantic::operator== const):
(WebCore::WHLSL::AST::StageInOutSemantic::operator!= const):
* Modules/webgpu/WHLSL/AST/WHLSLStatement.h: Added.
(WebCore::WHLSL::AST::Statement::Statement):
(WebCore::WHLSL::AST::Statement::isBlock const):
(WebCore::WHLSL::AST::Statement::isBreak const):
(WebCore::WHLSL::AST::Statement::isContinue const):
(WebCore::WHLSL::AST::Statement::isDoWhileLoop const):
(WebCore::WHLSL::AST::Statement::isEffectfulExpressionStatement const):
(WebCore::WHLSL::AST::Statement::isFallthrough const):
(WebCore::WHLSL::AST::Statement::isForLoop const):
(WebCore::WHLSL::AST::Statement::isIfStatement const):
(WebCore::WHLSL::AST::Statement::isReturn const):
(WebCore::WHLSL::AST::Statement::isSwitchCase const):
(WebCore::WHLSL::AST::Statement::isSwitchStatement const):
(WebCore::WHLSL::AST::Statement::isTrap const):
(WebCore::WHLSL::AST::Statement::isVariableDeclarationsStatement const):
(WebCore::WHLSL::AST::Statement::isWhileLoop const):
* Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h: Added.
(WebCore::WHLSL::AST::StructureDefinition::StructureDefinition):
(WebCore::WHLSL::AST::StructureDefinition::structureElements):
* Modules/webgpu/WHLSL/AST/WHLSLStructureElement.h: Added.
(WebCore::WHLSL::AST::StructureElement::StructureElement):
(WebCore::WHLSL::AST::StructureElement::origin const):
(WebCore::WHLSL::AST::StructureElement::type):
(WebCore::WHLSL::AST::StructureElement::name):
(WebCore::WHLSL::AST::StructureElement::semantic):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchCase.h: Added.
(WebCore::WHLSL::AST::SwitchCase::SwitchCase):
(WebCore::WHLSL::AST::SwitchCase::value):
(WebCore::WHLSL::AST::SwitchCase::block):
* Modules/webgpu/WHLSL/AST/WHLSLSwitchStatement.h: Added.
(WebCore::WHLSL::AST::SwitchStatement::SwitchStatement):
(WebCore::WHLSL::AST::SwitchStatement::value):
(WebCore::WHLSL::AST::SwitchStatement::switchCases):
* Modules/webgpu/WHLSL/AST/WHLSLTernaryExpression.h: Added.
(WebCore::WHLSL::AST::TernaryExpression::TernaryExpression):
(WebCore::WHLSL::AST::TernaryExpression::predicate):
(WebCore::WHLSL::AST::TernaryExpression::bodyExpression):
(WebCore::WHLSL::AST::TernaryExpression::elseExpression):
* Modules/webgpu/WHLSL/AST/WHLSLTrap.h: Added.
(WebCore::WHLSL::AST::Trap::Trap):
* Modules/webgpu/WHLSL/AST/WHLSLType.h: Added.
(WebCore::WHLSL::AST::Type::isNamedType const):
(WebCore::WHLSL::AST::Type::isUnnamedType const):
(WebCore::WHLSL::AST::Type::isResolvableType const):
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.cpp: Added.
(WebCore::WHLSL::AST::clone):
* Modules/webgpu/WHLSL/AST/WHLSLTypeArgument.h: Added.
* Modules/webgpu/WHLSL/AST/WHLSLTypeDefinition.h: Added.
(WebCore::WHLSL::AST::TypeDefinition::TypeDefinition):
(WebCore::WHLSL::AST::TypeDefinition::type):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.cpp: Added.
(WebCore::WHLSL::AST::TypeReference::wrap):
* Modules/webgpu/WHLSL/AST/WHLSLTypeReference.h: Added.
(WebCore::WHLSL::AST::TypeReference::TypeReference):
(WebCore::WHLSL::AST::TypeReference::name):
(WebCore::WHLSL::AST::TypeReference::typeArguments):
(WebCore::WHLSL::AST::TypeReference::resolvedType const):
(WebCore::WHLSL::AST::TypeReference::setResolvedType):
(WebCore::WHLSL::AST::TypeReference::cloneTypeReference const):
* Modules/webgpu/WHLSL/AST/WHLSLUnnamedType.h: Added.
(WebCore::WHLSL::AST::UnnamedType::UnnamedType):
(WebCore::WHLSL::AST::UnnamedType::isTypeReference const):
(WebCore::WHLSL::AST::UnnamedType::isPointerType const):
(WebCore::WHLSL::AST::UnnamedType::isArrayReferenceType const):
(WebCore::WHLSL::AST::UnnamedType::isArrayType const):
(WebCore::WHLSL::AST::UnnamedType::isReferenceType const):
(WebCore::WHLSL::AST::UnnamedType::unifyNode const):
(WebCore::WHLSL::AST::UnnamedType::unifyNode):
(WebCore::WHLSL::AST::UnnamedType::origin const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.cpp: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::valueForSelectedType const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteral.h: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::UnsignedIntegerLiteral):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::type):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::value const):
(WebCore::WHLSL::AST::UnsignedIntegerLiteral::clone const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.cpp: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::UnsignedIntegerLiteralType):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::canResolve const):
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::conversionCost const):
* Modules/webgpu/WHLSL/AST/WHLSLUnsignedIntegerLiteralType.h: Added.
(WebCore::WHLSL::AST::UnsignedIntegerLiteralType::preferredType):
* Modules/webgpu/WHLSL/AST/WHLSLValue.h: Added.
(WebCore::WHLSL::AST::Value::Value):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclaration.h: Added.
(WebCore::WHLSL::AST::VariableDeclaration::VariableDeclaration):
(WebCore::WHLSL::AST::VariableDeclaration::origin const):
(WebCore::WHLSL::AST::VariableDeclaration::name):
(WebCore::WHLSL::AST::VariableDeclaration::type const):
(WebCore::WHLSL::AST::VariableDeclaration::type):
(WebCore::WHLSL::AST::VariableDeclaration::semantic):
(WebCore::WHLSL::AST::VariableDeclaration::initializer):
* Modules/webgpu/WHLSL/AST/WHLSLVariableDeclarationsStatement.h: Added.
(WebCore::WHLSL::AST::VariableDeclarationsStatement::VariableDeclarationsStatement):
(WebCore::WHLSL::AST::VariableDeclarationsStatement::variableDeclarations):
* Modules/webgpu/WHLSL/AST/WHLSLVariableReference.h: Added.
(WebCore::WHLSL::AST::VariableReference::VariableReference):
(WebCore::WHLSL::AST::VariableReference::wrap):
(WebCore::WHLSL::AST::VariableReference::name):
(WebCore::WHLSL::AST::VariableReference::variable):
(WebCore::WHLSL::AST::VariableReference::setVariable):
* Modules/webgpu/WHLSL/AST/WHLSLWhileLoop.h: Added.
(WebCore::WHLSL::AST::WhileLoop::WhileLoop):
(WebCore::WHLSL::AST::WhileLoop::conditional):
(WebCore::WHLSL::AST::WhileLoop::body):
* Modules/webgpu/WHLSL/WHLSLLexer.cpp:
* Modules/webgpu/WHLSL/WHLSLParser.cpp: Added.
* Modules/webgpu/WHLSL/WHLSLParser.h: Added.
* Modules/webgpu/WHLSL/WHLSLProgram.h: Added.
(WebCore::WHLSL::Program::append):
(WebCore::WHLSL::Program::nameContext):
(WebCore::WHLSL::Program::intrinsics):
(WebCore::WHLSL::Program::typeDefinitions):
(WebCore::WHLSL::Program::structureDefinitions):
(WebCore::WHLSL::Program::enumerationDefinitions):
(WebCore::WHLSL::Program::functionDefinitions const):
(WebCore::WHLSL::Program::functionDefinitions):
(WebCore::WHLSL::Program::nativeFunctionDeclarations const):
(WebCore::WHLSL::Program::nativeFunctionDeclarations):
(WebCore::WHLSL::Program::nativeTypeDeclarations):

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

7 months agoREGRESSION (r237658): Tap highlight limits cause the highlight to no longer show...
zalan@apple.com [Thu, 10 Jan 2019 21:50:42 +0000 (21:50 +0000)]
REGRESSION (r237658): Tap highlight limits cause the highlight to no longer show with legitimate button sizes
https://bugs.webkit.org/show_bug.cgi?id=193294
<rdar://problem/46006678>

Reviewed by Simon Fraser.

Input type elements should always paint tap highlight (ignore size heuristic).

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didGetTapHighlightGeometries):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showTapHighlight]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:nodeHasBuiltInClickHandling:]):
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didGetTapHighlightGeometries):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):

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

7 months agoBindings generator emits incorrect code when using VoidCallback as an IDL dictionary...
wenson_hsieh@apple.com [Thu, 10 Jan 2019 21:46:30 +0000 (21:46 +0000)]
Bindings generator emits incorrect code when using VoidCallback as an IDL dictionary attribute
https://bugs.webkit.org/show_bug.cgi?id=193328

Reviewed by Chris Dumez.

Currently, when generating the function body of `convertDictionary`, our bindings generator does not pass in an
argument to use as the `$globalObjectReference` in `JSValueToNative`, when generating code to convert a wrapped
attribute value to the native value. As a result, if the generated IDL type returns `true` from
`JSValueToNativeDOMConvertNeedsGlobalObject` (i.e. for callback function types), we will end up using the empty
string as the generated expression for the global object. This emits syntactically incorrect code:

    `convert<IDLCallbackFunction<JSVoidCallback>>(state, someValue, );`

To fix this, we pass in a string to use as the global object, which uses the given ExecState to grab the global
object. Tested by augmenting TestStandaloneDictionary.idl and its generated expectation.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):
* bindings/scripts/test/TestStandaloneDictionary.idl:

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

7 months agoRemove unneeded XPCService variant for plugin service
ap@apple.com [Thu, 10 Jan 2019 21:23:00 +0000 (21:23 +0000)]
Remove unneeded XPCService variant for plugin service
https://bugs.webkit.org/show_bug.cgi?id=193326

Reviewed by Tim Horton.

* Configurations/PluginService.32.xcconfig: Removed.
* Configurations/PluginService.64.xcconfig:
* PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Removed.
* PluginProcess/EntryPoint/mac/XPCService/PluginService.64.Info.plist: Copied from Source/WebKit/PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist.
* WebKit.xcodeproj/project.pbxproj:

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

7 months agoDefine page media state flags for display capture.
eric.carlson@apple.com [Thu, 10 Jan 2019 20:48:49 +0000 (20:48 +0000)]
Define page media state flags for display capture.
https://bugs.webkit.org/show_bug.cgi?id=193230
<rdar://problem/47095142>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: fast/mediastream/get-display-media-muted.html

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::mediaState const):
* page/MediaProducer.h:
* platform/mediastream/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/mac/AVVideoCaptureSource.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/WindowDisplayCaptureSourceMac.h:
* platform/mock/MockRealtimeAudioSource.h:
* platform/mock/MockRealtimeVideoSource.h:
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState):

Source/WebKit:

* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState):
* UIProcess/API/C/WKPagePrivate.h:
* WebProcess/cocoa/UserMediaCaptureManager.cpp:
(WebKit::UserMediaCaptureManager::Source::Source):
(WebKit::UserMediaCaptureManager::createCaptureSource):

LayoutTests:

* fast/mediastream/get-display-media-muted-expected.txt: Added.
* fast/mediastream/get-display-media-muted.html: Added.

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

7 months agoRebaseline inspector generator test results after recent changes.
bburg@apple.com [Thu, 10 Jan 2019 20:22:32 +0000 (20:22 +0000)]
Rebaseline inspector generator test results after recent changes.

Unreviewed test gardening.

* inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result:
* inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result:
* inspector/scripts/tests/generic/expected/fail-on-domain-availability-value.json-error:

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

7 months agoUnreviewed, rolling out r239825.
commit-queue@webkit.org [Thu, 10 Jan 2019 20:04:32 +0000 (20:04 +0000)]
Unreviewed, rolling out r239825.
https://bugs.webkit.org/show_bug.cgi?id=193330

Broke tests on armv7/linux bots (Requested by guijemont on
#webkit).

Reverted changeset:

"Enable DFG on ARM/Linux again"
https://bugs.webkit.org/show_bug.cgi?id=192496
https://trac.webkit.org/changeset/239825

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

7 months agoSource/WebCore:
justin_fan@apple.com [Thu, 10 Jan 2019 19:59:15 +0000 (19:59 +0000)]
Source/WebCore:
[WebGPU] Add BindGroupBinding, BindGroupDescriptor, and BufferBinding dictionaries from API
https://bugs.webkit.org/show_bug.cgi?id=193298

Reviewed by Dean Jackson.

No new tests. No change in behavior.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/webgpu/WebGPUBindGroupBinding.h: Added.
* Modules/webgpu/WebGPUBindGroupBinding.idl: Added.
* Modules/webgpu/WebGPUBindGroupDescriptor.h: Added.
* Modules/webgpu/WebGPUBindGroupDescriptor.idl: Added.
* Modules/webgpu/WebGPUBufferBinding.h: Added.
* Modules/webgpu/WebGPUBufferBinding.idl: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/gpu/GPUBindGroupBinding.h: Added.
* platform/graphics/gpu/GPUBindGroupDescriptor.h: Added.
* platform/graphics/gpu/GPUBufferBinding.h: Added.

LayoutTests:
[WebGPU] Fix vertex-buffer-triangle-strip test and small update to GPURenderPipeline
https://bugs.webkit.org/show_bug.cgi?id=193289

Reviewed by Dean Jackson.

Fix broken test after pipeline layouts were added.

* webgpu/js/webgpu-functions.js:
(createBasicPipeline): Ensure pipeline layout is actually optional.
* webgpu/vertex-buffer-triangle-strip.html:

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

7 months agoDisable the run-jsc-stress-test remote host key check.
commit-queue@webkit.org [Thu, 10 Jan 2019 19:36:25 +0000 (19:36 +0000)]
Disable the run-jsc-stress-test remote host key check.
https://bugs.webkit.org/show_bug.cgi?id=192988

Patch by Zhifei Fang <zhifei_fang@apple.com> on 2019-01-10
Reviewed by Alexey Proskuryakov.

* Scripts/run-jsc-stress-tests:

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

7 months agoREGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https...
commit-queue@webkit.org [Thu, 10 Jan 2019 19:11:33 +0000 (19:11 +0000)]
REGRESSION(r239815) http/tests/workers/service/serviceworker-private-browsing.https.html test times out
https://bugs.webkit.org/show_bug.cgi?id=193325

Patch by Alex Christensen <achristensen@webkit.org> on 2019-01-10
Reviewed by Joseph Pecoraro.

InjectedBundle::setPrivateBrowsingEnabled effectively didn't do anything when enabled was false.
I made it destroy the legacy private browsing session in the NetworkProcess, which caused a test to time out.
This functionality is only used for testing, so it's no big deal to revert that part of the patch.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::destroyLegacyPrivateBrowsingSession): Deleted.
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::setPrivateBrowsingEnabled):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::destroyLegacyPrivateBrowsingSessionInNetworkProcess): Deleted.
* WebProcess/WebProcess.h:

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

7 months ago[macOS] Add name of IORegistry key in sandbox.
pvollan@apple.com [Thu, 10 Jan 2019 18:47:39 +0000 (18:47 +0000)]
[macOS] Add name of IORegistry key in sandbox.
https://bugs.webkit.org/show_bug.cgi?id=193324

Reviewed by Brent Fulgham.

IOGVAVTCapabilities key has been changed to IOGVAHEVCDecodeCapabilities.

* WebProcess/com.apple.WebProcess.sb.in:

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

7 months agoSafari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateB...
dino@apple.com [Thu, 10 Jan 2019 18:08:23 +0000 (18:08 +0000)]
Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters
https://bugs.webkit.org/show_bug.cgi?id=193309
<rdar://problem/45279224>

Reviewed by Antoine Quint.

A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters.

The crash log indicates we crash in a Checked<> class that is not recording
overflow i.e. it is crashing due to an overflow. The only place in this function
where that could happen is when we convert the FloatRect for the backdrop
region into a Checked<unsigned> for width and height. This suggests that either
the width or height are negative, or the float values are too large for integers,
or the product of the two overflows.

Avoid this by using RecordOverflow, but also changing the code a little to
bail if the rectangle is incorrect.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateBackdropFilters):

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

7 months agoOverride the session configuration for cookieAcceptPolicy
ryanhaddad@apple.com [Thu, 10 Jan 2019 17:57:22 +0000 (17:57 +0000)]
Override the session configuration for cookieAcceptPolicy
https://bugs.webkit.org/show_bug.cgi?id=190925
<rdar://problem/45497382>

Patch by John Wilander <wilander@apple.com> on 2019-01-10
Reviewed by Alexey Proskuryakov and Alex Christensen.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Declaration of _overrideSessionCookieAcceptPolicy on NSHTTPCookieStorage.

Source/WebKit:

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
    Now sets cookieStorage._overrideSessionCookieAcceptPolicy to YES.

Source/WTF:

* wtf/Platform.h:
    Definition of HAVE_CFNETWORK_OVERRIDE_SESSION_COOKIE_ACCEPT_POLICY.

Tools:

Test infrastructure for setting a first-party-only cookie policy.

* DumpRenderTree/TestRunner.cpp:
(setOnlyAcceptFirstPartyCookiesCallback):
(TestRunner::staticFunctions):
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setOnlyAcceptFirstPartyCookies):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::setOnlyAcceptFirstPartyCookies):
* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setOnlyAcceptFirstPartyCookies):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* TestExpectations:
    Skipped since this cookie policy is only supported on Cocoa platforms.
* http/tests/cookies/only-accept-first-party-cookies-expected.txt: Added.
* http/tests/cookies/only-accept-first-party-cookies.html: Added.
* http/tests/cookies/resources/reset-cookies.html: Added.
    To support reset of third-party cookies in an iframe.
* http/tests/cookies/resources/set-cookie-and-redirect-back.php: Added.
    A simple bounce to set a cookie.
* platform/ios/TestExpectations:
    Skipped for now. Will be fixed in <rdar://problem/47165939>.
* platform/mac/TestExpectations:
    Skipped for now. Will be fixed in <rdar://problem/47165939>.

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

7 months ago[css-grid] Let abspos items reference implicit grid lines
commit-queue@webkit.org [Thu, 10 Jan 2019 17:32:24 +0000 (17:32 +0000)]
[css-grid] Let abspos items reference implicit grid lines
https://bugs.webkit.org/show_bug.cgi?id=193313

Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-10
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import test changes from WPT.

* web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html:
* web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html:

Source/WebCore:

While they can't create new implicit grid lines, abspos items
can reference existing ones as clarified in
https://github.com/w3c/csswg-drafts/commit/511bb63

This patch makes WebKit match Blink, Firefox and Edge.

Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html
       web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::populateExplicitGridAndOrderIterator const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const):
Remove argument from spanSizeForAutoPlacedItem call.
(WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild):
Don't treat implicit grid lines as 'auto'.
* rendering/RenderGrid.h:
Remove unused gridPositionIsAutoForOutOfFlow.
* rendering/style/GridPositionsResolver.cpp:
(WebCore::adjustGridPositionsFromStyle):
Don't treat implicit grid lines as 'auto'.
Remove unused gridContainerStyle parameter.
(WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem):
Remove argument from adjustGridPositionsFromStyle call.
Remove unused gridContainerStyle parameter.
(WebCore::resolveGridPositionFromStyle):
Remove unnecessary assert that uses isValidNamedLineOrArea.
(WebCore::GridPositionsResolver::resolveGridPositionsFromStyle):
Remove argument from adjustGridPositionsFromStyle call.
* rendering/style/GridPositionsResolver.h:
Remove unused isValidNamedLineOrArea.
Remove unused parameter from spanSizeForAutoPlacedItem.

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

7 months agoPut per-document autoplay behavior behind runtime website policies quirk instead...
mrajca@apple.com [Thu, 10 Jan 2019 17:31:27 +0000 (17:31 +0000)]
Put per-document autoplay behavior behind runtime website policies quirk instead of a compile time flag
https://bugs.webkit.org/show_bug.cgi?id=193301

Reviewed by Jer Noble.
Source/WebCore:

Instead of unconditionally enabling this with a compile-time flag, let clients
enable the quirk on a per-load basis.

Tests: added API tests in favor of the current layout test as this behavior is no
       longer on by default unless a client opts in.

* html/MediaElementSession.cpp:
(WebCore::needsPerDocumentAutoplayBehaviorQuirk):
(WebCore::MediaElementSession::playbackPermitted const):
* loader/DocumentLoader.h:

Source/WebKit:

Register a new quirk that can be configured per-load for per-document media
autoplay behaviors.

* Shared/WebsiteAutoplayQuirk.h:
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* UIProcess/API/C/WKWebsitePolicies.cpp:
(WKWebsitePoliciesSetAllowedAutoplayQuirks):
(WKWebsitePoliciesGetAllowedAutoplayQuirks):
* UIProcess/API/C/WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.h:
* UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
(-[_WKWebsitePolicies setAllowedAutoplayQuirks:]):
(-[_WKWebsitePolicies allowedAutoplayQuirks]):

Tools:

Added API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/autoplaying-multiple-media-elements.html: Added.

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

7 months agoVPModuleInitialize should be called when VCP is enabled
youenn@apple.com [Thu, 10 Jan 2019 16:45:51 +0000 (16:45 +0000)]
VPModuleInitialize should be called when VCP is enabled
https://bugs.webkit.org/show_bug.cgi?id=193299

Reviewed by Eric Carlson.

Add the necessary include to make sure ENABLE_VCP_ENCODER is defined appropriately.

* Source/webrtc/sdk/WebKit/WebKitUtilities.mm:

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

7 months agoUnreviewed GTK+ gardening after r239824.
magomez@igalia.com [Thu, 10 Jan 2019 15:46:35 +0000 (15:46 +0000)]
Unreviewed GTK+ gardening after r239824.

* platform/gtk/TestExpectations:

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

7 months ago[LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when comput...
zalan@apple.com [Thu, 10 Jan 2019 15:42:18 +0000 (15:42 +0000)]
[LFC][BFC][MarginCollapsing] Take collapsed through siblings into account when computing vertical position
https://bugs.webkit.org/show_bug.cgi?id=193310

Reviewed by Antti Koivisto.

Source/WebCore:

If the block inflow element has previous siblings with collapsed through vertical margins,
then this box's before margin could _indirectly_ collapse with the parent. Use the previous siblings
to check for margin collapsing.

Test: fast/block/block-only/collapsed-through-siblings.html

* layout/blockformatting/BlockFormattingContext.cpp:
(WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
* page/FrameViewLayoutContext.cpp:
(WebCore::layoutUsingFormattingContext):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

LayoutTests:

* fast/block/margin-collapse/collapsed-through-siblings-expected.txt: Added.
* fast/block/margin-collapse/collapsed-through-siblings.html: Added.

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

7 months ago[MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
aboya@igalia.com [Thu, 10 Jan 2019 12:46:18 +0000 (12:46 +0000)]
[MSE][GStreamer] Use GRefPtr in AppendPipeline::pushNewBuffer()
https://bugs.webkit.org/show_bug.cgi?id=192934

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::pushNewBuffer):
* platform/graphics/gstreamer/mse/AppendPipeline.h:
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append):

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

7 months agoEnable DFG on ARM/Linux again
dinfuehr@igalia.com [Thu, 10 Jan 2019 11:55:51 +0000 (11:55 +0000)]
Enable DFG on ARM/Linux again
https://bugs.webkit.org/show_bug.cgi?id=192496

Reviewed by Yusuke Suzuki.

JSTests:

Test wasn't really skipped before moving the line with skip
to the top.

* stress/regress-192717.js:

Source/JavaScriptCore:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux. Do not use register
r11 in compiled DFG mode since it is already used in LLInt as metadataTable
register. Also clean up code since ARM traditional isn't supported anymore.

* dfg/DFGOSRExit.cpp:
(JSC::DFG::restoreCalleeSavesFromVMEntryFrameCalleeSavesBuffer):
(JSC::DFG::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
* jit/CallFrameShuffler.cpp:
(JSC::CallFrameShuffler::CallFrameShuffler):
* jit/GPRInfo.h:
(JSC::GPRInfo::toIndex):
* llint/LowLevelInterpreter32_64.asm:
* offlineasm/arm.rb:

Source/WTF:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux.

* wtf/Platform.h:

Tools:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux. Run again JIT-tests
on ARM by default.

* Scripts/run-jsc-stress-tests:

LayoutTests:

After changing the bytecode format DFG was disabled on all 32-bit
architectures. Enable DFG now again on ARM/Linux. Disable tests that
run out of executable memory with LLInt disabled.

* js/script-tests/dfg-float32array.js:
* js/script-tests/dfg-float64array.js:
* js/script-tests/dfg-int16array.js:
* js/script-tests/dfg-int32array-overflow-values.js:
* js/script-tests/dfg-int32array.js:
* js/script-tests/dfg-int8array.js:
* js/script-tests/dfg-uint16array.js:
* js/script-tests/dfg-uint32array.js:
* js/script-tests/dfg-uint8array.js:

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