WebKit-https.git
3 years ago[GTK] GtkDoc build should be quieter
mcatanzaro@igalia.com [Mon, 19 Dec 2016 13:02:54 +0000 (13:02 +0000)]
[GTK] GtkDoc build should be quieter
https://bugs.webkit.org/show_bug.cgi?id=165994

Reviewed by Carlos Garcia Campos.

Make it not print by default.

* gtk/generate-gtkdoc:
(get_generator_for_config):
(generate_doc):
* gtk/gtkdoc.py:
(GTKDoc._run_command):
(GTKDoc._copy_doc_files_to_output_dir):

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

3 years agoWebAssembly: Make running Wasm tests take less time by reducing some tests' iteration...
sbarati@apple.com [Mon, 19 Dec 2016 08:19:01 +0000 (08:19 +0000)]
WebAssembly: Make running Wasm tests take less time by reducing some tests' iteration count and by splitting some tests into different files
https://bugs.webkit.org/show_bug.cgi?id=166017

Reviewed by Yusuke Suzuki.

* wasm/function-tests/trap-load-2.js: Added.
(assert):
(wasmFrameCountFromError):
(continuation):
(i.catch):
* wasm/function-tests/trap-load.js:
(assert.continuation): Deleted.
* wasm/function-tests/trap-store-2.js: Added.
(import.Builder.from.string_appeared_here.assert):
(continuation):
(i.catch):
* wasm/function-tests/trap-store.js:
(assert.continuation): Deleted.
(assert): Deleted.
* wasm/js-api/test_memory.js:
(test):

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

3 years agoWebAssembly: Implement the WebAssembly.compile and WebAssembly.validate
sbarati@apple.com [Mon, 19 Dec 2016 07:22:42 +0000 (07:22 +0000)]
WebAssembly: Implement the WebAssembly.compile and WebAssembly.validate
https://bugs.webkit.org/show_bug.cgi?id=165936

Reviewed by Mark Lam.

JSTests:

* wasm/js-api/Module-compile.js: Added.
(async.testPromiseAPI):
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):
* wasm/js-api/validate.js: Added.
(assert.truthy.WebAssembly.validate.builder.WebAssembly):

Source/JavaScriptCore:

The APIs are documented here:
- https://github.com/WebAssembly/design/blob/master/JS.md#webassemblycompile
- https://github.com/WebAssembly/design/blob/master/JS.md#webassemblyvalidate

* wasm/JSWebAssembly.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::webAssemblyValidateFunc):
(JSC::JSWebAssembly::finishCreation):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::parseAndValidateModule):
(JSC::Wasm::Plan::run):
* wasm/WasmPlan.h:
* wasm/js/JSWebAssemblyHelpers.h:
(JSC::getWasmBufferFromValue):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::callJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModuleConstructor.h:

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

3 years agoIndexedDB 2.0: Prefetch cursor records in the server.
beidson@apple.com [Mon, 19 Dec 2016 01:40:37 +0000 (01:40 +0000)]
IndexedDB 2.0: Prefetch cursor records in the server.
https://bugs.webkit.org/show_bug.cgi?id=166014

Reviewed by Andy Estes.

No new tests (Covered by existing LayoutTests and PerformanceTests).

This patch implements the followng:
1 - After a backing store cursor completes a fetch in the server, it will schedule the next fetch
    even before the client requests one. It will do this up to a limited number of prefetches.
2 - Once a client request to advance the cursor comes in, we'll work our way through prefetched
    records instead of reading anything from disk, which might then cause us to continue prefetch.
3 - If any changes to the object store occur, it will throw away all previously fetched records
    (There's room for future improvement here)

* Modules/indexeddb/server/IDBBackingStore.h:

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

* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::prefetchCursor):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
(WebCore::IDBServer::SQLiteIDBCursor::prefetch):
(WebCore::IDBServer::SQLiteIDBCursor::advance):
* Modules/indexeddb/server/SQLiteIDBCursor.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
(WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
(WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

3 years agoChanging text direction fires input events with null inputTypes and no data
wenson_hsieh@apple.com [Mon, 19 Dec 2016 01:14:10 +0000 (01:14 +0000)]
Changing text direction fires input events with null inputTypes and no data
https://bugs.webkit.org/show_bug.cgi?id=166007
<rdar://problem/29557205>

Reviewed by Sam Weinig.

Source/WebCore:

Adds support for the "formatSetInlineTextDirection" input type, triggered when using the context menu on Mac in
an editable area (for both plain and rich text cases) to change paragraph direction. To do this, we add cases
for EditActionSetWritingDirection in inputTypeNameForEditingAction and inputEventDataForEditingStyleAndAction.

When changing text direction for a plaintext editable element, we have logic in Editor::setBaseWritingDirection
that sets the focused element's dir attribute to the requested value (ltr or rtl). We add similar hooks here to
dispatch input events and handle preventing default.

Test: fast/events/before-input-events-prevent-text-direction.html

* editing/EditCommand.cpp:
(WebCore::inputTypeNameForEditingAction):

Handle the EditActionSetWritingDirection case.

* editing/Editor.cpp:
(WebCore::inputEventDataForEditingStyleAndAction):
(WebCore::Editor::applyParagraphStyle):

Include input event data when dispatching an input event here.

(WebCore::Editor::setBaseWritingDirection):
* testing/Internals.cpp:
(WebCore::Internals::setBaseWritingDirection):
* testing/Internals.h:
* testing/Internals.idl:

Introduce an internal testing support hook for setting base writing direction (the same codepath taken when
using the context menu to change paragraph direction). Currently, using testRunner.execCommand creates and
applies style with an additional `unicode-bidi` attribute, and appears to also be intentionally disabled for
plaintext editable elements.

LayoutTests:

Verifies that changing text direction causes beforeinput and input events with appropriate inputType and data to
be dispatched, and that preventing this beforeinput event causes no change in text direction.

* fast/events/before-input-events-prevent-text-direction-expected.txt: Added.
* fast/events/before-input-events-prevent-text-direction.html: Added.

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

3 years agoExpose a way for MiniBrowser to simulate header and footer banners
simon.fraser@apple.com [Sun, 18 Dec 2016 21:09:34 +0000 (21:09 +0000)]
Expose a way for MiniBrowser to simulate header and footer banners
https://bugs.webkit.org/show_bug.cgi?id=166005

Reviewed by Wenson Hsieh.

Source/WebKit2:

Expose testing SPI that allows a client to simulate the presence of header
and footer banners. These are simply plumbed through to set FrameView's
m_headerHeight and m_footerHeight.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _setHeaderBannerHeightForTesting:]):
(-[WKWebView _setFooterBannerHeightForTesting:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setHeaderBannerHeightForTesting):
(WebKit::WebPageProxy::setFooterBannerHeightForTesting):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setHeaderBannerHeightForTesting):
(WebKit::WebPage::setFooterBannerHeightForTesting):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

Add a MiniBrowser menu item and setting to toggle adding space for header and footer
banners. This only works in WebKit2.

We need to reset these on each navigation, since newly created FrameViews
don't re-fetch the header and footer height stored on Page.

Also fix the signature of webView:didFinishNavigation: to follow API changes,
as well as fixing webViewWebContentProcessDidTerminate:

* MiniBrowser/mac/SettingsController.h:
* MiniBrowser/mac/SettingsController.m:
(-[SettingsController _populateMenu]):
(-[SettingsController validateMenuItem:]):
(-[SettingsController toggleReserveSpaceForBanners:]):
(-[SettingsController isSpaceReservedForBanners]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController didChangeSettings]):
(-[WK2BrowserWindowController webView:didFinishNavigation:]):
(-[WK2BrowserWindowController webViewWebContentProcessDidTerminate:]):
(-[WK2BrowserWindowController webView:didFinishLoadingNavigation:]): Deleted.
(-[WK2BrowserWindowController _webViewWebProcessDidCrash:]): Deleted.

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

3 years agoRename finallyActionRegister to completionTypeRegister and only store int JSValues...
mark.lam@apple.com [Sun, 18 Dec 2016 19:04:20 +0000 (19:04 +0000)]
Rename finallyActionRegister to completionTypeRegister and only store int JSValues in it.
https://bugs.webkit.org/show_bug.cgi?id=165979

Reviewed by Saam Barati.

This patch makes it so that we only store int JSValues in the finallyActionRegister
thereby making type prediction on this register more successful for JITs.  In so
doing, we are able to get some additional benefits:

1. Renamed the following:
   FinallyRegistersScope => CompletionRecordScope
   finallyActionRegister => completionTypeRegister
   finallyReturnValueRegister => completionValueRegister

   These new names are more in line with the ES spec, which describes these
   values as the completion record and its type and value properties.
   https://tc39.github.io/ecma262/#sec-completion-record-specification-type

2. We now think of the Break and Continue jumpIDs as encodings of CompletionType
   (in our implementation of completion type).  As a result, we only need one of
   each of the emitter methods for getting, setting, and compare-and-jump on the
   completion type.  The code using these methods also reads much clearer now.

3. Finally blocks' op_catch should now always pop the caught Exception object into
   the completionValueRegister instead of the completionTypeRegister (formerly
   finallyActionRegister).

Also removed the restoreScopeRegister() call in the IteratorClose catch block
because that is an implementation specific synthesized catch block, and we
can guarantee that it never needs to resolve any symbols from the scope.  Hence,
there is no need to restore the scope register.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::emitJumpViaFinallyIfNeeded):
(JSC::BytecodeGenerator::emitReturnViaFinallyIfNeeded):
(JSC::BytecodeGenerator::emitFinallyCompletion):
(JSC::BytecodeGenerator::allocateCompletionRecordRegisters):
(JSC::BytecodeGenerator::releaseCompletionRecordRegisters):
(JSC::BytecodeGenerator::emitJumpIfCompletionType):
(JSC::BytecodeGenerator::allocateFinallyRegisters): Deleted.
(JSC::BytecodeGenerator::releaseFinallyRegisters): Deleted.
(JSC::BytecodeGenerator::emitCompareFinallyActionAndJumpIf): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::bytecodeOffsetToJumpID):
(JSC::FinallyJump::FinallyJump):
(JSC::FinallyContext::registerJump):
(JSC::BytecodeGenerator::CompletionRecordScope::CompletionRecordScope):
(JSC::BytecodeGenerator::CompletionRecordScope::~CompletionRecordScope):
(JSC::BytecodeGenerator::completionTypeRegister):
(JSC::BytecodeGenerator::completionValueRegister):
(JSC::BytecodeGenerator::emitSetCompletionType):
(JSC::BytecodeGenerator::emitSetCompletionValue):
(JSC::BytecodeGenerator::FinallyRegistersScope::FinallyRegistersScope): Deleted.
(JSC::BytecodeGenerator::FinallyRegistersScope::~FinallyRegistersScope): Deleted.
(JSC::BytecodeGenerator::finallyActionRegister): Deleted.
(JSC::BytecodeGenerator::finallyReturnValueRegister): Deleted.
(JSC::BytecodeGenerator::emitSetFinallyActionToNormalCompletion): Deleted.
(JSC::BytecodeGenerator::emitSetFinallyActionToReturnCompletion): Deleted.
(JSC::BytecodeGenerator::emitSetFinallyActionToJumpID): Deleted.
(JSC::BytecodeGenerator::emitSetFinallyReturnValueRegister): Deleted.
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNormalCompletion): Deleted.
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNotJump): Deleted.
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsReturnCompletion): Deleted.
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNotReturnCompletion): Deleted.
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNotThrowCompletion): Deleted.
(JSC::BytecodeGenerator::emitJumpIfCompletionTypeIsThrow): Deleted.
(JSC::BytecodeGenerator::bytecodeOffsetToJumpID): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::TryNode::emitBytecode):

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

3 years agoRebaseline these tests after r209967, since they are now affected by status bar height.
simon.fraser@apple.com [Sun, 18 Dec 2016 17:26:26 +0000 (17:26 +0000)]
Rebaseline these tests after r209967, since they are now affected by status bar height.

* fast/viewport/ios/ipad/width-is-device-width-expected.txt:
* fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-expected.txt:
* fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall-expected.txt:
* fast/viewport/ios/width-is-device-width-overflowing-expected.txt:
* fast/viewport/ios/width-is-device-width-overflowing-no-shrink-to-fit-expected.txt:

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

3 years agoFix iOS test results after r209967.
simon.fraser@apple.com [Sun, 18 Dec 2016 08:11:48 +0000 (08:11 +0000)]
Fix iOS test results after r209967.

Subtracting out the status bar height was erroneously happening for all tests,
not just for flexible viewport tests.

Fix by plumbing WebViewSizingMode through resizeTo() and setWindowFrame().

* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::resizeTo):
(WTR::PlatformWebView::setWindowFrame):
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::resizeTo):
(WTR::PlatformWebView::setWindowFrame):
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::PlatformWebView::resizeTo):
(WTR::PlatformWebView::setWindowFrame):
* WebKitTestRunner/ios/TestControllerIOS.mm:
(WTR::TestController::platformConfigureViewForTest):
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::resizeTo):
(WTR::PlatformWebView::setWindowFrame):

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

3 years agoBuild fix: linking WebCore was failing: you can't export inline functions.
simon.fraser@apple.com [Sun, 18 Dec 2016 08:11:45 +0000 (08:11 +0000)]
Build fix: linking WebCore was failing: you can't export inline functions.

* css/DeprecatedCSSOMPrimitiveValue.cpp:
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
(WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
* css/DeprecatedCSSOMPrimitiveValue.h:
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue): Deleted.
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue): Deleted.

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

3 years ago[EFL] bump EFL version to 1.18.4
jh718.park@samsung.com [Sun, 18 Dec 2016 06:07:17 +0000 (06:07 +0000)]
[EFL] bump EFL version to 1.18.4
https://bugs.webkit.org/show_bug.cgi?id=166004

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsEfl.cmake: Use efl-1.18.4 instead of 1.18.1.

Tools:

* efl/jhbuild.modules: Use efl-1.18.4 instead of 1.18.1.

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

3 years ago[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
hyatt@apple.com [Sat, 17 Dec 2016 20:08:34 +0000 (20:08 +0000)]
[CSS Values] Make separate wrapper classes for the deprecated CSS Values OM
https://bugs.webkit.org/show_bug.cgi?id=165968

Reviewed by Andreas Kling.

Source/WebCore:

This patch changes the CSS OM for values to use distinct wrapper
classes instead of cloning the existing classes. By actually wrapping
values instead of cloning, we are freed up to change our CSS value hierarchy
however we'd like (such as changing to match the new CSS Values OM that
is coming soon).

All of the CSS Values wrapper classes are prefixed with "DeprecatedCSSOM"
to reflect our desire (ultimately) to remove this API from our tree. We're
the only ones that support it, and it's not used on the Web, but it is part
of the WebKitLegacy API and might be used internally.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/DOMWrapperWorld.h:
* bindings/js/JSCSSStyleDeclarationCustom.cpp:
(WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
* bindings/js/JSCSSValueCustom.cpp:
(WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
(WebCore::JSDeprecatedCSSOMValueOwner::finalize):
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
(WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots): Deleted.
(WebCore::JSCSSValueOwner::finalize): Deleted.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSComputedStyleDeclaration.h:
* css/CSSGridLineNamesValue.cpp:
(WebCore::CSSGridLineNamesValue::cloneForCSSOM): Deleted.
* css/CSSGridLineNamesValue.h:
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::cloneForCSSOM): Deleted.
* css/CSSImageSetValue.h:
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::createDeprecatedCSSOMWrapper):
(WebCore::CSSImageValue::cloneForCSSOM): Deleted.
* css/CSSImageValue.h:
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::createDeprecatedCSSOMPrimitiveWrapper):
(WebCore::CSSPrimitiveValue::cloneForCSSOM): Deleted.
* css/CSSPrimitiveValue.h:
* css/CSSPrimitiveValue.idl: Removed.
* css/CSSStyleDeclaration.h:
* css/CSSStyleDeclaration.idl:
* css/CSSValue.cpp:
(WebCore::CSSValue::traverseSubresources):
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::createDeprecatedCSSOMWrapper):
(): Deleted.
(WebCore::CSSValue::cloneForCSSOM): Deleted.
* css/CSSValue.h:
(WebCore::CSSValue::CSSValue):
(WebCore::CSSValue::setCssText): Deleted.
(WebCore::CSSValue::isCSSOMSafe): Deleted.
(WebCore::CSSValue::isSubtypeExposedToCSSOM): Deleted.
* css/CSSValue.idl: Removed.
* css/CSSValueList.cpp:
(WebCore::CSSValueList::cloneForCSSOM): Deleted.
* css/CSSValueList.h:
(WebCore::CSSValueList::separator):
* css/CSSValueList.idl: Removed.
* css/Counter.h:
* css/Counter.idl: Removed.
* css/DeprecatedCSSOMCounter.h: Added.
* css/DeprecatedCSSOMCounter.idl: Copied from Source/WebCore/css/Counter.idl.
* css/DeprecatedCSSOMPrimitiveValue.cpp: Added.
(WebCore::DeprecatedCSSOMPrimitiveValue::getCounterValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRectValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getRGBColorValue):
* css/DeprecatedCSSOMPrimitiveValue.h: Added.
(WebCore::DeprecatedCSSOMPrimitiveValue::create):
(WebCore::DeprecatedCSSOMPrimitiveValue::equals):
(WebCore::DeprecatedCSSOMPrimitiveValue::cssValueType):
(WebCore::DeprecatedCSSOMPrimitiveValue::cssText):
(WebCore::DeprecatedCSSOMPrimitiveValue::primitiveType):
(WebCore::DeprecatedCSSOMPrimitiveValue::setFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getFloatValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::setStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::getStringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::stringValue):
(WebCore::DeprecatedCSSOMPrimitiveValue::DeprecatedCSSOMPrimitiveValue):
* css/DeprecatedCSSOMPrimitiveValue.idl: Copied from Source/WebCore/css/CSSPrimitiveValue.idl.
* css/DeprecatedCSSOMRGBColor.h: Added.
* css/DeprecatedCSSOMRGBColor.idl: Copied from Source/WebCore/css/RGBColor.idl.
* css/DeprecatedCSSOMRect.h: Added.
* css/DeprecatedCSSOMRect.idl: Copied from Source/WebCore/css/Rect.idl.
* css/DeprecatedCSSOMValue.cpp: Added.
(WebCore::compareCSSOMValues):
(WebCore::DeprecatedCSSOMValue::equals):
(WebCore::DeprecatedCSSOMValue::destroy):
(WebCore::DeprecatedCSSOMValue::cssValueType):
(WebCore::DeprecatedCSSOMValue::cssText):
* css/DeprecatedCSSOMValue.h: Added.
(WebCore::DeprecatedCSSOMValue::deref):
(WebCore::DeprecatedCSSOMValue::setCssText):
(WebCore::DeprecatedCSSOMValue::operator==):
(WebCore::DeprecatedCSSOMValue::isComplexValue):
(WebCore::DeprecatedCSSOMValue::isPrimitiveValue):
(WebCore::DeprecatedCSSOMValue::isValueList):
(WebCore::DeprecatedCSSOMValue::classType):
(WebCore::DeprecatedCSSOMValue::DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMValue::~DeprecatedCSSOMValue):
(WebCore::DeprecatedCSSOMComplexValue::create):
(WebCore::DeprecatedCSSOMComplexValue::equals):
(WebCore::DeprecatedCSSOMComplexValue::cssText):
(WebCore::DeprecatedCSSOMComplexValue::cssValueType):
(WebCore::DeprecatedCSSOMComplexValue::DeprecatedCSSOMComplexValue):
* css/DeprecatedCSSOMValue.idl: Copied from Source/WebCore/css/CSSValue.idl.
* css/DeprecatedCSSOMValueList.cpp: Added.
(WebCore::DeprecatedCSSOMValueList::equals):
(WebCore::DeprecatedCSSOMValueList::cssText):
* css/DeprecatedCSSOMValueList.h: Added.
(WebCore::DeprecatedCSSOMValueList::create):
(WebCore::DeprecatedCSSOMValueList::cssValueType):
(WebCore::DeprecatedCSSOMValueList::length):
(WebCore::DeprecatedCSSOMValueList::item):
(WebCore::DeprecatedCSSOMValueList::DeprecatedCSSOMValueList):
* css/DeprecatedCSSOMValueList.idl: Copied from Source/WebCore/css/CSSValueList.idl.
* css/LengthRepeat.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValue):
(WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
(WebCore::StyleRuleCSSStyleDeclaration::didMutate):
(WebCore::InlineCSSStyleDeclaration::didMutate):
(WebCore::PropertySetCSSStyleDeclaration::cloneAndCacheForCSSOM): Deleted.
* css/PropertySetCSSStyleDeclaration.h:
* css/RGBColor.cpp:
(WebCore::RGBColor::red): Deleted.
(WebCore::RGBColor::green): Deleted.
(WebCore::RGBColor::blue): Deleted.
(WebCore::RGBColor::alpha): Deleted.
* css/RGBColor.h:
* css/RGBColor.idl: Removed.
* css/Rect.h:
(WebCore::RectBase::RectBase):
* css/Rect.idl: Removed.
* svg/SVGElement.cpp:
(WebCore::SVGElement::getPresentationAttribute):
* svg/SVGElement.h:
* svg/SVGElement.idl:

Source/WebKit/mac:

* DOM/DOMCSS.mm:
(kitClass):
* DOM/DOMCSSPrimitiveValue.mm:
(-[DOMCSSPrimitiveValue getCounterValue]):
(-[DOMCSSPrimitiveValue getRectValue]):
(kit):
* DOM/DOMCSSPrimitiveValueInternal.h:
* DOM/DOMCSSStyleDeclaration.mm:
* DOM/DOMCSSValue.mm:
(kit):
* DOM/DOMCSSValueInternal.h:
* DOM/DOMCSSValueList.mm:
* DOM/DOMCounter.mm:
(kit):
* DOM/DOMCounterInternal.h:
* DOM/DOMRGBColor.mm:
(kit):
* DOM/DOMRGBColorInternal.h:
* DOM/DOMRect.mm:
(kit):
* DOM/DOMRectInternal.h:
* DOM/DOMUtility.mm:
(createDOMWrapper):

Source/WebKit2:

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
(WebKit::kit):
(WebKit::core):
(WebKit::wrapCSSValue):
(webkit_dom_css_value_constructor):
(webkit_dom_css_value_get_css_text):
(webkit_dom_css_value_set_css_text):
(webkit_dom_css_value_get_css_value_type):
* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:

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

3 years agoUnreviewed, rollout r209860 OWR player shouldn't be selected for
philn@webkit.org [Sat, 17 Dec 2016 19:32:45 +0000 (19:32 +0000)]
Unreviewed, rollout r209860 OWR player shouldn't be selected for
normal video playback

Source/WebCore:

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
(WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
(WebCore::MediaPlayerPrivateGStreamerOwr::play):
(WebCore::MediaPlayerPrivateGStreamerOwr::pause):
(WebCore::MediaPlayerPrivateGStreamerOwr::load):
(WebCore::MediaPlayerPrivateGStreamerOwr::stop):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded):
(WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
(WebCore::MediaPlayerPrivateGStreamerOwr::setSize):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
(WebCore::MediaEndpointOwr::createMutedRemoteSource):
* platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
(WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Removed.
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
* platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Removed.

LayoutTests:

* platform/gtk/TestExpectations:

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

3 years agoVisual viewports: bottom fixed elements disappear behind the keyboard
wenson_hsieh@apple.com [Sat, 17 Dec 2016 19:18:12 +0000 (19:18 +0000)]
Visual viewports: bottom fixed elements disappear behind the keyboard
https://bugs.webkit.org/show_bug.cgi?id=165983
<rdar://problem/29409852>

Reviewed by Simon Fraser.

Source/WebKit2:

Accounts for input view bounds in WebPageProxy::computeCustomFixedPositionRect. To do this, we introduce and
pass unobscuredContentRectRespectingInputViewBounds along with the regular unobscuredContentRect (which does not
respect the obscuring keyboard rect). This unobscuredContentRectRespectingInputViewBounds is then used when
computing the origin of the updated layout viewport rect (and also, when we are _not_ below minimum scale),

Additionally, the size is computed using the (unconstrained) unobscured rect. This is because we previously
would use the document-constrained version of the unobscured rect, which caused the layout viewport to shrink
when approaching the max scroll extents of the document while the keyboard is up, since the unobscured rect
would spill out of the document rect. However, using this unconstrained rect's size also means that if the user
rubber-bands out of the document rect, we would end up pushing the layout viewport rect out of the document,
with no way of adjusting it back in without the user scrolling to push the layout viewport into back document
bounds. To address this, we move the layout rect to be within document bounds after computing its size and
location.

Added a new layout test: fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html, and also tweaked
fixed-caret-position-after-scroll.html to cover these changes.

* Shared/VisibleContentRectUpdateInfo.cpp:
(WebKit::operator<<):
* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
(WebKit::VisibleContentRectUpdateInfo::unobscuredContentRectRespectingInputViewBounds):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _updateContentRectsWithState:]):
(-[WKWebView _inputViewBounds]):

Returns the current bounds of the input view. For testing purposes.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::unobscuredContentRectRespectingInputViewBounds):
* UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::customFixedPositionRect):
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect:inputViewBounds:scale:]):

Helper to compute the unobscured rect, accounting for the bounds of the current input view.

(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:inputViewBounds:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
(-[WKContentView _didCommitLayerTree:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):

Tools:

Add support for UIScriptController.inputViewBounds, which UI-side scripts may use to fetch the bounding rect of
the keyboard when it is up.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::inputViewBounds):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::inputViewBounds):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
(WTR::viewRectForWindowRect):

Previously, we accounted for the status bar height by translating the entire web view down by the height of the
status bar. However, we did not shrink the height of the web view itself, which means that for tests which
involve scrolling past the end of the document, the bottom strip of the web view is out of bounds of the window.

(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::setWindowFrame):
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::inputViewBounds):

LayoutTests:

Tweaked fixed-caret-position-after-scroll.html to account for the keyboard height, and also added a new layout
test, fixed-element-on-bottom-with-keyboard.html, which checks that the layout viewport does not change before
and after showing the keyboard, and that scrolling past the end of the document does not bump the layout
viewport past document bounds.

The rest of the changes here involve rebaselining existing tests to account for the height of the web view no
longer being equal to the height of the window.

* editing/caret/ios/absolute-caret-position-after-scroll-expected.txt:
* editing/caret/ios/absolute-caret-position-after-scroll.html:
* editing/caret/ios/fixed-caret-position-after-scroll-expected.txt:
* editing/caret/ios/fixed-caret-position-after-scroll.html:
* editing/selection/ios/absolute-selection-after-scroll.html:
* editing/selection/ios/fixed-selection-after-scroll.html:
* fast/events/ios/keyboard-scrolling-distance-expected.txt:
* fast/events/ios/keyboard-should-not-trigger-resize-expected.txt:
* fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt:
* fast/forms/ios/accessory-bar-navigation-expected.txt:
* fast/forms/ios/focus-input-in-fixed-expected.txt:
* fast/forms/ios/focus-input-in-iframe-expected.txt:
* fast/forms/ios/focus-input-via-button-expected.txt:
* fast/forms/ios/focus-input-via-button-no-scaling-expected.txt:
* fast/forms/ios/focus-long-textarea-expected.txt:
* fast/forms/ios/zoom-after-input-tap-expected.txt:
* fast/forms/ios/zoom-after-input-tap-wide-input-expected.txt:
* fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt:
* fast/viewport/ios/width-is-device-width-expected.txt:
* fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard-expected.txt: Added.
* fast/visual-viewport/ios/fixed-element-on-bottom-with-keyboard.html: Added.
* fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt:
* platform/ios-simulator/fast/scrolling/ios/clipping-ancestor-with-accelerated-scrolling-ancestor-expected.txt:
* platform/ios-simulator/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt:
* platform/ios-simulator/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt:
* platform/ios-simulator/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt:
* platform/ios-simulator/fast/scrolling/ios/touch-stacking-expected.txt:
* scrollingcoordinator/ios/non-stable-viewport-scroll-expected.txt:
* scrollingcoordinator/ios/ui-scrolling-tree-expected.txt:

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

3 years agoWebAssembly: WasmB3IRGenerator uses WarmAny as a ValueRep but expects the incoming...
sbarati@apple.com [Sat, 17 Dec 2016 18:44:17 +0000 (18:44 +0000)]
WebAssembly: WasmB3IRGenerator uses WarmAny as a ValueRep but expects the incoming value to be a register
https://bugs.webkit.org/show_bug.cgi?id=165989

Reviewed by Mark Lam.

The input should be constrained to a register to match what
the patchpoint code expects.

* wasm/WasmB3IRGenerator.cpp:

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

3 years agowarning: the compiler can assume that the address of 'thisObject' will always evaluat...
mcatanzaro@igalia.com [Sat, 17 Dec 2016 18:13:32 +0000 (18:13 +0000)]
warning: the compiler can assume that the address of 'thisObject' will always evaluate to 'true' [-Waddress] in WebCore::JSHTMLDocument::getOwnPropertySlot
https://bugs.webkit.org/show_bug.cgi?id=165987

Reviewed by Mark Lam.

Work around the warning by passing the JSObject pointer this function receives directly to
ASSERT_GC_OBJECT_INHERITS, instead of casting it to a reference and then taking the address
of that, to avoid the -Waddress warning.

* bindings/js/JSHTMLDocumentCustom.cpp:
(WebCore::JSHTMLDocument::getOwnPropertySlot):

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

3 years agoAdd implementation for navigator.requestMediaKeySystemAccess()
jer.noble@apple.com [Sat, 17 Dec 2016 17:18:54 +0000 (17:18 +0000)]
Add implementation for navigator.requestMediaKeySystemAccess()
https://bugs.webkit.org/show_bug.cgi?id=165850

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html

Add an implementation of NavigatorEME::requestMediaKeySystemAccess() as well as the CDM
object on which it depends.

* Modules/encryptedmedia/CDM.cpp: Added.
(WebCore::cdmFactories):
(WebCore::createCDMPrivateForKeySystem):
(WebCore::CDM::registerCDMFactory):
(WebCore::CDM::unregisterCDMFactory):
(WebCore::CDM::supportsKeySystem):
(WebCore::CDM::create):
(WebCore::CDM::CDM):
(WebCore::CDM::getSupportedConfiguration):
(WebCore::CDM::doSupportedConfigurationStep):
(WebCore::CDM::isPersistentType):
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
(WebCore::CDM::getConsentStatus):
* Modules/encryptedmedia/CDM.h: Added.
(WebCore::CDMFactory::~CDMFactory):
(WebCore::CDM::keySystem):
(WebCore::CDM::createWeakPtr):
* Modules/encryptedmedia/CDMPrivate.h: Added.
(WebCore::CDMPrivate::~CDMPrivate):
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::NavigatorEME::requestMediaKeySystemAccess):
(WebCore::tryNextSupportedConfiguration):
* Modules/encryptedmedia/NavigatorEME.h:
* Modules/encryptedmedia/NavigatorEME.idl:

To aid in testing, a new Internals object is added, MockCDMFactory, which can be
controlled by LayoutTests to change the behavior of the Mock objects it creates.

* testing/Internals.cpp:
(WebCore::Internals::registerMockCDM):
* testing/Internals.h:
* testing/Internals.idl:
* testing/MockCDMFactory.cpp: Added.
(WebCore::MockCDMFactory::MockCDMFactory):
(WebCore::MockCDMFactory::~MockCDMFactory):
(WebCore::MockCDMFactory::unregister):
(WebCore::MockCDMFactory::supportsKeySystem):
(WebCore::MockCDMFactory::createCDM):
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::supportsInitDataType):
(WebCore::MockCDM::supportsConfiguration):
(WebCore::MockCDM::supportsConfigurationWithRestrictions):
(WebCore::MockCDM::supportsSessionTypeWithConfiguration):
(WebCore::MockCDM::supportsRobustness):
(WebCore::MockCDM::distinctiveIdentifiersRequirement):
(WebCore::MockCDM::persistentStateRequirement):
(WebCore::MockCDM::distinctiveIdentifiersAreUniquePerOriginAndClearable):
* testing/MockCDMFactory.h: Added.
(WebCore::MockCDMFactory::create):
(WebCore::MockCDMFactory::supportedDataTypes):
(WebCore::MockCDMFactory::setSupportedDataTypes):
(WebCore::MockCDMFactory::supportedRobustness):
(WebCore::MockCDMFactory::setSupportedRobustness):
(WebCore::MockCDMFactory::distinctiveIdentifiersRequirement):
(WebCore::MockCDMFactory::setDistinctiveIdentifiersRequirement):
(WebCore::MockCDMFactory::persistentStateRequirement):
(WebCore::MockCDMFactory::setPersistentStateRequirement):
* testing/MockCDMFactory.idl: Added.

Move the MediaKeySessionType definition out of the MediaKeys.idl file and into its own.
Move the MediaKeysRequiriment definition out of the MediaKeySystemConfiguration.idl file
and into its own. Generally fix up the .idl files so that they properly work with their
implementation files.

* Modules/encryptedmedia/MediaKeySessionType.idl: Added.
* Modules/encryptedmedia/MediaKeySystemAccess.cpp:
(WebCore::MediaKeySystemAccess::create):
(WebCore::MediaKeySystemAccess::MediaKeySystemAccess):
(WebCore::MediaKeySystemAccess::keySystem): Deleted.
(WebCore::MediaKeySystemAccess::getConfiguration): Deleted.
* Modules/encryptedmedia/MediaKeySystemAccess.h:
(WebCore::MediaKeySystemAccess::keySystem):
(WebCore::MediaKeySystemAccess::getConfiguration):
(WebCore::MediaKeySystemAccess::create): Deleted.
* Modules/encryptedmedia/MediaKeySystemAccess.idl:
* Modules/encryptedmedia/MediaKeySystemConfiguration.h:
* Modules/encryptedmedia/MediaKeySystemConfiguration.idl:
* Modules/encryptedmedia/MediaKeySystemMediaCapability.idl:
* Modules/encryptedmedia/MediaKeys.idl:
* Modules/encryptedmedia/MediaKeysRequirement.idl: Added.
* Modules/encryptedmedia/MediaKeysRestrictions.h: Added.
* bindings/js/JSMediaKeySystemAccessCustom.cpp: Removed.

As some of these enums are referenced in the Internals project, they need to be exported
from WebCore correctly. Teach the code generator how to export the symbols generated by
enums.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateEnumerationHeaderContent):

Add new files to the project.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

LayoutTests:

* media/encrypted-media/mock-navigator-requestMediaKeySystemAccess-expected.txt: Added.
* media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoWebAssembly: Change a RELEASE_ASSERT_NOT_REACHED to a jit.breakpoint() for now to...
sbarati@apple.com [Sat, 17 Dec 2016 17:14:03 +0000 (17:14 +0000)]
WebAssembly: Change a RELEASE_ASSERT_NOT_REACHED to a jit.breakpoint() for now to allow us to run some wasm benchmarks
https://bugs.webkit.org/show_bug.cgi?id=165990

Reviewed by Mark Lam.

* wasm/WasmBinding.cpp:
(JSC::Wasm::importStubGenerator):

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

3 years agoRemove WebCore::Dictionary, which is now unused
darin@apple.com [Sat, 17 Dec 2016 16:42:03 +0000 (16:42 +0000)]
Remove WebCore::Dictionary, which is now unused
https://bugs.webkit.org/show_bug.cgi?id=165988

Reviewed by Andreas Kling.

* CMakeLists.txt: Removed the files.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/Dictionary.cpp: Removed.
* bindings/js/Dictionary.h: Removed.
* bindings/js/JSBindingsAllInOne.cpp: Removed include of Dictionary.cpp.

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

3 years agoCloned CachedResource should not have an empty response
commit-queue@webkit.org [Sat, 17 Dec 2016 10:33:12 +0000 (10:33 +0000)]
Cloned CachedResource should not have an empty response
https://bugs.webkit.org/show_bug.cgi?id=165947

Patch by Youenn Fablet <youenn@apple.com> on 2016-12-17
Reviewed by Sam Weinig.

Source/WebCore:

Test: http/tests/loading/reusing-cached-stylesheet-from-different-domain.html

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setBodyDataFrom): Copying the response to the cloned resource.
Even though the issue is appearing for stylesheets only, it is safer to do that for all cloned ressources.

LayoutTests:

This new test is working as follow:
- A first frame is loaded. As part of it, it will load an absolute URL CSS stylesheet that contains a relative URL to import a CSS stylesheet.
This second stylesheet will make the background as green.
- Once done, a second frame is loaded (same HTML but from a different domain) with the same absolute URL CSS stylesheet.
The relative URL stylesheet should use the absolute URL of the CSS stylesheet as base.
If it is using the frame as base, the loaded CSS will change background to red.

* http/tests/loading/resources/cached-stylesheet-from-different-domain-frame.css.php: Added.
* http/tests/loading/resources/cached-stylesheet-from-different-domain-frame.html: Added.
* http/tests/loading/resources/imported-stylesheet-varying-according-domain.css.php: Added.
* http/tests/loading/reusing-cached-stylesheet-from-different-domain-expected.html: Added.
* http/tests/loading/reusing-cached-stylesheet-from-different-domain.html: Added.

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

3 years agoIndexedDB: Refactor SQLiteIDBCursor to prepare for cursor prefetching.
beidson@apple.com [Sat, 17 Dec 2016 07:29:17 +0000 (07:29 +0000)]
IndexedDB: Refactor SQLiteIDBCursor to prepare for cursor prefetching.
https://bugs.webkit.org/show_bug.cgi?id=165978

Reviewed by Alex Christensen.

No new tests (Refactor, no behavior change).

In preparation for cursor prefetching, we need to shift the cursor off of keeping "the current record"
and onto keeping "a deque of fetched records", the first of which is "the current record".

This patch does just that, but with no behavior change; The deque only ever holds 0 or 1 records.

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::prefetch):
(WebCore::IDBServer::SQLiteIDBCursor::advance):
(WebCore::IDBServer::SQLiteIDBCursor::fetch):
(WebCore::IDBServer::SQLiteIDBCursor::fetchNextRecord):
(WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
(WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):
(WebCore::IDBServer::SQLiteIDBCursor::didComplete):
(WebCore::IDBServer::SQLiteIDBCursor::didError):
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::advanceOnce): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce): Deleted.

* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::SQLiteCursorRecord::isTerminalRecord):
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::currentKey): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::currentValue): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::didComplete): Deleted.
(WebCore::IDBServer::SQLiteIDBCursor::didError): Deleted.

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

3 years agoRemove all custom bindings from media streams, using dictionaries instead
darin@apple.com [Sat, 17 Dec 2016 06:42:39 +0000 (06:42 +0000)]
Remove all custom bindings from media streams, using dictionaries instead
https://bugs.webkit.org/show_bug.cgi?id=165943

Reviewed by Sam Weinig.

Source/WebCore:

* CMakeLists.txt: Added and removed files.
* DerivedSources.make: Ditto.

* Modules/mediastream/DoubleRange.h: Added. Moved dictionary here so it can be shared
by both MediaStreamTrack and MediaTrackSupportedConstraints.
* Modules/mediastream/DoubleRange.idl: Ditto.
* Modules/mediastream/LongRange.h: Ditto.
* Modules/mediastream/LongRange.idl: Ditto.

* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::getSupportedConstraints): Changed to return a struct instead
of a reference counted object.
* Modules/mediastream/MediaDevices.h: Updated for the above.
* Modules/mediastream/MediaDevices.idl: Added a conditional on the dictionary in this
file; not needed because the conditional on the interface automatically affects the
entire fiel, but for now the style seems to be to put these on all the dictionaries.

* Modules/mediastream/MediaSourceSettings.cpp: Removed.
* Modules/mediastream/MediaSourceSettings.h: Removed.

* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings): Changed to return a struct instead of a
reference counted object.
(WebCore::capabilityDoubleRange): Added. Helper for getCapabilities.
(WebCore::capabilityIntRange): Ditto.
(WebCore::capabilityStringVector): Ditto.
(WebCore::capabilityBooleanVector): Ditto.
(WebCore::MediaStreamTrack::getCapabilities): Changed to return a struct instead
of a reference counted object.
* Modules/mediastream/MediaStreamTrack.h: Updated for the above changes. Also
defined the structs here in the class.
* Modules/mediastream/MediaStreamTrack.idl: Defined the two dictionaries here and
changed the functions to return them and not use [Custom] any more.

* Modules/mediastream/MediaTrackConstraints.h: Moved DoubleRange and LongRange out
of this file and into their own headers. Also removed the currently unimplemented
latency and channelCount; there are FIXME comments in the IDL file about eventually
adding these to match the specification.
* Modules/mediastream/MediaTrackConstraints.idl: Added conditionals, and removed
the unimplemented latency and channelCount.
style of marking everything consistently.

* Modules/mediastream/MediaTrackSupportedConstraints.h: Replaced this class with
a struct.
* Modules/mediastream/MediaTrackSupportedConstraints.idl: Replaced this interface
with a dictionary.

* WebCore.xcodeproj/project.pbxproj: Added and removed files.

* bindings/js/JSMediaStreamTrackCustom.cpp: Removed.
* bindings/js/JSMediaTrackSupportedConstraintsCustom.cpp: Removed.

* platform/mediastream/MediaStreamTrackPrivate.cpp: Removed include of the
MediaSourceSettings.h header.
* platform/mediastream/MediaStreamTrackPrivate.h: Removed forward declaration of
the MediaSourceSettings class.

LayoutTests:

* fast/mediastream/MediaDevices-getSupportedConstraints-expected.txt: Updated since the
properties in the dictionaries are now in alphabetical order and because of the test change.
* fast/mediastream/MediaDevices-getSupportedConstraints.html: Updated to expect some true
and some false rather than some true and some missing.

* fast/mediastream/MediaStreamTrack-getCapabilities-expected.txt: Updated since the
properties in the dictionaries are now in alphabetical order.
* fast/mediastream/MediaStreamTrack-getSettings-expected.txt: Ditto.

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

3 years agoJSContext Inspector: Avoid some possible exceptions inspecting a JSContext
commit-queue@webkit.org [Sat, 17 Dec 2016 05:05:17 +0000 (05:05 +0000)]
JSContext Inspector: Avoid some possible exceptions inspecting a JSContext
https://bugs.webkit.org/show_bug.cgi?id=165986
<rdar://problem/29551379>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-12-16
Reviewed by Matt Baker.

Source/JavaScriptCore:

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.processProperties):
Prefer String.prototype.endsWith now that it is available.

(InjectedScript.prototype._describe):
Prefer Function.prototype.toString for converting functions to String.
Previously we were doing String(f) which would to Symbol.toPrimitive
conversion which seems unnecessary here.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
There will not be a main frame if we are debugging a JSContext.
In those cases do not change the title.

* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
There may not be a parent folder in JavaScript inspection. In that case
ScriptTreeElements are added to the Top Level, not folders.

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

3 years agoDeleting a character converted from pinyin after an image causes a Safari crash
rniwa@webkit.org [Sat, 17 Dec 2016 04:04:08 +0000 (04:04 +0000)]
Deleting a character converted from pinyin after an image causes a Safari crash
https://bugs.webkit.org/show_bug.cgi?id=165839
Source/WebKit2:

Reviewed by Darin Adler.

The crash was caused by the payload of the IPC not being decoded correctly when the encoded attributed string
contains a NSTextAttachment but send<> would still gladly send it to the UIProcess.

Fixed it by omitting the image as done in r176412 since encoding NSFileWrapper, etc... would require
quite a bit of work, and IME doesn't really need to see the image in its attributed string.

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::attributedSubstringForCharacterRangeAsync): Fixed the bug.

Tools:

<rdar://problem/27951933>

Reviewed by Wenson Hsieh.

Add a WebKit API test to call attributedSubstringForProposedRange on a WKWebView
while the proposed range contains an image. This should not cause a WebProcess to crash
or send an invalid message to the UIProcess.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/chinese-character-with-image.html: Added.
* TestWebKitAPI/Tests/WebKit2/mac/AttributedSubstringForProposedRangeWithImage.mm: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::processDidCrash):
(TestWebKitAPI::invalidMessageFunction):
(TestWebKitAPI::WebKit2.AttributedSubstringForProposedRangeWithImage):

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

3 years agoUnreviewed, fix GCC 6 build failure after r209952
mcatanzaro@igalia.com [Sat, 17 Dec 2016 03:32:39 +0000 (03:32 +0000)]
Unreviewed, fix GCC 6 build failure after r209952

Return false, not nullptr, in function returning bool.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitJumpViaFinallyIfNeeded):

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

3 years agoWebAssembly: We still have some incorrect parsing productions inside unreachable...
sbarati@apple.com [Sat, 17 Dec 2016 03:19:48 +0000 (03:19 +0000)]
WebAssembly: We still have some incorrect parsing productions inside unreachable code
https://bugs.webkit.org/show_bug.cgi?id=165981

Reviewed by Keith Miller.

This hardens our parsing for CallIndirect and Loop/Block/If to be exactly like their reachable variant.

It also fixes a more nefarious bug in which we were decoding an extra varuint32
for Br/BrIf inside unreachable code.

* wasm/WasmFunctionParser.h:

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

3 years agoCellState should have members with accurate names
fpizlo@apple.com [Sat, 17 Dec 2016 02:41:05 +0000 (02:41 +0000)]
CellState should have members with accurate names
https://bugs.webkit.org/show_bug.cgi?id=165969

Reviewed by Mark Lam.

This once again renames the members in CellState. I wanted to convey the following
pieces of information in the names:

- What does the state mean for Generational GC?
- What does the state mean for Concurrent GC?
- Does the state guarantee what it means, or is there some contingency?

The names I came up with are:

PossiblyOldOrBlack: An object in this state may be old, or may be black, depending on
    other things. If the mark bit is set then the object is either black or being
    blackened as we speak. It's going to survive the GC, so it will be old, but may be
    new now. In between GCs, objects in this state are definitely old. If the mark bit
    is not set, then the object is actually old and white.

DefinitelyNewAndWhite: The object was just allocated so it is white (not marked) and
    new.

DefinitelyGrey: The object is definitely grey - it will be rescanned in the future. It
    may be new or old depending on other things.

* heap/CellState.h:
* heap/Heap.cpp:
(JSC::Heap::addToRememberedSet):
(JSC::Heap::writeBarrierSlowPath):
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendJSCellOrAuxiliary):
(JSC::SlotVisitor::setMarkedAndAppendToMarkStack):
(JSC::SlotVisitor::appendToMarkStack):
(JSC::SlotVisitor::visitChildren):
* runtime/JSCellInlines.h:
(JSC::JSCell::JSCell):
* runtime/StructureIDBlob.h:
(JSC::StructureIDBlob::StructureIDBlob):

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

3 years agoB3::DoubleToFloatReduction will accidentally convince itself it converted a Phi from...
sbarati@apple.com [Sat, 17 Dec 2016 01:07:38 +0000 (01:07 +0000)]
B3::DoubleToFloatReduction will accidentally convince itself it converted a Phi from Double to Float and then convert uses of that Phi into a use of FloatToDouble(@Phi)
https://bugs.webkit.org/show_bug.cgi?id=165946

Reviewed by Keith Miller.

This was happening because the phase will convert some Phi nodes
from Double to Float. However, one place that did this conversion
forgot to first check if the Phi was already a Float. If it's already
a Float, a later part of the phase will be buggy if the phase claims that it has
converted it from Double->Float. The reason is that at the end of the
phase, we'll look for all uses of former Double Phi nodes and make them
be a use of ConvertFloatToDouble on the Phi, instead of a use of the Phi itself.
This is clearly wrong if the Phi were Float to begin with (and
therefore, the uses were Float uses to begin with).

* b3/B3ReduceDoubleToFloat.cpp:
* b3/testb3.cpp:
(JSC::B3::testReduceFloatToDoubleValidates):
(JSC::B3::run):

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

3 years agoJSTests:
mark.lam@apple.com [Sat, 17 Dec 2016 01:06:49 +0000 (01:06 +0000)]
JSTests:
De-duplicate finally blocks.
https://bugs.webkit.org/show_bug.cgi?id=160168

Reviewed by Keith Miller.

* stress/deeply-nested-finallys.js: Added.
- Tests many levels of finally nesting.  This causes the old code to hang (and
  crashes eventually) while trying to generate bytecode for the exponentially
  duplicated finally blocks.  The new code completes this test almost instantly.

* stress/test-finally.js: Added.
- Tests control flow through various permutations of finally blocks.

Source/JavaScriptCore:
De-duplicate finally blocks.
https://bugs.webkit.org/show_bug.cgi?id=160168

Reviewed by Keith Miller.

JS execution can arrive at a finally block when there are abrupt completions from
its try or catch block.  The abrupt completion types include Break,
Continue, Return, and Throw.  The non-abrupt completion type is called Normal
(i.e. the case of a try block falling through to the finally block).

Previously, we enable each of these paths for abrupt completion (except for Throw)
to run the finally block code by duplicating the finally block code at each of
the sites that trigger those completions.  This patch fixes the implementation so
that each of these abrupt completions will set a finallyActionRegister (plus a
finallyReturnValueRegister for CompletionType::Return) and then jump to the
relevant finally blocks, and continue to thread through subsequent outer finally
blocks until execution reaches the outermost finally block that the completion
type dictates.  We no longer duplicate the finally block code.

The implementation details:
1. We allocate a pair of finallyActionRegister and finallyReturnValueRegister
   just before entering the outermost try-catch-finally scope.

   On allocating the registers, we set them to the empty JSValue.  This serves
   to set the completion type to CompletionType::Normal (see (2) below).

2. The finallyActionRegister serves 2 purpose:
   a. indicates the CompletionType that triggered entry into the finally block.

      This is how we encode the completion type in the finallyActionRegister:
      1. CompletionType::Normal
         - finallyActionRegister is set to the empty JSValue.
      2. CompletionType::Break
         - finallyActionRegister is set to the int jumpID for the site of the break statement.
      3. CompletionType::Continue
         - finallyActionRegister is set to the int jumpID for the site of the continue statement.
      4. CompletionType::Return
         - finallyActionRegister is set to CompletionType::Return as an int JSValue.
         - finallyReturnValueRegister is set to the value to be returned.
      5. CompletionType::Throw
         - finallyActionRegister is set to the exception object that was caught by the finally block.

      Hence, if the finallyActionRegister can either be:
      1. empty i.e. we're handling CompletionType::Normal.
      2. an int JSValue i.e. we're handling CompletionType::Break, Continue, or Return.
      3. an object i.e. we're handling CompletionType::Throw.

   b. stores the exception caught in the finally block if we're handing
      CompletionType::Throw.

3. Each finally block will have 2 entries:
   a. the entry via throw.
   b. the normal entry.

   The entry via throw is recorded in the codeBlock's exception table, and can
   only be jumped to by the VM's exception handling mechanism.

   The normal entry is recorded in a FinallyContext (at bytecode generation time
   only) and is jumped to when we want enter the finally block due any of the
   other CompletionTypes.

4. CompletionType::Normal
   ======================
   We encounter this when falling through from a try or catch block to the finally block.

   For the try block case, since finallyActionRegister is set to Normal by default,
   there's nothing more that needs to be done.

   For the catch block case, since we entered the catch block with an exception,
   finallyActionRegister may be set to Throw.  We'll need to set it to Normal
   before jumping to the finally block's normal entry.

   CompletionType::Break
   =====================
   When we emit bytecode for the BreakNode, we check if we have any FinallyContexts
   that we need to service before jumping to the breakTarget.  If we do, then:
   a. we'll register a jumpID along with the breakTarget with the outermost FinallyContext.
   b. we'll also increment the numberOfBreaksOrContinues count in each FinallyContext
      from the innermost to the outermost.
   c. instead of emitting bytecode to jump to the breakTarget, we:
      1. emit bytecode to set finallyActionRegister to the jumpID.
      b. emit bytecode to jump to the normal entry of the innermost finally block.

   Each finally block will take care of cascading to the next outer finally block
   as needed (see (5) below).

   CompletionType::Continue
   ========================
   Since continues and breaks work the same way (i.e. with a jump), we handle this
   exactly the same way as CompletionType::Break, except that we use the
   continueTarget instead of the breakTarget.

   CompletionType::Return
   ======================
   When we emit bytecode for the ReturnNode, we check if we have any FinallyContexts
   at all on the m_controlFlowScopeStack.

   If so, then instead of emitting op_ret, we:
      1. emit bytecode to set finallyActionRegister to the CompletionType::Return.
      1. emit bytecode to move the return value into finallyReturnValueRegister.
      2. emit bytecode to jump to the normal entry of the innermost finally block.

   Each finally block will take care of cascading to the next outer finally block
   as needed (see (5) below).

   CompletionType::Throw
   ======================
   The op_catch of a finally block will always store the caught exception object
   in the finallyActionRegister.  This means we're handling CompletionType::Throw
   (see (2) above).

5. What happens in each finally block?
   ==================================
   Only the finally block's entry via throw will have an op_catch that catches the
   pending exception (and stores it in the finallyActionRegister).  This throw
   entry then falls through to the normal entry.

   The finally block's normal entry will restore the scope of the finally block
   and proceed to execute its code.

   At the end of the finally block (see emitFinallyCompletion()), the finally
   block will check the finallyActionRegister for each completion type in the
   following order:

   a. CompletionType::Normal: jump to the code after the finally block as
      designated by a normalCompletion label.

   b. CompletionType::Break and Continue:
      If the FinallyContext for this block has registered FinallyJumps, we'll
      check for the jumpIDs against the finallyActionRegister.  If the jumpID
      matches, jump to the corresponding jumpTarget.

      If no jumpIDs match but the FinallyContext's numberOfBreaksOrContinues is
      greater than the number of registered FinallyJumps, then this means that
      we have a Break or Continue that needs to be handled by an outer finally
      block.  In that case, jump to the outer finally block's normal entry.

   c. CompletionType::Return:
      If this finally block is not the outermost and finallyActionRegister contains
      CompletionType::Return, then jump to the outer finally block's normal entry.

      Otherwise, if this finally block is the outermost and finallyActionRegister
      contains CompletionType::Return, then execute op_ret and return the value
      in finallyReturnValueRegister.

   d. CompletionType::Throw:
      If we're not handling any of the above cases, then just throw the
      finallyActionRegister which contains the exception to re-throw.

6. restoreScopeRegister()

   Since the needed scope objects are always stored in a local, we can restore
   the scope register by simply moving from that local instead of going through
   op_get_parent_scope.

7. m_controlFlowScopeStack needs to be a SegmentedVector instead of a Vector.
   This makes it easier to keep a pointer to the FinallyContext on that stack,
   and not have to worry about the vector being realloc'ed due to resizing.

Performance appears to be neutral both on ES6SampleBench (run via cli) and the
JSC benchmarks.

Relevant spec references:
https://tc39.github.io/ecma262/#sec-completion-record-specification-type
https://tc39.github.io/ecma262/#sec-try-statement-runtime-semantics-evaluation

* bytecode/HandlerInfo.h:
(JSC::HandlerInfoBase::typeName):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::emitReturn):
(JSC::BytecodeGenerator::pushFinallyControlFlowScope):
(JSC::BytecodeGenerator::popFinallyControlFlowScope):
(JSC::BytecodeGenerator::allocateAndEmitScope):
(JSC::BytecodeGenerator::pushTry):
(JSC::BytecodeGenerator::popTry):
(JSC::BytecodeGenerator::emitCatch):
(JSC::BytecodeGenerator::restoreScopeRegister):
(JSC::BytecodeGenerator::labelScopeDepthToLexicalScopeIndex):
(JSC::BytecodeGenerator::labelScopeDepth):
(JSC::BytecodeGenerator::pushLocalControlFlowScope):
(JSC::BytecodeGenerator::popLocalControlFlowScope):
(JSC::BytecodeGenerator::emitEnumeration):
(JSC::BytecodeGenerator::emitIsNumber):
(JSC::BytecodeGenerator::emitYield):
(JSC::BytecodeGenerator::emitDelegateYield):
(JSC::BytecodeGenerator::emitJumpViaFinallyIfNeeded):
(JSC::BytecodeGenerator::emitReturnViaFinallyIfNeeded):
(JSC::BytecodeGenerator::emitFinallyCompletion):
(JSC::BytecodeGenerator::allocateFinallyRegisters):
(JSC::BytecodeGenerator::releaseFinallyRegisters):
(JSC::BytecodeGenerator::emitCompareFinallyActionAndJumpIf):
(JSC::BytecodeGenerator::pushIteratorCloseControlFlowScope): Deleted.
(JSC::BytecodeGenerator::popIteratorCloseControlFlowScope): Deleted.
(JSC::BytecodeGenerator::emitComplexPopScopes): Deleted.
(JSC::BytecodeGenerator::emitPopScopes): Deleted.
(JSC::BytecodeGenerator::popTryAndEmitCatch): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::FinallyJump::FinallyJump):
(JSC::FinallyContext::FinallyContext):
(JSC::FinallyContext::outerContext):
(JSC::FinallyContext::finallyLabel):
(JSC::FinallyContext::depth):
(JSC::FinallyContext::numberOfBreaksOrContinues):
(JSC::FinallyContext::incNumberOfBreaksOrContinues):
(JSC::FinallyContext::handlesReturns):
(JSC::FinallyContext::setHandlesReturns):
(JSC::FinallyContext::registerJump):
(JSC::FinallyContext::numberOfJumps):
(JSC::FinallyContext::jumps):
(JSC::ControlFlowScope::ControlFlowScope):
(JSC::ControlFlowScope::isLabelScope):
(JSC::ControlFlowScope::isFinallyScope):
(JSC::BytecodeGenerator::currentLexicalScopeIndex):
(JSC::BytecodeGenerator::FinallyRegistersScope::FinallyRegistersScope):
(JSC::BytecodeGenerator::FinallyRegistersScope::~FinallyRegistersScope):
(JSC::BytecodeGenerator::finallyActionRegister):
(JSC::BytecodeGenerator::finallyReturnValueRegister):
(JSC::BytecodeGenerator::emitSetFinallyActionToNormalCompletion):
(JSC::BytecodeGenerator::emitSetFinallyActionToReturnCompletion):
(JSC::BytecodeGenerator::emitSetFinallyActionToJumpID):
(JSC::BytecodeGenerator::emitSetFinallyReturnValueRegister):
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNormalCompletion):
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNotJump):
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsReturnCompletion):
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNotReturnCompletion):
(JSC::BytecodeGenerator::emitJumpIfFinallyActionIsNotThrowCompletion):
(JSC::BytecodeGenerator::emitJumpIfCompletionTypeIsThrow):
(JSC::BytecodeGenerator::bytecodeOffsetToJumpID):
(JSC::BytecodeGenerator::isInFinallyBlock): Deleted.
* bytecompiler/NodesCodegen.cpp:
(JSC::ContinueNode::emitBytecode):
(JSC::BreakNode::emitBytecode):
(JSC::ReturnNode::emitBytecode):
(JSC::TryNode::emitBytecode):

Source/WTF:
Add predecessor info to dumps from JSC_dumpBytecodeLivenessResults=true.
https://bugs.webkit.org/show_bug.cgi?id=165958

Reviewed by Keith Miller.

Added some methods to bring SegmentedVector closer to parity with Vector.

* wtf/SegmentedVector.h:
(WTF::SegmentedVector::first):
(WTF::SegmentedVector::last):
(WTF::SegmentedVector::takeLast):

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

3 years agoPossible nullptr dereference when applying pagination to viewport
zalan@apple.com [Sat, 17 Dec 2016 00:48:31 +0000 (00:48 +0000)]
Possible nullptr dereference when applying pagination to viewport
https://bugs.webkit.org/show_bug.cgi?id=165926

Reviewed by Simon Fraser.

Static analysis found a code path where a null dereference could occur.

* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):

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

3 years agoFix failing test.
weinig@apple.com [Fri, 16 Dec 2016 23:59:20 +0000 (23:59 +0000)]
Fix failing test.

* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:
Update results to match latest IDL.

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

3 years agoFix the Windows build.
ryanhaddad@apple.com [Fri, 16 Dec 2016 23:51:59 +0000 (23:51 +0000)]
Fix the Windows build.

Unreviewed build fix.

* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:

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

3 years agoYet another attempt to fix the Windows build after r209936.
ryanhaddad@apple.com [Fri, 16 Dec 2016 23:32:55 +0000 (23:32 +0000)]
Yet another attempt to fix the Windows build after r209936.

Unreviewed build fix.

* platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:

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

3 years agoUse initEvent quirk added in r207908 for Flipboard
achristensen@apple.com [Fri, 16 Dec 2016 23:24:06 +0000 (23:24 +0000)]
Use initEvent quirk added in r207908 for Flipboard
https://bugs.webkit.org/show_bug.cgi?id=165974
<rdar://problem/28264190>

Reviewed by Chris Dumez.

* dom/Event.cpp:
(WebCore::Event::initEventForBindings):
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isFlipboard):
Flipboard also has JavaScript content that calls initEvent with not enough arguments.

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

3 years ago[iOS] Align HTML from validation popover style with Copy/Paste callout bar
cdumez@apple.com [Fri, 16 Dec 2016 23:17:42 +0000 (23:17 +0000)]
[iOS] Align HTML from validation popover style with Copy/Paste callout bar
https://bugs.webkit.org/show_bug.cgi?id=165973
<rdar://problem/29336638>

Reviewed by Simon Fraser.

Tweak font size and padding of the HTML from validation popover to
match the style of the Copy/Paste callout bar on iOS.

* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::ValidationBubble):

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

3 years agoAnother attempt to fix the Windows build after r209936.
ryanhaddad@apple.com [Fri, 16 Dec 2016 23:12:59 +0000 (23:12 +0000)]
Another attempt to fix the Windows build after r209936.

Unreviewed build fix.

* CMakeLists.txt:

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

3 years agoAdd a setting to suppress keyboard input during provisional navigation
aestes@apple.com [Fri, 16 Dec 2016 23:10:56 +0000 (23:10 +0000)]
Add a setting to suppress keyboard input during provisional navigation
https://bugs.webkit.org/show_bug.cgi?id=165830

Reviewed by Brent Fulgham.

Source/WebCore:

Added a setting that suppresses keyboard input during provisional navigation. When the
setting is enabled, DOM propogation of keyboard input events (KeyboardEvents,
CompositionEvents, InputEvents, and some TextEvents) is suppressed, and text insertion is
disabled in the editor.

Non-editing default event handling still occurs, for instance keyboard scrolling, access
keys, and focus navigation.

Test: http/tests/navigation/keyboard-events-during-provisional-navigation.html

* dom/CompositionEvent.h: Added a type trait specialization.
* dom/EventDispatcher.cpp:
(WebCore::shouldSuppressEventDispatchInDOM): Added. Returns true if the event is trusted,
FrameLoader::shouldSuppressKeyboardInput() returns true, and the event is a
CompositionEvent, InputEvent, KeyboardEvent, or keyboard/composition TextEvent.
(WebCore::EventDispatcher::dispatchEvent): Called stopPropogation() on the event if
shouldSuppressEventDispatchInDOM() returns true.
* dom/InputEvent.h: Removed the inline no-op destructor so that DataTransfer does not need
to be a complete type in every translation unit that includes this header. Added a type
trait specialization.
* dom/TextEvent.h: Added isKeyboard() to determine if m_inputType is TextEventInputKeyboard.
* editing/Editor.cpp:
(WebCore::Editor::shouldInsertText): Returned false if
FrameLoader::shouldSuppressKeyboardInput() returns true and the action is
EditorInsertActionTyped.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldSuppressKeyboardInput): Added. Returns true if
Settings::shouldSuppressKeyboardInputDuringProvisionalNavigation() returns true and the
state is FrameStateProvisional.
* loader/FrameLoader.h: Declared shouldSuppressKeyboardInput().
* page/EventHandler.h: Exported accessKeyModifiers().
* page/Settings.in: Defined shouldSuppressKeyboardInputDuringProvisionalNavigation with an
initial value of false.
* testing/Internals.cpp:
(WebCore::Internals::accessKeyModifiers): Added. Returns a vector of strings representing
the access key modifiers.
* testing/Internals.h: Declared accessKeyModifiers().
* testing/Internals.idl: Exposed accessKeyModifiers() on the internals object.

Source/WebKit2:

* Shared/WebPreferencesDefinitions.h: Defined
shouldSuppressKeyboardDOMEventsDuringProvisionalNavigation.
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
(WKPreferencesGetShouldSuppressKeyboardInputDuringProvisionalNavigation): Added.
* UIProcess/API/C/WKPreferencesRefPrivate.h: Declared a getter and setter for the new
preference.
* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _shouldSuppressKeyboardInputDuringProvisionalNavigation]): Added.
(-[WKPreferences _setShouldSuppressKeyboardInputDuringProvisionalNavigation:]): Added.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h: Declared a property for the new preference.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences): Mapped the new preference to its corresponding
WebCore::Setting.

LayoutTests:

* http/tests/navigation/keyboard-events-during-provisional-navigation-expected.txt: Added.
* http/tests/navigation/keyboard-events-during-provisional-navigation.html: Added.
* http/tests/navigation/resources/keyboard-events-after-navigation.html: Added.
* http/tests/navigation/resources/keyboard-events-test.js: Added.
(runTest.eventHandler):
(runTest):
* http/tests/navigation/resources/never-respond.php: Added.
* platform/ios-simulator/TestExpectations:

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

3 years agoMore SQLiteIDBCursor refactoring.
beidson@apple.com [Fri, 16 Dec 2016 23:03:26 +0000 (23:03 +0000)]
More SQLiteIDBCursor refactoring.
https://bugs.webkit.org/show_bug.cgi?id=165956

Reviewed by Tim Horton.

No new tests (No behavior change).

This is a simple patch that encapsulates the current state of the cursor in one structure
which will allow for storing multiple-such states in the future (to support prefetching).

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::advance):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
(WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):

* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):
(WebCore::IDBServer::SQLiteIDBCursor::didComplete):
(WebCore::IDBServer::SQLiteIDBCursor::didError):

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

3 years agoHTML form validation bubble should be dismissed on navigation
cdumez@apple.com [Fri, 16 Dec 2016 23:00:48 +0000 (23:00 +0000)]
HTML form validation bubble should be dismissed on navigation
https://bugs.webkit.org/show_bug.cgi?id=165960
<rdar://problem/29668086>

Reviewed by Simon Fraser.

Source/WebKit/mac:

Dismiss HTML form validation bubble on top-level navigation on Mac WK1.

* WebView/WebView.mm:
(-[WebView _didStartProvisionalLoadForFrame:]):

Source/WebKit2:

Dismiss HTML form validation bubble on top-level navigation on WK2.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):

LayoutTests:

Add layout test coverage.

* http/tests/navigation/navigation-dismisses-validation-bubbles-expected.txt: Added.
* http/tests/navigation/navigation-dismisses-validation-bubbles.html: Added.
* http/tests/navigation/resources/check-validation-bubble-not-visible.html: Added.

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

3 years agoFollow-up build fix after r209936; also rename MockCDM -> LegacyMockCDM in
jer.noble@apple.com [Fri, 16 Dec 2016 22:33:00 +0000 (22:33 +0000)]
Follow-up build fix after r209936; also rename MockCDM -> LegacyMockCDM in
CMakeLists.txt.

* CMakeLists.txt:

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

3 years ago[Bindings] Remove use of Dictionary/ArrayValue in CDMSessionClearKey
weinig@apple.com [Fri, 16 Dec 2016 22:29:19 +0000 (22:29 +0000)]
[Bindings] Remove use of Dictionary/ArrayValue in CDMSessionClearKey
https://bugs.webkit.org/show_bug.cgi?id=165961

Reviewed by Darin Adler.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
Remove ArrayValue.h/cpp

* bindings/js/ArrayValue.cpp: Removed.
* bindings/js/ArrayValue.h: Removed.

* bindings/js/Dictionary.cpp:
* bindings/js/Dictionary.h:
Remove support for ArrayValue.

* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
(WebCore::CDMSessionClearKey::update):
Replace use of Dictionary/ArrayValue with direct JSObject functions. This
should really be replaced with a JSON parser that does not require round
tripping through JavaScript objects.

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

3 years agoREGRESSION: HipChat and Mail sometimes hang beneath JSC::Heap::lastChanceToFinalize()
msaboff@apple.com [Fri, 16 Dec 2016 22:26:09 +0000 (22:26 +0000)]
REGRESSION: HipChat and Mail sometimes hang beneath JSC::Heap::lastChanceToFinalize()
https://bugs.webkit.org/show_bug.cgi?id=165962

Reviewed by Filip Pizlo.

There is an inherent race in Condition::waitFor() where the timeout can happen just before
a notify from another thread.

Fixed this by adding a condition variable and flag to each AutomaticThread.  The flag
is used to signify to a notifying thread that the thread is waiting.  That flag is set
in the waiting thread before calling waitFor() and cleared by another thread when it
notifies the thread.  The access to that flag happens when the lock is held.
Now the waiting thread checks if the flag after a timeout to see that it in fact should
proceed like a normal notification.

The added condition variable allows us to target a specific thread.  We used to keep a list
of waiting threads, now we keep a list of all threads.  To notify one thread, we look for
a waiting thread and notify it directly.  If we can't find a waiting thread, we start a
sleeping thread.

We notify all threads by waking all waiting threads and starting all sleeping threads.

* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::notifyOne):
(WTF::AutomaticThreadCondition::notifyAll):
(WTF::AutomaticThread::isWaiting):
(WTF::AutomaticThread::notify):
(WTF::AutomaticThread::start):
* wtf/AutomaticThread.h:

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

3 years agoSmall refactor: Use HashCountedSet rather than HashMap<..., int> to store client...
jer.noble@apple.com [Fri, 16 Dec 2016 22:05:54 +0000 (22:05 +0000)]
Small refactor: Use HashCountedSet rather than HashMap<..., int> to store client counts in WebPlaybackSessionManager{,Proxy}.
https://bugs.webkit.org/show_bug.cgi?id=165807

Reviewed by Eric Carlson.

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
(WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::addClientForContext):
(WebKit::WebPlaybackSessionManager::removeClientForContext):

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

3 years agoMove existing CDM* implementations into modules/encryptedmedia/legacy
jer.noble@apple.com [Fri, 16 Dec 2016 21:52:38 +0000 (21:52 +0000)]
Move existing CDM* implementations into modules/encryptedmedia/legacy
https://bugs.webkit.org/show_bug.cgi?id=165823

Rubber-stamped by Sam Weinig.

* Modules/encryptedmedia/legacy/LegacyCDM.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.cpp.
(WebCore::CDMFactory::CDMFactory):
(WebCore::installedCDMFactories):
(WebCore::CDM::registerCDMFactory):
(WebCore::CDMFactoryForKeySystem):
(WebCore::CDM::supportsKeySystem):
(WebCore::CDM::keySystemSupportsMimeType):
(WebCore::CDM::create):
(WebCore::CDM::CDM):
(WebCore::CDM::~CDM):
(WebCore::CDM::supportsMIMEType):
(WebCore::CDM::createSession):
(WebCore::CDM::mediaPlayer):
* Modules/encryptedmedia/legacy/LegacyCDM.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDM.h.
(WebCore::CDMClient::~CDMClient):
(WebCore::CDM::keySystem):
(WebCore::CDM::client):
(WebCore::CDM::setClient):
* Modules/encryptedmedia/legacy/LegacyCDMPrivate.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivate.h.
(WebCore::CDMPrivateInterface::CDMPrivateInterface):
(WebCore::CDMPrivateInterface::~CDMPrivateInterface):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.cpp.
(WebCore::CDMPrivateClearKey::supportsKeySystem):
(WebCore::CDMPrivateClearKey::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateClearKey::supportsMIMEType):
(WebCore::CDMPrivateClearKey::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateClearKey.h.
(WebCore::CDMPrivateClearKey::CDMPrivateClearKey):
(WebCore::CDMPrivateClearKey::~CDMPrivateClearKey):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp.
(WebCore::CDMPrivateMediaPlayer::supportsKeySystem):
(WebCore::CDMPrivateMediaPlayer::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateMediaPlayer::supportsMIMEType):
(WebCore::CDMPrivateMediaPlayer::createSession):
* Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMPrivateMediaPlayer.h.
(WebCore::CDMPrivateMediaPlayer::CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::~CDMPrivateMediaPlayer):
(WebCore::CDMPrivateMediaPlayer::cdm):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.cpp.
(WebCore::clearKeyVM):
(WebCore::CDMSessionClearKey::CDMSessionClearKey):
(WebCore::CDMSessionClearKey::~CDMSessionClearKey):
(WebCore::CDMSessionClearKey::generateKeyRequest):
(WebCore::CDMSessionClearKey::releaseKeys):
(WebCore::CDMSessionClearKey::update):
(WebCore::CDMSessionClearKey::cachedKeyForKeyID):
* Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.h: Renamed from Source/WebCore/Modules/encryptedmedia/CDMSessionClearKey.h.
* Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
* Modules/encryptedmedia/legacy/WebKitMediaKeys.h:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/LegacyCDMSession.h: Renamed from Source/WebCore/platform/graphics/CDMSession.h.
(WebCore::CDMSessionClient::~CDMSessionClient):
(WebCore::CDMSession::CDMSession):
(WebCore::CDMSession::~CDMSession):
(WebCore::CDMSession::type):
(WebCore::CDMSession::cachedKeyForKeyID):
* platform/graphics/MediaPlayer.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
* platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
* testing/Internals.cpp:
* testing/LegacyMockCDM.cpp: Renamed from Source/WebCore/testing/MockCDM.cpp.
(WebCore::MockCDMSession::~MockCDMSession):
(WebCore::MockCDM::supportsKeySystem):
(WebCore::MockCDM::supportsKeySystemAndMimeType):
(WebCore::MockCDM::supportsMIMEType):
(WebCore::MockCDM::createSession):
(WebCore::initDataPrefix):
(WebCore::keyPrefix):
(WebCore::keyRequest):
(WebCore::generateSessionId):
(WebCore::MockCDMSession::MockCDMSession):
(WebCore::MockCDMSession::generateKeyRequest):
(WebCore::MockCDMSession::releaseKeys):
(WebCore::MockCDMSession::update):
* testing/LegacyMockCDM.h: Renamed from Source/WebCore/testing/MockCDM.h.
(WebCore::MockCDM::MockCDM):
(WebCore::MockCDM::~MockCDM):

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

3 years agoMove the skip expectation for fast/visual-viewport/ios/zoomed-focus-in-fixed.html...
ryanhaddad@apple.com [Fri, 16 Dec 2016 21:42:50 +0000 (21:42 +0000)]
Move the skip expectation for fast/visual-viewport/ios/zoomed-focus-in-fixed.html to ios-simulator-wk2.

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/TestExpectations:

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

3 years agoAdd missing cases to parseUnreachableExpression and cleanup FunctionParser
keith_miller@apple.com [Fri, 16 Dec 2016 21:36:40 +0000 (21:36 +0000)]
Add missing cases to parseUnreachableExpression and cleanup FunctionParser
https://bugs.webkit.org/show_bug.cgi?id=165966

Reviewed by Saam Barati.

This patch adds a number of missing cases to the Wasm FunctionParser's unreachable
code decoder. It also, removes unneeded OpType namespaces where they were not
needed and has the unary / binary macros cover all the cases rather than
just the simple cases.

* wasm/WasmFunctionParser.h:

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

3 years agoWeb Inspector: REGRESSION (r209882): Opening find banner in editor causes UI to hang
mattbaker@apple.com [Fri, 16 Dec 2016 21:20:53 +0000 (21:20 +0000)]
Web Inspector: REGRESSION (r209882): Opening find banner in editor causes UI to hang
https://bugs.webkit.org/show_bug.cgi?id=165967

Reviewed by Timothy Hatcher.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype._findBannerDidShow):
Showing the find banner should cause search results to be refreshed only
if it contains query text.

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

3 years agoSubframes going into page cache don't need to resetScrollbars().
akling@apple.com [Fri, 16 Dec 2016 20:44:01 +0000 (20:44 +0000)]
Subframes going into page cache don't need to resetScrollbars().
<https://webkit.org/b/163750>
<rdar://problem/29273020>

Reviewed by Antti Koivisto.

Source/WebCore:

The main frame is the only frame that switches its FrameView when using the page cache,
subframes just suspend their DOM and wait around to be either killed or restored.

Thus there is no reason for subframes to reset their FrameView's scrollbars when going
into page cache, since nothing affects them while cached, and their layout should end up
identical when restoring.

This was causing some flakiness with subframe scrollbars jumping between different sizes
in when restoring from page cache in macOS/WK1. This change makes the behavior consistent
in both WK1 and WK2, and removes the flakiness.

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

LayoutTests:

Unskip compositing/iframes/page-cache-layer-tree.html on mac-wk1 and fix up the
result now that WK2 behaves correctly as well.

Both DRT and WTR run with scrollbars in "always on" mode, so the correct dimensions
for the 300x150 iframe layers here are 285x135.

* compositing/iframes/page-cache-layer-tree-expected.txt:
* platform/mac-wk1/TestExpectations:

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

3 years agoVisual viewports: carets and selection UI are incorrectly positioned when editing...
wenson_hsieh@apple.com [Fri, 16 Dec 2016 20:24:37 +0000 (20:24 +0000)]
Visual viewports: carets and selection UI are incorrectly positioned when editing fixed elements
https://bugs.webkit.org/show_bug.cgi?id=165767
<rdar://problem/29602382>

Reviewed by Simon Fraser.

Source/WebCore:

When changing the layout viewport override, mark viewport-constrained objects as needing layout. If only the
width and height of the old and new layout viewports are compared, EditorState info (namely selection and caret
rects) that depends on the document location of fixed elements may be stale immediately after the layout
viewport override changes and before layout occurs.

This caused one of the tests (fixed-caret-position-after-scroll.html) to occasionally fail.

Tests: editing/caret/ios/absolute-caret-position-after-scroll.html
       editing/caret/ios/fixed-caret-position-after-scroll.html
       editing/selection/ios/absolute-selection-after-scroll.html
       editing/selection/ios/fixed-selection-after-scroll.html

* page/FrameView.cpp:
(WebCore::FrameView::setLayoutViewportOverrideRect):

Source/WebKit2:

When focusing an input, the position of the caret on iOS is determined by the overridden layout viewport rect in
the web process. However, this rect is not updated until the end the scroll gesture. Whereas this is fine for
non-fixed inputs since their document location does not change, fixed inputs effectively change their position
in the document as the user scrolls. This causes the caret to be 'left behind' in the document position it was
in at the start of the scroll. To fix this, we deactivate the selection when exiting stable state if the
assisted node is in a fixed position container, and reenable it upon receiving the next stable state EditorState
update (as indicated by postLayoutData().isStableStateUpdate). Additionally, we apply similar treatment to the
web selection assistant -- this time, we need to force the selection view to hide (analagous to deactivating
the text selection assistant) and show it again upon receiving the next selection change update when the WebPage
(in the web process) is stable.

Furthermore, adds test support for querying text caret and selection rects, as well as perform a callback after
the WebPage has indicated that it is stable, both as SPI on the WKWebView.

Covered by 4 new layout tests in fast/editing/caret/ios and fast/editing/selection/ios.

* Platform/spi/ios/UIKitSPI.h:
* Shared/EditorState.cpp:
(WebKit::EditorState::PostLayoutData::encode):
(WebKit::EditorState::PostLayoutData::decode):
* Shared/EditorState.h:

Introduce isStableStateUpdate, which is true when the WebPage is known to be in stable state, as well as
insideFixedPosition, which is true when the current selection is inside a fixed position container.

* Shared/mac/RemoteLayerTreeTransaction.h:
(WebKit::RemoteLayerTreeTransaction::isInStableState):
(WebKit::RemoteLayerTreeTransaction::setIsInStableState):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _uiTextCaretRect]):

Introduced a new SPI method for fetching the current rect of the text assistant's caret view, at keyPath
"selectionView.selection.caretRect".

(-[WKWebView _uiTextSelectionRects]):

Renamed (and refactored) from _uiTextSelectionRectViews, which was previously fetching an array of UIViews. I
found this to cause character-granularity-rect.html to fail due to the array of UIViews here being empty, so I
refactored this to simply return an array of rects from the keyPath "selectionView.selection.selectionRects" for
the text selection assistant and @"selectionView.selectionRects" for the web selection assistant.

(-[WKWebView _doAfterNextStablePresentationUpdate:]):

Runs the given block after both the UI process and web processes agree that the visible content rect state is
stable. To do this, we fire presentation updates until the UI process (via RemoteLayerTreeTransactions)
discovers that the web page is in stable state. This is used solely for testing purposes.

(-[WKWebView _firePresentationUpdateForPendingStableStatePresentationCallbacks]):
(-[WKWebView _uiTextSelectionRectViews]): Deleted.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::inStableState):
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _didExitStableState]):

Deactivate the text selection if the assisted node is inside a fixed container.

(-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView cleanupInteraction]):
(-[WKContentView shouldHideSelectionWhenScrolling]):
(-[WKContentView _uiTextSelectionRects]):
(-[WKContentView _didEndScrollingOrZooming]):
(-[WKContentView _updateChangedSelection:]):

If the EditorState was created after a stable state update, reactivate the text selection assistant if it exists.
Additionally, if we are deferring the end scrolling selection update until after the first stable editor state
update arrives from the web process, we need to also call [_textSelectionAssistant didEndScrollingOverflow]
and [_webSelectionAssistant didEndScrollingOrZoomingPage] here instead of doing so immediately after scrolling
finishes. This ensures that selection UI (the callout and selection highlights) do not flicker from their old
position to the new position when scrolling finishes.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformEditorState):
(WebKit::WebPage::updateVisibleContentRects):

When updating the layout viewport override rect, also recompute the caret if needed and send an updated
EditorState over to the UI process.

Tools:

Introduces two new UIScriptController methods: doAfterWebPageIsInStableState and textSelectionCaretRect. See
WebKit2 ChangeLog for more details.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::doAfterNextStablePresentationUpdate):
(WTR::UIScriptController::textSelectionCaretRect):
* DumpRenderTree/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::doAfterNextStablePresentationUpdate):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::doAfterNextStablePresentationUpdate):
(WTR::UIScriptController::textSelectionCaretRect):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/cocoa/TestRunnerWKWebView.mm:
(-[TestRunnerWKWebView _setStableStateOverride:]):

Force the WKWebView to update its visible content rects when changing the stable state override.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::toNSDictionary):
(WTR::UIScriptController::doAfterNextStablePresentationUpdate):
(WTR::UIScriptController::selectionRangeViewRects):
(WTR::UIScriptController::textSelectionCaretRect):
* WebKitTestRunner/mac/UIScriptControllerMac.mm:
(WTR::UIScriptController::doAfterNextStablePresentationUpdate):

LayoutTests:

Adds new layout tests verifying that scrolling selected text (non-editable) and a text caret (in editable
content) results in the selection/caret rects having the correct location relative to the document, in both
cases where the selected/focused element has fixed position or absolute position. For fixed position elements,
this means that the rects must "move" down in the document as the document is scrolled, but for absolute
elements, these rects must remain in place.

* TestExpectations:
* editing/caret/ios/absolute-caret-position-after-scroll-expected.txt: Added.
* editing/caret/ios/absolute-caret-position-after-scroll.html: Added.
* editing/caret/ios/fixed-caret-position-after-scroll-expected.txt: Added.
* editing/caret/ios/fixed-caret-position-after-scroll.html: Added.
* editing/selection/ios/absolute-selection-after-scroll-expected.txt: Added.
* editing/selection/ios/absolute-selection-after-scroll.html: Added.
* editing/selection/ios/fixed-selection-after-scroll-expected.txt: Added.
* editing/selection/ios/fixed-selection-after-scroll.html: Added.

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

3 years agoAdd predecessor info to dumps from JSC_dumpBytecodeLivenessResults=true.
mark.lam@apple.com [Fri, 16 Dec 2016 19:28:58 +0000 (19:28 +0000)]
Add predecessor info to dumps from JSC_dumpBytecodeLivenessResults=true.
https://bugs.webkit.org/show_bug.cgi?id=165958

Reviewed by Saam Barati.

Also:
1. refactored the code to use a common lambda function to dump FastBitVectors.
2. list successors by their block index instead of pointers.

* bytecode/BytecodeLivenessAnalysis.cpp:
(JSC::BytecodeLivenessAnalysis::dumpResults):

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

3 years agoWebAssembly: WasmB3IRGenerator should throw exceptions instead of crash
sbarati@apple.com [Fri, 16 Dec 2016 19:24:06 +0000 (19:24 +0000)]
WebAssembly: WasmB3IRGenerator should throw exceptions instead of crash
https://bugs.webkit.org/show_bug.cgi?id=165834

Reviewed by Keith Miller.

JSTests:

* wasm/function-tests/exceptions.js: Added.
(import.Builder.from.string_appeared_here.import.as.assert.from.string_appeared_here.makeInstance):
* wasm/function-tests/table-basic.js:
(i.i.42.throw.new.Error):

Source/JavaScriptCore:

This patch generalizes how we throw exceptions in the Wasm::B3IRGenerator.
There are still places where we need to throw exceptions and we don't, but
this patch removes most of those places inside the IR generator. There are
still a few places we need to throw exceptions inside the IR generator, like
div/mod by 0. Those will be done in a separate patch. Also, there are
still some stubs we need to throw exceptions from; those will also be
done in a separate patch.

All exceptions thrown from Wasm share a common stub. The ABI for the stub
is to move the Wasm::ExceptionType into argGPR1 and jump to the stub.
The stub will then throw an exception with an error message tailored
to the particular Wasm::ExceptionType failure.

This patch also refactors B3::Compilation. Before, B3::Compilation(VM, Procedure)
constructor would compile a B3 function. This patch makes B3::Compilation a simple
tuple that keeps the necessary bits of B3 function alive in order to be runnable.
There is a new function that actually does the compilation for you. It is:
Compilation B3::compile(VM&, Procedure&)
The reason for this change is that I'm now using B3::Compilation(CodeRef, OpaqueByproducts)
constructor in Wasm code. It is weird to have a class both have a
constructor that instantiates the tuple, and another that performs the
compilation and then instantiates the tuple. It's more straight
forward if Compilation's job wasn't to actually do the compilation
but just to hold the necessary bits to keep a compiled B3 alive.

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3Compilation.cpp:
(JSC::B3::Compilation::Compilation):
* b3/B3Compilation.h:
* b3/B3Compile.cpp: Added.
(JSC::B3::compile):
* b3/B3Compile.h: Added.
* b3/testb3.cpp:
(JSC::B3::compile):
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromWasmThunkGenerator):
* jit/ThunkGenerators.h:
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::emitExceptionCheck):
(JSC::Wasm::createJSToWasmWrapper):
(JSC::Wasm::parseAndCompile):
* wasm/WasmExceptionType.h: Added.
(JSC::Wasm::errorMessageForExceptionType):

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

3 years ago[ApplePay] Remove remaining custom bindings from the ApplePay code
weinig@apple.com [Fri, 16 Dec 2016 18:56:24 +0000 (18:56 +0000)]
[ApplePay] Remove remaining custom bindings from the ApplePay code
https://bugs.webkit.org/show_bug.cgi?id=165860

Reviewed by Darin Adler.

* DerivedSources.make:
Add new IDL files.

* WebCore.xcodeproj/project.pbxproj:
Add/remove files.

* bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp: Removed.
* bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp: Removed.
* bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp: Removed.
* bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp: Removed.
Remove custom bindings.

* Modules/applepay/ApplePayLineItem.h: Added.
* Modules/applepay/ApplePayLineItem.idl: Added.
* Modules/applepay/ApplePayPayment.h: Added.
* Modules/applepay/ApplePayPayment.idl: Added.
* Modules/applepay/ApplePayPaymentContact.h: Added.
* Modules/applepay/ApplePayPaymentContact.idl: Added.
* Modules/applepay/ApplePayPaymentMethod.h: Added.
* Modules/applepay/ApplePayPaymentMethod.idl: Added.
* Modules/applepay/ApplePayPaymentPass.h: Added.
* Modules/applepay/ApplePayPaymentPass.idl: Added.
* Modules/applepay/ApplePayPaymentRequest.h: Added.
* Modules/applepay/ApplePayPaymentRequest.idl: Added.
* Modules/applepay/ApplePayShippingMethod.h: Added.
* Modules/applepay/ApplePayShippingMethod.idl: Added.
Split out dictionaries and enums into separate files where needed.

* Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
(WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
* Modules/applepay/ApplePayPaymentAuthorizedEvent.h:
* Modules/applepay/ApplePayPaymentAuthorizedEvent.idl:
Convert the 'payment' property to return an ApplePayPayment dictionary, removing
the need for custom bindings.

* Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
(WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
* Modules/applepay/ApplePayPaymentMethodSelectedEvent.idl:
Convert the 'paymentMethod' property to return an ApplePayPaymentMethod dictionary, removing
the need for custom bindings.

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
(WebCore::ApplePaySession::create):
(WebCore::ApplePaySession::ApplePaySession):
(WebCore::ApplePaySession::completeShippingMethodSelection):
(WebCore::ApplePaySession::completeShippingContactSelection):
(WebCore::ApplePaySession::completePaymentMethodSelection):
(WebCore::ApplePaySession::didSelectShippingMethod):
* Modules/applepay/ApplePaySession.h:
Update for new names, remove need for ExecState in the create function, and simplify
billingContact and shippingContact now that they are strongly typed.

* Modules/applepay/ApplePaySession.idl:
Move dictionaries and enums to their own files.

* Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
(WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
* Modules/applepay/ApplePayShippingContactSelectedEvent.h:
* Modules/applepay/ApplePayShippingContactSelectedEvent.idl:
Convert the 'shippingContact' property to return an ApplePayPaymentContact dictionary, removing
the need for custom bindings.

* Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
* Modules/applepay/ApplePayShippingMethodSelectedEvent.h:
* Modules/applepay/ApplePayShippingMethodSelectedEvent.idl:
Convert the 'shippingMethod' property to return an ApplePayShippingMethod dictionary, removing
the need for custom bindings.

* Modules/applepay/Payment.h:
* Modules/applepay/PaymentContact.h:
* Modules/applepay/PaymentMethod.h:
* Modules/applepay/cocoa/PaymentCocoa.mm:
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
* Modules/applepay/cocoa/PaymentMethodCocoa.mm:
Replace toJS/fromJS functions with ones that convert to/from the associated dictionary type.

* bindings/generic/IDLTypes.h:
(WebCore::IDLJSON::nullValue):
(WebCore::IDLJSON::isNullValue):
(WebCore::IDLJSON::extractValueFromNullable):
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<IDLJSON>::convert):
(WebCore::JSConverter<IDLJSON>::convert):
Add a new custom type, JSON, which converts from a String to a JS object.

* bindings/scripts/CodeGenerator.pm:
* bindings/scripts/CodeGeneratorJS.pm:
Add support for the new JSON type, and improve scoped naming to allow for enums
in dictionary only IDL files.

* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
Update test result for improved scoped naming.

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

3 years agoDefer certain accessibility callbacks until after layout is finished.
zalan@apple.com [Fri, 16 Dec 2016 18:48:31 +0000 (18:48 +0000)]
Defer certain accessibility callbacks until after layout is finished.
https://bugs.webkit.org/show_bug.cgi?id=165861
rdar://problem/29646301

Reviewed by Chris Fleizach.

Source/WebCore:

Currently with certain AXObjectCache callbacks, we can end up in a layout while the render tree is being mutated.
This patch ensures that such callbacks are deferred until after tree mutation/layout is finished.

Test: accessibility/accessibility-crash-with-dynamic-inline-content.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::performDeferredIsIgnoredChange):
(WebCore::AXObjectCache::insertDeferredIsIgnoredChange):
* accessibility/AXObjectCache.h:
* page/FrameView.cpp:
(WebCore::FrameView::performPostLayoutTasks):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::deleteLines):
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::createAndAppendRootInlineBox):

LayoutTests:

* accessibility/accessibility-crash-with-dynamic-inline-content-expected.txt: Added.
* accessibility/accessibility-crash-with-dynamic-inline-content.html: Added.

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

3 years agoRebaseline bindings tests after r209897.
ryanhaddad@apple.com [Fri, 16 Dec 2016 18:45:56 +0000 (18:45 +0000)]
Rebaseline bindings tests after r209897.

Unreviewed test gardening.

* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::JSTestObj::visitChildren):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::JSTestSerializedScriptValueInterface::visitChildren):

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

3 years agoArguments called in wrong order
bfulgham@apple.com [Fri, 16 Dec 2016 18:32:27 +0000 (18:32 +0000)]
Arguments called in wrong order
https://bugs.webkit.org/show_bug.cgi?id=165923

Reviewed by Simon Fraser.

Source/WebCore:

Correct the ordering of several function calls.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): The 'nearestToPresentationStartTime'
argument is being checked for validity, but 'nearestToPresentationEndTime' is being used in the
calculation. This seems like a copy/paste error.
* page/PrintContext.cpp:
(WebCore::PrintContext::outputLinkedDestinations): FloatPoint::expandedTo returns a new object that
has been expanded. This code continued using the 'unexpanded' point.
* platform/graphics/GraphicsContext3D.cpp:
(WebCore::GraphicsContext3D::computeImageSizeInBytes): The 'bytesPerComponent' and 'componentsPerPixel'
variables were being passed in the wrong order.
* platform/network/CacheValidation.cpp: The 'last-modified' header string was being concatenated with
the following string, resulting in an incorrect 'last-modifiedproxy-authenticate' string value.
* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::firstGlyph): The ASSERT was assigning to the (by-value) input
parameter 'codePoint', rather than comparing it to the firstGlyph value's codePoint.

Tools:

The 'audioDeviceUIDs' array is being passed to the argument that expects video devices,
and the 'videoDeviceUIDs' array is being passed to the audo device argument. Fix this.

* TestWebKitAPI/Tests/WebKit2/UserMedia.cpp:
(TestWebKitAPI::decidePolicyForUserMediaPermissionRequestCallBack): The
order of arguments to WKUserMediaPermissionRequestAllow are flipped.

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

3 years agoi64.eqz should use an Int64 zero
keith_miller@apple.com [Fri, 16 Dec 2016 17:53:26 +0000 (17:53 +0000)]
i64.eqz should use an Int64 zero
https://bugs.webkit.org/show_bug.cgi?id=165942

Reviewed by Mark Lam.

JSTests:

* wasm/wasm.json:

Source/JavaScriptCore:

This patch fixes i64.eqz, which was using an Int32 zero
for the comparison previously. This patch also, adds
printing opcodes names in verbose mode.

* wasm/WasmFunctionParser.h:
* wasm/generateWasmOpsHeader.py:
* wasm/wasm.json:

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

3 years agoWeb Inspector: Modernize find banner UI
mattbaker@apple.com [Fri, 16 Dec 2016 16:56:17 +0000 (16:56 +0000)]
Web Inspector: Modernize find banner UI
https://bugs.webkit.org/show_bug.cgi?id=165939

Reviewed by Timothy Hatcher.

The find banner should have a modern appearance, matching Xcode.

* UserInterface/Views/FindBanner.css:
(.find-banner > input[type="search"]):
(.find-banner > button):
Use standard border colors.
(.find-banner > button:disabled > .glyph):
Disabled previous / next glyphs should be lighter.
(.find-banner > button:active:not(:disabled)):
Update depressed button style: flat colors, no text color change.
(.find-banner > button.segmented):
(.find-banner > button.segmented.left):
(.find-banner > button:not(:active).segmented.right:before):
(.find-banner > button.segmented.left:active + button.segmented.right,):
(.find-banner > button.segmented.left:active + button.segmented.right:before):
(.find-banner > button.segmented.right):
(.find-banner.console-find-banner > input[type="search"]):
(.find-banner.console-find-banner > :matches(input[type="search"], button)):
(.find-banner > button:disabled): Deleted.
(.find-banner > button.segmented:active): Deleted.
Overlapping button borders are no longer an issue.

* UserInterface/Views/FindBanner.js:
(WebInspector.FindBanner):
Insert previous / next buttons after the input field in the DOM.
(WebInspector.FindBanner.prototype.get delegate):
(WebInspector.FindBanner.prototype.set delegate):
(WebInspector.FindBanner.prototype.get inputField):
(WebInspector.FindBanner.prototype.get searchQuery):
(WebInspector.FindBanner.prototype.set searchQuery):
(WebInspector.FindBanner.prototype.get numberOfResults):
Inline simple getters and setters.

* UserInterface/Views/Variables.css:
(:root):
Add button colors.

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

3 years ago[WK2] SharedMemory: include cleanups
csaavedra@igalia.com [Fri, 16 Dec 2016 16:43:16 +0000 (16:43 +0000)]
[WK2] SharedMemory: include cleanups
https://bugs.webkit.org/show_bug.cgi?id=165950

Reviewed by Žan Doberšek.

The WTFString include is not needed in the header, so move to the
Unix file. Use the existing UNIX_DOMAIN_SOCKETS define. Also
include the WTFOptional header where needed.

* Platform/SharedMemory.h:
* Platform/unix/SharedMemoryUnix.cpp:

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

3 years ago[EFL] Fix build break since r209907. Unreviewed.
jh718.park@samsung.com [Fri, 16 Dec 2016 16:31:55 +0000 (16:31 +0000)]
[EFL] Fix build break since r209907. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=165954

* UIProcess/efl/TextCheckerEfl.cpp: Change the remaining TextBreakIterator to UBreakIterator
(WebKit::nextWordOffset):
(WebKit::TextChecker::checkTextOfParagraph):

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

3 years ago[EFL] Disable non-srcdir builds for failing libraries
hs85.jeong@samsung.com [Fri, 16 Dec 2016 13:36:49 +0000 (13:36 +0000)]
[EFL] Disable non-srcdir builds for failing libraries
https://bugs.webkit.org/show_bug.cgi?id=165896

Reviewed by Gyuyoung Kim.

* efl/jhbuild.modules: Set non srcdir builds to no

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

3 years ago[Fetch API] Improve resource loading console logging
commit-queue@webkit.org [Fri, 16 Dec 2016 11:51:16 +0000 (11:51 +0000)]
[Fetch API] Improve resource loading console logging
https://bugs.webkit.org/show_bug.cgi?id=160546

Patch by Youenn Fablet <youenn@apple.com> on 2016-12-16
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebasing since error logging is happening for fetch API.

* web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-blob-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-others-expected.txt:
* web-platform-tests/fetch/api/cors/cors-basic-expected.txt:
* web-platform-tests/fetch/api/cors/cors-cookies-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt:
* web-platform-tests/fetch/api/cors/cors-origin-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight.html:
* web-platform-tests/fetch/api/cors/cors-redirect-credentials-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-location-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-schemes-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-to-dataurl-expected.txt:

Source/WebCore:

Covered by rebased tests.

Adding support for logging of resource loading failures in ThreadableLoader.
This will allow doing consistent logging for clients such as fetch, XHR, event source...

Doing logging for Fetch API only at the moment in ThreadableLoader.
Future patches should migrate XHR to this logging system.

Logging routine is implemented in ThreadableLoader.
It is used directly by DocumentThreadableLoader before calling didFail client callback.
DocumentThreadableLoader has a new option to not log errors, in the case the client is WorkerThreadableLoader::MainBridge.
In that case, the logging is done in the worker context within WorkerThreadableLoader::MainBridge::didFail

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadResourceSynchronously): Enable logging.
(WebCore::DocumentThreadableLoader::create): Passing logging parameter to constructor.
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Adding initialization of logging parameter.
(WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Making use of the new logErrorAndFail helper routine.
(WebCore::DocumentThreadableLoader::cancel): No need to log error if it is being cancelled.
(WebCore::DocumentThreadableLoader::redirectReceived): Made the reportXX routines methods of DocumentThreadableLoaders and using logErrorAndFail internally.
(WebCore::DocumentThreadableLoader::didFail): Wrapper around logErrorAndFail since cancel is not calling it anymore.
(WebCore::DocumentThreadableLoader::preflightFailure):
(WebCore::DocumentThreadableLoader::loadRequest):
(WebCore::DocumentThreadableLoader::reportRedirectionWithBadScheme):
(WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError):
(WebCore::DocumentThreadableLoader::reportCrossOriginResourceSharingError):
(WebCore::DocumentThreadableLoader::logErrorAndFail):
(WebCore::reportContentSecurityPolicyError): Deleted.
(WebCore::reportCrossOriginResourceSharingError): Deleted.
(WebCore::reportRedirectionWithBadScheme): Deleted.
* loader/DocumentThreadableLoader.h:
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoader::logError):
* loader/ThreadableLoader.h:
* loader/ThreadableLoaderClientWrapper.h:
(WebCore::ThreadableLoaderClientWrapper::create):
(WebCore::ThreadableLoaderClientWrapper::initiator):
(WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
(WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):

LayoutTests:

Rebasing since error logging is happening for fetch API.
Some tests are flaky due to always changing console logs, in which case DumpJSConsoleLogInStdErr is used.

* TestExpectations:
* http/tests/fetch/fetching-same-resource-with-diffferent-options-expected.txt:
* http/tests/inspector/network/fetch-network-data-expected.txt:
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt:
* platform/ios-simulator-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-basic-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/fetch/api/cors/cors-origin-expected.txt:

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

3 years ago[GStreamer][MSE] Fix build warning in MediaPlayerPrivateGStreamer.cpp using gcc 6.2
eocanha@igalia.com [Fri, 16 Dec 2016 11:50:19 +0000 (11:50 +0000)]
[GStreamer][MSE] Fix build warning in MediaPlayerPrivateGStreamer.cpp using gcc 6.2
https://bugs.webkit.org/show_bug.cgi?id=165900

Reviewed by Žan Doberšek.

* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
Move the variable asignation out of the if condition.

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

3 years ago[Readable Streams API] Implement ReadableByteStreamController cancel internal method
commit-queue@webkit.org [Fri, 16 Dec 2016 10:01:49 +0000 (10:01 +0000)]
[Readable Streams API] Implement ReadableByteStreamController cancel internal method
https://bugs.webkit.org/show_bug.cgi?id=165798

Patch by Romain Bellessort <romain.bellessort@crf.canon.fr> on 2016-12-16
Reviewed by Youenn Fablet.

Source/WebCore:

Implemented cancel method of ReadableByteStreamController.
Also fixed small inconsistency in readableByteStreamControllerClose.

Added one test to check cancel behaviour. More tests may be added as the API is implemented.

* Modules/streams/ReadableByteStreamInternals.js:
(privateInitializeReadableByteStreamController): Define cancel internal method.
(readableByteStreamControllerCancel): Added.
(readableByteStreamControllerClose): Fixed behaviour (no value should be dequeued).
* bindings/js/WebCoreBuiltinNames.h: Removed bytesFilled (previous addition was not needed).

LayoutTests:

Added one test to check cancel behaviour. More tests may be added as the API is implemented.
Also replaced async_test by promise_test where applicable.

* streams/readable-byte-stream-controller-expected.txt: Updated expectations.
* streams/readable-byte-stream-controller.js: Added one test.

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

3 years agosvg/as-image/svg-image-with-data-uri-use-data-uri.svg is flaky after r207754
commit-queue@webkit.org [Fri, 16 Dec 2016 08:42:29 +0000 (08:42 +0000)]
svg/as-image/svg-image-with-data-uri-use-data-uri.svg is flaky after r207754
https://bugs.webkit.org/show_bug.cgi?id=163887
<rdar://problem/29266436>

Patch by Youenn Fablet <youennf@gmail.com> on 2016-12-16
Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/security/cross-origin-cached-images-with-memory-pressure.html

With the introduction of cached resource cloning, an Image may be referenced by several CachedImage.
This did not work well with Image observer system as it mandates a one-to-one relationship.

Introducing CachedImageObserver to restore the one-to-one relationship between Image and its observer.
CachedImageObserver can keep references for more than one CachedImage.

In the future, it might be better to split more clearly CachedImageObserver and its API from CachedImage.
Or remove the concept of CachedResource cloning and find new ways to provide CachedResource origin information to clients.

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::load): Moved boolean image observer fields to CachedImageObserver.
(WebCore::CachedImage::setBodyDataFrom): Keeping a reference of the image observer when cloning the resource.
(WebCore::CachedImage::createImage): Creating the observer when creating the image.
(WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
(WebCore::CachedImage::CachedImageObserver::decodedSizeChanged):
(WebCore::CachedImage::CachedImageObserver::didDraw):
(WebCore::CachedImage::CachedImageObserver::animationAdvanced):
(WebCore::CachedImage::CachedImageObserver::changedInRect):
(WebCore::CachedImage::clearImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::setBodyDataFrom): Now that each cached image receives decodedSizeChanged callback, we need to set its size correctly.

LayoutTests:

* http/tests/security/cross-origin-cached-images-with-memory-pressure-expected.txt: Added.
* http/tests/security/cross-origin-cached-images-with-memory-pressure.html: Added.

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

3 years agoUnreviewed build fix after r209910
mmaxfield@apple.com [Fri, 16 Dec 2016 07:12:23 +0000 (07:12 +0000)]
Unreviewed build fix after r209910

Unreviewed.

* wtf/Platform.h:

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

3 years ago[EFL] Fix debug build break since r209873. Unreviewed.
jh718.park@samsung.com [Fri, 16 Dec 2016 07:10:00 +0000 (07:10 +0000)]
[EFL] Fix debug build break since r209873. Unreviewed.
https://bugs.webkit.org/show_bug.cgi?id=165945

No new tests, no new behaviours.

Use Primitive System Data Type uint64_t instead of unsigned long long.

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
* Modules/indexeddb/IDBFactory.h:

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

3 years agotext-align: justify and word-spacing combine to overflow column
zalan@apple.com [Fri, 16 Dec 2016 06:32:36 +0000 (06:32 +0000)]
text-align: justify and word-spacing combine to overflow column
https://bugs.webkit.org/show_bug.cgi?id=165796
rdar://problem/29672168

Reviewed by Myles C. Maxfield.

Source/WebCore:

The value of the word-spacing property is not applied on the inline-tree boxes (normal line layout)
with kerning enabled. It causes hittest failures and selection/rendering glitches.
We normally use the pre-computed 'WordMeasurements' values to figure out the run widths. However
with kerning on, in some cases we need to re-measure a certain part of the text by calling RenderText::width().
This function omits the word-spacing value for leading whitespace, so when this text fragment starts with a whitespace,
(while it's not at the beginning of the run) we have to manually add the word-spacing value back.
r146087 added this logic with the restriction of applying it only to whitespace-only runs.

Test: fast/css/word-spacing-with-normal-layout.html

* rendering/RenderBlockLineLayout.cpp:
(WebCore::setLogicalWidthForTextRun):

LayoutTests:

These are progressions.

* fast/css/word-spacing-with-normal-layout-expected.html: Added.
* fast/css/word-spacing-with-normal-layout.html: Added.
* platform/mac/css1/text_properties/word_spacing-expected.txt:
* platform/mac/fast/css/word-space-extra-expected.txt:
* platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.txt:
* platform/mac/fast/text/word-space-expected.txt:
* platform/mac/svg/custom/svg-fonts-in-html-expected.txt:
* platform/mac/svg/custom/svg-fonts-word-spacing-expected.txt:

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

3 years agoStop reinterpret_casting UBreakIterators to the undefined type TextBreakIterator
mmaxfield@apple.com [Fri, 16 Dec 2016 05:19:32 +0000 (05:19 +0000)]
Stop reinterpret_casting UBreakIterators to the undefined type TextBreakIterator
https://bugs.webkit.org/show_bug.cgi?id=165931

Source/WebCore:

Reviewed by Alex Christensen.

No new tests because there is no behavior change.

* dom/CharacterData.cpp:
(WebCore::CharacterData::parserAppendData):
* editing/TextCheckingHelper.cpp:
(WebCore::findMisspellings):
* editing/VisibleUnits.cpp:
(WebCore::wordBreakIteratorForMinOffsetBoundary):
(WebCore::wordBreakIteratorForMaxOffsetBoundary):
(WebCore::isLogicalStartOfWord):
(WebCore::islogicalEndOfWord):
(WebCore::visualWordPosition):
(WebCore::startSentenceBoundary):
(WebCore::endSentenceBoundary):
(WebCore::previousSentencePositionBoundary):
(WebCore::nextSentencePositionBoundary):
* html/HTMLInputElement.cpp:
* html/HTMLTextAreaElement.cpp:
* html/InputType.cpp:
* html/TextFieldInputType.cpp:
* html/TextInputType.cpp:
* platform/graphics/StringTruncator.cpp:
(WebCore::textBreakAtOrPreceding):
(WebCore::boundedTextBreakFollowing):
(WebCore::rightClipToWordBuffer):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::offsetForPosition):
* platform/text/TextBoundaries.cpp:
(WebCore::findNextWordFromIndex):
(WebCore::findWordBoundary):
(WebCore::findEndWordBoundary):
* platform/text/mac/TextBoundaries.mm:
(WebCore::findNextWordFromIndex):
* rendering/BreakLines.h:
(WebCore::nextBreakablePositionNonLoosely):
(WebCore::nextBreakablePositionLoosely):
* rendering/RenderBlock.cpp:
* rendering/RenderText.cpp:
(WebCore::makeCapitalized):
(WebCore::RenderText::previousOffset):
(WebCore::RenderText::previousOffsetForBackwardDeletion):
(WebCore::RenderText::nextOffset):
* rendering/SimpleLineLayoutTextFragmentIterator.h:
* rendering/line/LineBreaker.h:

Source/WebKit/ios:

Reviewed by Alex Christensen.

* Misc/WebUIKitSupport.mm:

Source/WTF:

We have a class declaration for TextBreakIterator but no definition for it. When we
create an ICU UBreakIterator, we immediately reinterpret_cast it to this undefined
type, and pass it around our code inside WebCore. Then, whenever we want to actually
use this iterator, we reinterpret_cast it back to UBreakIterator. This is likely due
to some ports historically implementing breaking interators on top of other libraries
other than ICU; however, now, all ports use ICU. Because this internal type is not
helpful and just adds confusion, we should just call our breaking iterators what
they are: UBreakIterators.

This patch is a mechanical replacement of TextBreakIterator to UBreakIterator and
removes the functions we were calling which pass through directly to ubrk_*().

Reviewed by Alex Christensen.

* wtf/text/LineBreakIteratorPoolICU.h:
(WTF::LineBreakIteratorPool::take):
(WTF::LineBreakIteratorPool::put):
* wtf/text/StringView.cpp:
(WTF::StringView::GraphemeClusters::Iterator::Impl::computeIndexEnd):
* wtf/text/TextBreakIterator.cpp:
(WTF::initializeIterator):
(WTF::initializeIteratorWithRules):
(WTF::setTextForIterator):
(WTF::setContextAwareTextForIterator):
(WTF::wordBreakIterator):
(WTF::sentenceBreakIterator):
(WTF::cursorMovementIterator):
(WTF::acquireLineBreakIterator):
(WTF::releaseLineBreakIterator):
(WTF::openLineBreakIterator):
(WTF::closeLineBreakIterator):
(WTF::getNonSharedCharacterBreakIterator):
(WTF::cacheNonSharedCharacterBreakIterator):
(WTF::isWordTextBreak):
(WTF::numGraphemeClusters):
(WTF::numCharactersInGraphemeClusters):
(WTF::textBreakFirst): Deleted.
(WTF::textBreakLast): Deleted.
(WTF::textBreakNext): Deleted.
(WTF::textBreakPrevious): Deleted.
(WTF::textBreakPreceding): Deleted.
(WTF::textBreakFollowing): Deleted.
(WTF::textBreakCurrent): Deleted.
(WTF::isTextBreak): Deleted.
* wtf/text/TextBreakIterator.h:
(WTF::LazyLineBreakIterator::lastCharacter):
(WTF::LazyLineBreakIterator::secondToLastCharacter):
(WTF::LazyLineBreakIterator::setPriorContext):
(WTF::LazyLineBreakIterator::updatePriorContext):
(WTF::LazyLineBreakIterator::resetPriorContext):
(WTF::LazyLineBreakIterator::priorContextLength):
(WTF::LazyLineBreakIterator::get):
(WTF::NonSharedCharacterBreakIterator::operator UBreakIterator*):
(WTF::NonSharedCharacterBreakIterator::operator TextBreakIterator*): Deleted.

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

3 years agoUse asString instead of toWTFString, toString, or getString when we already checked...
darin@apple.com [Fri, 16 Dec 2016 04:52:20 +0000 (04:52 +0000)]
Use asString instead of toWTFString, toString, or getString when we already checked isString
https://bugs.webkit.org/show_bug.cgi?id=165895

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

Once we have called isString, we should always use asString and value rather than using
functions that have to deal with non-JSString objects. This leads to slightly fewer branches,
slightly less reference count churn, since the string is stored right inside the JSString,
and obviates the need for exception handling.

* bindings/ScriptValue.cpp:
(Inspector::jsToInspectorValue): Use asString/value instead of getString.
* dfg/DFGOperations.cpp:
(JSC::DFG::operationMapHash): Call jsMapHash with its new arguments.
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::evaluateWithScopeExtension): Use asString/value instead
of toWTFString.
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension): Ditto.
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::getPreview): Use asString/tryGetValue, instead of the
peculiar getString(nullptr) that was here before.
* jsc.cpp:
(functionGetGetterSetter): Use asString/toIdentifier instead of the much less efficient
toWTFString/Identifier::fromString.
(functionIsRope): Use asString instead of jsCast<JSString*>; same thing, but we should
prefer the asString function, since it exists.
(functionFindTypeForExpression): Use asString/value instead of getString.
(functionHasBasicBlockExecuted): Ditto.
(functionBasicBlockExecutionCount): Ditto.
(functionCreateBuiltin): Use asString/value instead of toWTFString and removed
unneeded RETURN_IF_EXCEPTION.
(valueWithTypeOfWasmValue): Use asString instead of jsCast<String*>.
(box): Ditto.
* runtime/DateConstructor.cpp:
(JSC::constructDate): Use asString/values instead of getString.
* runtime/ExceptionHelpers.cpp:
(JSC::errorDescriptionForValue): Tweaked formatting.

* runtime/HashMapImpl.h:
(JSC::jsMapHash): Changed this function to use asString/value.

* runtime/JSCJSValue.cpp:
(JSC::JSValue::dumpInContextAssumingStructure): Use asString instead of
jsCast<JSString*>.
(JSC::JSValue::dumpForBacktrace): Ditto.
* runtime/JSCJSValueInlines.h:
(JSC::toPreferredPrimitiveType): Ditto.

* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncEval): Use asString/value instead of toWTFString.

* runtime/JSString.cpp:
(JSC::JSString::destroy): Streamlined by removing local variable.
(JSC::JSString::estimatedSize): Use asString instead of jsCast<JSString*>.
(JSC::JSString::visitChildren): Ditto.
(JSC::JSString::toThis): Ditto.
* runtime/JSString.h:
(JSC::JSValue::toString): Ditto.
(JSC::JSValue::toStringOrNull): Ditto.
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncValueOf): Ditto.
* runtime/ObjectPrototype.cpp:
(JSC::objectProtoFuncToString): Ditto.
* runtime/StringPrototype.cpp:
(JSC::stringProtoFuncRepeatCharacter): Ditto.
(JSC::stringProtoFuncSubstr): Ditto.
(JSC::builtinStringSubstrInternal): Simplified assertion by removing local variable.

Source/WebCore:

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract): Use asString/value instead of toWTFString.

* Modules/mediastream/SDPProcessor.cpp:
(WebCore::SDPProcessor::callScript): Use asString/value instead of getString.

* bindings/js/ArrayValue.cpp:
(WebCore::ArrayValue::get): Use asString/value instead of toWTFString.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::get): Use asString/length instead of toString/length.
(WebCore::createIDBKeyFromValue): Use asString/value instead of toWTFString.
* bindings/js/JSCryptoAlgorithmDictionary.cpp:
(WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier): Ditto.
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue): Use asString/value instead of getString.
* bindings/js/JSInspectorFrontendHostCustom.cpp:
(WebCore::populateContextMenuItems): Use asString/value instead of toWTFString.

* bindings/js/ScriptController.cpp:
(WebCore::jsValueToModuleKey): Use asString/toIdentifier instead of
jsCast<JSString*>/value/Identifier::fromString.

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal): Streamline by getting rid of local variable.

* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::getDomainList): Use asString instead of jsCast<JSString*>.
(WebCore::ContentExtensions::loadTrigger): Use asString/value instead of toWTFString.
(WebCore::ContentExtensions::loadAction): Ditto.

* css/FontFace.cpp:
(WebCore::FontFace::create): Use asString/value instead of getString.

Source/WebKit/mac:

* Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::addValueToArray): Use asString/value instead of
toWTFString.
* WebView/WebView.mm:
(aeDescFromJSValue): Use asString/value instead of getString.

Source/WebKit2:

* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
(WebKit::NPRuntimeObjectMap::convertJSValueToNPVariant): Use asString/value instead of toWTFString.

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

3 years agoChange ::computeLogicalHeight's computedValues out argument to the return value.
zalan@apple.com [Fri, 16 Dec 2016 04:37:28 +0000 (04:37 +0000)]
Change ::computeLogicalHeight's computedValues out argument to the return value.
https://bugs.webkit.org/show_bug.cgi?id=165789

Reviewed by Simon Fraser.

No change in functionality.

* html/shadow/SliderThumbElement.cpp:
(WebCore::RenderSliderContainer::computeLogicalHeight):
* html/shadow/mac/ImageControlsButtonElementMac.cpp:
(WebCore::RenderImageControlsButton::computeLogicalHeight):
* html/shadow/mac/ImageControlsRootElementMac.cpp:
(WebCore::RenderImageControls::computeLogicalHeight):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
(WebCore::RenderBlock::estimateRegionRangeForBoxChild):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::updateLogicalHeight):
(WebCore::RenderBox::computeLogicalHeight):
(WebCore::RenderBox::computePercentageLogicalHeight):
(WebCore::RenderBox::computeReplacedLogicalHeightUsing):
(WebCore::RenderBox::availableLogicalHeightUsing):
* rendering/RenderBox.h:
(WebCore::RenderBox::ComputedMarginValues::ComputedMarginValues): Deleted.
(WebCore::RenderBox::LogicalExtentComputedValues::LogicalExtentComputedValues): Deleted.
* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::mainAxisContentExtent):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::computeLogicalHeight):
* rendering/RenderFlowThread.h:
* rendering/RenderListBox.cpp:
(WebCore::RenderListBox::computeLogicalHeight):
* rendering/RenderListBox.h:
* rendering/RenderMeter.cpp:
(WebCore::RenderMeter::computeLogicalHeight):
* rendering/RenderMeter.h:
* rendering/RenderMultiColumnFlowThread.cpp:
(WebCore::RenderMultiColumnFlowThread::computeLogicalHeight):
* rendering/RenderMultiColumnFlowThread.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::computeLogicalHeight):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::computeLogicalHeight):
* rendering/RenderProgress.h:
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::computeLogicalHeight):
* rendering/RenderTextControl.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::computeLogicalHeight):
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeLogicalHeight):
* rendering/svg/RenderSVGForeignObject.h:

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

3 years agocheck-style should not complain about code in icu directories
dbates@webkit.org [Fri, 16 Dec 2016 03:35:54 +0000 (03:35 +0000)]
check-style should not complain about code in icu directories
https://bugs.webkit.org/show_bug.cgi?id=53929

Reviewed by Darin Adler.

Skip style checking of imported ICU headers to avoid a deluge of style issues
as they do not conform to the WebKit Code Style guideline. We want to preserve
the formatting of these headers so as to make it straightforward to merge
changes to them, if necessary.

* Scripts/webkitpy/style/checker.py:

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

3 years agoMake sure HTML validation bubble's state is updated after layout
cdumez@apple.com [Fri, 16 Dec 2016 03:14:52 +0000 (03:14 +0000)]
Make sure HTML validation bubble's state is updated after layout
https://bugs.webkit.org/show_bug.cgi?id=165922
<rdar://problem/29694730>

Reviewed by Simon Fraser.

Source/WebCore:

Make sure HTML validation bubble's state is updated after layout.
In particular, if the validation bubble's associated element has
moved or is no longer visible, we now hide the bubble.

Tests: fast/forms/validation-bubble-disappears-when-input-detached.html
       fast/forms/validation-bubble-disappears-when-input-moved.html
       fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html

* page/FrameView.cpp:
(WebCore::FrameView::viewportContentsChanged):
* page/Page.cpp:
(WebCore::Page::updateValidationBubbleStateIfNeeded):
* page/Page.h:
* page/ValidationMessageClient.h:

Source/WebKit/mac:

Make sure HTML validation bubble's state is updated after layout.
In particular, if the validation bubble's associated element has
moved or is no longer visible, we now hide the bubble.

* WebCoreSupport/WebValidationMessageClient.h:
* WebCoreSupport/WebValidationMessageClient.mm:
(WebValidationMessageClient::showValidationMessage):
(WebValidationMessageClient::hideValidationMessage):
(WebValidationMessageClient::updateValidationBubbleStateIfNeeded):

Source/WebKit2:

Make sure HTML validation bubble's state is updated after layout.
In particular, if the validation bubble's associated element has
moved or is no longer visible, we now hide the bubble.

* WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
(WebKit::WebValidationMessageClient::showValidationMessage):
(WebKit::WebValidationMessageClient::hideValidationMessage):
(WebKit::WebValidationMessageClient::updateValidationBubbleStateIfNeeded):
* WebProcess/WebCoreSupport/WebValidationMessageClient.h:

LayoutTests:

Add several layout tests to cover this.

* fast/forms/validation-bubble-disappears-when-input-detached-expected.txt: Added.
* fast/forms/validation-bubble-disappears-when-input-detached.html: Added.
* fast/forms/validation-bubble-disappears-when-input-moved-expected.txt: Added.
* fast/forms/validation-bubble-disappears-when-input-moved.html: Added.
* fast/forms/validation-bubble-disappears-when-input-no-longer-visible-expected.txt: Added.
* fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html: Added.

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

3 years ago[WebIDL] Remove use of Dictionary from JSCryptoAlgorithmDictionary
commit-queue@webkit.org [Fri, 16 Dec 2016 03:01:14 +0000 (03:01 +0000)]
[WebIDL] Remove use of Dictionary from JSCryptoAlgorithmDictionary
https://bugs.webkit.org/show_bug.cgi?id=165919

Patch by Sam Weinig <sam@webkit.org> on 2016-12-15
Reviewed by Darin Adler.

* bindings/js/JSCryptoAlgorithmDictionary.cpp:
* bindings/js/JSCryptoAlgorithmDictionary.h:
* bindings/js/JSCryptoOperationData.cpp:
* bindings/js/JSCryptoOperationData.h:
* bindings/js/JSWebKitSubtleCryptoCustom.cpp:
Replace simplistic use of Dictionary with simplistic use of direct JSObject
functions. Also, pass the ExecState by reference.

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

3 years agoFix validation of non-void if blocks with no else
keith_miller@apple.com [Fri, 16 Dec 2016 02:38:27 +0000 (02:38 +0000)]
Fix validation of non-void if blocks with no else
https://bugs.webkit.org/show_bug.cgi?id=165938

Reviewed by Saam Barati.

JSTests:

Add a new failing test and a fix an existing one.

* wasm/function-tests/dead-call.js:
* wasm/function-tests/if-no-else-non-void.js: Added.

Source/JavaScriptCore:

We should not have been allowing non-void if-blocks that don't
have an else. Since this causes a value to be placed on the
stack that only appears under some control flow and not another.

* wasm/WasmValidate.cpp:

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

3 years agoImprove NetworkSession logging
achristensen@apple.com [Fri, 16 Dec 2016 02:25:35 +0000 (02:25 +0000)]
Improve NetworkSession logging
https://bugs.webkit.org/show_bug.cgi?id=165941

Reviewed by Tim Horton.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
(-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
One of the "didReceiveResponse completionHandler (cancel)" messages was wrong,
and other messages could have more useful information without being overwhelming.

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

3 years agoGet rid of HeapRootVisitor and make SlotVisitor less painful to use
fpizlo@apple.com [Fri, 16 Dec 2016 02:16:19 +0000 (02:16 +0000)]
Get rid of HeapRootVisitor and make SlotVisitor less painful to use
https://bugs.webkit.org/show_bug.cgi?id=165911

Reviewed by Geoffrey Garen.
Source/JavaScriptCore:

Previously we had two ways of adding a raw pointer to the GC's mark stack:

- SlotVisitor::appendUnbarrieredXYZ() methods
- HeapRootVisitor::visit() methods

HeapRootVisitor existed only to prevent you from calling its non-WriteBarrier<> methods
unless you had permission. But SlotVisitor would let you do it anyway, because that was
a lot more practical.

I think that we should just have one way to do it. This removes HeapRootVisitor. It
also renames appendUnbarrieredXYZ to appendUnbarriered, and it removes the use of extra
indirection (so you now pass const WriteBarrier<>& instead of WriteBarrier<>*).

* API/JSCallbackObject.h:
(JSC::JSCallbackObjectData::JSPrivatePropertyMap::visitChildren):
* JavaScriptCore.xcodeproj/project.pbxproj:
* Scripts/builtins/builtins_templates.py:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::visitWeakly):
(JSC::CodeBlock::visitChildren):
(JSC::CodeBlock::propagateTransitions):
(JSC::CodeBlock::determineLiveness):
(JSC::CodeBlock::visitOSRExitTargets):
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::stronglyVisitWeakReferences):
* bytecode/DirectEvalCodeCache.cpp:
(JSC::DirectEvalCodeCache::visitAggregate):
* bytecode/InternalFunctionAllocationProfile.h:
(JSC::InternalFunctionAllocationProfile::visitAggregate):
* bytecode/ObjectAllocationProfile.h:
(JSC::ObjectAllocationProfile::visitAggregate):
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::propagateTransitions):
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::visitChildren):
* bytecode/UnlinkedFunctionExecutable.cpp:
(JSC::UnlinkedFunctionExecutable::visitChildren):
* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::visitChildren):
* dfg/DFGDesiredTransitions.cpp:
(JSC::DFG::DesiredTransition::visitChildren):
* dfg/DFGDesiredWeakReferences.cpp:
(JSC::DFG::DesiredWeakReferences::visitChildren):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::visitChildren):
* dfg/DFGPlan.cpp:
(JSC::DFG::Plan::markCodeBlocks):
(JSC::DFG::Plan::checkLivenessAndVisitChildren):
* heap/HandleSet.cpp:
(JSC::HandleSet::visitStrongHandles):
* heap/HandleSet.h:
* heap/HandleStack.cpp:
(JSC::HandleStack::visit):
* heap/HandleStack.h:
* heap/Heap.cpp:
(JSC::Heap::markToFixpoint):
* heap/Heap.h:
* heap/HeapRootVisitor.h: Removed.
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::visitWeakSet):
* heap/LargeAllocation.h:
* heap/MarkedBlock.h:
(JSC::MarkedBlock::Handle::visitWeakSet):
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::visitWeakSets):
* heap/MarkedSpace.h:
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::appendUnbarriered):
* heap/SlotVisitor.h:
* heap/SlotVisitorInlines.h:
(JSC::SlotVisitor::appendUnbarriered):
(JSC::SlotVisitor::append):
(JSC::SlotVisitor::appendHidden):
(JSC::SlotVisitor::appendValues):
(JSC::SlotVisitor::appendValuesHidden):
(JSC::SlotVisitor::appendUnbarrieredPointer): Deleted.
(JSC::SlotVisitor::appendUnbarrieredReadOnlyPointer): Deleted.
(JSC::SlotVisitor::appendUnbarrieredValue): Deleted.
(JSC::SlotVisitor::appendUnbarrieredReadOnlyValue): Deleted.
(JSC::SlotVisitor::appendUnbarrieredWeak): Deleted.
* heap/WeakBlock.cpp:
(JSC::WeakBlock::specializedVisit):
(JSC::WeakBlock::visit):
* heap/WeakBlock.h:
* heap/WeakSet.h:
(JSC::WeakSet::visit):
* interpreter/ShadowChicken.cpp:
(JSC::ShadowChicken::visitChildren):
* jit/GCAwareJITStubRoutine.cpp:
(JSC::MarkingGCAwareJITStubRoutine::markRequiredObjectsInternal):
* jit/PolymorphicCallStubRoutine.cpp:
(JSC::PolymorphicCallStubRoutine::markRequiredObjectsInternal):
* jsc.cpp:
(WTF::Element::visitChildren):
(WTF::ImpureGetter::visitChildren):
(WTF::SimpleObject::visitChildren):
* runtime/AbstractModuleRecord.cpp:
(JSC::AbstractModuleRecord::visitChildren):
* runtime/ArgList.cpp:
(JSC::MarkedArgumentBuffer::markLists):
* runtime/ArgList.h:
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::visitChildren):
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::visitChildren):
* runtime/EvalExecutable.cpp:
(JSC::EvalExecutable::visitChildren):
* runtime/Exception.cpp:
(JSC::Exception::visitChildren):
* runtime/FunctionExecutable.cpp:
(JSC::FunctionExecutable::visitChildren):
* runtime/FunctionRareData.cpp:
(JSC::FunctionRareData::visitChildren):
* runtime/GetterSetter.cpp:
(JSC::GetterSetter::visitChildren):
* runtime/HashMapImpl.cpp:
(JSC::HashMapBucket<Data>::visitChildren):
(JSC::HashMapImpl<HashMapBucket>::visitChildren):
* runtime/InferredTypeTable.cpp:
(JSC::InferredTypeTable::visitChildren):
* runtime/InternalFunction.cpp:
(JSC::InternalFunction::visitChildren):
* runtime/IntlCollator.cpp:
(JSC::IntlCollator::visitChildren):
* runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructor::visitChildren):
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::visitChildren):
* runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructor::visitChildren):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::visitChildren):
* runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructor::visitChildren):
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::visitChildren):
* runtime/JSCallee.cpp:
(JSC::JSCallee::visitChildren):
* runtime/JSCellInlines.h:
(JSC::JSCell::visitChildren):
* runtime/JSCustomGetterSetterFunction.cpp:
(JSC::JSCustomGetterSetterFunction::visitChildren):
* runtime/JSFunction.cpp:
(JSC::JSFunction::visitChildren):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::visitChildren):
* runtime/JSMapIterator.cpp:
(JSC::JSMapIterator::visitChildren):
* runtime/JSModuleEnvironment.cpp:
(JSC::JSModuleEnvironment::visitChildren):
* runtime/JSModuleNamespaceObject.cpp:
(JSC::JSModuleNamespaceObject::visitChildren):
* runtime/JSModuleRecord.cpp:
(JSC::JSModuleRecord::visitChildren):
* runtime/JSNativeStdFunction.cpp:
(JSC::JSNativeStdFunction::visitChildren):
* runtime/JSObject.cpp:
(JSC::JSObject::visitButterflyImpl):
* runtime/JSPromiseDeferred.cpp:
(JSC::JSPromiseDeferred::visitChildren):
* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::visitChildren):
* runtime/JSPropertyNameIterator.cpp:
(JSC::JSPropertyNameIterator::visitChildren):
* runtime/JSProxy.cpp:
(JSC::JSProxy::visitChildren):
* runtime/JSScope.cpp:
(JSC::JSScope::visitChildren):
* runtime/JSSegmentedVariableObject.cpp:
(JSC::JSSegmentedVariableObject::visitChildren):
* runtime/JSSetIterator.cpp:
(JSC::JSSetIterator::visitChildren):
* runtime/JSString.cpp:
(JSC::JSRopeString::visitFibers):
* runtime/JSSymbolTableObject.cpp:
(JSC::JSSymbolTableObject::visitChildren):
* runtime/JSWeakMap.cpp:
(JSC::JSWeakMap::visitChildren):
* runtime/JSWeakSet.cpp:
(JSC::JSWeakSet::visitChildren):
* runtime/JSWithScope.cpp:
(JSC::JSWithScope::visitChildren):
* runtime/JSWrapperObject.cpp:
(JSC::JSWrapperObject::visitChildren):
* runtime/LazyClassStructure.cpp:
(JSC::LazyClassStructure::visit):
* runtime/LazyPropertyInlines.h:
(JSC::ElementType>::visit):
* runtime/MapBase.cpp:
(JSC::MapBase<HashMapBucketType>::visitChildren):
* runtime/ModuleProgramExecutable.cpp:
(JSC::ModuleProgramExecutable::visitChildren):
* runtime/NativeErrorConstructor.cpp:
(JSC::NativeErrorConstructor::visitChildren):
* runtime/ProgramExecutable.cpp:
(JSC::ProgramExecutable::visitChildren):
* runtime/ProxyObject.cpp:
(JSC::ProxyObject::visitChildren):
* runtime/ProxyRevoke.cpp:
(JSC::ProxyRevoke::visitChildren):
* runtime/RegExpCachedResult.cpp:
(JSC::RegExpCachedResult::visitChildren):
* runtime/RegExpObject.cpp:
(JSC::RegExpObject::visitChildren):
* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::visitChildren):
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::visit):
* runtime/ScopedArguments.cpp:
(JSC::ScopedArguments::visitChildren):
* runtime/SmallStrings.cpp:
(JSC::SmallStrings::visitStrongReferences):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::visitChildren):
* runtime/Structure.cpp:
(JSC::Structure::visitChildren):
(JSC::Structure::markIfCheap):
* runtime/StructureChain.cpp:
(JSC::StructureChain::visitChildren):
* runtime/StructureRareData.cpp:
(JSC::StructureRareData::visitChildren):
* runtime/SymbolTable.cpp:
(JSC::SymbolTable::visitChildren):
* runtime/TypeProfilerLog.cpp:
(JSC::TypeProfilerLog::visit):
* runtime/WeakMapData.cpp:
(JSC::WeakMapData::DeadKeyCleaner::visitWeakReferences):
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::visitChildren):
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::visitChildren):
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::visitChildren):
* wasm/js/WebAssemblyFunction.cpp:
(JSC::WebAssemblyFunction::visitChildren):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::visitChildren):

Source/WebCore:

No new tests because no new behavior.

This updates WebCore code to new JSC API.

* bindings/js/JSDOMBinding.cpp:
(WebCore::DOMConstructorJSBuiltinObject::visitChildren):
* bindings/js/JSDOMGlobalObject.cpp:
(WebCore::JSDOMGlobalObject::visitChildren):
* bindings/js/JSDOMPromise.h:
(WebCore::DeferredPromise::visitAggregate):
* bindings/js/JSEventListener.cpp:
(WebCore::JSEventListener::visitJSFunction):
* bindings/js/JSWorkerGlobalScopeBase.cpp:
(WebCore::JSWorkerGlobalScopeBase::visitChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):

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

3 years agoSort Xcode project files
mmaxfield@apple.com [Fri, 16 Dec 2016 01:54:58 +0000 (01:54 +0000)]
Sort Xcode project files
https://bugs.webkit.org/show_bug.cgi?id=165937

Reviewed by Simon Fraser.

Source/bmalloc:

* bmalloc.xcodeproj/project.pbxproj:

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/ThirdParty/ANGLE:

* ANGLE.xcodeproj/project.pbxproj:

Source/WebCore:

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:

Source/WebKit2:

* WebKit2.xcodeproj/project.pbxproj:

Source/WTF:

* WTF.xcodeproj/project.pbxproj:

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

3 years agoMove charCode / keyCode / which attributes from UIEvent to KeyboardEvent
cdumez@apple.com [Fri, 16 Dec 2016 01:29:23 +0000 (01:29 +0000)]
Move charCode / keyCode / which attributes from UIEvent to KeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=165904

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

* web-platform-tests/dom/events/Event-subclasses-constructors-expected.txt:

Source/WebCore:

Move 'charCode' / 'keyCode' attributes from UIEvent to KeyboardEvent and add
'which' to KeyboardEvent to match the specification:
- https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent

We keep a 'which' attribute on UIEvent even though the specification does
not say we should because Firefox and Chrome have 'which' on UIEvent still.

Specification:
- 'charCode' / 'keyCode' / 'which' on KeyboardEvent only

Firefox:
- 'charCode' / 'keyCode' on KeyboardEvent only
- 'which' on UIEvent only

Chrome:
- 'charCode' / 'keyCode' / 'which' on KeyboardEvent
- 'which' on UIEvent as well

Old WebKit behavior:
- 'charCode' / 'keyCode' / 'which' on UIEvent only

New WebKit behavior:
- 'charCode' / 'keyCode' / 'which' on KeyboardEvent
- 'which' on UIEvent as well

Our new behavior is identical to Chrome, much closer to the specification,
and closer to Firefox as well.

No new tests, updated / rebaselined existing tests.

* dom/KeyboardEvent.cpp:
(WebCore::KeyboardEvent::KeyboardEvent):
(WebCore::KeyboardEvent::keyCode):
(WebCore::KeyboardEvent::charCode):
(WebCore::KeyboardEvent::which):
* dom/KeyboardEvent.h:
* dom/KeyboardEvent.idl:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::which):
* dom/UIEvent.cpp:
* dom/UIEvent.h:
* dom/UIEvent.idl:

Source/WebKit/mac:

Update ObjC bindings so they keep building.

* DOM/DOMUIEvent.mm:
(-[DOMUIEvent keyCode]):
(-[DOMUIEvent charCode]):

LayoutTests:

Extend existing testing.

* fast/events/arrow-keys-on-body-expected.txt:
* fast/events/arrow-keys-on-body.html:
* fast/events/key-events-in-input-button-expected.txt:
* fast/events/key-events-in-input-button.html:
* fast/events/key-events-in-input-text-expected.txt:
* fast/events/key-events-in-input-text.html:

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

3 years agoMove JSC testers from Yosemite to Sierra
ap@apple.com [Fri, 16 Dec 2016 01:28:57 +0000 (01:28 +0000)]
Move JSC testers from Yosemite to Sierra
https://bugs.webkit.org/show_bug.cgi?id=165925

Reviewed by Lucas Forschler.

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

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

3 years agoIndexedDB: Add an "IDBCursorRecord" struct.
beidson@apple.com [Fri, 16 Dec 2016 01:20:24 +0000 (01:20 +0000)]
IndexedDB: Add an "IDBCursorRecord" struct.
https://bugs.webkit.org/show_bug.cgi?id=165929

Reviewed by Alex Christensen.

No new tests (Refactor, no behavior change).

* Modules/indexeddb/server/SQLiteIDBCursor.cpp:
(WebCore::IDBServer::SQLiteIDBCursor::currentData):
(WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
(WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
(WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
(WebCore::IDBServer::SQLiteIDBCursor::iterate):

* Modules/indexeddb/server/SQLiteIDBCursor.h:
(WebCore::IDBServer::SQLiteIDBCursor::currentKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
(WebCore::IDBServer::SQLiteIDBCursor::currentValue):

* Modules/indexeddb/shared/IDBCursorRecord.h: Added.
(WebCore::IDBCursorRecord::encode):
(WebCore::IDBCursorRecord::decode):

* WebCore.xcodeproj/project.pbxproj:

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

3 years agoAdd coordinate space to event streams and streamline tests
commit-queue@webkit.org [Fri, 16 Dec 2016 01:14:40 +0000 (01:14 +0000)]
Add coordinate space to event streams and streamline tests
https://bugs.webkit.org/show_bug.cgi?id=165119

Patch by Megan Gardner <megan_gardner@apple.com> on 2016-12-15
Reviewed by Simon Fraser.

Tools:

Update event streams to allow for both content and global coordinate space.
Update example script to more accurately show all the available options.

* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::convertCoordinates):
(WTR::UIScriptController::sendEventStream):

LayoutTests:

Streamline tests. Make them more readable and only use one function for drags.
Update for new content coordinate space.

* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html:
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html:

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

3 years agoWasm should not create empty unlinked callsites
keith_miller@apple.com [Fri, 16 Dec 2016 01:06:02 +0000 (01:06 +0000)]
Wasm should not create empty unlinked callsites
https://bugs.webkit.org/show_bug.cgi?id=165933

Reviewed by Mark Lam.

JSTests:

* wasm/function-tests/dead-call.js: Added.

Source/JavaScriptCore:

Wasm would create holes in the unlinked callsite vector if B3 was able to
eliminate the callsite.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addCall):

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

3 years agoRefactor Document::suspend/resume
krollin@apple.com [Fri, 16 Dec 2016 01:04:07 +0000 (01:04 +0000)]
Refactor Document::suspend/resume
https://bugs.webkit.org/show_bug.cgi?id=165921

Reviewed by Chris Dumez.

Update Document::suspend to call Document::suspendScheduledTasks
rather than duplicating the latter's code within itself. Similar
treatment of Document::resume and Document::resumeScheduledTasks.

No new tests -- no new functionality, just refactoring existing code.

* dom/Document.cpp:
(WebCore::Document::suspend):
(WebCore::Document::resume):

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

3 years agoMarking js/dom/global-constructors-attributes.html as failing on ElCapitan WK1.
ryanhaddad@apple.com [Fri, 16 Dec 2016 01:02:49 +0000 (01:02 +0000)]
Marking js/dom/global-constructors-attributes.html as failing on ElCapitan WK1.
https://bugs.webkit.org/show_bug.cgi?id=165934

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agofast/visual-viewport/ios/zoomed-focus-in-fixed.html always times out
simon.fraser@apple.com [Fri, 16 Dec 2016 01:00:12 +0000 (01:00 +0000)]
fast/visual-viewport/ios/zoomed-focus-in-fixed.html always times out

Skip this test, which relies on touch events.

* platform/ios-simulator/TestExpectations:

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

3 years agoFix flakiness of fast/visual-viewport/ios/zoomed-focus-in-fixed.html
simon.fraser@apple.com [Fri, 16 Dec 2016 00:46:27 +0000 (00:46 +0000)]
Fix flakiness of fast/visual-viewport/ios/zoomed-focus-in-fixed.html
https://bugs.webkit.org/show_bug.cgi?id=165930

Reviewed by Tim Horton.

The test zooms when focussing the input, which completes after the keyboard shows,
so we need to wait for zooming to finish using the uiController.didEndZoomingCallback.

* fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt:
* fast/visual-viewport/ios/zoomed-focus-in-fixed.html:

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

3 years agoRemove flex and bison build dependencies; commit generated XPath parser
achristensen@apple.com [Thu, 15 Dec 2016 23:53:24 +0000 (23:53 +0000)]
Remove flex and bison build dependencies; commit generated XPath parser
https://bugs.webkit.org/show_bug.cgi?id=165783

Reviewed by Brent Fulgham.

.:

* Source/cmake/WebKitCommon.cmake:
* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

flex and bison are annoying to install and use, especially on Windows.
Since only XPathGrammar uses them and that's not actively developed, let's just check in the one generated file
and make building WebKit easier forever!

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* css/makegrammar.pl: Removed.
* xml/XPathGrammar.cpp: Added.
(xpathyylex):
(xpathyyerror):
(yysyntax_error):
* xml/XPathGrammar.h: Added.
* xml/XPathGrammar.y: Rename TEXT to TEXT_ to fix a build error on Windows.  TEXT is already defined.

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

3 years agoWeb Inspector: console search bar jumps, behaves poorly at narrow widths
mattbaker@apple.com [Thu, 15 Dec 2016 23:52:42 +0000 (23:52 +0000)]
Web Inspector: console search bar jumps, behaves poorly at narrow widths
https://bugs.webkit.org/show_bug.cgi?id=164047
<rdar://problem/29055582>

Reviewed by Timothy Hatcher.

At narrow widths the find banner behaves poorly in the split console
toolbar. It should work like the main content browser, appearing below
the toolbar when Command-F is pressed and either the split console or
quick console prompt has the focus.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
Enable split content browser find banner.

* UserInterface/Views/ContentBrowser.js:
(WebInspector.ContentBrowser.prototype.showFindBanner):
Check for custom find banner support at runtime.
(WebInspector.ContentBrowser.prototype._findBannerDidShow):
(WebInspector.ContentBrowser.prototype._findBannerDidHide):
Refresh search results when banner is shown/hidden, instead of relying
on toggling the "showing-find-banner" class name for everything.

(WebInspector.ContentBrowser.prototype.handleFindEvent): Deleted.
Renamed `showFindBanner`.

* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.prototype.get supportsCustomFindBanner):
(WebInspector.ContentView.prototype.showCustomFindBanner):
Custom find banner support (used by LogContentView).

* UserInterface/Views/LogContentView.js:
(WebInspector.LogContentView):
(WebInspector.LogContentView.prototype.get supportsSearch):
(WebInspector.LogContentView.prototype.get numberOfSearchResults):
(WebInspector.LogContentView.prototype.get hasPerformedSearch):
Cleanup.
(WebInspector.LogContentView.prototype.get supportsCustomFindBanner):
Use toolbar item find banner when showing Console tab.
(WebInspector.LogContentView.prototype.findBannerRevealPreviousResult):
(WebInspector.LogContentView.prototype.findBannerRevealNextResult):
(WebInspector.LogContentView.prototype._isMessageVisible):
(WebInspector.LogContentView.prototype._visibleMessageElements):
(WebInspector.LogContentView.prototype._logCleared):
(WebInspector.LogContentView.prototype._filterMessageElements):
(WebInspector.LogContentView.prototype.findBannerPerformSearch):
(WebInspector.LogContentView.prototype.findBannerSearchCleared):
(WebInspector.LogContentView.prototype.performSearch):
Support both the standard and custom (toolbar item) find banners.
(WebInspector.LogContentView.prototype.searchCleared):
Refresh search results.
(WebInspector.LogContentView.prototype._highlightRanges):
Correct spelling: _selectedSearchMathIsValid -> _selectedSearchMatchIsValid.
(WebInspector.LogContentView.prototype.get searchInProgress): Deleted.
Override ContentView.prototype.hasPerformedSearch instead.
(WebInspector.LogContentView.prototype.handleFindEvent): Deleted.
Replaced by `showCustomFindBanner`.
(WebInspector.LogContentView.prototype.highlightPreviousSearchMatch): Deleted.
Absorbed by findBannerRevealPreviousResult.
(WebInspector.LogContentView.prototype.highlightNextSearchMatch): Deleted.
Absorbed by findBannerRevealNextResult.
(WebInspector.LogContentView.prototype._performSearch): Deleted.
Override ContentView.prototype.performSearch instead.

* UserInterface/Views/Main.css:
(#split-content-browser > .navigation-bar :matches(.find-banner, .find-banner + .divider)):
Hide the toolbar banner and divider.

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

3 years agoEnhance some of the logging statements just added for IndexedDB Operation scheduling.
beidson@apple.com [Thu, 15 Dec 2016 23:42:54 +0000 (23:42 +0000)]
Enhance some of the logging statements just added for IndexedDB Operation scheduling.

Rubberstamped by Tim Horton.

No new tests (No behavior change).

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestPutOrAdd):

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString):

* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString):

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

3 years agoWebAssembly: improve compilation error messages
jfbastien@apple.com [Thu, 15 Dec 2016 23:42:19 +0000 (23:42 +0000)]
WebAssembly: improve compilation error messages
https://bugs.webkit.org/show_bug.cgi?id=163919

Reviewed by Saam Barati.

JSTests:

Update error messages in these tests.
Use the assert.throws facility in many of them which weren't already.

* wasm/js-api/element.js:
(assert.throws.new.WebAssembly.Module.builder.WebAssembly):
(assert.throws):
* wasm/js-api/global-error.js:
(assert.throws.new.WebAssembly.Module.bin):
(assert.throws):
(new.Number):
* wasm/js-api/table.js:
(assert.throws.new.WebAssembly.Module.builder.WebAssembly):
(assert.throws):
(assertBadTableImport):
* wasm/js-api/test_Data.js:
(DataSectionWithoutMemory):
* wasm/js-api/test_Start.js:
(InvalidStartFunctionIndex):
* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties.switch):

Source/JavaScriptCore:

The error handling messages were underwhelming because most
locations merely returned `false` on failure. This patch uses
std::expected to denote that failure isn't expected. Doing this
makes it almost impossible to mess up the code: either a function
returns a result (or a partial result for internal helpers) or an
error. We're not synchronizing the error string with the m_failed
bool anymore, and the caller will abort if they try to get a
result but the outcome was an error.

This also shortens the code significantly using macros, while also
judiciously preventing inlining of error handling code and biasing
towards success using UNLIKELY. This means that the generated code
should be more efficient (no string formatting on success, and
regalloc can avoid these unlikely paths).

The patch adds a few missing checks as well, especially related to
count limits and memory allocation failure.

As a follow-up I'd like to improve WTF::makeString further, so it
does coercions to string and understands ADL as I did in this
patch.

* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::fail):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmFormat.h:
(JSC::Wasm::isValidExternalKind):
(JSC::Wasm::makeString):
* wasm/WasmFunctionParser.h:
* wasm/WasmModuleParser.cpp:
* wasm/WasmModuleParser.h:
* wasm/WasmParser.h:
(JSC::Wasm::FailureHelper::makeString):
(JSC::Wasm::Parser::fail):
(JSC::Wasm::Parser<SuccessType>::Parser):
(JSC::Wasm::Parser<SuccessType>::consumeCharacter):
(JSC::Wasm::Parser<SuccessType>::consumeString):
(JSC::Wasm::Parser<SuccessType>::consumeUTF8String):
(JSC::Wasm::Parser<SuccessType>::parseVarUInt32):
(JSC::Wasm::Parser<SuccessType>::parseVarUInt64):
(JSC::Wasm::Parser<SuccessType>::parseVarInt32):
(JSC::Wasm::Parser<SuccessType>::parseVarInt64):
(JSC::Wasm::Parser<SuccessType>::parseUInt32):
(JSC::Wasm::Parser<SuccessType>::parseUInt64):
(JSC::Wasm::Parser<SuccessType>::parseUInt8):
(JSC::Wasm::Parser<SuccessType>::parseInt7):
(JSC::Wasm::Parser<SuccessType>::parseUInt7):
(JSC::Wasm::Parser<SuccessType>::parseVarUInt1):
(JSC::Wasm::Parser<SuccessType>::parseResultType):
(JSC::Wasm::Parser<SuccessType>::parseValueType):
(JSC::Wasm::Parser<SuccessType>::parseExternalKind):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::run):
* wasm/WasmSections.h:
(JSC::Wasm::isValidSection):
(JSC::Wasm::validateOrder):
(JSC::Wasm::makeString):
* wasm/WasmValidate.cpp:
(JSC::Wasm::Validate::fail):
(JSC::Wasm::Validate::addUnreachable):
(JSC::Wasm::validateFunction):
* wasm/WasmValidate.h:
* wasm/generateWasmB3IRGeneratorInlinesHeader.py:
* wasm/generateWasmOpsHeader.py:
* wasm/generateWasmValidateInlinesHeader.py:
(loadMacro):
(storeMacro):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):

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

3 years agoAdd more mach_msg logging instrumentation
andersca@apple.com [Thu, 15 Dec 2016 22:48:10 +0000 (22:48 +0000)]
Add more mach_msg logging instrumentation
https://bugs.webkit.org/show_bug.cgi?id=165914

Reviewed by Darin Adler.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::sendMessage):
(IPC::Connection::sendOutgoingMessage):
* Platform/IPC/mac/MachMessage.h:
(IPC::MachMessage::messageName):
(IPC::MachMessage::setMessageName):

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

3 years ago[Cocoa] Implement font-synthesis: small-caps
mmaxfield@apple.com [Thu, 15 Dec 2016 22:12:21 +0000 (22:12 +0000)]
[Cocoa] Implement font-synthesis: small-caps
https://bugs.webkit.org/show_bug.cgi?id=165892

Reviewed by David Hyatt.

Source/WebCore:

The CSS Fonts level 4 spec adds a new value to the "font-synthesis"
property which controls whether or not small-caps is allowed to be
synthesized. Luckily, we already have an implementation of this
straightforward, so the implementation is quite simple.

Tests: css3/font-synthesis-small-caps.html
       fast/text/font-synthesis-parsing.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontSynthesisFromStyle):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontSynthesis):
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::FontDescription):
* platform/graphics/FontDescription.h:
(WebCore::FontCascadeDescription::initialFontSynthesis):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::shouldSynthesize):
(WebCore::ComplexTextController::collectComplexTextRuns):

LayoutTests:

* fast/text/font-synthesis-parsing-expected.txt: Added.
* fast/text/font-synthesis-parsing.html: Added.
* css3/font-synthesis-small-caps-expected.html: Added.
* css3/font-synthesis-small-caps.html: Added.
* fast/css/getComputedStyle/computed-style-expected.txt:
* fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
* fast/css3-text/font-synthesis-parse-expected.txt:
* fast/css3-text/font-synthesis-parse.html:
* svg/css/getComputedStyle-basic-expected.txt:

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

3 years agoJSTests:
jfbastien@apple.com [Thu, 15 Dec 2016 22:08:38 +0000 (22:08 +0000)]
JSTests:
WebAssembly API: improve data section errors
https://bugs.webkit.org/show_bug.cgi?id=165733

Reviewed by Keith Miller.

* wasm/js-api/element-data.js: Added.
(ElementBeforeData.set const):
(ElementBeforeData): check the order of initialization, which is observable on failure
* wasm/js-api/test_Data.js:
(DataSectionWithoutMemory):
(DataSectionOffTheEnd): Deleted.
(DataSectionPartlyOffTheEnd): Deleted.
(DataSectionEmptyOffTheEnd): Deleted.
(DataSectionSeenByStart): Deleted.

Source/JavaScriptCore:
WebAssembly API: improve data section errors, initialize after Element
https://bugs.webkit.org/show_bug.cgi?id=165733

Reviewed by Keith Miller.

* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseData): Data section without Memory section or import is a validation error
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::dataSegmentFail):
(JSC::WebAssemblyModuleRecord::evaluate): tighten checks (though the spec isn't fully baked), and move after Element initialization

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

3 years agoAdd a new Logging Channel for IndexedDB Operation scheduling.
beidson@apple.com [Thu, 15 Dec 2016 22:08:26 +0000 (22:08 +0000)]
Add a new Logging Channel for IndexedDB Operation scheduling.
https://bugs.webkit.org/show_bug.cgi?id=165912

Reviewed by Alex Christensen.

No new tests (No behavior change).

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::transaction):

* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::openInternal):
(WebCore::IDBFactory::deleteDatabase):

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::internalAbort):
(WebCore::IDBTransaction::commit):
(WebCore::IDBTransaction::createObjectStore):
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::createIndex):
(WebCore::IDBTransaction::renameIndex):
(WebCore::IDBTransaction::doRequestOpenCursor):
(WebCore::IDBTransaction::iterateCursor):
(WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
(WebCore::IDBTransaction::requestGetAllIndexRecords):
(WebCore::IDBTransaction::requestGetRecord):
(WebCore::IDBTransaction::requestIndexRecord):
(WebCore::IDBTransaction::requestCount):
(WebCore::IDBTransaction::requestDeleteRecord):
(WebCore::IDBTransaction::requestClearObjectStore):
(WebCore::IDBTransaction::requestPutOrAdd):
(WebCore::IDBTransaction::deleteObjectStore):
(WebCore::IDBTransaction::deleteIndex):

* Modules/indexeddb/shared/IDBCursorInfo.cpp:
(WebCore::IDBCursorInfo::loggingString):
* Modules/indexeddb/shared/IDBCursorInfo.h:

* Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
(WebCore::IDBGetAllRecordsData::loggingString):
* Modules/indexeddb/shared/IDBGetAllRecordsData.h:

* Modules/indexeddb/shared/IDBGetRecordData.cpp:
(WebCore::IDBGetRecordData::loggingString):
* Modules/indexeddb/shared/IDBGetRecordData.h:

* Modules/indexeddb/shared/IDBIndexInfo.cpp:
(WebCore::IDBIndexInfo::condensedLoggingString):
* Modules/indexeddb/shared/IDBIndexInfo.h:

* Modules/indexeddb/shared/IDBIterateCursorData.cpp:
(WebCore::IDBIterateCursorData::loggingString):
* Modules/indexeddb/shared/IDBIterateCursorData.h:

* Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
(WebCore::IDBObjectStoreInfo::condensedLoggingString):
* Modules/indexeddb/shared/IDBObjectStoreInfo.h:

* platform/Logging.h:

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

3 years agoTurn on WebAssembly by default
keith_miller@apple.com [Thu, 15 Dec 2016 22:07:10 +0000 (22:07 +0000)]
Turn on WebAssembly by default
https://bugs.webkit.org/show_bug.cgi?id=165918

Reviewed by Saam Barati.

* runtime/Options.h:

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

3 years agoAdded missing override and final specifiers
annulen@yandex.ru [Thu, 15 Dec 2016 21:26:08 +0000 (21:26 +0000)]
Added missing override and final specifiers
https://bugs.webkit.org/show_bug.cgi?id=165903

Reviewed by Darin Adler.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
* jsc.cpp:
* parser/Nodes.h:

Source/WebCore:

No new tests needed.

* Modules/mediastream/OverconstrainedErrorEvent.h:
* bindings/js/JSCallbackData.h:
* bindings/js/JSCustomXPathNSResolver.h:
* bindings/js/JSErrorHandler.h:
* css/StyleRuleImport.h:
* dom/SecurityPolicyViolationEvent.h:
* editing/CreateLinkCommand.h:
* editing/DeleteSelectionCommand.h:
* editing/DictationCommand.h:
* editing/Editor.cpp:
* editing/FormatBlockCommand.h:
* editing/IndentOutdentCommand.h:
* editing/InsertLineBreakCommand.h:
* editing/InsertParagraphSeparatorCommand.h:
* editing/ModifySelectionListLevel.h:
* editing/MoveSelectionCommand.h:
* editing/RemoveFormatCommand.h:
* editing/RemoveNodePreservingChildrenCommand.h:
* editing/ReplaceSelectionCommand.h:
* editing/SimplifyMarkupCommand.h:
* editing/SplitTextNodeContainingElementCommand.h:
* editing/UnlinkCommand.h:
* fileapi/FileReaderLoader.h:
* html/canvas/ANGLEInstancedArrays.h:
* html/canvas/WebGLVertexArrayObjectBase.h:
* loader/SinkDocument.h:
* loader/archive/mhtml/MHTMLArchive.h:
* page/animation/CSSPropertyAnimation.cpp:
* platform/audio/MultiChannelResampler.cpp:
* platform/audio/SincResampler.cpp:
* platform/audio/gstreamer/AudioDestinationGStreamer.h:
* platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
* platform/graphics/TextTrackRepresentation.cpp:
* platform/graphics/displaylists/DisplayListItems.h:
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.h:
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEDiffuseLighting.h:
* platform/graphics/filters/FEDropShadow.h:
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMerge.h:
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FESpecularLighting.h:
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/SourceAlpha.h:
* platform/graphics/filters/SourceGraphic.h:
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/Extensions3DOpenGLCommon.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
* platform/mock/GeolocationClientMock.h:
* platform/text/TextCodecICU.h:
* platform/text/TextCodecLatin1.h:
* platform/text/TextCodecUTF16.h:
* platform/text/TextCodecUTF8.h:
* platform/text/TextCodecUserDefined.h:
* rendering/RenderFullScreen.cpp:
* storage/StorageEvent.h:
* svg/properties/SVGListProperty.h:
* svg/properties/SVGStaticListPropertyTearOff.h:
* svg/properties/SVGStaticPropertyTearOff.h:
* xml/NativeXPathNSResolver.h:
* xml/XMLHttpRequestProgressEvent.h:
* xml/XMLHttpRequestProgressEventThrottle.h:
* xml/XPathVariableReference.h:
* xml/XSLImportRule.h:

Source/WebKit2:

* UIProcess/API/gtk/WebKitGeolocationProvider.h:
* UIProcess/WebFormSubmissionListenerProxy.h:
* UIProcess/WebFramePolicyListenerProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/InjectedBundle/API/gtk/DOM/GObjectXPathNSResolver.h:
* WebProcess/MediaCache/WebMediaKeyStorageManager.h:
* WebProcess/Plugins/Netscape/NPRuntimeObjectMap.h:
* WebProcess/WebCoreSupport/WebPlugInClient.h:
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
* WebProcess/WebPage/FindController.h:

Source/WTF:

* wtf/RunLoop.h:

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

3 years agoInline Document::existingAXObjectCache()
cdumez@apple.com [Thu, 15 Dec 2016 21:08:40 +0000 (21:08 +0000)]
Inline Document::existingAXObjectCache()
https://bugs.webkit.org/show_bug.cgi?id=165906

Reviewed by Darin Adler.

Inline Document::existingAXObjectCache() to avoid paying function call
cost in the common case where AX is disabled.

* dom/Document.cpp:
(WebCore::Document::existingAXObjectCacheSlow):
(WebCore::Document::existingAXObjectCache): Deleted.
* dom/Document.h:
(WebCore::Document::existingAXObjectCache):

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

3 years agoHarden JSObject::getOwnPropertyDescriptor()
cdumez@apple.com [Thu, 15 Dec 2016 20:55:18 +0000 (20:55 +0000)]
Harden JSObject::getOwnPropertyDescriptor()
https://bugs.webkit.org/show_bug.cgi?id=165908

Reviewed by Geoffrey Garen.

* runtime/JSObject.cpp:
(JSC::JSObject::getOwnPropertyDescriptor):

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

3 years agoRebaseline bindings tests after r209864.
ryanhaddad@apple.com [Thu, 15 Dec 2016 20:18:25 +0000 (20:18 +0000)]
Rebaseline bindings tests after r209864.

Unreviewed test gardening.

* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):

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

3 years ago[iOS WK2] Don't disable position:fixed when a form element has focus
simon.fraser@apple.com [Thu, 15 Dec 2016 19:19:51 +0000 (19:19 +0000)]
[iOS WK2] Don't disable position:fixed when a form element has focus
https://bugs.webkit.org/show_bug.cgi?id=165891
rdar://problem/29271694

Reviewed by Wenson Hsieh.

Source/WebKit2:

Before visual viewports, we had to lay out position:fixed relative to the document rect (effectively
disabling position:fixed) when a form element was focused, to ensure that we could scroll to inputs
inside position:Fixed.

When visual viewports are enabled, we can do a better job of this, and keep position:fixed active.

Test: fast/visual-viewport/ios/zoomed-focus-in-fixed.html

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Soon this will use
insideFixed to have better scroll-into-view behavior.
(-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/ios/WKContentView.h:
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _zoomToFocusRect:selectionRect:insideFixed:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
(-[WKContentView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]): Deleted.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _displayFormNodeInputView]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::computeCustomFixedPositionRect): Don't fall back to using the documentRect as the fixed
position rect if visual viewports are enabled.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getAssistedNodeInformation): Don't reset the customtFixedPositionRect around computing element
coordinates if visual viewports are enabled.

LayoutTests:

* TestExpectations:
* fast/visual-viewport/ios/zoomed-focus-in-fixed-expected.txt: Added.
* fast/visual-viewport/ios/zoomed-focus-in-fixed.html: Added.
* platform/ios-simulator-wk2/TestExpectations:

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