WebKit-https.git
3 years agoSVG should not paint selection within a mask
dino@apple.com [Fri, 21 Oct 2016 19:10:41 +0000 (19:10 +0000)]
SVG should not paint selection within a mask
https://bugs.webkit.org/show_bug.cgi?id=163772
<rdar://problem/28705129>

Reviewed by Simon Fraser.

Source/WebCore:

When masking content, we shouldn't paint the text
selection as we are rendering into the masking
offscreen buffer.

Test: svg/masking/mask-should-not-paint-selection.html

* rendering/PaintPhase.h: Add a new behavior - PaintBehaviorSkipSelectionHighlight.
* rendering/svg/SVGInlineTextBox.cpp:
(WebCore::SVGInlineTextBox::paint): Don't update the selectionStyle if
PaintBehaviorSkipSelectionHighlight is true.
* rendering/svg/SVGRenderingContext.cpp:
(WebCore::SVGRenderingContext::renderSubtreeToImageBuffer): Add PaintBehaviorSkipSelectionHighlight
to the PaintInfo.

LayoutTests:

* svg/masking/mask-should-not-paint-selection-expected.html: Added.
* svg/masking/mask-should-not-paint-selection.html: Added.

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

3 years agoWebKitTestRunnerApp packages .idl file
jbedard@apple.com [Fri, 21 Oct 2016 18:58:44 +0000 (18:58 +0000)]
WebKitTestRunnerApp packages .idl file
https://bugs.webkit.org/show_bug.cgi?id=163788

Reviewed by Darin Adler.

* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: Removed .idl file from app package, removed bad reference to app icon.

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

3 years ago[Web IDL] MediaControlsHost has invalid operation overloads
cdumez@apple.com [Fri, 21 Oct 2016 18:53:05 +0000 (18:53 +0000)]
[Web IDL] MediaControlsHost has invalid operation overloads
https://bugs.webkit.org/show_bug.cgi?id=163793

Reviewed by Darin Adler.

MediaControlsHost has invalid operation overloads:
- sortedTrackListForMenu()
- displayNameForTrack()

The parameter is nullable for both overloads which is not valid IDL.

- sortedTrackListForMenu(): The parameter is no longer nullable. This is a minor
  behavior change and it should be safe since this is Apple-specific and only
  called from mediaControlsApple.js which uses HTMLMediaElement.videoTracks and
  HTMLMediaElement.audioTracks as input, both of which are not nullable.
  Note that we could have also kept one of the parameters as nullable to not
  change behavior but allowing null does not seem useful here.
- displayNameForTrack(): Use a union instead of overloading, no behavior change.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::sortedTrackListForMenu):
(WebCore::MediaControlsHost::displayNameForTrack):
* Modules/mediacontrols/MediaControlsHost.h:
* Modules/mediacontrols/MediaControlsHost.idl:

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

3 years agoImplement basic pointer lock behavior for WebKit and WebKit2.
commit-queue@webkit.org [Fri, 21 Oct 2016 18:45:39 +0000 (18:45 +0000)]
Implement basic pointer lock behavior for WebKit and WebKit2.
https://bugs.webkit.org/show_bug.cgi?id=162745

Patch by Jeremy Jones <jeremyj@apple.com> on 2016-10-21
Reviewed by Simon Fraser.

Source/WebCore:

When ENABLE_POINTER_LOCK is enabled, these tests now pass with DumpRenderTree.
LayoutTests/pointer-lock/lock-already-locked.html
LayoutTests/pointer-lock/lock-element-not-in-dom.html
LayoutTests/pointer-lock/locked-element-iframe-removed-from-dom.html
LayoutTests/pointer-lock/mouse-event-api.html

Export pointer lock symbols and cancel pointer lock on "escape".

* dom/Document.h: Export symbols.
* dom/Element.h: Export symbols.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Cancel pointer lock on "escape".
* page/PointerLockController.cpp: Add missing include.
* page/PointerLockController.h: Export symbols.

Source/WebKit/mac:

Add basic pointer lock functionality. User permission is not yet implemented.

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::requestPointerLock):
(WebChromeClient::requestPointerUnlock):

Source/WebKit2:

Enable basic pointer lock functionality by plumbing requests through WebPage IPC.
Pass through mouse movement deltas.
Unlock pointer when view is no longer visible.

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): Pass along mouse movement.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::dispatchViewStateChange): Unlock pointer when page is not visible.
(WebKit::WebPageProxy::requestPointerLock): Hide and disassociate pointer.
(WebKit::WebPageProxy::requestPointerUnlock): Show and associate pointer.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Add methods.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestPointerLock): Pass along to web page.
(WebKit::WebChromeClient::requestPointerUnlock): Ditto.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didAcquirePointerLock): Forward to PointerLockController.
(WebKit::WebPage::didNotAcquirePointerLock): Ditto.
(WebKit::WebPage::didLosePointerLock): Ditto.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Add methods.

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

3 years agoWebCore::PlatformMediaSession::stopSession + 13
jer.noble@apple.com [Fri, 21 Oct 2016 18:37:47 +0000 (18:37 +0000)]
WebCore::PlatformMediaSession::stopSession + 13
https://bugs.webkit.org/show_bug.cgi?id=163799

Reviewed by Eric Carlson.

Because m_sessions can be mutated by removeSession() while iterating over m_sessions, and because
PlatformMediaSessions are not refcounted, it is not enough to copy m_sessions into a copied Vector
before iterating. Instead, wrap iteration of m_sessions in a convenience function, which sets an
iteration counter which, when cleared, removes all null entries from m_session. In parallel, modify
removeSession() to check this iteration counter, and replace the session with a null value rather
than mutating the m_sessions vector itself.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::has):
(WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
(WebCore::PlatformMediaSessionManager::canProduceAudio):
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::currentSessionsMatching):
(WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
(WebCore::PlatformMediaSessionManager::applicationDidEnterForeground):
(WebCore::PlatformMediaSessionManager::systemWillSleep):
(WebCore::PlatformMediaSessionManager::systemDidWake):
(WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForDocument):
(WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess):
(WebCore::PlatformMediaSessionManager::forEachSession):
(WebCore::PlatformMediaSessionManager::anyOfSessions):
* platform/audio/PlatformMediaSessionManager.h:

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

3 years agoMove some more assorted classes from ExceptionCode to Exception
darin@apple.com [Fri, 21 Oct 2016 18:32:04 +0000 (18:32 +0000)]
Move some more assorted classes from ExceptionCode to Exception
https://bugs.webkit.org/show_bug.cgi?id=163775

Reviewed by Chris Dumez.

* Modules/fetch/WorkerGlobalScopeFetch.cpp:
(WebCore::WorkerGlobalScopeFetch::fetch): Remove unnecessary calls to
WorkerGlobalScope::scriptExcutionObject, which just returns the scope itself.

* Modules/notifications/Notification.cpp: Added now-needed include.
* Modules/webdatabase/DOMWindowWebDatabase.cpp: Ditto.

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

* bindings/js/JSDedicatedWorkerGlobalScopeCustom.cpp:
(WebCore::JSDedicatedWorkerGlobalScope::postMessage): Pass a reference instead
of a pointer to handlePostMessage.
* bindings/js/JSMessagePortCustom.cpp:
(WebCore::JSMessagePort::postMessage): Ditto.

* bindings/js/JSMessagePortCustom.h: Use pragma once. Change handlePostMessage
to take a reference to the object instead of a pointer, and also to use
propagateException since postMessage now uses ExceptionOr.

* bindings/js/JSWorkerCustom.cpp:
(WebCore::JSWorker::postMessage): Pass a reference instead of a pointer to
handlePostMessage.
(WebCore::constructJSWorker): Use the version of toJSNewlyCreated that handles
propagating an exception from ExceptionOr.

* bindings/js/JSWorkerGlobalScopeCustom.cpp:
(WebCore::JSWorkerGlobalScope::visitAdditionalChildren): Use auto.
Remove unnecessary round trip through the scriptExecutionContext function.
(WebCore::JSWorkerGlobalScope::importScripts): Use reserveInitialCapacity and
uncheckedAppend to build up the vector of strings. Use propagateException
to deal with ExceptionOr result.

* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort): Initialize boolean data members in the
class definition instead of here.
(WebCore::MessagePort::postMessage): Use ExceptionOr.
(WebCore::MessagePort::entangle): Use an rvalue reference.
(WebCore::MessagePort::dispatchMessages): Use ExceptionOr.
(WebCore::MessagePort::disentanglePorts): Ditto. Also use a more efficient
idiom that does half as much hashing as the old algorithm, and got rid an
unneeded local variable.
(WebCore::MessagePort::entanglePorts): Use an rvalue reference.
* dom/MessagePort.h: Updated for above changes.

* fileapi/FileReader.cpp:
(WebCore::FileReader::create): Use auto.
(WebCore::FileReader::FileReader): Initialize scalars in the class definition.
(WebCore::FileReader::~FileReader): Call cancel on the loader directly
instead of sharing code with the stop function.
(WebCore::FileReader::stop): Moved the body of the terminate function here.
(WebCore::FileReader::readAsArrayBuffer): Use ExceptionOr.
(WebCore::FileReader::readAsBinaryString): Ditto.
(WebCore::FileReader::readAsText): Ditto.
(WebCore::FileReader::readAsDataURL): Ditto.
(WebCore::FileReader::readInternal): Ditto. Also add a cast now that
we derive privately from FileReaderLoaderClient.
(WebCore::FileReader::abort): Call stop instead of terminate.
(WebCore::FileReader::terminate): Deleted. Moved code into stop.
(WebCore::FileReader::didReceiveData): Moved comment to where the constant is.
* fileapi/FileReader.h: Updated for above changes. Made more functions private
and used final instead of override.
* fileapi/FileReader.idl: Use non-legacy exceptions.

* fileapi/FileReaderSync.cpp:
(WebCore::FileReaderSync::readAsArrayBuffer): Use ExceptionOr.
(WebCore::FileReaderSync::readAsBinaryString): Ditto.
(WebCore::FileReaderSync::readAsText): Ditto.
(WebCore::FileReaderSync::readAsDataURL): Ditto.
(WebCore::FileReaderSync::startLoading): Ditto.
(WebCore::FileReaderSync::startLoadingString): Added. Helper to cut down on
repeated code in functions above.
* fileapi/FileReaderSync.h: Updated for above changes.
* fileapi/FileReaderSync.idl: Use non-legacy exceptions.

* page/Base64Utilities.cpp:
(WebCore::Base64Utilities::btoa): Use ExceptionOr.
(WebCore::Base64Utilities::atob): Ditto.
* page/Base64Utilities.h: Updated for above changes.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::navigator): Pass a reference to the frame.
(WebCore::DOMWindow::postMessage): Use ExceptionOr when calling
MessagePort::disentanglePorts. Also udpated for changes to the
PostMessageTimer.

* page/Navigator.cpp:
(WebCore::Navigator::Navigator): Take a reference.
(WebCore::shouldHideFourDot): Ditto
(WebCore::Navigator::appVersion): Pass a reference.
(WebCore::Navigator::plugins): Return a reference.
(WebCore::Navigator::mimeTypes): Ditto.
* page/Navigator.h: Updated for above changes. Also marked the
class final and moved derivation from RefCounted to NavigatorBase.

* page/NavigatorBase.h: Addded derivation from RefCounted since
both derived classes want that, and the destructor is already virtual.

* page/WindowOrWorkerGlobalScope.idl: Use non-legacy exceptions.

* page/WorkerNavigator.cpp:
(WebCore::WorkerNavigator::~WorkerNavigator): Deleted.

* page/WorkerNavigator.h: Moved derivation from RefCounted to
NavigatorBase. Also marked class final.

* workers/AbstractWorker.cpp:
(WebCore::AbstractWorker::resolveURL): Use ExceptionOr.
* workers/AbstractWorker.h: Updated for above changes.

* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::create): Use RefPtr&&
instead of PassRefPtr.
(WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
Ditto.
(WebCore::DedicatedWorkerGlobalScope::postMessage): Use ExceptionOr.
(WebCore::DedicatedWorkerGlobalScope::importScripts): Ditto.
* workers/DedicatedWorkerGlobalScope.h: Updated for above changes.
* workers/DedicatedWorkerGlobalScope.idl: Use non-legacy exceptions.

* workers/Worker.cpp:
(WebCore::Worker::create): Use ExceptionOr.
(WebCore::Worker::postMessage): Ditto.
* workers/Worker.h: Updated for above changes.
* workers/Worker.idl: Use non-legacy exception.

* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::WorkerGlobalScope): Moved initialization
of m_closing to class definition.
(WebCore::WorkerGlobalScope::~WorkerGlobalScope): Removed call to
deleted notifyObserversOfStop function.
(WebCore::WorkerGlobalScope::importScripts): Use ExceptionOr. Also use
reserveInitialCapacity and uncheckedAppend to build a vector.
(WebCore::WorkerGlobalScope::addConsoleMessage): Use an rvalue reference.
Also moved the body of one of the addMessageToWorkerConsole overloads into
one of the overloads of this function, and changed the other to call addMessage.
(WebCore::WorkerGlobalScope::addMessage): Moved the body of the other
addMessageToWorkerConsole here.
(WebCore::WorkerGlobalScope::addMessageToWorkerConsole): Deleted.
(WebCore::WorkerGlobalScope::Observer::Observer): Deleted.
(WebCore::WorkerGlobalScope::Observer::~Observer): Deleted.
(WebCore::WorkerGlobalScope::Observer::stopObserving): Deleted.
(WebCore::WorkerGlobalScope::registerObserver): Deleted.
(WebCore::WorkerGlobalScope::unregisterObserver): Deleted.
(WebCore::WorkerGlobalScope::notifyObserversOfStop): Deleted.
* workers/WorkerGlobalScope.h: Removed unneeded includes. Moved many virtual
function overrides into the private section. Marked many functions final instead
of just override. Removed unused Observer class and m_workerObservers set.

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop): Removed call to deleted
WorkerGlobalScope::notifyObserversOfStop function.

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

3 years agoTighten ComputedStyleExtractor to use Element instead of Node
antti@apple.com [Fri, 21 Oct 2016 18:20:07 +0000 (18:20 +0000)]
Tighten ComputedStyleExtractor to use Element instead of Node
https://bugs.webkit.org/show_bug.cgi?id=163798

Reviewed by Andreas Kling.

Also make its functions non-const as they may compute style.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::styleElementForNode):
(WebCore::ComputedStyleExtractor::ComputedStyleExtractor):

    If we are called with a Node figure out the style Element in constructor.

(WebCore::ComputedStyleExtractor::getFontSizeCSSValuePreferringKeyword):
(WebCore::ComputedStyleExtractor::useFixedFontDefaultSize):
(WebCore::ComputedStyleExtractor::styledElement):
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
(WebCore::CSSComputedStyleDeclaration::copyProperties):
(WebCore::elementOrItsAncestorNeedsStyleRecalc):

    Use composed tree iterator for increased correctness in shadow trees.

(WebCore::updateStyleIfNeededForElement):
(WebCore::computeRenderStyleForProperty):
(WebCore::ComputedStyleExtractor::customPropertyValue):
(WebCore::ComputedStyleExtractor::customPropertyText):
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::CSSComputedStyleDeclaration::length):
(WebCore::CSSComputedStyleDeclaration::item):
(WebCore::ComputedStyleExtractor::propertyMatches):
(WebCore::ComputedStyleExtractor::copyProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForSidesShorthand):
(WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand):
(WebCore::ComputedStyleExtractor::copyPropertiesInSet):
(WebCore::CSSComputedStyleDeclaration::getPropertyValue):
(WebCore::ComputedStyleExtractor::getBackgroundShorthandValue):
(WebCore::ComputedStyleExtractor::styledNode): Deleted.
(WebCore::nodeOrItsAncestorNeedsStyleRecalc): Deleted.
(WebCore::updateStyleIfNeededForNode): Deleted.
* css/CSSComputedStyleDeclaration.h:
* css/SVGCSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::svgPropertyValue):
* editing/EditingStyle.cpp:
(WebCore::EditingStyle::removeEquivalentProperties):
* editing/EditingStyle.h:

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

3 years agoWebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
cdumez@apple.com [Fri, 21 Oct 2016 17:56:09 +0000 (17:56 +0000)]
WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading
https://bugs.webkit.org/show_bug.cgi?id=163792

Reviewed by Darin Adler.

WebGL2RenderingContext.texSubImage3D() should use a union instead of overloading for
- https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7 (for texSubImage3D)
- https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14 (for TexImageSource)

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage3D):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

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

3 years ago[JSC] don't crash when arguments to `new Function()` produce unexpected AST
caitp@igalia.com [Fri, 21 Oct 2016 17:49:30 +0000 (17:49 +0000)]
[JSC] don't crash when arguments to `new Function()` produce unexpected AST
https://bugs.webkit.org/show_bug.cgi?id=163748

Reviewed by Mark Lam.

JSTests:

* stress/regress-163748.js: Added.
(assert):
(shouldThrowSyntaxError):
(GeneratorFunction):

Source/JavaScriptCore:

The ASSERT(statement); and ASSERT(funcDecl); lines are removed, replaced with blocks
to report a generic Parser error message. These lines are only possible to be reached
if the input string produced an unexpected AST, which previously could be used to crash
the process via ASSERT failure.

The node type assertions are left in the tree, as it should be impossible for a top-level
`{` to produce anything other than a Block node. If the node turns out not to be a Block,
it indicates that the (C++) caller of this function (E.g in FunctionConstructor.cpp), is
doing something incorrect. Similarly, it should be impossible for the `funcDecl` node to
be anything other than a function declaration given the conventions of the caller of this
function.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):

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

3 years agoDo not mutate the render tree while collecting selection repaint rects.
zalan@apple.com [Fri, 21 Oct 2016 17:39:17 +0000 (17:39 +0000)]
Do not mutate the render tree while collecting selection repaint rects.
https://bugs.webkit.org/show_bug.cgi?id=163800
<rdar://problem/28806886>

Reviewed by David Hyatt.

Source/WebCore:

RenderListItem not only mutates the tree while in layout but it also uses
the old descendant context to find the insertion point.
This patch strictly ensures that we only do it while in layout and never
in other cases such as collecting repaint rects.
This gets redundant when webkit.org/b/163789 is fixed.

Test: fast/lists/crash-when-list-marker-is-moved-during-selection.html

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):

LayoutTests:

* fast/lists/crash-when-list-marker-is-moved-during-selection-expected.txt: Added.
* fast/lists/crash-when-list-marker-is-moved-during-selection.html: Added.

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

3 years ago[CSS Parser] Support horizontal-bt writing mode
hyatt@apple.com [Fri, 21 Oct 2016 17:23:57 +0000 (17:23 +0000)]
[CSS Parser] Support horizontal-bt writing mode
https://bugs.webkit.org/show_bug.cgi?id=163797

Reviewed by Zalan Bujtas.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

3 years ago[Win][Direct2D] Correct some memory leaks and other minor bugs
bfulgham@apple.com [Fri, 21 Oct 2016 17:10:31 +0000 (17:10 +0000)]
[Win][Direct2D] Correct some memory leaks and other minor bugs
https://bugs.webkit.org/show_bug.cgi?id=163769

Reviewed by Alex Christensen.

Several D2D handles were being leaked.

Direct2D sometimes returns an infinite rect containing { -inf, -inf, FloatMax, FloatMax },
sometimes { -FloatMax, -FloatMax, inf, inf }, and various combinations thereof. This caused
most SVG drawing to decide no screen rect was contained in the "infinite rect" so nothing
would be drawn.

Tested by existing layout tests.

* platform/graphics/GraphicsContext.h:
* platform/graphics/win/FloatRectDirect2D.cpp:
(WebCore::isInfiniteRect): Recognize various infinite rects in Windows.
(WebCore::FloatRect::FloatRect): Convert a Windows infinite rect to the style
we use inside WebKit.
* platform/graphics/win/FontCascadeDirect2D.cpp:
(WebCore::FontCascade::drawGlyphs): Use cached brushes if possible.
* platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
(WebCore::GlyphPage::fill): Don't terminate on this error case.
* platform/graphics/win/GradientDirect2D.cpp:
(WebCore::Gradient::generateGradient): Don't leak gradients.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContextPlatformPrivate::brushWithColor): Added.
(WebCore::GraphicsContext::brushWithColor): Added.
(WebCore::GraphicsContextPlatformPrivate::concatCTM): Perform transform multiplication
in the right order (hint: it's not distributive).
(WebCore::GraphicsContext::drawWithShadow): Use convenience method.
(WebCore::GraphicsContext::fillRect): Ditto.
(WebCore::GraphicsContext::platformFillRoundedRect): Ditto.
(WebCore::GraphicsContext::clearRect): Ditto.
(WebCore::GraphicsContext::setPlatformStrokeColor): Ditto.
(WebCore::GraphicsContext::setPlatformFillColor): Ditto.
* platform/graphics/win/PathDirect2D.cpp:
(WebCore::Path::polygonPathFromPoints): No need to convert manually.
(WebCore::Path::~Path): Don't leak ID2D1Geometry entities.
(WebCore::Path::appendGeometry): Ditto.
(WebCore::Path::createGeometryWithFillMode): Ditto.
(WebCore::Path::Path): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::strokeBoundingRect): Provide an implementation.
(WebCore::Path::addRect): No need for manual casting here.

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

3 years agoFix minor style issue in the signature of StaticRange::create
wenson_hsieh@apple.com [Fri, 21 Oct 2016 17:08:19 +0000 (17:08 +0000)]
Fix minor style issue in the signature of StaticRange::create
https://bugs.webkit.org/show_bug.cgi?id=163786
<rdar://problem/28853079>

Reviewed by Alex Christensen.

Change `Ref<WebCore::Node> &&` to `Ref<Node>&&`.

* dom/StaticRange.cpp:
(WebCore::StaticRange::create):

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

3 years ago[CSS Parser] Add support for -webkit-line-box-contain
hyatt@apple.com [Fri, 21 Oct 2016 17:03:10 +0000 (17:03 +0000)]
[CSS Parser] Add support for -webkit-line-box-contain
https://bugs.webkit.org/show_bug.cgi?id=163794

Reviewed by Zalan Bujtas.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLineBoxContain):
(WebCore::CSSPropertyParser::parseSingleValue):

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

3 years agoVersioning.
matthew_hanson@apple.com [Fri, 21 Oct 2016 17:00:14 +0000 (17:00 +0000)]
Versioning.

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

3 years ago[CSS Parser] Add support for @-webkit-region rules
hyatt@apple.com [Fri, 21 Oct 2016 16:35:09 +0000 (16:35 +0000)]
[CSS Parser] Add support for @-webkit-region rules
https://bugs.webkit.org/show_bug.cgi?id=163787

Reviewed by Zalan Bujtas.

* css/StyleRule.cpp:
(WebCore::StyleRuleRegion::StyleRuleRegion):
* css/StyleRule.h:
* css/parser/CSSAtRuleID.cpp:
(WebCore::cssAtRuleID):
* css/parser/CSSAtRuleID.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeAtRule):
(WebCore::CSSParserImpl::consumePageRule):
(WebCore::CSSParserImpl::consumeRegionRule):
* css/parser/CSSParserImpl.h:

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

3 years agoBug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
ddkilzer@apple.com [Fri, 21 Oct 2016 16:14:06 +0000 (16:14 +0000)]
Bug 163757: Use IntSize::unclampedArea() in PDFDocumentImage::updateCachedImageIfNeeded()
<https://webkit.org/b/163757>

Reviewed by Brent Fulgham.

No new tests since there is no change in nominal behavior.

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Use
IntSize::unclampedArea() where manual calculations were used
previously.  Also gets rid of more safeCast<size_t>() use.

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

3 years ago[GTK] Unreviewed gardening: update expectations after r207664
commit-queue@webkit.org [Fri, 21 Oct 2016 16:12:58 +0000 (16:12 +0000)]
[GTK] Unreviewed gardening: update expectations after r207664
https://bugs.webkit.org/show_bug.cgi?id=163784

Unreviewed gardening.

Patch by Miguel Gomez <magomez@igalia.com> on 2016-10-21

* platform/gtk/TestExpectations:

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

3 years ago[Web IDL] Support unions in our overload resolution algorithm
cdumez@apple.com [Fri, 21 Oct 2016 16:12:10 +0000 (16:12 +0000)]
[Web IDL] Support unions in our overload resolution algorithm
https://bugs.webkit.org/show_bug.cgi?id=163764

Reviewed by Darin Adler.

Support unions in our overload resolution algorithm as per:
- https://heycam.github.io/webidl/#es-overloads
- https://heycam.github.io/webidl/#dfn-distinguishable

* bindings/scripts/CodeGeneratorJS.pm:
(IsIDLTypeDistinguishableWithUnionForOverloadResolution):
(AreTypesDistinguishableForOverloadResolution):
(GetOverloadThatMatches):
(GenerateOverloadedFunctionOrConstructor):
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/TestObj.idl:

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

3 years agoAudioNode.connect(): First parameter should not be nullable
cdumez@apple.com [Fri, 21 Oct 2016 16:09:28 +0000 (16:09 +0000)]
AudioNode.connect(): First parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=163773

Reviewed by Darin Adler.

Source/WebCore:

AudioNode.connect()'s first parameter should not be nullable:
- https://webaudio.github.io/web-audio-api/#idl-def-AudioNode.

We were throwing a SYNTAX_ERR when passing null, we now throw
a TypeError instead.

No new tests, updated existing test.

* Modules/webaudio/AudioBasicInspectorNode.cpp:
(WebCore::AudioBasicInspectorNode::connect):
* Modules/webaudio/AudioBasicInspectorNode.h:
* Modules/webaudio/AudioNode.cpp:
(WebCore::AudioNode::connect):
* Modules/webaudio/AudioNode.h:
* Modules/webaudio/AudioNode.idl:

LayoutTests:

Improve test coverage.

* webaudio/audionode-expected.txt:
* webaudio/audionode.html:

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

3 years agoAdd support for WASM calls
keith_miller@apple.com [Fri, 21 Oct 2016 16:02:39 +0000 (16:02 +0000)]
Add support for WASM calls
https://bugs.webkit.org/show_bug.cgi?id=161727

Reviewed by Filip Pizlo and Michael Saboff.

JSTests:

Add members of the Call category to the WASMOps special group.

* wasm/generate-wasmops-header.js:

Source/JavaScriptCore:

Add support for WASM calls. Since most of the work for this was already done when we added
WASM Memory, this is mostly just cleanup work.  The main interesting part of this patch is
how we link calls to other WASM functions in the same module. Since a WASM callee may not
have been compiled by the time the current function has started compilation we don't know
what address we need to call to.  For each callsite in the compiling function, WASM
remembers the CodeLocationCall and the target function index. Once all WASM functions are
compiled, each callsite is linked to the appropriate entrypoint.

* testWASM.cpp:
(runWASMTests):
* wasm/WASMB3IRGenerator.cpp:
(JSC::WASM::createJSWrapper):
(JSC::WASM::parseAndCompile):
* wasm/WASMB3IRGenerator.h:
* wasm/WASMCallingConvention.cpp:
(JSC::WASM::jscCallingConvention):
(JSC::WASM::wasmCallingConvention):
* wasm/WASMCallingConvention.h:
(JSC::WASM::CallingConvention::CallingConvention):
(JSC::WASM::CallingConvention::marshallArgumentImpl):
(JSC::WASM::CallingConvention::marshallArgument):
(JSC::WASM::CallingConvention::loadArguments):
(JSC::WASM::CallingConvention::setupCall):
(JSC::WASM::CallingConvention::iterate): Deleted.
* wasm/WASMFormat.h:
* wasm/WASMFunctionParser.h:
(JSC::WASM::FunctionParser<Context>::FunctionParser):
(JSC::WASM::FunctionParser<Context>::parseBlock):
(JSC::WASM::FunctionParser<Context>::parseExpression):
* wasm/WASMModuleParser.cpp:
(JSC::WASM::ModuleParser::parse):
* wasm/WASMOps.h:
* wasm/WASMParser.h:
(JSC::WASM::Parser::parseVarUInt32):
(JSC::WASM::Parser::parseVarUInt64):
* wasm/WASMPlan.cpp:
(JSC::WASM::Plan::Plan):

Source/WTF:

Added a new decodeUInt64. Also, added WTF::LEBDecoder namespace.

* wtf/LEBDecoder.h:
(WTF::LEBDecoder::decodeUInt):
(WTF::LEBDecoder::decodeUInt32):
(WTF::LEBDecoder::decodeUInt64):
(WTF::LEBDecoder::decodeInt32):
(decodeUInt32): Deleted.
(decodeInt32): Deleted.

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

3 years agoImplement InputEvent.getTargetRanges() for the input events spec
wenson_hsieh@apple.com [Fri, 21 Oct 2016 15:51:28 +0000 (15:51 +0000)]
Implement InputEvent.getTargetRanges() for the input events spec
https://bugs.webkit.org/show_bug.cgi?id=162947
<rdar://problem/28853079>

Reviewed by Darin Adler.

Source/JavaScriptCore:

Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry
for more details.

* runtime/CommonIdentifiers.h:

Source/WebCore:

Implements InputEvent.getTargetRanges(). See individual method changes below for more details. Adds a new hook
for subclasses of CompositeEditCommand to vend a list of target StaticRanges when retrieving target ranges for
an editing command on a contenteditable area.

Tests: fast/events/before-input-delete-empty-list-target-ranges.html
       fast/events/before-input-delete-text-target-ranges.html
       fast/events/before-input-replace-text-target-ranges.html

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

Add StaticRange.idl, StaticRange.cpp and StaticRange.h.

* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
(WebCore::RuntimeEnabledFeatures::inputEventsEnabled):

Add a new runtime bindings flag for InputEvents and guard both InputEvent and StaticRange behind it.

* dom/DOMAllInOne.cpp:
* dom/InputEvent.cpp:
(WebCore::InputEvent::InputEvent):
* dom/InputEvent.h:
* dom/InputEvent.idl:
* dom/StaticRange.cpp: Copied from Source/WebCore/dom/InputEvent.cpp.
(WebCore::StaticRange::StaticRange):
(WebCore::StaticRange::create):
(WebCore::StaticRange::createFromRange):

Convenience method for creating a StaticRange from a Range's start/end container and offset.

(WebCore::StaticRange::startContainer):
(WebCore::StaticRange::endContainer):
(WebCore::StaticRange::collapsed):
* dom/StaticRange.h: Copied from Source/WebCore/dom/InputEvent.cpp.
(WebCore::StaticRange::startOffset):
(WebCore::StaticRange::endOffset):
* dom/StaticRange.idl: Copied from Source/WebCore/editing/ReplaceRangeWithTextCommand.h.
* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::willApplyCommand):
(WebCore::CompositeEditCommand::targetRanges):

Virtual method that returns a list of target ranges which are associated with this command.

(WebCore::CompositeEditCommand::targetRangesForBindings):

Non-virtual method that calls the above targetRanges(). Takes whether or not the CompositeEditCommand is editing
a textarea or plain text input into account.

(WebCore::CompositeEditCommand::moveParagraphs):
* editing/CompositeEditCommand.h:
* editing/EditCommand.cpp:
(WebCore::EditCommand::frame):
* editing/EditCommand.h:
(WebCore::EditCommand::document):
* editing/Editor.cpp:
(WebCore::dispatchBeforeInputEvent):
(WebCore::dispatchInputEvent):
(WebCore::dispatchBeforeInputEvents):

Changed the `beforeinput` event dispatch to use the regular Node::dispatchEvent instead of dispatchScopedEvent.
This is because if the page prevents the `beforeinput` event, we need to know immediately in order to bail from
the default action.

(WebCore::dispatchInputEvents):
(WebCore::Editor::willApplyEditing):

Added a list of static ranges as a parameter when calling on the Editor to dispatch `beforeinput` events.
By default, this uses the composite edit command's targetRangesForBindings(), though it may be special cased
by subclasses of CompositeEditCommand (see ReplaceRangeWithTextCommand, SpellingCorrectionCommand, and
TypingCommand).

* editing/Editor.h:
* editing/ReplaceRangeWithTextCommand.cpp:
(WebCore::ReplaceRangeWithTextCommand::targetRanges):
* editing/ReplaceRangeWithTextCommand.h:
* editing/SpellingCorrectionCommand.cpp:
(WebCore::SpellingCorrectionCommand::targetRanges):
* editing/SpellingCorrectionCommand.h:
* editing/TypingCommand.cpp:
(WebCore::editActionIsDeleteByTyping):
(WebCore::TypingCommand::shouldDeferWillApplyCommandUntilAddingTypingCommand):
(WebCore::TypingCommand::willApplyCommand):
(WebCore::TypingCommand::willAddTypingToOpenCommand):
(WebCore::TypingCommand::deleteKeyPressed):
(WebCore::TypingCommand::forwardDeleteKeyPressed):

Moves the firing of the `beforeinput` until after the selection range to delete has been computed.

* editing/TypingCommand.h:

Source/WebKit2:

Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry
for more details.

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

LayoutTests:

Adds 3 new layout tests and tweaks some existing unit tests. See WebCore ChangeLog entry for more details.
Tests verify the result of getTargetRanges() when breaking out of a list, deleting backwards and forwards at
all text granularities, deleting selected text, and spell checking (candidate text replacement).

* fast/events/before-input-delete-empty-list-target-ranges-expected.txt: Added.
* fast/events/before-input-delete-empty-list-target-ranges.html: Added.
* fast/events/before-input-delete-text-target-ranges-expected.txt: Added.
* fast/events/before-input-delete-text-target-ranges.html: Added.
* fast/events/before-input-events-prevent-default-in-textfield.html:
* fast/events/before-input-replace-text-target-ranges-expected.txt: Added.
* fast/events/before-input-replace-text-target-ranges.html: Added.
* fast/events/input-events-fired-when-typing-expected.txt:
* fast/events/input-events-fired-when-typing.html:
* js/dom/global-constructors-attributes-expected.txt:
* platform/ios-simulator/TestExpectations:
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

3 years agoStyle resolver should be updated lazily
antti@apple.com [Fri, 21 Oct 2016 13:36:45 +0000 (13:36 +0000)]
Style resolver should be updated lazily
https://bugs.webkit.org/show_bug.cgi?id=163721

Reviewed by Andreas Kling.

Currently when stylesheets change in some way we generally update style resolvers and
invalidate style immediately. We should do this lazily to avoid unnecessary work.

Also improve naming of the stylesheet invalidation functions and use more optimal functions in some places.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::updateStyleIfNeededForNode):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::setDisabled):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):

    Initialize root style font with null font selector.
    This avoids hitting a CSSFontSelector assert in fast/media/mq-relative-constraints-08.html where
    media query evaluation requires font information before it is ready.
    Exposed by increased laziness in this patch.

* dom/Document.cpp:
(WebCore::Document::setContentLanguage):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::isPageBoxVisible):
(WebCore::Document::pageSizeAndMarginsInPixels):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::didInsertInDocumentShadowRoot):
(WebCore::Document::didRemoveInDocumentShadowRoot):
* dom/Document.h:
(WebCore::Document::inDocumentShadowRoots):

    Track all shadow roots in the document. This allows us to find and flush style scopes cheaply.

* dom/Element.cpp:
(WebCore::Element::computedStyle):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
(WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): Deleted.

    Since updates are now done lazily we don't need a special timer for extension stylesheets.

* dom/ExtensionStyleSheets.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::insertedInto):
(WebCore::ShadowRoot::removedFrom):
(WebCore::ShadowRoot::styleScope):
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp:
(WebCore::Style::Scope::setPreferredStylesheetSetName):
(WebCore::Style::Scope::setSelectedStylesheetSetName):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::flushPendingUpdate):

    Also flush descendant shadow roots.

(WebCore::Style::Scope::scheduleUpdate):
(WebCore::Style::Scope::didChangeActiveStyleSheetCandidates):

    Make lazy.

(WebCore::Style::Scope::didChangeStyleSheetContents):

    Make lazy.

(WebCore::Style::Scope::didChangeStyleSheetEnvironment):

    Environment changes also affect author shadow roots.

(WebCore::Style::Scope::styleSheetsForStyleSheetList):
(WebCore::Style::Scope::scheduleActiveSetUpdate): Deleted.
(WebCore::Style::Scope::didChangeCandidatesForActiveSet): Deleted.
(WebCore::Style::Scope::didChangeContentsOrInterpretation): Deleted.

    Improved naming of these and split didChangeContentsOrInterpretation into two separate functions.

* style/StyleScope.h:
(WebCore::Style::Scope::styleSheetsForStyleSheetList): Deleted.
(WebCore::Style::Scope::setPreferredStylesheetSetName): Deleted.
(WebCore::Style::Scope::setSelectedStylesheetSetName): Deleted.
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

    Ensure that cationsStyleSheetOverride really becomes empty. Some tests rely on not having suprise
    inserted stylesheets. Previously this was racy and the patch affected order of things.

(WebCore::Internals::styleChangeType):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):

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

3 years ago[EFL] REGRESSION(r207616): Build is broken due to missing libgeoclue-dev package
ossy@webkit.org [Fri, 21 Oct 2016 13:27:10 +0000 (13:27 +0000)]
[EFL] REGRESSION(r207616): Build is broken due to missing libgeoclue-dev package
https://bugs.webkit.org/show_bug.cgi?id=163733

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/OptionsEfl.cmake: Expose USE_GEOCLUE2 to the build properly.

Tools:

* efl/install-dependencies: Added geoclue-2.0 package.

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

3 years agoWebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
adam.bergkvist@ericsson.com [Fri, 21 Oct 2016 12:24:25 +0000 (12:24 +0000)]
WebRTC: [OpenWebRTC] Move SDPProcessorScriptResource(Gtk) to openwebrtc directory
https://bugs.webkit.org/show_bug.cgi?id=163778

Reviewed by Philippe Normand.

Move SDPProcessorScriptResourceGtk from the platform gtk directory to the port generic
openwebrtc directory to make it usable by other ports. Also drop the Gtk-suffix.

No change of behavior.

* PlatformGTK.cmake:
* platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp:
(WebCore::SDPProcessorScriptResource::scriptString): Deleted.
* platform/mediastream/openwebrtc/SDPProcessorScriptResource.cpp: Renamed from Source/WebCore/platform/mediastream/gtk/SDPProcessorScriptResourceGtk.cpp.
(WebCore::SDPProcessorScriptResource::scriptString):

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

3 years ago[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivat...
commit-queue@webkit.org [Fri, 21 Oct 2016 10:26:50 +0000 (10:26 +0000)]
[GTK] Several tests crashing on debug bot in (anonymous namespace)::MediaPlayerPrivateGStreamerBase::repaint
https://bugs.webkit.org/show_bug.cgi?id=163511

Patch by Miguel Gomez <magomez@igalia.com> on 2016-10-21
Reviewed by Carlos Garcia Campos.

Perform the video repaint in the main thread when accelerated compositing is disabled. Added a new method to
MediaPlayerClient to get whether accelerated compositing is enabled from the MediaPlayer. This is needed
because mediaPlayerAcceleratedCompositingEnabled() will return false while HTMLMediaElement doesn't have a
RenderVideo, even when accelerated compositing is enabled.

Covered by existent tests.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerAcceleratedCompositingEnabled):
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerAcceleratedCompositingEnabled):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
(WebCore::MediaPlayerPrivateGStreamerBase::repaint):
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

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

3 years agoWebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
adam.bergkvist@ericsson.com [Fri, 21 Oct 2016 10:20:23 +0000 (10:20 +0000)]
WebRTC: [GTK] Add MediaEndpointOwr - an OpenWebRTC WebRTC backend
https://bugs.webkit.org/show_bug.cgi?id=163327

Reviewed by Philippe Normand.

.:

Add manual WebRTC test. Test features:
- Two RTCPeerConnection instances communicate in a single browser tab.
- Supports setting up bidirectional media with a single SDP dialog, as
  well as one direction at a time.
- Strips vendor prefixes (runs in Chrome and Firefox as well)
- Supports modern as well as legacy APIs (mainly to make the test run
  in Chrome)

* ManualTests/webrtc-one-tab-p2p.html: Added.

Source/WebCore:

Add MediaEndpointOwr which is a MediaEndpoint implementation (WebRTC backend) based on
OpenWebRTC [1]. The WebRTC backend can be tested with a manual test. Automatic testing
is still done with MockMediaEndpoint.

[1] http://www.openwebrtc.org/

Testing: Added manual test (webrtc-one-tab-p2p.html)

* CMakeLists.txt:
* platform/GStreamer.cmake:
* platform/mediastream/openwebrtc/MediaEndpointOwr.cpp: Added.
(WebCore::createMediaEndpointOwr):
(WebCore::MediaEndpointOwr::MediaEndpointOwr):
(WebCore::MediaEndpointOwr::~MediaEndpointOwr):
(WebCore::MediaEndpointOwr::setConfiguration):
(WebCore::cryptoDataCallback):
(WebCore::MediaEndpointOwr::generateDtlsInfo):
(WebCore::MediaEndpointOwr::getDefaultAudioPayloads):
(WebCore::MediaEndpointOwr::getDefaultVideoPayloads):
(WebCore::payloadsContainType):
(WebCore::MediaEndpointOwr::filterPayloads):
(WebCore::MediaEndpointOwr::updateReceiveConfiguration):
(WebCore::findRtxPayload):
(WebCore::MediaEndpointOwr::updateSendConfiguration):
(WebCore::MediaEndpointOwr::addRemoteCandidate):
(WebCore::MediaEndpointOwr::replaceMutedRemoteSourceMid):
(WebCore::MediaEndpointOwr::createMutedRemoteSource):
(WebCore::MediaEndpointOwr::replaceSendSource):
(WebCore::MediaEndpointOwr::stop):
(WebCore::MediaEndpointOwr::transceiverIndexForSession):
(WebCore::MediaEndpointOwr::sessionMid):
(WebCore::MediaEndpointOwr::matchTransceiverByMid):
(WebCore::MediaEndpointOwr::dispatchNewIceCandidate):
(WebCore::MediaEndpointOwr::dispatchGatheringDone):
(WebCore::MediaEndpointOwr::processIceTransportStateChange):
(WebCore::MediaEndpointOwr::dispatchDtlsFingerprint):
(WebCore::MediaEndpointOwr::unmuteRemoteSource):
(WebCore::MediaEndpointOwr::prepareSession):
(WebCore::MediaEndpointOwr::prepareMediaSession):
(WebCore::parseHelperServerUrl):
(WebCore::MediaEndpointOwr::ensureTransportAgentAndTransceivers):
(WebCore::MediaEndpointOwr::internalAddRemoteCandidate):
(WebCore::gotCandidate):
(WebCore::candidateGatheringDone):
(WebCore::iceConnectionStateChange):
(WebCore::gotIncomingSource):
* platform/mediastream/openwebrtc/MediaEndpointOwr.h: Added.
(WebCore::OwrTransceiver::create):
(WebCore::OwrTransceiver::~OwrTransceiver):
(WebCore::OwrTransceiver::mid):
(WebCore::OwrTransceiver::session):
(WebCore::OwrTransceiver::owrIceState):
(WebCore::OwrTransceiver::setOwrIceState):
(WebCore::OwrTransceiver::gotEndOfRemoteCandidates):
(WebCore::OwrTransceiver::markGotEndOfRemoteCandidates):
(WebCore::OwrTransceiver::OwrTransceiver):
* platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
(WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr):
(WebCore::RealtimeMediaSourceOwr::swapOutShallowSource):
Add support for an initially muted source. This is used for early
creation of remote sources.

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

3 years agoUnreviewed, rolling out r207609.
commit-queue@webkit.org [Fri, 21 Oct 2016 08:17:33 +0000 (08:17 +0000)]
Unreviewed, rolling out r207609.
https://bugs.webkit.org/show_bug.cgi?id=163776

As glib bump was rollout, we need to rollout this too
(Requested by rego on #webkit).

Reverted changeset:

"[GTK] Cannot build GTK+ with CUPS 2.* versions"
https://bugs.webkit.org/show_bug.cgi?id=163591
http://trac.webkit.org/changeset/207609

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

3 years ago[css-grid] Content Alignment broken with indefinite sized grid container
jfernandez@igalia.com [Fri, 21 Oct 2016 08:11:14 +0000 (08:11 +0000)]
[css-grid] Content Alignment broken with indefinite sized grid container
https://bugs.webkit.org/show_bug.cgi?id=163724

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

The Grid Tracks sizing algorithm receives as parameter the
available space to be used as space for tracks. We hold a variable
to store the remaining free space for each dimension.

When the grid container size is indefinite we can't compute the
available free space after computing track sizes until such
indefinite size is resolved.

No new tests, just added some additional test cases.

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::layoutBlock): Compute freeSpace for Rows
after doing layout and resolving the indefinite height.

LayoutTests:

Added additional test cases to verify we compute properly the
available free space for content-alignment, handling correctly the
overflow when needed.

* fast/css-grid-layout/grid-content-alignment-overflow.html:

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

3 years ago[mac-wk2 release] LayoutTest media/media-source/media-source-seek-detach-crash.html...
jer.noble@apple.com [Fri, 21 Oct 2016 08:04:43 +0000 (08:04 +0000)]
[mac-wk2 release] LayoutTest media/media-source/media-source-seek-detach-crash.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=163751

Reviewed by Eric Carlson.

Don't log when we receive an "error" event; this makes the test non-deterministic.

* media/media-source/media-source-seek-detach-crash-expected.txt:
* media/media-source/media-source-seek-detach-crash.html:

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

3 years agoCRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
jer.noble@apple.com [Fri, 21 Oct 2016 08:03:22 +0000 (08:03 +0000)]
CRASH in SourceBuffer::sourceBufferPrivateDidReceiveSample + 2169
https://bugs.webkit.org/show_bug.cgi?id=163735

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-sample-wrong-track-id.html

When SourceBuffer receives a sample in sourceBufferPrivateDidReceiveSample() containing
a trackID not previously seen in an initialization segment, it creates a default TrackBuffer
object to contain that track's samples. One of the fields in TrackBuffer, description, is
normally filled out when an initialization segment is received, but with this default
TrackBuffer, it's still null when it's checked later in sourceBufferPrivateDidReceiveSample().

Rather than adding a null-check on trackBuffer.description, drop any sample that has a
trackID which was not present during a previous initialization segment.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

LayoutTests:

* media/media-source/media-source-sample-wrong-track-id-expected.txt: Added.
* media/media-source/media-source-sample-wrong-track-id.html: Added.

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

3 years agoImport W3C EME tests
zandobersek@gmail.com [Fri, 21 Oct 2016 06:08:59 +0000 (06:08 +0000)]
Import W3C EME tests
https://bugs.webkit.org/show_bug.cgi?id=163214

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Import the W3C EME tests from the web-platform-tests repository on GitHub.
The import was done via the import-w3c-tests script.

All the tests are still missing baselines, and they're skipped on all platforms.
The baselines will be added incrementally as the implementation grows. The idlharness.html
test will be unskipped first when the navigator.requestMediaKeySystemAccess() is added.

* resources/ImportExpectations: Skip Google EME tests.
* web-platform-tests/encrypted-media/: Added. The file list is omitted for clarity.

LayoutTests:

Skip the newly-imported W3C EME tests on all platforms.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* tests-options.json:

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

3 years agoFix JSC cast-align compiler warnings on ARMv7
zandobersek@gmail.com [Fri, 21 Oct 2016 06:00:48 +0000 (06:00 +0000)]
Fix JSC cast-align compiler warnings on ARMv7
https://bugs.webkit.org/show_bug.cgi?id=163744

Reviewed by Mark Lam.

Use the reinterpret_cast_ptr workaround in a few places where
the cast alignment warning is being thrown by the GCC compiler
when compiling for the ARMv7 architecture.

* heap/Heap.cpp:
(JSC::Zombify::visit):
* heap/HeapCell.h:
(JSC::HeapCell::zap):
(JSC::HeapCell::isZapped):
* heap/MarkedBlock.cpp:
(JSC::MarkedBlock::Handle::specializedSweep):

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

3 years ago[GTK] Configures but fails to link with ENABLE_OPENGL=OFF
carlosgc@webkit.org [Fri, 21 Oct 2016 05:30:53 +0000 (05:30 +0000)]
[GTK] Configures but fails to link with ENABLE_OPENGL=OFF
https://bugs.webkit.org/show_bug.cgi?id=163449

Reviewed by Michael Catanzaro.

.:

Remove wrong dependency of Wayland on OpenGL introduced in r190615, it should be possible to build for Wayland
without GL.

* Source/cmake/OptionsGTK.cmake:

Source/WebCore:

Only define sharingGLContext in PlatformDisplay if EGL or GLX are enabled.

* platform/graphics/PlatformDisplay.cpp:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::~PlatformDisplayX11):

Source/WebKit2:

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current
display is X11.
(webkitWebViewBaseUnrealize): Ditto.
(webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
(webkitWebViewBasePageClosed): Ditto.
* UIProcess/AcceleratedDrawingAreaProxy.cpp:
(WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto.
(WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before
trying to use the WaylandCompositor.
* UIProcess/AcceleratedDrawingAreaProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess): Ditto.
* UIProcess/gtk/AcceleratedBackingStore.cpp:
(WebKit::AcceleratedBackingStore::create): Ditto.
* UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
* UIProcess/gtk/WaylandCompositor.cpp:
* UIProcess/gtk/WaylandCompositor.h:
* WebProcess/WebPage/AcceleratedDrawingArea.cpp:
(WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
* WebProcess/WebPage/AcceleratedDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/LayerTreeHost.h:

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

3 years agoThe tracking of the coarse-grain Heap state (allocating or not, collector or not...
fpizlo@apple.com [Fri, 21 Oct 2016 02:17:35 +0000 (02:17 +0000)]
The tracking of the coarse-grain Heap state (allocating or not, collector or not, eden vs full) should respect the orthogonality between allocating and collecting
https://bugs.webkit.org/show_bug.cgi?id=163738

Reviewed by Geoffrey Garen.
Source/JavaScriptCore:

We need to know if we're currently in an allocation slow path, so that code can assert that
it's not being used from inside a destructor that runs during a sweep. We need to know if
we're currently collecting, because some code behaves differently during collection, and
other code wants to assert that it's not being used from inside a visitChildren method that
runs during marking. If we are collecting, we need to know if it's an eden collection or a
full collection. If we are requesting a collection, we need to know if we're requesting an
eden collection, a full collection, or any kind of collection.

Prior to this change, you would reason about all of these things using the HeapOperation. It
had the following states: NoOperation, Allocation, FullCollection, EdenCollection, and
AnyCollection. NoOperation versus Allocation was primarily for asserting that sweep didn't
call arbitrary JS. FullCollection versus EdenCollection was about describing generations. We
would even use HeapOperation in places where we knew that it could only be either Full or
Eden, because we just needed a variable to tell us which generation we were talking about.
It was all very confusing.

Where it completely breaks down is the fact that a concurrent GC has two logical threads, the
mutator and the collector, which can change state independently. The mutator can be
allocating. It can also be doing some work to help the GC. That's three states: running,
allocating, or helping GC. At the same time, the GC thread could either be running or not,
and if it's running, it could be a full collection or an eden collection. Because the mutator
and collector can run at the same time, it means that if we used one enum, we would need nine
states: every combination of mutator running, allocating, or helping GC, crossed with
collector not running, running eden, or running full. So, this change decouples mutator state
from collector state and uses two separate fields with two different types.

Mutator state is described using MutatorState, which can be either MutatorState::Running,
MutatorState::Allocating, or MutatorState::HelpingGC.

Collector state is described using Optional<CollectionScope>. CollectionScope describes how
big the scope of the collection is, and it can be either CollectionScope::Eden or
CollectionScope::Full. If the Optional is Nullopt, it means that we are not collecting. This
way, you can treat collectionScope as a boolean (an Optional is true iff it's engaged). You
can pass around just a CollectionScope if you know that you must be collecting and you just
want to know about the generation. Also, we can use Nullopt in methods that request
collection, which those methods take to mean that they can run any kind of collection (the
old AnyCollection).

Another use of HeapOperation was to answer questions about whether the caller is running as
part of the GC or as part of the mutator. Optional<CollectionScope> does not answer this,
since code that runs in the mutator while the mutator is not HelpingGC at the same time as
the collector is running should run as if it was part of the mutator not as if it was part of
the GC. MutatorState is needed to answer this question, but it doesn't tell the whole story
since code that runs in the collector thread at the same time as the mutator is running
should run as if it was part of the GC not as if it was part of the mutator. So, we need to
know if we're on the collector thread or the mutator thread. We already have a WTF facility
for this, which answers if a thread is a GC thread. But we already use this to answer a
stronger question: are we part of the parallel GC helpers? Some functions in the GC, like
mark bit queries, will work fine in a concurrent collector thread so long as there is no
parallel marking. So, this change also changes WTF's mayBeGCThread to tell what kind of GC
thread we may be: either GCThreadType::Main or GCThreadType::Helper. The parallel GC safety
checks look for GCThreadType::Helper. The "should I run as mutator" query can now be answered
by checking with mayBeGCThread, which returns Optional<GCThreadType>; if engaged, then run as
GC, else run as GC if MutatorState is HelpingGC, else run as mutator.

This doesn't change the way that the GC behaves, but it does change how the GC represents a
fundamental piece of state. So, it's a big change. It should be perf-neutral (still testing).

* API/JSBase.cpp:
(JSSynchronousEdenCollectForDebugging):
* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::jettison):
* dfg/DFGWorklist.cpp:
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* heap/AllocatingScope.h: Added.
(JSC::AllocatingScope::AllocatingScope):
(JSC::AllocatingScope::~AllocatingScope):
* heap/AllocationScope.h: Removed.
* heap/CodeBlockSet.cpp:
(JSC::CodeBlockSet::deleteUnmarkedAndUnreferenced):
* heap/CodeBlockSet.h:
* heap/CollectionScope.cpp: Added.
(JSC::collectionScopeName):
(WTF::printInternal):
* heap/CollectionScope.h: Added.
* heap/EdenGCActivityCallback.cpp:
(JSC::EdenGCActivityCallback::doCollection):
* heap/FullGCActivityCallback.cpp:
(JSC::FullGCActivityCallback::doCollection):
* heap/GCTypeMap.h:
(JSC::GCTypeMap::operator[]):
* heap/Heap.cpp:
(JSC::Heap::Heap):
(JSC::Heap::lastChanceToFinalize):
(JSC::Heap::markRoots):
(JSC::Heap::beginMarking):
(JSC::Heap::visitSmallStrings):
(JSC::Heap::updateObjectCounts):
(JSC::Heap::deleteAllCodeBlocks):
(JSC::Heap::deleteUnmarkedCompiledCode):
(JSC::Heap::collectAllGarbage):
(JSC::Heap::collect):
(JSC::Heap::collectWithoutAnySweep):
(JSC::Heap::collectImpl):
(JSC::Heap::willStartCollection):
(JSC::Heap::flushWriteBarrierBuffer):
(JSC::Heap::pruneStaleEntriesFromWeakGCMaps):
(JSC::Heap::notifyIncrementalSweeper):
(JSC::Heap::updateAllocationLimits):
(JSC::Heap::didFinishCollection):
(JSC::Heap::isValidAllocation):
(JSC::Heap::shouldDoFullCollection):
* heap/Heap.h:
(JSC::Heap::mutatorState):
(JSC::Heap::collectionScope):
(JSC::Heap::operationInProgress): Deleted.
* heap/HeapInlines.h:
(JSC::Heap::shouldCollect):
(JSC::Heap::isCurrentThreadBusy):
(JSC::Heap::isMarked):
(JSC::Heap::reportExtraMemoryVisited):
(JSC::Heap::reportExternalMemoryVisited):
(JSC::Heap::collectAccordingToDeferGCProbability):
(JSC::Heap::isBusy): Deleted.
(JSC::Heap::isCollecting): Deleted.
* heap/HeapObserver.h:
* heap/HeapOperation.cpp: Removed.
* heap/HeapOperation.h: Removed.
* heap/HeapVerifier.cpp:
(JSC::HeapVerifier::initializeGCCycle):
(JSC::HeapVerifier::reportObject):
(JSC::HeapVerifier::collectionTypeName): Deleted.
* heap/HeapVerifier.h:
(JSC::HeapVerifier::GCCycle::collectionTypeName): Deleted.
* heap/HelpingGCScope.h: Added.
(JSC::HelpingGCScope::HelpingGCScope):
(JSC::HelpingGCScope::~HelpingGCScope):
* heap/LargeAllocation.cpp:
(JSC::LargeAllocation::flip):
* heap/MarkedAllocator.cpp:
(JSC::MarkedAllocator::doTestCollectionsIfNeeded):
(JSC::MarkedAllocator::allocateSlowCaseImpl):
* heap/MarkedBlock.h:
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::prepareForAllocation):
(JSC::MarkedSpace::visitWeakSets):
(JSC::MarkedSpace::reapWeakSets):
(JSC::MarkedSpace::prepareForMarking):
(JSC::MarkedSpace::beginMarking):
(JSC::MarkedSpace::snapshotUnswept):
* heap/MutatorState.cpp: Added.
(WTF::printInternal):
* heap/MutatorState.h: Added.
* heap/SlotVisitor.cpp:
(JSC::SlotVisitor::didStartMarking):
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::protocolTypeForHeapOperation):
(Inspector::InspectorHeapAgent::didGarbageCollect):
* inspector/agents/InspectorHeapAgent.h:
* interpreter/Interpreter.cpp:
(JSC::Interpreter::execute):
(JSC::Interpreter::executeCall):
(JSC::Interpreter::executeConstruct):
(JSC::Interpreter::prepareForRepeatCall):
* jsc.cpp:
(functionFullGC):
(functionEdenGC):
* runtime/Completion.cpp:
(JSC::evaluate):
(JSC::loadAndEvaluateModule):
(JSC::loadModule):
(JSC::linkAndEvaluateModule):
* runtime/JSLock.cpp:
(JSC::JSLock::DropAllLocks::DropAllLocks):
* runtime/SmallStrings.h:
(JSC::SmallStrings::needsToBeVisited):
* runtime/VM.h:
(JSC::VM::isCollectorBusyOnCurrentThread):
(JSC::VM::isCollectorBusy): Deleted.
* tools/JSDollarVMPrototype.cpp:
(JSC::JSDollarVMPrototype::edenGC):

Source/WebCore:

No new tests because no change in behavior.

* bindings/js/GCController.cpp:
(WebCore::GCController::garbageCollectNow):

Source/WTF:

There will soon be different kinds of GC threads, and WTF's "are you a GC thread" thing
should know about this.

* wtf/MainThread.cpp:
(WTF::initializeGCThreads):
(WTF::registerGCThread):
(WTF::mayBeGCThread):
* wtf/MainThread.h:

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

3 years ago[JSC] Drop isEnvironmentRecord type info flag and use JSType information instead
utatane.tea@gmail.com [Fri, 21 Oct 2016 01:33:14 +0000 (01:33 +0000)]
[JSC] Drop isEnvironmentRecord type info flag and use JSType information instead
https://bugs.webkit.org/show_bug.cgi?id=163761

Reviewed by Keith Miller.

JSTests:

* modules/string-prototype-module-scope.js: Added.
(shouldBe):
(catch):
(refer):
* stress/string-prototype-scopes-global-lexical-environment-strict.js: Added.
(shouldBe):
(catch):
* stress/string-prototype-scopes-global-lexical-environment.js: Added.
(shouldBe):
(catch):
* stress/string-prototype-scopes-strict.js: Added.
(shouldBe):
(catch):
(try.refer):
(refer):
* stress/string-prototype-scopes.js: Added.
(shouldBe):
(catch):
(try.refer):
(refer):
(object.toString):
(with):

Source/JavaScriptCore:

When we call a function in the following form,

    var charAt = String.prototype.charAt;
    charAt();  // |this| becomes the global object.

we should see |this| as undefined/null. In StringPrototype.cpp,
we use IsEnvironmentRecord type info flag to check whther the
given |this| is an environment record.
However, type info flag is precious thing and only StringPrototype.cpp
uses IsEnvironmentRecord. In addition to that, JSType should
already knows whether the given object is an environment record.
So IsEnvironmentRecord type info flag should be dropped.

This patch adds a new JSType, StrictEvalActivation. And we add a new
method JSObject::isEnvironmentRecord(). This method uses JSType to
return the result. And we drop IsEnvironmentRecord type info flag.
This patch makes a room for putting one bit flag to the out of line
type info flag. Previously, it is already exhausted.

* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:
* runtime/JSObject.h:
(JSC::JSObject::isStrictEvalActivation):
(JSC::JSObject::isEnvironmentRecord):
* runtime/JSSymbolTableObject.h:
* runtime/JSType.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::newImpurePropertyFiresWatchpoints):
(JSC::TypeInfo::isEnvironmentRecord): Deleted.
* runtime/StrictEvalActivation.h:
(JSC::StrictEvalActivation::createStructure):
* runtime/StringPrototype.cpp:
(JSC::checkObjectCoercible):

LayoutTests:

* js/dom/script-tests/string-prototype-scopes-in-workers.js: Added.
(catch):
* js/dom/script-tests/string-prototype-scopes.js: Added.
(catch):
* js/dom/string-prototype-scopes-expected.txt: Added.
* js/dom/string-prototype-scopes-in-workers-expected.txt: Added.
* js/dom/string-prototype-scopes-in-workers.html: Added.
* js/dom/string-prototype-scopes.html: Added.

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

3 years ago[Bindings] Start using signature->idlType instead of signature->type in the overload...
cdumez@apple.com [Fri, 21 Oct 2016 01:27:02 +0000 (01:27 +0000)]
[Bindings] Start using signature->idlType instead of signature->type in the overload resolution code
https://bugs.webkit.org/show_bug.cgi?id=163767

Reviewed by Darin Adler.

Start using signature->idlType instead of signature->type in the overload resolution code
to prepare for union type support.

* bindings/scripts/CodeGeneratorJS.pm:
(ComputeEffectiveOverloadSet):
(AreTypesDistinguishableForOverloadResolution):
(GetDistinguishingArgumentIndex):
(GetOverloadThatMatches):
(GenerateOverloadedFunctionOrConstructor):

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

3 years agoWebAssembly API: implement exception constructors properly
jfbastien@apple.com [Fri, 21 Oct 2016 01:19:24 +0000 (01:19 +0000)]
WebAssembly API: implement exception constructors properly

 - Rename WebAssemblyObject to JSWebAssembly for consistency.
 - WebAssembly object now has its own prototype: add WebAssemblyPrototype, and
   use it to register JSWebAssembly's function properties through auto-generated
   .lut.h, instead of manually.
 - The error constructors used to throw (e.g. `new WebAssembly.CompileError()`).
 - Register WebAssembly's constructors from the global object, and hold a
   reference to their structure and prototype so that invoking the constructor
   can use the structure directly from the global object.
 - Add a prototype base field to global object creation. Previous ones all had
   Object's prototype as their base, but WebAssembly's error constructors have
   Error as their base.
 - Test for the error object's correctness.
 - Add missing #if ENABLE(WEBASSEMBLY)

WebAssembly API: implement exception constructors properly
https://bugs.webkit.org/show_bug.cgi?id=163699

Reviewed by Keith Miller.

JSTests:

* wasm/js-api/test_basic_api.js:
(const.c.in.constructorProperties): more tests

Source/JavaScriptCore:

* CMakeLists.txt: rename WebAssemblyObject -> JSWebAssembly; add a .lut.h file
* DerivedSources.make: new .lut.h file
* JavaScriptCore.xcodeproj/project.pbxproj: ditto
* runtime/JSGlobalObject.cpp: new prototypeBase macro
(JSC::JSGlobalObject::init): register WebAssembly constructors here
(JSC::JSGlobalObject::visitChildren): use the macro to visit
* runtime/JSGlobalObject.h: declare the WebAssembly constructor macro
* wasm/JSWebAssembly.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssembly::create):
(JSC::JSWebAssembly::createStructure):
(JSC::JSWebAssembly::finishCreation):
(JSC::JSWebAssembly::JSWebAssembly):
* wasm/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/WebAssemblyObject.cpp: Removed.
* wasm/js/JSWebAssemblyCompileError.cpp:
* wasm/js/JSWebAssemblyCompileError.h:
(JSC::JSWebAssemblyCompileError::create): string convenience
* wasm/js/JSWebAssemblyInstance.cpp:
* wasm/js/JSWebAssemblyInstance.h:
* wasm/js/JSWebAssemblyMemory.cpp:
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.cpp:
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyRuntimeError.cpp:
* wasm/js/JSWebAssemblyRuntimeError.h:
(JSC::JSWebAssemblyRuntimeError::create): string convenience
* wasm/js/JSWebAssemblyTable.cpp:
* wasm/js/JSWebAssemblyTable.h:
* wasm/js/WebAssemblyCompileErrorConstructor.cpp:
(JSC::constructJSWebAssemblyCompileError):don't throw, create the object
(JSC::WebAssemblyCompileErrorConstructor::finishCreation):no need for the structure, it's on the global object
* wasm/js/WebAssemblyCompileErrorConstructor.h:
* wasm/js/WebAssemblyCompileErrorPrototype.cpp:
* wasm/js/WebAssemblyCompileErrorPrototype.h:
* wasm/js/WebAssemblyInstanceConstructor.cpp:
* wasm/js/WebAssemblyInstanceConstructor.h:
* wasm/js/WebAssemblyInstancePrototype.cpp:
* wasm/js/WebAssemblyInstancePrototype.h:
* wasm/js/WebAssemblyMemoryConstructor.cpp:
* wasm/js/WebAssemblyMemoryConstructor.h:
* wasm/js/WebAssemblyMemoryPrototype.cpp:
* wasm/js/WebAssemblyMemoryPrototype.h:
* wasm/js/WebAssemblyModuleConstructor.cpp:
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModulePrototype.cpp:
* wasm/js/WebAssemblyModulePrototype.h:
* wasm/js/WebAssemblyPrototype.cpp: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyCompileErrorPrototype.cpp.
(JSC::webAssemblyFunctionValidate):
(JSC::webAssemblyFunctionCompile):
(JSC::WebAssemblyPrototype::create):
(JSC::WebAssemblyPrototype::createStructure):
(JSC::WebAssemblyPrototype::finishCreation):
(JSC::WebAssemblyPrototype::WebAssemblyPrototype):
* wasm/js/WebAssemblyPrototype.h: Copied from Source/JavaScriptCore/wasm/js/WebAssemblyMemoryPrototype.h.
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp:
(JSC::constructJSWebAssemblyRuntimeError):don't throw, create the object
(JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):no need for the structure, it's on the global object
* wasm/js/WebAssemblyRuntimeErrorConstructor.h:
* wasm/js/WebAssemblyRuntimeErrorPrototype.cpp:
* wasm/js/WebAssemblyRuntimeErrorPrototype.h:
* wasm/js/WebAssemblyTableConstructor.cpp:
* wasm/js/WebAssemblyTableConstructor.h:
* wasm/js/WebAssemblyTablePrototype.cpp:
* wasm/js/WebAssemblyTablePrototype.h:

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

3 years agoImplement WebGL2 bufferData() and bufferSubData() methods
mmaxfield@apple.com [Fri, 21 Oct 2016 01:17:31 +0000 (01:17 +0000)]
Implement WebGL2 bufferData() and bufferSubData() methods
https://bugs.webkit.org/show_bug.cgi?id=163759

Reviewed by Dean Jackson.

Source/WebCore:

These new overloads simply clip the input array buffer.

Test: fast/canvas/webgl/bufferData-offset-length.html

* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::bufferData):
(WebCore::WebGL2RenderingContext::bufferSubData):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.idl:

LayoutTests:

* fast/canvas/webgl/bufferData-offset-length-expected.txt: Added.
* fast/canvas/webgl/bufferData-offset-length.html: Added.
* fast/canvas/webgl/resources/webgl-test.js:
(create3DContext):
(initWebGL):

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

3 years ago"Download Linked File" context menu action should use 'download' attribute as suggest...
cdumez@apple.com [Fri, 21 Oct 2016 01:15:54 +0000 (01:15 +0000)]
"Download Linked File" context menu action should use 'download' attribute as suggested filename
https://bugs.webkit.org/show_bug.cgi?id=163742
<rdar://problem/28840734>

Reviewed by Darin Adler.

Source/WebCore:

Add convenience method to HitTestResult to return the URL element's
download attribute.

* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::URLElementDownloadAttribute):
* rendering/HitTestResult.h:

Source/WebKit2:

Update "Download Linked File" context menu action to use the anchor
element's 'download' attribute as suggested filename for the download.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::downloadRequest):
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* Shared/WebHitTestResultData.cpp:
(WebKit::WebHitTestResultData::WebHitTestResultData):
(WebKit::WebHitTestResultData::encode):
(WebKit::WebHitTestResultData::decode):
* Shared/WebHitTestResultData.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::download):
* UIProcess/WebProcessPool.h:
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/link-with-download-attribute.html: Added.
* TestWebKitAPI/Tests/WebKit2/mac/ContextMenuDownload.mm: Added.
(TestWebKitAPI::didFinishLoadForFrame):
(TestWebKitAPI::getContextMenuFromProposedMenu):
(TestWebKitAPI::decideDestinationWithSuggestedFilename):
(TestWebKitAPI::TEST):

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

3 years agoAX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
n_wang@apple.com [Fri, 21 Oct 2016 01:15:21 +0000 (01:15 +0000)]
AX: VoiceOver is not detecting ARIA treeview if it contains role="presentation"
https://bugs.webkit.org/show_bug.cgi?id=163763

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/mac/aria-tree-with-presentation-role.html

Web authors sometimes use presentation role in the aria tree to hide elements. We should
consider this a valid case if they specify tree items and groups correctly.

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::hierarchicalLevel):
* accessibility/AccessibilityTree.cpp:
(WebCore::AccessibilityTree::nodeHasTreeItemChild):
(WebCore::AccessibilityTree::isTreeValid):
* accessibility/AccessibilityTree.h:

LayoutTests:

* accessibility/mac/aria-tree-with-presentation-role-expected.txt: Added.
* accessibility/mac/aria-tree-with-presentation-role.html: Added.

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

3 years agobmalloc api should crash on failure to allocate when !isBmallocEnabled.
mark.lam@apple.com [Fri, 21 Oct 2016 00:15:31 +0000 (00:15 +0000)]
bmalloc api should crash on failure to allocate when !isBmallocEnabled.
https://bugs.webkit.org/show_bug.cgi?id=163766

Reviewed by Keith Miller and Filip Pizlo.

We want to crash in bmalloc on failure to allocate even when !isBmallocEnabled.
This is so that failures to allocate memory will manifest as crashes with a
unique signature (i.e. as a SIGTRAP on release builds, or as a write to illegal
address 0xbbadbeef on debug builds) and the crash will manifest inside bmalloc.
This distinguishes allocation failures from other crashing bugs that manifest as
SIGSEGVs due to random pointer dereferences in the clients of bmalloc.

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::allocateImpl):
(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::allocateSlowCase):

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

3 years agoMany WebGL functions which don't throw are marked as possibly throwing
mmaxfield@apple.com [Thu, 20 Oct 2016 23:51:26 +0000 (23:51 +0000)]
Many WebGL functions which don't throw are marked as possibly throwing
https://bugs.webkit.org/show_bug.cgi?id=163747

Reviewed by Dean Jackson.

Mechanically remove the exception code.

No new tests because there is no behavior change.

* bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
(WebCore::getObjectParameter):
(WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
(WebCore::JSWebGLRenderingContextBase::getProgramParameter):
(WebCore::JSWebGLRenderingContextBase::getShaderParameter):
(WebCore::JSWebGLRenderingContextBase::getUniform):
(WebCore::dataFunctionf):
(WebCore::dataFunctioni):
(WebCore::dataFunctionMatrix):
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::texSubImage2D):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::activeTexture):
(WebCore::WebGLRenderingContextBase::attachShader):
(WebCore::WebGLRenderingContextBase::bindAttribLocation):
(WebCore::WebGLRenderingContextBase::bindBuffer):
(WebCore::WebGLRenderingContextBase::bindFramebuffer):
(WebCore::WebGLRenderingContextBase::bindRenderbuffer):
(WebCore::WebGLRenderingContextBase::bindTexture):
(WebCore::WebGLRenderingContextBase::bufferData):
(WebCore::WebGLRenderingContextBase::bufferSubData):
(WebCore::WebGLRenderingContextBase::compileShader):
(WebCore::WebGLRenderingContextBase::createShader):
(WebCore::WebGLRenderingContextBase::detachShader):
(WebCore::WebGLRenderingContextBase::disableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::drawArrays):
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::enableVertexAttribArray):
(WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
(WebCore::WebGLRenderingContextBase::framebufferTexture2D):
(WebCore::WebGLRenderingContextBase::getActiveAttrib):
(WebCore::WebGLRenderingContextBase::getActiveUniform):
(WebCore::WebGLRenderingContextBase::getAttachedShaders):
(WebCore::WebGLRenderingContextBase::getBufferParameter):
(WebCore::WebGLRenderingContextBase::getProgramParameter):
(WebCore::WebGLRenderingContextBase::getProgramInfoLog):
(WebCore::WebGLRenderingContextBase::getRenderbufferParameter):
(WebCore::WebGLRenderingContextBase::getShaderParameter):
(WebCore::WebGLRenderingContextBase::getShaderInfoLog):
(WebCore::WebGLRenderingContextBase::getShaderPrecisionFormat):
(WebCore::WebGLRenderingContextBase::getShaderSource):
(WebCore::WebGLRenderingContextBase::getTexParameter):
(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::getUniformLocation):
(WebCore::WebGLRenderingContextBase::getVertexAttrib):
(WebCore::WebGLRenderingContextBase::linkProgram):
(WebCore::WebGLRenderingContextBase::readPixels):
(WebCore::WebGLRenderingContextBase::shaderSource):
(WebCore::WebGLRenderingContextBase::videoFrameToImage):
(WebCore::WebGLRenderingContextBase::texImage2D):
(WebCore::WebGLRenderingContextBase::uniform1f):
(WebCore::WebGLRenderingContextBase::uniform1fv):
(WebCore::WebGLRenderingContextBase::uniform1i):
(WebCore::WebGLRenderingContextBase::uniform1iv):
(WebCore::WebGLRenderingContextBase::uniform2f):
(WebCore::WebGLRenderingContextBase::uniform2fv):
(WebCore::WebGLRenderingContextBase::uniform2i):
(WebCore::WebGLRenderingContextBase::uniform2iv):
(WebCore::WebGLRenderingContextBase::uniform3f):
(WebCore::WebGLRenderingContextBase::uniform3fv):
(WebCore::WebGLRenderingContextBase::uniform3i):
(WebCore::WebGLRenderingContextBase::uniform3iv):
(WebCore::WebGLRenderingContextBase::uniform4f):
(WebCore::WebGLRenderingContextBase::uniform4fv):
(WebCore::WebGLRenderingContextBase::uniform4i):
(WebCore::WebGLRenderingContextBase::uniform4iv):
(WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
(WebCore::WebGLRenderingContextBase::useProgram):
(WebCore::WebGLRenderingContextBase::validateProgram):
(WebCore::WebGLRenderingContextBase::vertexAttribPointer):
(WebCore::WebGLRenderingContextBase::restoreCurrentFramebuffer):
(WebCore::WebGLRenderingContextBase::restoreCurrentTexture2D):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:

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

3 years agoUnreviewed, rolling out r207589.
commit-queue@webkit.org [Thu, 20 Oct 2016 23:41:10 +0000 (23:41 +0000)]
Unreviewed, rolling out r207589.
https://bugs.webkit.org/show_bug.cgi?id=163765

Introduced 17 new layout test failures (Requested by
mcatanzaro on #webkit).

Reverted changeset:

"[GTK] Bump glib to 2.50.1"
https://bugs.webkit.org/show_bug.cgi?id=163689
http://trac.webkit.org/changeset/207589

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

3 years ago[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
mmaxfield@apple.com [Thu, 20 Oct 2016 23:05:53 +0000 (23:05 +0000)]
[macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
https://bugs.webkit.org/show_bug.cgi?id=163374

Reviewed by Darin Adler.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Because of platform lack of support for variations in in-memory fonts,
this feature should be disabled on the affected OSes.

No tests because there is no behavior change (on the relevant platforms).

* Configurations/FeatureDefines.xcconfig:

Source/WebKit/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Moving animations/font-variation-settings* tests to animations/font-variations
in order to make them easier to mark as failing.

Mark the relevant tests as failing on El Capitan and iOS 9.

* animations/font-variations/font-variation-settings-expected.html: Renamed from LayoutTests/animations/font-variation-settings-expected.html.
* animations/font-variations/font-variation-settings-order-expected.html: Renamed from LayoutTests/animations/font-variation-settings-order-expected.html.
* animations/font-variations/font-variation-settings-order.html: Renamed from LayoutTests/animations/font-variation-settings-order.html.
* animations/font-variations/font-variation-settings-unlike-expected.html: Renamed from LayoutTests/animations/font-variation-settings-unlike-expected.html.
* animations/font-variations/font-variation-settings-unlike.html: Renamed from LayoutTests/animations/font-variation-settings-unlike.html.
* animations/font-variations/font-variation-settings.html: Renamed from LayoutTests/animations/font-variation-settings.html.
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:

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

3 years agoIndexedDB 2.0: Support IDBObjectStore name assignment.
beidson@apple.com [Thu, 20 Oct 2016 23:03:21 +0000 (23:03 +0000)]
IndexedDB 2.0: Support IDBObjectStore name assignment.
<rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/IndexedDB/idbobjectstore-rename-errors-expected.txt:
* web-platform-tests/IndexedDB/idbobjectstore-rename-store-expected.txt:

Source/WebCore:

Tests: storage/indexeddb/modern/objectstore-rename-1-private.html
       storage/indexeddb/modern/objectstore-rename-1.html

Touches a *lot* of code sites, but none of them are particularly interesting.
They are all just getting the new name spread out to all of the various objects that need it.

* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::renameObjectStore):
* Modules/indexeddb/IDBDatabase.h:

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::setName):
* Modules/indexeddb/IDBObjectStore.h:
* Modules/indexeddb/IDBObjectStore.idl:

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::renameObjectStore):
(WebCore::IDBTransaction::renameObjectStoreOnServer):
(WebCore::IDBTransaction::didRenameObjectStoreOnServer):
* Modules/indexeddb/IDBTransaction.h:

* Modules/indexeddb/client/IDBConnectionProxy.cpp:
(WebCore::IDBClient::IDBConnectionProxy::renameObjectStore):
* Modules/indexeddb/client/IDBConnectionProxy.h:

* Modules/indexeddb/client/IDBConnectionToServer.cpp:
(WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
(WebCore::IDBClient::IDBConnectionToServer::didRenameObjectStore):
* Modules/indexeddb/client/IDBConnectionToServer.h:
* Modules/indexeddb/client/IDBConnectionToServerDelegate.h:

* Modules/indexeddb/server/IDBBackingStore.h:

* Modules/indexeddb/server/IDBConnectionToClient.cpp:
(WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore):
(WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore):
* Modules/indexeddb/server/IDBConnectionToClient.h:
* Modules/indexeddb/server/IDBConnectionToClientDelegate.h:

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

* Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
(WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreRenamed):
(WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
* Modules/indexeddb/server/MemoryBackingStoreTransaction.h:

* Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
(WebCore::IDBServer::MemoryIDBBackingStore::renameObjectStore):
* Modules/indexeddb/server/MemoryIDBBackingStore.h:

* Modules/indexeddb/server/MemoryObjectStore.h:
(WebCore::IDBServer::MemoryObjectStore::rename):

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::performRenameObjectStore):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformRenameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

* Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:

* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
(WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
* Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:

* Modules/indexeddb/shared/IDBDatabaseInfo.cpp:
(WebCore::IDBDatabaseInfo::renameObjectStore):
* Modules/indexeddb/shared/IDBDatabaseInfo.h:

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

* Modules/indexeddb/shared/IDBResultData.cpp:
(WebCore::IDBResultData::renameObjectStoreSuccess):
* Modules/indexeddb/shared/IDBResultData.h:

* Modules/indexeddb/shared/InProcessIDBServer.cpp:
(WebCore::InProcessIDBServer::didRenameObjectStore):
(WebCore::InProcessIDBServer::renameObjectStore):
* Modules/indexeddb/shared/InProcessIDBServer.h:

Source/WebKit2:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didRenameObjectStore):
(WebKit::WebIDBConnectionToClient::renameObjectStore):
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::renameObjectStore):
(WebKit::WebIDBConnectionToServer::didRenameObjectStore):
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

LayoutTests:

* storage/indexeddb/modern/objectstore-rename-1-expected.txt: Added.
* storage/indexeddb/modern/objectstore-rename-1-private-expected.txt: Added.
* storage/indexeddb/modern/objectstore-rename-1-private.html: Added.
* storage/indexeddb/modern/objectstore-rename-1.html: Added.
* storage/indexeddb/modern/resources/objectstore-rename-1.js: Added.

* storage/indexeddb/readonly-expected.txt:
* storage/indexeddb/readonly-private-expected.txt:
* storage/indexeddb/resources/readonly.js: Removed the test that verifies that object store names are
  readonly as they are no longer readonly.

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

3 years agoMake table.deleteRow(-1) a no-op when there are no rows
cdumez@apple.com [Thu, 20 Oct 2016 21:00:54 +0000 (21:00 +0000)]
Make table.deleteRow(-1) a no-op when there are no rows
https://bugs.webkit.org/show_bug.cgi?id=163746

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Import test coverage from:
- https://github.com/w3c/web-platform-tests/pull/4001

* web-platform-tests/html/semantics/tabular-data/the-table-element/remove-row-expected.txt:
* web-platform-tests/html/semantics/tabular-data/the-table-element/remove-row.html:
* web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt:
* web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html:
* web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell-expected.txt:
* web-platform-tests/html/semantics/tabular-data/the-tr-element/deleteCell.html:

Source/WebCore:

Make table.deleteRow(-1) a no-op when there are no rows, instead of throwing:
- https://github.com/whatwg/html/pull/1924

This is more consistent with the behavior of tbody.deleteRow(-1) and
tr.deleteCell(-1). This is also consistent with Gecko. Blink is doing the
same change via:
- https://codereview.chromium.org/2427963004/

No new tests, updated existing tests.

* html/HTMLTableElement.cpp:
(WebCore::HTMLTableElement::deleteRow):

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

3 years agoUnreviewed gardening.
zalan@apple.com [Thu, 20 Oct 2016 20:28:17 +0000 (20:28 +0000)]
Unreviewed gardening.

Update expected results.

* imported/blink/fast/pagination/first-letter-inherit-all-crash-expected.txt:

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

3 years ago[CSS Parser] Make sure to handle prefixed transform-style
hyatt@apple.com [Thu, 20 Oct 2016 20:13:34 +0000 (20:13 +0000)]
[CSS Parser] Make sure to handle prefixed transform-style
https://bugs.webkit.org/show_bug.cgi?id=163756

Reviewed by Dean Jackson.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

3 years agoShapes tests failing on iOS
dino@apple.com [Thu, 20 Oct 2016 20:10:42 +0000 (20:10 +0000)]
Shapes tests failing on iOS
https://bugs.webkit.org/show_bug.cgi?id=163755
<rdar://problem/28875780>

Skip these temporarily on iOS.

* platform/ios-simulator/TestExpectations:

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

3 years ago[CSS Parser] Fix crash when parsing -webkit-margin-collapse
hyatt@apple.com [Thu, 20 Oct 2016 20:10:07 +0000 (20:10 +0000)]
[CSS Parser] Fix crash when parsing -webkit-margin-collapse
https://bugs.webkit.org/show_bug.cgi?id=163753

Reviewed by Dean Jackson.

* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseShorthand):

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

3 years agoMarking compositing/iframes/page-cache-layer-tree.html as flaky on mac-wk1.
ryanhaddad@apple.com [Thu, 20 Oct 2016 19:59:01 +0000 (19:59 +0000)]
Marking compositing/iframes/page-cache-layer-tree.html as flaky on mac-wk1.
https://bugs.webkit.org/show_bug.cgi?id=163750

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

3 years agoPassing a number as the pixel parameter to texImage2D() doesn't thrown an exception
cdumez@apple.com [Thu, 20 Oct 2016 19:52:16 +0000 (19:52 +0000)]
Passing a number as the pixel parameter to texImage2D() doesn't thrown an exception
https://bugs.webkit.org/show_bug.cgi?id=163715

Reviewed by Darin Adler.

Source/WebCore:

Enable strict type checking for typed arrays in the bindings, similarly
do what we do for other wrapper types, as per Web IDL.

No new tests, updated existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateParametersCheck):

LayoutTests:

Update existing tests now that we throw a TypeError when passing an unexpected
type for a parameter where we expect a typed array.

* fast/canvas/webgl/script-tests/texImageTest.js:
* fast/canvas/webgl/texImageTest-expected.txt:
* webgl/1.0.2/resources/webgl_test_files/conformance/textures/tex-image-with-invalid-data.html:

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

3 years agoMarking media/modern-media-controls/media-controller/media-controller-resize.html...
ryanhaddad@apple.com [Thu, 20 Oct 2016 19:48:01 +0000 (19:48 +0000)]
Marking media/modern-media-controls/media-controller/media-controller-resize.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=163636

Unreviewed test gardening.

* TestExpectations:

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

3 years agoImprove error message when passing a null ArrayBuffer to bufferData()
mmaxfield@apple.com [Thu, 20 Oct 2016 19:17:06 +0000 (19:17 +0000)]
Improve error message when passing a null ArrayBuffer to bufferData()
https://bugs.webkit.org/show_bug.cgi?id=163745

Reviewed by Dean Jackson.

Source/WebCore:

Test: fast/canvas/webgl/bufferData-nullable-array-buffer-view.html

Update the idl file to accept a nullable ArrayBuffer, and throw
the relevant error with a more helpful error string.

* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::bufferData):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.idl:

LayoutTests:

* fast/canvas/webgl/bufferData-nullable-array-buffer-view-expected.txt: Added.
* fast/canvas/webgl/bufferData-nullable-array-buffer-view.html: Added.

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

3 years agoStop searching for first-letter containers at multi-column boundary.
zalan@apple.com [Thu, 20 Oct 2016 19:15:59 +0000 (19:15 +0000)]
Stop searching for first-letter containers at multi-column boundary.
https://bugs.webkit.org/show_bug.cgi?id=163739
<rdar://problem/28810750>

Source/WebCore:

We should not cross the multi-column boundary while searching for the first-letter container.
While moving first-letter renderers to a multi-column parent, it could result in finding the wrong
container and end up adding a new wrapper under the original container (from where we are moving the renderers).

Reviewed by David Hyatt.

Test: fast/css-generated-content/first-letter-move-to-multicolumn-crash.html

* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::moveChildrenTo):
* rendering/RenderTextFragment.cpp:
(WebCore::RenderTextFragment::blockForAccompanyingFirstLetter):

LayoutTests:

Reviewed by David Hyatt.

* fast/css-generated-content/first-letter-move-to-multicolumn-crash-expected.txt: Added.
* fast/css-generated-content/first-letter-move-to-multicolumn-crash.html: Added.

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

3 years agoSupport CSS Shapes Level 1 without a prefix
dino@apple.com [Thu, 20 Oct 2016 19:09:30 +0000 (19:09 +0000)]
Support CSS Shapes Level 1 without a prefix
https://bugs.webkit.org/show_bug.cgi?id=163709
<rdar://problem/28859369>

Reviewed by Myles Maxfield.

Source/WebCore:

Support the unprefixed form of CSS Shapes, now that
it is in CR.

We have a few failing tests:

- Some image-based shaping failures, now skipped.
  https://bugs.webkit.org/show_bug.cgi?id=163706

- Some false negatives, where my understanding
  of the CSS OM seems to suggest that the W3C tests
  are incorrect.
  https://bugs.webkit.org/show_bug.cgi?id=163708

Tests: imported/w3c/csswg-test/css-shapes-1

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/parser/CSSParser.cpp:
(WebCore::isSimpleLengthPropertyID):
(WebCore::CSSParser::parseValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::parseSingleValue):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):

Source/WebInspectorUI:

Replace -webkit-shape-outside with shape-outside.

* UserInterface/Models/CSSKeywordCompletions.js:

LayoutTests:

Unskip all but a couple of tests.

* TestExpectations:

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

3 years ago[CSS Parser] Fix region, column and page break parsing
hyatt@apple.com [Thu, 20 Oct 2016 18:35:56 +0000 (18:35 +0000)]
[CSS Parser] Fix region, column and page break parsing
https://bugs.webkit.org/show_bug.cgi?id=163743

Reviewed by Simon Fraser.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
Add the missing values for break support.

* css/parser/CSSPropertyParser.cpp:
(WebCore::isLegacyBreakProperty):
(WebCore::CSSPropertyParser::parseValueStart):
Add a special case for handling legacy break properties. Blink treats them like
shorthands, but we can't do that without breaking the old parser, so for now
we add a special case.

(WebCore::mapFromPageBreakBetween):
(WebCore::mapFromColumnBreakBetween):
(WebCore::mapFromRegionBreakBetween):
Updated to have the AvoidXXX values (where XXX is Column/Page/Region).

(WebCore::CSSPropertyParser::parseShorthand):
Remove the consumeLegacyBreak from the shorthand function, since we can't treat
the legacy break properties as shorthands yet.

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

3 years ago[JSC] disallow references to `await` in AsyncFunction formal parameters
caitp@igalia.com [Thu, 20 Oct 2016 18:30:59 +0000 (18:30 +0000)]
[JSC] disallow references to `await` in AsyncFunction formal parameters
https://bugs.webkit.org/show_bug.cgi?id=163694

Reviewed by Saam Barati.

JSTests:

* stress/async-await-syntax.js:

Source/JavaScriptCore:

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

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

3 years agoAdd convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
weinig@apple.com [Thu, 20 Oct 2016 18:27:28 +0000 (18:27 +0000)]
Add convenience function that combines WTF::visit(...) with WTF::makeVisitor(...)
https://bugs.webkit.org/show_bug.cgi?id=163713

Reviewed by Dan Bernstein.

Source/WebCore:

Switch uses of WTF::visit to use WTF::switchOn.

* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source):
* dom/Node.cpp:
(WebCore::nodeSetPreTransformedFromNodeOrStringVector):
(WebCore::Node::convertNodesOrStringsIntoNode):
* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::add):
* html/track/TrackEvent.cpp:
(WebCore::TrackEvent::TrackEvent):
* testing/TypeConversions.h:
(WebCore::TypeConversions::typeConversionsDictionaryUnionType):

Source/WTF:

- Add WTF::switchOn which merges WTF::visit with WTF::makeVisitor in the following
  way:
        WTF::visit(WTF::makeVisitor(...), variant)

* wtf/Variant.h:
(WTF::switchOn):

Tools:

* TestWebKitAPI/Tests/WTF/Variant.cpp:
Add test for WTF::switchOn()

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

3 years ago[JSC] Move InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero to out of line...
utatane.tea@gmail.com [Thu, 20 Oct 2016 18:02:31 +0000 (18:02 +0000)]
[JSC] Move InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero to out of line type info flags
https://bugs.webkit.org/show_bug.cgi?id=163716

Reviewed by Saam Barati.

We found that all the accesses to the InterceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero flag is
done through the Structure. There is no user that accesses this flag in the cell inlined member. And JIT
code does not access it directly. That means that we can move this flag from inlined flags to out of line
flags. This patch moves it to the out of line flags. And make one bit empty in inlined flags. Later this
new empty flag will be used by megamorphic DOMJIT implementation.

* runtime/JSTypeInfo.h:
(JSC::TypeInfo::hasStaticPropertyTable):
(JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):

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

3 years agoInvalid assertion in arguments elimination
keith_miller@apple.com [Thu, 20 Oct 2016 17:40:19 +0000 (17:40 +0000)]
Invalid assertion in arguments elimination
https://bugs.webkit.org/show_bug.cgi?id=163740
<rdar://problem/27911462>

Reviewed by Michael Saboff.

JSTests:

* stress/direct-arguments-osr-entry.js: Added.
(foo.):
(foo):

Source/JavaScriptCore:

The DFGFTL's arguments elimination phase incorrectly asserted that a GetFromArguments' first
child would always be a CreateDirectArguments.  While we only create the
op_get_from_arguments bytecode pointing to a create_direct_arguments, its possible for a
number of reasons that a DFG GetFromArguments may not point to a CreateDirectArguments. For
example, if we are OSR entering in some function with direct arguments the
CreateDirectArguments node might become ExtractOSREntryLocals.

* dfg/DFGArgumentsEliminationPhase.cpp:

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

3 years ago[CSS Parser] Fix font family parsing and add CSS region property parsing
hyatt@apple.com [Thu, 20 Oct 2016 17:25:01 +0000 (17:25 +0000)]
[CSS Parser] Fix font family parsing and add CSS region property parsing
https://bugs.webkit.org/show_bug.cgi?id=163741

Reviewed by Zalan Bujtas.

* css/parser/CSSParser.cpp:
(WebCore::isKeywordPropertyID):
(WebCore::parseKeywordValue):
(WebCore::CSSParser::parseValue):
Modify the old CSSParser to have its own keyword check, since keywords were
incorrectly added to the new parser when this check was consolidated. Column
and region breaks are considered keyword properties by the old parser, but
not by the new parser, since the new parser special cases them and maps them
into the generic break property.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Update for regions to make sure all the region properties are there. Remove the
column and region break properties, since they're not supposed to be here in the
new parser.

* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFamilyName):
Fix font parsing to make font family values so that fonts work.

(WebCore::consumeFlowProperty):
Add a function for handling -webkit-flow-from and -webkit-flow-into.

(WebCore::CSSPropertyParser::parseSingleValue):
Add support for the region properties.

(WebCore::mapFromRegionBreakBetween):
(WebCore::mapFromColumnRegionOrPageBreakInside):
(WebCore::mapFromLegacyBreakProperty):
(WebCore::CSSPropertyParser::consumeLegacyBreakProperty):
(WebCore::mapFromColumnOrPageBreakInside): Deleted.
Update to handle the region break properties in the same way that column break
properties are handled.

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

3 years agoCRASH in WebCore::MediaSource::seekToTime + 185
jer.noble@apple.com [Thu, 20 Oct 2016 16:53:00 +0000 (16:53 +0000)]
CRASH in WebCore::MediaSource::seekToTime + 185
https://bugs.webkit.org/show_bug.cgi?id=163652

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/media-source/media-source-seek-detach-crash.html

Add isClosed() checks (which are effectively m_private null-checks) everywhere m_private is
dereferenced. The one place where m_private is cleared without setting the state to closed
is stop(), so make stop() set the state to closed as well (without firing any events).

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::completeSeek):
(WebCore::MediaSource::monitorSourceBuffers):
(WebCore::MediaSource::streamEndedWithError):
(WebCore::MediaSource::stop):

LayoutTests:

* media/media-source/content/test-48kHz.m4a: Added.
* media/media-source/content/test-48khz-manifest.json: Added.
* media/media-source/media-source-seek-detach-crash-expected.txt: Added.
* media/media-source/media-source-seek-detach-crash.html: Added.

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

3 years agoDrop StyleResolver and SelectorQueryCache when entering PageCache.
akling@apple.com [Thu, 20 Oct 2016 16:38:50 +0000 (16:38 +0000)]
Drop StyleResolver and SelectorQueryCache when entering PageCache.
<https://webkit.org/b/154238>

Reviewed by Antti Koivisto.

Source/WebCore:

Stop keeping these around for cached pages to save lots of memory.
We can easily rebuild them if a cached navigation occurs, and this
way we also don't need to worry about invalidating style for cached
pages in all the right places.

Restoring a cached page will now lead to a forced style recalc.
We don't try to defer this (beyond a zero-timer) since it's going
to happen anyway, and it's nicer to front-load the cost rather than
stuttering on the first user content interaction.

* dom/Document.cpp:
(WebCore::Document::setPageCacheState):
* history/CachedPage.cpp:
(WebCore::CachedPage::restore):
(WebCore::CachedPage::clear):
* history/CachedPage.h:
(WebCore::CachedPage::markForVisitedLinkStyleRecalc): Deleted.
(WebCore::CachedPage::markForFullStyleRecalc): Deleted.
* history/PageCache.cpp:
(WebCore::PageCache::markPagesForVisitedLinkStyleRecalc): Deleted.
(WebCore::PageCache::markPagesForFullStyleRecalc): Deleted.
* history/PageCache.h:
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Page.cpp:
(WebCore::Page::setViewScaleFactor):
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::setPagination):
(WebCore::Page::setPaginationLineGridEnabled):
(WebCore::Page::setVisitedLinkStore):

LayoutTests:

Progression in compositing/iframes/page-cache-layer-tree.html, when navigating back,
the two iframes' dimensions correctly exclude the horizontal scrollbar's height since
it's not present after a style recalc.

* compositing/iframes/page-cache-layer-tree-expected.txt:

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

3 years ago[GTK] Build fix after r207616
clopez@igalia.com [Thu, 20 Oct 2016 15:57:25 +0000 (15:57 +0000)]
[GTK] Build fix after r207616
https://bugs.webkit.org/show_bug.cgi?id=163333

Reviewed by Carlos Garcia Campos.

EGL_PLATFORM_X11_KHR and EGL_PLATFORM_WAYLAND_KHR are not defined
on the EGL headers shipped by Mesa 10.3 (shipped by Debian 8)

* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::initializeEGLDisplay):

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

3 years ago[JSC] throw TypeError when constructing dynamically created JSGeneratorFunction
caitp@igalia.com [Thu, 20 Oct 2016 15:00:43 +0000 (15:00 +0000)]
[JSC] throw TypeError when constructing dynamically created JSGeneratorFunction
https://bugs.webkit.org/show_bug.cgi?id=163714

Reviewed by Mark Lam.

JSTests:

Add missing test coverage that dynamically created
JSGeneratorFunctions can not be constructed.

* stress/generator-function-constructor.js:
(shouldThrow):

Source/JavaScriptCore:

According to CreateDynamicFunction() (https://tc39.github.io/ecma262/#sec-createdynamicfunction),
non-normal functions are not constructors. Previously, dynamically created functions would always
be constructible, and so it was possible to evaluate `new  (function*() {}.constructor())`,
and have it return an Iterator object.

This change selects a dynamically created function's ConstructAbility based on its parse mode instead.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getFunctionExecutableFromGlobalCode):

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

3 years ago[CMake] CMake does not support the dep files for implicit dependency
commit-queue@webkit.org [Thu, 20 Oct 2016 14:34:24 +0000 (14:34 +0000)]
[CMake] CMake does not support the dep files for implicit dependency
https://bugs.webkit.org/show_bug.cgi?id=161433

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2016-10-20
Reviewed by Brent Fulgham.

Created a Perl script to generate all IDL bindings for CMake.
This script can regenerate outdated bindings by based on the
supplemental dependency and dep files created by
'--write-dependencies' switch of generate-bindings.pl.

add_custom_target is used to invoke the script instead of
add_custom_command because Ninja deletes all output files before
executing the command in case of add_custom_command.

USES_TERMINAL option of add_custom_target has two effects:
1) Not buffering output of the command
2) Invoking the command in the special Ninja pool which inhibits parallel build
One needs to use CMake 3.2 or later to enable this feature.

.:

* Source/cmake/WebKitMacros.cmake (GENERATE_BINDINGS): Included
ProcessorCount.  Added a new argument 'target'.  Use
add_custom_target instead of add_custom_command.  Invoke the new
script.

Source/WebCore:

* CMakeLists.txt: Specified target names for
GENERATE_BINDINGS. Added dependency for the targets.
* bindings/scripts/generate-bindings-all.pl: Added.

Tools:

* DumpRenderTree/CMakeLists.txt: Specified a target name for
GENERATE_BINDINGS. Added dependency for the target.
* WebKitTestRunner/CMakeLists.txt: Ditto.

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

3 years agoPrefer eglGetPlatformDisplay to eglGetDisplay
commit-queue@webkit.org [Thu, 20 Oct 2016 13:18:09 +0000 (13:18 +0000)]
Prefer eglGetPlatformDisplay to eglGetDisplay
https://bugs.webkit.org/show_bug.cgi?id=163333

Patch by Adam Jackson <ajax@redhat.com> on 2016-10-20
Reviewed by Carlos Garcia Campos.

eglGetDisplay forces the implementation to guess what kind of void* it's been handed. Different implementations
do different things, in particular glvnd and Mesa behave differently. Fortunately there exists API to tell EGL
what kind of display it is, so let's use it.

* platform/graphics/wayland/PlatformDisplayWayland.cpp:
(WebCore::PlatformDisplayWayland::initialize):
* platform/graphics/x11/PlatformDisplayX11.cpp:
(WebCore::PlatformDisplayX11::initializeEGLDisplay):

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

3 years ago[GTK] Avoid including egl.h headers in internal headers
carlosgc@webkit.org [Thu, 20 Oct 2016 12:37:53 +0000 (12:37 +0000)]
[GTK] Avoid including egl.h headers in internal headers
https://bugs.webkit.org/show_bug.cgi?id=163722

Reviewed by Žan Doberšek.

egl.h includes eglplatform.h that decides the native types for the platform at compile time. However, we support
to build with X11 and Wayland at the same time and decide what to use at runtime. Currently GLContext.h includes
eglplatform.h after wayland-egl.h if Wayland is enabled. That means that the wayland native types are used by
default from all cpp files including GLContext.h. It currently works in X11 because we cast the value anyway and
for example EGLNativeWindowType is a pointer in Wayland that can be casted to unsigned long in X11 to represent
the X Window. This is very fragile in any case, we should avoid adding egl headers in our headers and only
include it in cpp files. But we also need to ensure we don't use X11 and Wayland in the same cpp file.

* PlatformGTK.cmake:
* platform/graphics/GLContext.cpp:
(WebCore::GLContext::createContextForWindow):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createWindowContext):
(WebCore::GLContextEGL::createContext):
(WebCore::GLContextEGL::~GLContextEGL):
* platform/graphics/egl/GLContextEGL.h:
* platform/graphics/egl/GLContextEGLWayland.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceWayland):
(WebCore::GLContextEGL::createWaylandContext):
(WebCore::GLContextEGL::destroyWaylandWindow):
* platform/graphics/egl/GLContextEGLX11.cpp: Added.
(WebCore::GLContextEGL::GLContextEGL):
(WebCore::GLContextEGL::createWindowSurfaceX11):
(WebCore::GLContextEGL::createPixmapContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::GLContextGLX::createWindowContext):
(WebCore::GLContextGLX::createContext):
(WebCore::GLContextGLX::GLContextGLX):
* platform/graphics/glx/GLContextGLX.h:
* platform/graphics/wayland/PlatformDisplayWayland.cpp:
* platform/graphics/x11/PlatformDisplayX11.cpp:

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

3 years ago[GTK] Avoid strstr() when checking (E)GL extensions
carlosgc@webkit.org [Thu, 20 Oct 2016 12:36:06 +0000 (12:36 +0000)]
[GTK] Avoid strstr() when checking (E)GL extensions
https://bugs.webkit.org/show_bug.cgi?id=161958

Reviewed by Žan Doberšek.

Source/WebCore:

Add static method GLContext::isExtensionSupported() to properly search extenstions in the given extension
list, and use it instead of strstr().

* platform/graphics/GLContext.cpp:
(WebCore::GLContext::isExtensionSupported):
* platform/graphics/GLContext.h:
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createSurfacelessContext):
* platform/graphics/glx/GLContextGLX.cpp:
(WebCore::hasSGISwapControlExtension):

Source/WebKit2:

Use GLContext::isExtensionSupported() instead of strstr().

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::initializeEGL):

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

3 years ago[GTK] Cannot build GTK+ with CUPS 2.* versions
rego@igalia.com [Thu, 20 Oct 2016 10:11:02 +0000 (10:11 +0000)]
[GTK] Cannot build GTK+ with CUPS 2.* versions
https://bugs.webkit.org/show_bug.cgi?id=163591

Reviewed by Michael Catanzaro.

GTK+ is wrongly checking about the available CUPS version,
so if you have CUPS 2.* the configure step fails.

This has been already fixed upstream and included in 2.30 series:
https://git.gnome.org/browse/gtk+/commit/?id=631f6b536485829a0bd00532f5826ad302b4951b

Added patch on JHBuild so we can now build GTK+ with CUPS 2.*.

* gtk/jhbuild.modules: Applied patch and avoid using "configure" script directly
as the patch modifies "configure.ac".
* gtk/patches/configure-fix-detecting-CUPS-2.x.patch: Added.

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

3 years ago[Win][Direct2D] Implement ImageBufferData::getData.
pvollan@apple.com [Thu, 20 Oct 2016 09:03:29 +0000 (09:03 +0000)]
[Win][Direct2D] Implement ImageBufferData::getData.
https://bugs.webkit.org/show_bug.cgi?id=163668

Reviewed by Brent Fulgham.

Render data to a bitmap in system memory, which data can be read from.

* platform/graphics/win/ImageBufferDataDirect2D.cpp:
(WebCore::ImageBufferData::getData):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::ImageBuffer):

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

3 years agoWrong use of EGL_DEPTH_SIZE
carlosgc@webkit.org [Thu, 20 Oct 2016 08:33:44 +0000 (08:33 +0000)]
Wrong use of EGL_DEPTH_SIZE
https://bugs.webkit.org/show_bug.cgi?id=155536

Reviewed by Michael Catanzaro.

Source/WebCore:

What happens here is that the driver doesn't implement EGL_DEPTH_SIZE and the default value, which is 0, is
returned. Then XCreatePixmap fails because 0 is not a valid depth. The thing is that even if EGL_DEPTH_SIZE or
EGL_BUFFER_SIZE returned a valid depth, it still might not be supported by the default screen and XCreatePixmap
can fail. What we need to ensure is that the depth we pass is compatible with the X display, not only with the
EGL config, to avoid failures when creating the pixmap. So, we can use EGL_NATIVE_VISUAL_ID instead, and
then ask X for the visual info for that id. If it isn't found then we just return before creating the pixmap,
but if the visual is found then we can be sure that the depth of the visual will not make the pixmap creation
fail. However, with the driver I'm using it doesn't matter how we create the pixmap that eglCreatePixmapSurface
always fails, again with X errors that are fatal by default. Since the driver is not free, I assume it doesn't
support eglCreatePixmapSurface or it's just buggy, so the only option we have here is trap the x errors and
ignore them. It turns out that the X errors are not fatal in this case, because eglCreatePixmapSurface ends up
returning a surface, and since these are offscreen contexts, it doesn't really matter if they contain an
invalid pixmap, because we never do swap buffer on them, so just ignoring the X errors fixes the crashes and
makes everythig work. This patch adds a helper class XErrorTrapper that allows to trap XErrors and decide what
to do with them (ignore, warn or crash) or even not consider a particular set of errors as errors.

* PlatformEfl.cmake: Add new file to compilation.
* PlatformGTK.cmake: Ditto.
* platform/graphics/egl/GLContextEGL.cpp:
(WebCore::GLContextEGL::createPixmapContext): Use EGL_NATIVE_VISUAL_ID instead of EGL_DEPTH_SIZE to figure out
the depth to be passed to XCreatePixmap. Also use the XErrorTrapper class to ignore all BadDrawable errors
produced by eglCreatePixmapSurface() and only show a warning about all other X errors.
* platform/graphics/x11/XErrorTrapper.cpp: Added.
(WebCore::xErrorTrappersMap):
(WebCore::XErrorTrapper::XErrorTrapper):
(WebCore::XErrorTrapper::~XErrorTrapper):
(WebCore::XErrorTrapper::errorCode):
(WebCore::XErrorTrapper::errorEvent):
* platform/graphics/x11/XErrorTrapper.h: Added.
(WebCore::XErrorTrapper::XErrorTrapper):

Source/WebKit2:

Use XErrorTrapper class instead of the custom XErrorHandler.

* PluginProcess/unix/PluginProcessMainUnix.cpp:
(WebKit::PluginProcessMainUnix):

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

3 years ago[GTK] Bump glib to 2.50.1
rego@igalia.com [Thu, 20 Oct 2016 08:30:13 +0000 (08:30 +0000)]
[GTK] Bump glib to 2.50.1
https://bugs.webkit.org/show_bug.cgi?id=163689

Reviewed by Michael Catanzaro.

This is need in order to fix GTK+ build with CUPS 2.* (bug #163591).

* gtk/jhbuild.modules: Bump glib version. Pass --disable-libmount to build properly.
Also we don't need the patches anymore.
* gtk/patches/gdate-suppress-string-format-literal-warning.patch: Removed.
* gtk/patches/glib-warning-fix.patch: Removed.

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

3 years agoWebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
nael.ouedraogo@crf.canon.fr [Thu, 20 Oct 2016 07:26:55 +0000 (07:26 +0000)]
WebRTC: The MediaStreamTrackEvent init dictionary needs a required track member
https://bugs.webkit.org/show_bug.cgi?id=146232

Update MediaStreamTrackEvent IDL as per specification.

Source/WebCore:

Reviewed by Darin Adler.

No additional test required, rebase existings tests.

* Modules/mediastream/MediaStreamTrackEvent.idl:

LayoutTests:

No additional test required, rebase existings tests.

Reviewed by Darin Adler.

* fast/mediastream/MediaStreamTrackEvent-constructor-expected.txt:
* fast/mediastream/MediaStreamTrackEvent-constructor.html: Remove
useless tests.

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

3 years ago[Modern Media Controls] Media Controller: mute support
commit-queue@webkit.org [Thu, 20 Oct 2016 06:43:59 +0000 (06:43 +0000)]
[Modern Media Controls] Media Controller: mute support
https://bugs.webkit.org/show_bug.cgi?id=163677
<rdar://problem/28851582>

Patch by Antoine Quint <graouts@apple.com> on 2016-10-19
Reviewed by Dean Jackson.

Source/WebCore:

We introduce the MuteSupport class which brings support for muting the media
by clicking on the mute button in the media controls and correctly reflecting
the media's muted state should the media be muted via the media API.

Tests: media/modern-media-controls/mute-support/mute-support-button-click.html
       media/modern-media-controls/mute-support/mute-support-media-api.html
       media/modern-media-controls/mute-support/mute-support-muted.html

* Modules/modern-media-controls/media/media-controller.js:
(MediaController):
* Modules/modern-media-controls/media/mute-support.js: Copied from Source/WebCore/Modules/modern-media-controls/media/media-controller.js.
(MuteSupport.prototype.get control):
(MuteSupport.prototype.get mediaEvents):
(MuteSupport.prototype.buttonWasClicked):
(MuteSupport.prototype.syncControl):
(MuteSupport):
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::mediaControlsScript):

LayoutTests:

New tests for the MuteSupport class and adding the new resource to other MediaController tests.

* media/modern-media-controls/media-controller/media-controller-constructor.html:
* media/modern-media-controls/media-controller/media-controller-resize.html:
* media/modern-media-controls/mute-support/mute-support-button-click-expected.txt: Added.
* media/modern-media-controls/mute-support/mute-support-button-click.html: Added.
* media/modern-media-controls/mute-support/mute-support-media-api-expected.txt: Added.
* media/modern-media-controls/mute-support/mute-support-media-api.html: Added.
* media/modern-media-controls/mute-support/mute-support-muted-expected.txt: Added.
* media/modern-media-controls/mute-support/mute-support-muted.html: Added.
* media/modern-media-controls/start-support/start-support-audio.html:
* media/modern-media-controls/start-support/start-support-autoplay.html:
* media/modern-media-controls/start-support/start-support-click-to-start.html:
* media/modern-media-controls/start-support/start-support-error.html:
* media/modern-media-controls/start-support/start-support-fullscreen.html:
* media/modern-media-controls/start-support/start-support-manual-play.html:
* media/modern-media-controls/start-support/start-support-no-source.html:

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

3 years ago[SOUP] Add NetworkSession implementation and switch to use it
carlosgc@webkit.org [Thu, 20 Oct 2016 06:42:24 +0000 (06:42 +0000)]
[SOUP] Add NetworkSession implementation and switch to use it
https://bugs.webkit.org/show_bug.cgi?id=163597

Reviewed by Alex Christensen.

Basically move the ResourceHandle implementation to the network process, but modernized, cleaned up, and adapted
to the NetworkSession model.

* CMakeLists.txt: Add new files to compilation.
* NetworkProcess/Downloads/Download.cpp:
(WebKit::Download::Download): Use the same code for all ports using NetworkSession and add missing
initialization of m_sessionID.
* NetworkProcess/Downloads/Download.h:
(WebKit::Download::Download): Define PlatformDownloadTaskRef on every platform to make the constructor common to
all ports using NetworkSession.
* NetworkProcess/Downloads/soup/DownloadSoup.cpp:
(WebKit::Download::cancelNetworkLoad):
(WebKit::Download::platformDidFinish):
* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::pendingDownloadID): Make const.
(WebKit::NetworkDataTask::pendingDownload): Ditto.
(WebKit::NetworkDataTask::pendingDownloadLocation): Ditto.
(WebKit::NetworkDataTask::isDownload): Helper to check if the task is a download.
* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didReceiveResponseNetworkSession): Use NetworkDataTask::isDownload().
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::NetworkProcess): NetworkSession::setCustomProtocolManager() is Cocoa only.
* NetworkProcess/NetworkSession.h:
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(WebKit::NetworkSession::networkStorageSession): Make const.
* NetworkProcess/soup/NetworkDataTaskSoup.cpp: Added.
(WebKit::NetworkDataTask::NetworkDataTask):
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::scheduleFailure):
(WebKit::NetworkDataTask::failureTimerFired):
(WebKit::NetworkDataTask::suggestedFilename):
(WebKit::NetworkDataTask::setSuggestedFilename):
(WebKit::NetworkDataTask::setPendingDownloadLocation):
(WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost):
(WebKit::NetworkDataTask::createRequest):
(WebKit::NetworkDataTask::clearRequest):
(WebKit::NetworkDataTask::resume):
(WebKit::NetworkDataTask::suspend):
(WebKit::NetworkDataTask::cancel):
(WebKit::NetworkDataTask::invalidateAndCancel):
(WebKit::NetworkDataTask::state):
(WebKit::NetworkDataTask::timeoutFired):
(WebKit::NetworkDataTask::startTimeout):
(WebKit::NetworkDataTask::stopTimeout):
(WebKit::NetworkDataTask::sendRequestCallback):
(WebKit::NetworkDataTask::didSendRequest):
(WebKit::NetworkDataTask::didReceiveResponse):
(WebKit::NetworkDataTask::tlsErrorsChangedCallback):
(WebKit::NetworkDataTask::tlsErrorsChanged):
(WebKit::NetworkDataTask::applyAuthenticationToRequest):
(WebKit::NetworkDataTask::authenticateCallback):
(WebKit::isAuthenticationFailureStatusCode):
(WebKit::NetworkDataTask::authenticate):
(WebKit::NetworkDataTask::continueAuthenticate):
(WebKit::NetworkDataTask::skipInputStreamForRedirectionCallback):
(WebKit::NetworkDataTask::skipInputStreamForRedirection):
(WebKit::NetworkDataTask::didFinishSkipInputStreamForRedirection):
(WebKit::shouldRedirectAsGET):
(WebKit::NetworkDataTask::shouldStartHTTPRedirection):
(WebKit::NetworkDataTask::continueHTTPRedirection):
(WebKit::NetworkDataTask::readCallback):
(WebKit::NetworkDataTask::read):
(WebKit::NetworkDataTask::didRead):
(WebKit::NetworkDataTask::didFinishRead):
(WebKit::NetworkDataTask::requestNextPartCallback):
(WebKit::NetworkDataTask::requestNextPart):
(WebKit::NetworkDataTask::didRequestNextPart):
(WebKit::NetworkDataTask::didFinishRequestNextPart):
(WebKit::NetworkDataTask::gotHeadersCallback):
(WebKit::NetworkDataTask::didGetHeaders):
(WebKit::NetworkDataTask::wroteBodyDataCallback):
(WebKit::NetworkDataTask::didWriteBodyData):
(WebKit::NetworkDataTask::download):
(WebKit::NetworkDataTask::writeDownloadCallback):
(WebKit::NetworkDataTask::writeDownload):
(WebKit::NetworkDataTask::didWriteDownload):
(WebKit::NetworkDataTask::didFinishDownload):
(WebKit::NetworkDataTask::didFailDownload):
(WebKit::NetworkDataTask::cleanDownloadFiles):
(WebKit::NetworkDataTask::didFail):
(WebKit::NetworkDataTask::networkEventCallback):
(WebKit::NetworkDataTask::networkEvent):
(WebKit::NetworkDataTask::startingCallback):
(WebKit::NetworkDataTask::requestStartedCallback):
(WebKit::NetworkDataTask::didStartRequest):
(WebKit::NetworkDataTask::restartedCallback):
(WebKit::NetworkDataTask::didRestart):
* NetworkProcess/soup/NetworkSessionSoup.cpp:
(WebKit::NetworkSession::create):
(WebKit::NetworkSession::defaultSession):
(WebKit::NetworkSession::networkStorageSession):
(WebKit::NetworkSession::NetworkSession):
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::soupSession):
(WebKit::NetworkSession::invalidateAndCancel):
(WebKit::NetworkSession::clearCredentials):
* NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
(WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Add implementation matching
WebFrameNetworkingContext::ensurePrivateBrowsingSession().
(WebKit::RemoteNetworkingContext::storageSession): Do not always return the default session if the given one is
in the global map.
* PlatformEfl.cmake: Ad new files to compilation.
* PlatformGTK.cmake: Ditto.
* WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
(WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Also create a NetworkSession.
* config.h: Enable NetworkSession unconditionally for Soup based ports.

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

3 years agoRevert r207151
achristensen@apple.com [Thu, 20 Oct 2016 06:05:26 +0000 (06:05 +0000)]
Revert r207151
https://bugs.webkit.org/show_bug.cgi?id=163675

Reviewed by Brent Fulgham.

.:

* Source/cmake/OptionsAppleWin.cmake:

Source/WebCore:

This code is still useful for comparison with Windows.  I'll remove it again soon.

No new tests.  No change in behavior.

* WebCore.xcodeproj/project.pbxproj:
* WebCorePrefix.h:
* loader/DocumentLoader.h:
* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cf/ResourceLoaderCFNet.cpp:
* loader/cocoa/SubresourceLoaderCocoa.mm:
(WebCore::SubresourceLoader::willCacheResponse):
* loader/mac/DocumentLoaderMac.cpp:
* loader/mac/ResourceLoaderMac.mm:
(WebCore::ResourceLoader::willCacheResponse):
* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
(WebCore::Page::addSchedulePair):
(WebCore::Page::removeSchedulePair):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::WebCoreNSURLAuthenticationChallengeClient::create):
(WebCore::WebCoreNSURLAuthenticationChallengeClient::WebCoreNSURLAuthenticationChallengeClient):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge):
* platform/mac/WebCoreSystemInterface.h:
* platform/network/NetworkStorageSession.h:
* platform/network/ProtectionSpace.h:
* platform/network/ProtectionSpaceBase.cpp:
* platform/network/ResourceHandle.cpp:
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.cpp:
* platform/network/ResourceHandleClient.h:
* platform/network/ResourceHandleInternal.h:
(WebCore::ResourceHandleInternal::ResourceHandleInternal):
* platform/network/ResourceRequestBase.cpp:
* platform/network/cf/AuthenticationCF.cpp:
(WebCore::AuthenticationChallenge::AuthenticationChallenge):
(WebCore::AuthenticationChallenge::setAuthenticationClient): Deleted.
(WebCore::AuthenticationChallenge::authenticationClient): Deleted.
(WebCore::AuthenticationChallenge::platformCompare): Deleted.
(WebCore::createCF): Deleted.
(WebCore::core): Deleted.
* platform/network/cf/AuthenticationCF.h:
* platform/network/cf/AuthenticationChallenge.h:
* platform/network/cf/CookieJarCFNet.cpp:
* platform/network/cf/CredentialStorageCFNet.cpp:
(WebCore::CredentialStorage::getFromPersistentStorage):
(WebCore::CredentialStorage::saveToPersistentStorage):
* platform/network/cf/LoaderRunLoopCF.cpp:
* platform/network/cf/LoaderRunLoopCF.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStorage):
* platform/network/cf/ProtectionSpaceCFNet.cpp:
* platform/network/cf/ProtectionSpaceCFNet.h:
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceErrorCF.cpp:
* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::shouldSniffConnectionProperty):
(WebCore::ResourceHandle::createCFURLConnection):
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::tryHandlePasswordBasedAuthentication):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::schedule):
(WebCore::ResourceHandle::unschedule):
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp:
* platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestSetContentDispositionEncodingFallbackArrayFunction):
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceRequestCFNet.h:
* platform/network/cf/ResourceResponse.h:
* platform/network/cf/ResourceResponseCFNet.cpp:
(WebCore::ResourceResponse::cfURLResponse):
* platform/network/cf/SynchronousLoaderClientCFNet.cpp:
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupConnectionScheduling):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::willCacheResponse):
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.h:
* platform/network/cocoa/CredentialCocoa.h:
* platform/network/cocoa/CredentialCocoa.mm:
(WebCore::Credential::Credential):
(WebCore::Credential::cfCredential):
* platform/network/cocoa/ProtectionSpaceCocoa.h:
* platform/network/cocoa/ProtectionSpaceCocoa.mm:
(WebCore::ProtectionSpace::ProtectionSpace):
(WebCore::ProtectionSpace::cfSpace):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::nsURLRequest):
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo):
(WebCore::ResourceResponse::nsURLResponse):
(WebCore::ResourceResponse::ResourceResponse):
* platform/network/ios/QuickLook.h:
* platform/network/ios/QuickLook.mm:
(-[WebQuickLookHandleAsDelegate initWithConnectionDelegate:]):
(-[WebQuickLookHandleAsDelegate connection:didReceiveDataArray:]):
(-[WebQuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:]):
(-[WebQuickLookHandleAsDelegate connectionDidFinishLoading:]):
(-[WebQuickLookHandleAsDelegate connection:didFailWithError:]):
(-[WebQuickLookHandleAsDelegate detachHandle]):
(WebCore::QuickLookHandle::create):
(WebCore::QuickLookHandle::cfResponse):
* platform/network/mac/AuthenticationMac.mm:
(-[WebCoreAuthenticationClientAsChallengeSender setCFChallenge:]):
(-[WebCoreAuthenticationClientAsChallengeSender cfChallenge]):
(WebCore::core):
(WebCore::mac):
* platform/network/mac/CookieJarMac.mm:
(WebCore::setCookiesFromDOM):
(WebCore::addCookie):
(WebCore::cookieStorage):
* platform/network/mac/CredentialStorageMac.mm:
* platform/network/mac/FormDataStreamMac.h:
* platform/network/mac/FormDataStreamMac.mm:
* platform/network/mac/ResourceErrorMac.mm:
(NSErrorFromCFError):
(WebCore::ResourceError::ResourceError):
(WebCore::ResourceError::nsError):
(WebCore::ResourceError::operator NSError *):
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::getConnectionTimingData):
* platform/network/mac/ResourceRequestMac.mm: Added.
(WebCore::ResourceRequest::ResourceRequest):
(WebCore::ResourceRequest::updateNSURLRequest):
* platform/network/mac/SynchronousLoaderClient.mm:
* platform/network/mac/WebCoreResourceHandleAsDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
* platform/network/mac/WebCoreURLResponse.mm:
* platform/win/TemporaryLinkStubs.cpp:
* testing/js/WebCoreTestSupportPrefix.h:

Source/WebKit:

* WebCoreSupport/WebResourceLoadScheduler.cpp:
(WebResourceLoadScheduler::scheduleLoad):

Source/WebKit/mac:

* Misc/WebDownload.mm:
(-[WebDownload _initWithLoadingCFURLConnection:request:response:delegate:proxy:]):
* Misc/WebDownloadInternal.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::convertMainResourceLoadToDownload):
* WebView/WebPreferences.mm:
(+[WebPreferences _setCurrentNetworkLoaderSessionCookieAcceptPolicy:]):
* WebView/WebView.mm:
(-[WebView scheduleInRunLoop:forMode:]):
(-[WebView unscheduleFromRunLoop:forMode:]):

Source/WebKit/win:

* DefaultDownloadDelegate.h:
* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::savePlatformDataToCachedFrame):
* WebCoreSupport/WebFrameNetworkingContext.cpp:
(WebFrameNetworkingContext::ensurePrivateBrowsingSession):
* WebCoreSupport/WebFrameNetworkingContext.h:
* WebCoreSupport/WebPlatformStrategies.cpp:
* WebDownload.h:
* WebError.cpp:
(WebError::localizedDescription):
(WebError::sslPeerCertificate):
* WebError.h:
* WebMutableURLRequest.cpp:
(WebMutableURLRequest::mutableCopy):
* WebURLAuthenticationChallenge.cpp:
(WebURLAuthenticationChallenge::initWithProtectionSpace):
(WebURLAuthenticationChallenge::initWithAuthenticationChallenge):
* WebURLResponse.cpp:
(WebURLResponse::sslPeerCertificate):
* WebURLResponse.h:
* WebView.cpp:
(WebView::setCacheModel):
(WebView::canHandleRequest):
(WebView::notifyPreferencesChanged):
(updateSharedSettingsFromPreferencesIfNeeded):

Source/WebKit2:

* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/mac/DownloadMac.mm:
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/mac/NetworkLoadMac.mm:
(WebKit::NetworkLoad::willCacheResponseAsync):
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/mac/WebCoreArgumentCodersMac.mm:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
* WebKit2.xcodeproj/project.pbxproj:

Source/WTF:

* wtf/Platform.h:
* wtf/SchedulePair.h:
* wtf/SchedulePairMac.mm:

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

3 years agoREGRESSION (r206025): All YouTube videos play with black bars on all four sides
jer.noble@apple.com [Thu, 20 Oct 2016 03:10:12 +0000 (03:10 +0000)]
REGRESSION (r206025): All YouTube videos play with black bars on all four sides
https://bugs.webkit.org/show_bug.cgi?id=163308

Reviewed by Darin Adler.

Source/WebCore:

Test: media/media-source/media-source-resize.html

After r206025, we do not fire resize events when the size change notification happens equal-
to-or-before the current time, which can happen at the very beginning of a stream. Take care
of this case by checking that the target time isn't actually in the past inside of
sizeWillChangeAtTime(), and also always skip the boundary time observer when there was no
previous size (such as after a flush due to a seek).

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::sizeWillChangeAtTime):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setNaturalSize):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::flushAndEnqueueNonDisplayingSamples):
(WebCore::SourceBufferPrivateAVFObjC::enqueueSample):

LayoutTests:

* media/media-source/media-source-resize-expected.txt: Added.
* media/media-source/media-source-resize.html: Added.

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

3 years agoAX: [Mac] Mark element AXAPI should comform to specs
n_wang@apple.com [Thu, 20 Oct 2016 02:33:19 +0000 (02:33 +0000)]
AX: [Mac] Mark element AXAPI should comform to specs
https://bugs.webkit.org/show_bug.cgi?id=163707

Reviewed by Chris Fleizach.

Source/WebCore:

Created a new role for mark elements on Mac and exposed the role
description.

Changes are covered in modified test expectaions.

* English.lproj/Localizable.strings:
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/AccessibilityObjectMac.mm:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper roleDescription]):
* platform/LocalizedStrings.cpp:
(WebCore::AXMarkText):
* platform/LocalizedStrings.h:

LayoutTests:

Added the modified roles-computedRoleString-expected.txt in mac platform so
that the exposed mark element won't affect other platform.

* platform/mac/accessibility/roles-computedRoleString-expected.txt: Added.
* platform/mac/accessibility/roles-exposed-expected.txt:

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

3 years agoRe-enable URLParser for non-Safari Cocoa apps after r207321
commit-queue@webkit.org [Thu, 20 Oct 2016 00:47:39 +0000 (00:47 +0000)]
Re-enable URLParser for non-Safari Cocoa apps after r207321
https://bugs.webkit.org/show_bug.cgi?id=163690

Patch by Alex Christensen <achristensen@webkit.org> on 2016-10-19
Reviewed by Darin Adler.

Source/WebCore:

I disabled the URLParser for non-Safari applications in r207305
to give me time to make URLParser more compatible, which I did in r207321

Updated some API tests which will be investigated in
https://bugs.webkit.org/show_bug.cgi?id=163127

* platform/URLParser.cpp:
(WebCore::URLParser::setEnabled):
(WebCore::URLParser::enabled):
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setURLParserEnabled): Deleted.
* testing/js/WebCoreTestSupport.h:

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(DumpRenderTreeMain):
* TestWebKitAPI/Tests/WebKit2Cocoa/LoadInvalidURLRequest.mm:
(-[LoadInvalidURLNavigationActionDelegate webView:didFailProvisionalNavigation:withError:]):
* TestWebKitAPI/Tests/mac/LoadInvalidURLRequest.mm:
(TestWebKitAPI::TEST):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::TestController):

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

3 years agoCSS font-variation-settings does not handle uppercase axis names in variable fonts
mmaxfield@apple.com [Thu, 20 Oct 2016 00:39:09 +0000 (00:39 +0000)]
CSS font-variation-settings does not handle uppercase axis names in variable fonts
https://bugs.webkit.org/show_bug.cgi?id=163546

Reviewed by Dean Jackson.

Source/WebCore:

Remove the extra toASCIILower() call.

Test: fast/text/variations/case-axis-names.html

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontVariationTag):

LayoutTests:

* fast/text/variations/case-axis-names-expected.html: Added.
* fast/text/variations/case-axis-names.html: Added.

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

3 years agoRemove m_redirectURLs from HistoryItem
andersca@apple.com [Thu, 20 Oct 2016 00:31:56 +0000 (00:31 +0000)]
Remove m_redirectURLs from HistoryItem
https://bugs.webkit.org/show_bug.cgi?id=163704

Reviewed by Dan Bernstein.

* history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
* history/HistoryItem.h:

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

3 years ago[WK2] Expose suggested filename via WKBundleHitTestResult API
cdumez@apple.com [Wed, 19 Oct 2016 23:55:30 +0000 (23:55 +0000)]
[WK2] Expose suggested filename via WKBundleHitTestResult API
https://bugs.webkit.org/show_bug.cgi?id=163693
<rdar://problem/28840734>

Reviewed by Anders Carlsson.

Expose suggested filename via WKBundleHitTestResult API. The implementation
currently relies on the 'download' attribute on anchor / area elements
that we recently started supporting.

* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
(WKBundleHitTestResultCopyLinkSuggestedFilename):
* WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
(WebKit::InjectedBundleHitTestResult::create):
(WebKit::InjectedBundleHitTestResult::mediaType):
(WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
(WebKit::InjectedBundleHitTestResult::imageRect):
* WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:

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

3 years agoAdd a plain space instead of &nbsp; between text nodes
joone.hur@intel.com [Wed, 19 Oct 2016 23:49:43 +0000 (23:49 +0000)]
Add a plain space instead of &nbsp; between text nodes
https://bugs.webkit.org/show_bug.cgi?id=123163

Reviewed by Ryosuke Niwa.

When we rebalance white spaces, &nbsp; can be added as space
under some conditions. This patch adds a condition that the next
sibling text node should not exist.

Source/WebCore:

No new tests, updated existing test.

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::rebalanceWhitespaceOnTextSubstring):
* editing/htmlediting.cpp:
(WebCore::stringWithRebalancedWhitespace):
* editing/htmlediting.h:

LayoutTests:

* accessibility/mac/find-and-replace-match-capitalization-expected.txt:
* accessibility/mac/find-and-replace-match-capitalization.html:
* accessibility/mac/select-text/select-text-135575-expected.txt:
* accessibility/mac/select-text/select-text-7-expected.txt:
* accessibility/mac/select-text/select-text-8-expected.txt:
* accessibility/mac/select-text/select-text-9-expected.txt:
* editing/mac/spelling/autocorrection-blockquote-crash-expected.txt:
* editing/pasteboard/paste-text-003-expected.txt:
* platform/gtk/editing/execCommand/paste-1-expected.txt:
* platform/gtk/editing/pasteboard/paste-2-expected.txt:
* platform/gtk/editing/pasteboard/unrendered-br-expected.txt:
* platform/mac/editing/execCommand/paste-1-expected.txt:
* platform/mac/editing/pasteboard/paste-2-expected.txt:
* platform/mac/editing/pasteboard/unrendered-br-expected.txt:

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

3 years agoREGRESSION (r207480): 3 Dromaeo tests failing
fpizlo@apple.com [Wed, 19 Oct 2016 23:37:20 +0000 (23:37 +0000)]
REGRESSION (r207480): 3 Dromaeo tests failing
https://bugs.webkit.org/show_bug.cgi?id=163633

Reviewed by Mark Lam.

It's a ParkingLot bug: if we timeout and get unparked at the same time, then the unparking
thread will clear our address eventually - but not immediately. This causes a nasty
assertion failure. The tricky thing is that when we detect this, we need to wait until that
unparking thread does the deed. Otherwise, they will still do it at some later time.

Alternatively, we could use some kind of versioning to detect this - increment the version
when you park, so that unparking threads will know if they are time travelers. That seems
more yucky.

I don't think it matters too much what we do here, so long as it's simple and correct, since
this requires a race that is rare enough that it didn't happen once in my testing, and I was
pretty thorough. For example, it didn't happen once in 15 runs of JetStream. The race is
rare because it requires the timeout to happen right as someone else is unparking. Since
it's so rare, its probably OK that the unparked thread waits just a tiny moment until the
unparking thread is done.

* wtf/ParkingLot.cpp:
(WTF::ParkingLot::parkConditionallyImpl):
(WTF::ParkingLot::unparkOneImpl):

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

3 years agocreate_hash_table: allow empty tables
jfbastien@apple.com [Wed, 19 Oct 2016 23:34:45 +0000 (23:34 +0000)]
create_hash_table: allow empty tables

The Windows build was broken by because I added empty tables and Windows insists that empty tables are horrible. Put in dummy entries in that case.

create_hash_table: allow empty tables
https://bugs.webkit.org/show_bug.cgi?id=163701

Reviewed by Keith Miller.

* create_hash_table:

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

3 years agoAdd support for sequences and dictionaries in unions
weinig@apple.com [Wed, 19 Oct 2016 23:31:14 +0000 (23:31 +0000)]
Add support for sequences and dictionaries in unions
https://bugs.webkit.org/show_bug.cgi?id=163695

Reviewed by Chris Dumez.

Source/WebCore:

Tests:
 - Updated js/dom/webidl-type-mapping.html

* bindings/generic/IDLTypes.h:
Add additional helper predicates and fix formatting.

* bindings/js/JSDOMBinding.h:
Export hasIteratorMethod for use in testing.

* bindings/js/JSDOMConvert.h:
- Change return type of Converter<IDLDictionary<T>> to T, from Optional<T>.
- Add support for unions conversion step 12 (parts 1-3).

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDefaultValue):
Support complex default value computations for unions using the convert infrastructure.

(GenerateParametersCheck):
(GenerateConstructorDefinition):
Remove incorrect .value() calls now that Converter<IDLDictionary<T>> returns T.

* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Update bindings test results.

* testing/TypeConversions.h:
(WebCore::TypeConversions::setTypeConversionsDictionary):
(WebCore::TypeConversions::typeConversionsDictionaryLongValue):
(WebCore::TypeConversions::typeConversionsDictionaryStringValue):
(WebCore::TypeConversions::typeConversionsDictionarySequenceValue):
(WebCore::TypeConversions::typeConversionsDictionaryUnionType):
* testing/TypeConversions.idl:
Add some complex types to allow testing IDL conversions from tests.

LayoutTests:

* js/dom/webidl-type-mapping-expected.txt:
* js/dom/webidl-type-mapping.html:
Add tests for more complex conversions.

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

3 years agoMarking platform/mac-wk2/plugins/muted-state.html as failing.
ryanhaddad@apple.com [Wed, 19 Oct 2016 23:01:22 +0000 (23:01 +0000)]
Marking platform/mac-wk2/plugins/muted-state.html as failing.
https://bugs.webkit.org/show_bug.cgi?id=163702

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoImport W3C CSS Shapes tests
dino@apple.com [Wed, 19 Oct 2016 22:28:02 +0000 (22:28 +0000)]
Import W3C CSS Shapes tests
https://bugs.webkit.org/show_bug.cgi?id=163697

Rubberstamped by Anders Carlsson.

LayoutTests/imported/w3c:

They are marked as skipped for the moment, since we don't yet
support the unprefixed form.

* csswg-test/css-shapes-1/shape-outside-invalid-001.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-circle-000.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-circle-001.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-circle-002.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-circle-003.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-ellipse-001.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-ellipse-002.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-ellipse-003.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-ellipse-004.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-ellipse-005.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-ellipse-006.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-inset-001.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-inset-002.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-inset-003.html: Added.
* csswg-test/css-shapes-1/shape-outside-invalid-inset-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-002-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-003-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-004-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-006-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-006.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-007-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-007.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-008-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/shape-outside-box-008.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-box/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-001-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-002-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-003-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-004-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-linear-gradient-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/shape-outside-radial-gradient-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/gradients/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-000-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-001-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-002-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-003-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-004-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-005-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-005.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-006-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-006.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-007-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-007.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-008-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-008.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-009-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-009.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-010-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-010.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-011-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-011.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-012-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-012.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-013-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-013.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-014-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-014.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-015-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-015.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-016-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-016.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-017-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-017.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-018-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-018.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-019-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-019.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-020-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-020.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-021-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-021.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-022-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-022.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-023-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-023.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-024-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-024.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-025-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/shape-image-025.html: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/animated.gif: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle-20.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle-20.svg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle-50.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle-50.svg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle-70.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle-70.svg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle.jpg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/left-half-rectangle.svg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle-20.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle-50.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle-70.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle-70.svg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle.gif: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle.jpg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle.png: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/right-half-rectangle.svg: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/support/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/shape-image/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-013-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-013.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-014-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-014.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-015-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-015.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-016-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-016.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-017-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-017.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-018-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-018.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-019-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-019.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-020-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-020.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-021-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-021.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-022-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-022.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-024-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-024.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-025-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-025.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-026-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-026.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-027-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-027.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-028-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-028.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-029-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-029.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-030-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-030.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-031-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/shape-outside-circle-031.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/circle/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-013-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-013.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-014-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-014.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-015.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-016-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-016.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-017.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-018-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-018.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-019-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-019.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-020-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-020.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-021-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-021.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-022-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-022.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-023-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-023.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-024-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-024.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-025-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-025.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-030-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-030.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-031-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/shape-outside-ellipse-031.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/ellipse/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-010-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-010.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-011-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-011.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-012-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-012.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-013-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-013.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-014-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-014.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-015-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/shape-outside-inset-015.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/inset/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-007-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-007.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-008-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-008.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-009-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-009.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-010-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-010.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-011-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-011.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-012-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-012.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-013-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-013.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-014-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-014.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-015-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-015.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-016-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-016.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-017-expected.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/shape-outside-polygon-017.html: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/polygon/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/supported-shapes/support/rounded-rectangle.js: Added.
(ellipseXIntercept):
(scanConvertRoundedRectangleOutside):
(genLeftRoundedRectFloatShapeOutsideRefTest):
(getRoundedRectLeftEdge):
(genRightRoundedRectFloatShapeOutsideRefTest):
* csswg-test/css-shapes-1/shape-outside/supported-shapes/support/subpixel-utils.js: Added.
(isEnabled):
(return.snapToLayoutUnit):
(return.ceilSnapToLayoutUnit):
(SubPixelLayout):
* csswg-test/css-shapes-1/shape-outside/supported-shapes/support/test-utils.js: Added.
(verifyTextPoints):
* csswg-test/css-shapes-1/shape-outside/supported-shapes/support/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-image-threshold-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-image-threshold-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-image-threshold-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-image-threshold-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-margin-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-margin-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-margin-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-margin-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-margin-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-margin-005.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-box-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-005.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-006.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-007.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-008.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-009.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-010.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-circle-011.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-computed-shape-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-computed-shape-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-005.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-006.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-007.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-008.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-009.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-010.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-ellipse-011.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-005.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-006.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-007.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-008.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-inset-009.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-002.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-003.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-004.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-005.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-polygon-006.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-arguments-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-arguments-001.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-box-pair-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-inherit-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-initial-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-none-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/shape-outside-shape-notation-000.html: Added.
* csswg-test/css-shapes-1/shape-outside/values/support/parsing-utils.js: Added.
(testComputedStyle):
(testShapeMarginComputedStyle):
(testShapeThresholdComputedStyle):
(buildPositionTests):
(buildRadiiTests):
(buildInsetTests):
(buildCalcTests):
(unique):
(setUnit):
(convertToPx):
(roundResultStr):
(insetRound):
(serializedInsetRound):
(generateInsetRoundCases):
* csswg-test/css-shapes-1/shape-outside/values/support/w3c-import.log: Added.
* csswg-test/css-shapes-1/shape-outside/values/w3c-import.log: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-001-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-001.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-002-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-002.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-003-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-003.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-004-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-004.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-005-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-005.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-006-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-006.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-007-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-007.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-008-expected.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-008.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-010.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-011.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-012.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-013.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-014.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-015.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-016.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-017.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-018.html: Added.
* csswg-test/css-shapes-1/spec-examples/shape-outside-019.html: Added.
* csswg-test/css-shapes-1/spec-examples/support/circle-no-shadow.png: Added.
* csswg-test/css-shapes-1/spec-examples/support/circle-shadow.png: Added.
* csswg-test/css-shapes-1/spec-examples/support/rounded-triangle.svg: Added.
* csswg-test/css-shapes-1/spec-examples/support/spec-example-utils.js: Added.
(runTest):
(approxShapeTest):
* csswg-test/css-shapes-1/spec-examples/support/w3c-import.log: Added.
* csswg-test/css-shapes-1/spec-examples/w3c-import.log: Added.
* csswg-test/css-shapes-1/support/1x1-green.png: Added.
* csswg-test/css-shapes-1/support/1x1-lime.png: Added.
* csswg-test/css-shapes-1/support/1x1-maroon.png: Added.
* csswg-test/css-shapes-1/support/1x1-navy.png: Added.
* csswg-test/css-shapes-1/support/1x1-red.png: Added.
* csswg-test/css-shapes-1/support/1x1-white.png: Added.
* csswg-test/css-shapes-1/support/60x60-gg-rr.png: Added.
* csswg-test/css-shapes-1/support/60x60-green.png: Added.
* csswg-test/css-shapes-1/support/60x60-red.png: Added.
* csswg-test/css-shapes-1/support/README: Added.
* csswg-test/css-shapes-1/support/a-green.css: Added.
(.a):
* csswg-test/css-shapes-1/support/b-green.css: Added.
(.b):
* csswg-test/css-shapes-1/support/c-red.css: Added.
(.c):
* csswg-test/css-shapes-1/support/cat.png: Added.
* csswg-test/css-shapes-1/support/pattern-grg-rgr-grg.png: Added.
* csswg-test/css-shapes-1/support/pattern-grg-rrg-rgg.png: Added.
* csswg-test/css-shapes-1/support/pattern-rgr-grg-rgr.png: Added.
* csswg-test/css-shapes-1/support/pattern-tr.png: Added.
* csswg-test/css-shapes-1/support/square-purple.png: Added.
* csswg-test/css-shapes-1/support/square-teal.png: Added.
* csswg-test/css-shapes-1/support/square-white.png: Added.
* csswg-test/css-shapes-1/support/swatch-blue.png: Added.
* csswg-test/css-shapes-1/support/swatch-green.png: Added.
* csswg-test/css-shapes-1/support/swatch-lime.png: Added.
* csswg-test/css-shapes-1/support/swatch-orange.png: Added.
* csswg-test/css-shapes-1/support/swatch-red.png: Added.
* csswg-test/css-shapes-1/support/swatch-white.png: Added.
* csswg-test/css-shapes-1/support/swatch-yellow.png: Added.
* csswg-test/css-shapes-1/support/test-bl.png: Added.
* csswg-test/css-shapes-1/support/test-br.png: Added.
* csswg-test/css-shapes-1/support/test-outer.png: Added.
* csswg-test/css-shapes-1/support/test-tl.png: Added.
* csswg-test/css-shapes-1/support/test-tr.png: Added.
* csswg-test/css-shapes-1/support/w3c-import.log: Added.
* csswg-test/css-shapes-1/test-plan/index.html: Added.
* csswg-test/css-shapes-1/test-plan/w3c-import.log: Added.
* csswg-test/css-shapes-1/w3c-import.log: Added.

LayoutTests:

* TestExpectations: Mark as skipped while we unprefix.

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

3 years agoJavaScript WebAssembly API: baby steps
jfbastien@apple.com [Wed, 19 Oct 2016 22:11:11 +0000 (22:11 +0000)]
JavaScript WebAssembly API: baby steps

 - Expand WebAssembly constructors into their own files. This requires a lot of
   boilerplate, as well as adding the .lut.h files. All of the
   JSWebAssembly*.{h,cpp}, as well as Constructor and Prototype files, are
   currently the same between the 4 specified WebAssembly constructors. It'll be
   easy to implement individual functions on constructed objects as per the
   spec, and have each of these files diverge. The error constructors are also
   similar, except that their instance derives from ErrorInstance.
 - Use constructor macro when initializing the global object.
 - Dramatically improve testing of the WebAssembly API by checking for
   properties specified in the spec [*].
 - Clean up assert.js' exception testing.
 - Fix a copy-paste bug in wasm.json: floating-point const return values were
   swapped.

[*] https://github.com/WebAssembly/design/blob/master/JS.md

Implement more of the JavaScript WebAssembly API
https://bugs.webkit.org/show_bug.cgi?id=163571

Reviewed by Keith Miller.

JSTests:

* wasm/assert.js:
(export.const.isUndef): add this useful helper
(export.const.throws): fold other throw checks into this one, and check message as well
* wasm/js-api/test_basic_api.js:
(const.checkOwnPropertyDescriptor): check own property descriptor follows the spec
* wasm/self-test/test_BuilderJSON.js:
(const.assertOpThrows): use new assert API
(CheckedOpcodeArgumentsTooMany): ditto
(CheckedOpcodeArgumentsNotEnough): ditto
(CallInvalid): ditto
(I32ConstInvalid): ditto
(F32ConstInvalid): ditto (and this caugth the JSON copy-paste bug)
(F64ConstInvalid): ditto
* wasm/self-test/test_LowLevelBinary_varint.js: use new assert API
* wasm/self-test/test_LowLevelBinary_varuint.js: use new assert API
* wasm/utilities.js: add "global" object, used in basic API test (to access global.WebAssembly).
* wasm/wasm.json: fix copy-paste

Source/JavaScriptCore:

* CMakeLists.txt: add .lut.h generation
* DerivedSources.make: ditto
* JavaScriptCore.xcodeproj/project.pbxproj: add .lut.h generation and all the new files
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): use macro to list all constructors
* wasm/WebAssemblyObject.cpp: unboilerplate, all constructors into their own files
* wasm/WebAssemblyObject.h: ditto
* wasm/js/JSWebAssemblyCompileError.cpp: Added.
(JSC::JSWebAssemblyCompileError::create):
(JSC::JSWebAssemblyCompileError::createStructure):
(JSC::JSWebAssemblyCompileError::JSWebAssemblyCompileError):
(JSC::JSWebAssemblyCompileError::finishCreation):
(JSC::JSWebAssemblyCompileError::destroy):
(JSC::JSWebAssemblyCompileError::visitChildren):
* wasm/js/JSWebAssemblyCompileError.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyInstance.cpp: Added.
(JSC::JSWebAssemblyInstance::create):
(JSC::JSWebAssemblyInstance::createStructure):
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::destroy):
(JSC::JSWebAssemblyInstance::visitChildren):
* wasm/js/JSWebAssemblyInstance.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyMemory.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::createStructure):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::finishCreation):
(JSC::JSWebAssemblyMemory::destroy):
(JSC::JSWebAssemblyMemory::visitChildren):
* wasm/js/JSWebAssemblyMemory.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyModule.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssemblyModule::create):
(JSC::JSWebAssemblyModule::createStructure):
(JSC::JSWebAssemblyModule::JSWebAssemblyModule):
(JSC::JSWebAssemblyModule::finishCreation):
(JSC::JSWebAssemblyModule::destroy):
(JSC::JSWebAssemblyModule::visitChildren):
* wasm/js/JSWebAssemblyModule.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyRuntimeError.cpp: Added.
(JSC::JSWebAssemblyRuntimeError::create):
(JSC::JSWebAssemblyRuntimeError::createStructure):
(JSC::JSWebAssemblyRuntimeError::JSWebAssemblyRuntimeError):
(JSC::JSWebAssemblyRuntimeError::finishCreation):
(JSC::JSWebAssemblyRuntimeError::destroy):
(JSC::JSWebAssemblyRuntimeError::visitChildren):
* wasm/js/JSWebAssemblyRuntimeError.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/JSWebAssemblyTable.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::createStructure):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::finishCreation):
(JSC::JSWebAssemblyTable::destroy):
(JSC::JSWebAssemblyTable::visitChildren):
* wasm/js/JSWebAssemblyTable.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyCompileErrorConstructor.cpp: Added.
(JSC::constructJSWebAssemblyCompileError):
(JSC::callJSWebAssemblyCompileError):
(JSC::WebAssemblyCompileErrorConstructor::create):
(JSC::WebAssemblyCompileErrorConstructor::createStructure):
(JSC::WebAssemblyCompileErrorConstructor::finishCreation):
(JSC::WebAssemblyCompileErrorConstructor::WebAssemblyCompileErrorConstructor):
(JSC::WebAssemblyCompileErrorConstructor::getConstructData):
(JSC::WebAssemblyCompileErrorConstructor::getCallData):
(JSC::WebAssemblyCompileErrorConstructor::visitChildren):
* wasm/js/WebAssemblyCompileErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyCompileErrorConstructor::CompileErrorStructure):
* wasm/js/WebAssemblyCompileErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyCompileErrorPrototype::create):
(JSC::WebAssemblyCompileErrorPrototype::createStructure):
(JSC::WebAssemblyCompileErrorPrototype::finishCreation):
(JSC::WebAssemblyCompileErrorPrototype::WebAssemblyCompileErrorPrototype):
* wasm/js/WebAssemblyCompileErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyInstanceConstructor.cpp: Added.
(JSC::constructJSWebAssemblyInstance):
(JSC::callJSWebAssemblyInstance):
(JSC::WebAssemblyInstanceConstructor::create):
(JSC::WebAssemblyInstanceConstructor::createStructure):
(JSC::WebAssemblyInstanceConstructor::finishCreation):
(JSC::WebAssemblyInstanceConstructor::WebAssemblyInstanceConstructor):
(JSC::WebAssemblyInstanceConstructor::getConstructData):
(JSC::WebAssemblyInstanceConstructor::getCallData):
(JSC::WebAssemblyInstanceConstructor::visitChildren):
* wasm/js/WebAssemblyInstanceConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyInstanceConstructor::InstanceStructure):
* wasm/js/WebAssemblyInstancePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyInstancePrototype::create):
(JSC::WebAssemblyInstancePrototype::createStructure):
(JSC::WebAssemblyInstancePrototype::finishCreation):
(JSC::WebAssemblyInstancePrototype::WebAssemblyInstancePrototype):
* wasm/js/WebAssemblyInstancePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyMemoryConstructor.cpp: Added.
(JSC::constructJSWebAssemblyMemory):
(JSC::callJSWebAssemblyMemory):
(JSC::WebAssemblyMemoryConstructor::create):
(JSC::WebAssemblyMemoryConstructor::createStructure):
(JSC::WebAssemblyMemoryConstructor::finishCreation):
(JSC::WebAssemblyMemoryConstructor::WebAssemblyMemoryConstructor):
(JSC::WebAssemblyMemoryConstructor::getConstructData):
(JSC::WebAssemblyMemoryConstructor::getCallData):
(JSC::WebAssemblyMemoryConstructor::visitChildren):
* wasm/js/WebAssemblyMemoryConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyMemoryConstructor::MemoryStructure):
* wasm/js/WebAssemblyMemoryPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyMemoryPrototype::create):
(JSC::WebAssemblyMemoryPrototype::createStructure):
(JSC::WebAssemblyMemoryPrototype::finishCreation):
(JSC::WebAssemblyMemoryPrototype::WebAssemblyMemoryPrototype):
* wasm/js/WebAssemblyMemoryPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyModuleConstructor.cpp: Added.
(JSC::constructJSWebAssemblyModule):
(JSC::callJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::create):
(JSC::WebAssemblyModuleConstructor::createStructure):
(JSC::WebAssemblyModuleConstructor::finishCreation):
(JSC::WebAssemblyModuleConstructor::WebAssemblyModuleConstructor):
(JSC::WebAssemblyModuleConstructor::getConstructData):
(JSC::WebAssemblyModuleConstructor::getCallData):
(JSC::WebAssemblyModuleConstructor::visitChildren):
* wasm/js/WebAssemblyModuleConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyModuleConstructor::ModuleStructure):
* wasm/js/WebAssemblyModulePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyModulePrototype::create):
(JSC::WebAssemblyModulePrototype::createStructure):
(JSC::WebAssemblyModulePrototype::finishCreation):
(JSC::WebAssemblyModulePrototype::WebAssemblyModulePrototype):
* wasm/js/WebAssemblyModulePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyRuntimeErrorConstructor.cpp: Added.
(JSC::constructJSWebAssemblyRuntimeError):
(JSC::callJSWebAssemblyRuntimeError):
(JSC::WebAssemblyRuntimeErrorConstructor::create):
(JSC::WebAssemblyRuntimeErrorConstructor::createStructure):
(JSC::WebAssemblyRuntimeErrorConstructor::finishCreation):
(JSC::WebAssemblyRuntimeErrorConstructor::WebAssemblyRuntimeErrorConstructor):
(JSC::WebAssemblyRuntimeErrorConstructor::getConstructData):
(JSC::WebAssemblyRuntimeErrorConstructor::getCallData):
(JSC::WebAssemblyRuntimeErrorConstructor::visitChildren):
* wasm/js/WebAssemblyRuntimeErrorConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyRuntimeErrorConstructor::RuntimeErrorStructure):
* wasm/js/WebAssemblyRuntimeErrorPrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyRuntimeErrorPrototype::create):
(JSC::WebAssemblyRuntimeErrorPrototype::createStructure):
(JSC::WebAssemblyRuntimeErrorPrototype::finishCreation):
(JSC::WebAssemblyRuntimeErrorPrototype::WebAssemblyRuntimeErrorPrototype):
* wasm/js/WebAssemblyRuntimeErrorPrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
* wasm/js/WebAssemblyTableConstructor.cpp: Added.
(JSC::constructJSWebAssemblyTable):
(JSC::callJSWebAssemblyTable):
(JSC::WebAssemblyTableConstructor::create):
(JSC::WebAssemblyTableConstructor::createStructure):
(JSC::WebAssemblyTableConstructor::finishCreation):
(JSC::WebAssemblyTableConstructor::WebAssemblyTableConstructor):
(JSC::WebAssemblyTableConstructor::getConstructData):
(JSC::WebAssemblyTableConstructor::getCallData):
(JSC::WebAssemblyTableConstructor::visitChildren):
* wasm/js/WebAssemblyTableConstructor.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyTableConstructor::TableStructure):
* wasm/js/WebAssemblyTablePrototype.cpp: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.
(JSC::WebAssemblyTablePrototype::create):
(JSC::WebAssemblyTablePrototype::createStructure):
(JSC::WebAssemblyTablePrototype::finishCreation):
(JSC::WebAssemblyTablePrototype::WebAssemblyTablePrototype):
* wasm/js/WebAssemblyTablePrototype.h: Copied from Source/JavaScriptCore/wasm/WebAssemblyObject.h.

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

3 years agoAnnotate more DOM and HTML IDLs with CEReactions
rniwa@webkit.org [Wed, 19 Oct 2016 22:06:47 +0000 (22:06 +0000)]
Annotate more DOM and HTML IDLs with CEReactions
https://bugs.webkit.org/show_bug.cgi?id=163653

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaselined the tests now that more test cases are passing.

* web-platform-tests/custom-elements/attribute-changed-callback-expected.txt:
* web-platform-tests/custom-elements/reactions/DOMStringMap-expected.txt:
* web-platform-tests/custom-elements/reactions/Document-expected.txt:
* web-platform-tests/custom-elements/reactions/Element-expected.txt:
* web-platform-tests/custom-elements/reactions/ElementContentEditable-expected.txt:
* web-platform-tests/custom-elements/reactions/HTMLElement-expected.txt:
* web-platform-tests/custom-elements/reactions/Selection-expected.txt:

Source/WebCore:

Added CEReactions to more IDL files.

Test: fast/custom-elements/reactions-for-webkit-extensions.html

* bindings/js/JSDOMStringMapCustom.cpp:
(WebCore::JSDOMStringMap::deleteProperty): Instantiate CustomElementReactionStack, which is equivalent to
adding CEReactions in IDL.
(WebCore::JSDOMStringMap::putDelegate): Ditto.
* dom/Document.idl:
* dom/Element.idl:
* html/HTMLElement.idl:
* page/DOMSelection.idl:

LayoutTests:

Added a regression test to make sure webkitdropzone IDL attribute on HTMLElement
honors CEReactions semantics using the web-platform-tests' infrastructure I added.

* fast/custom-elements/reactions-for-webkit-extensions-expected.txt: Added.
* fast/custom-elements/reactions-for-webkit-extensions.html: Added.

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

3 years agoImport encoding web-platform-tests
commit-queue@webkit.org [Wed, 19 Oct 2016 21:34:07 +0000 (21:34 +0000)]
Import encoding web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=163684

Patch by Alex Christensen <achristensen@webkit.org> on 2016-10-19
Reviewed by Chris Dumez.

* web-platform-tests/encoding: Added.
* web-platform-tests/encoding/OWNERS: Added.
* web-platform-tests/encoding/api-basics-expected.txt: Added.
* web-platform-tests/encoding/api-basics.html: Added.
* web-platform-tests/encoding/api-invalid-label-expected.txt: Added.
* web-platform-tests/encoding/api-invalid-label.html: Added.
* web-platform-tests/encoding/api-replacement-encodings-expected.txt: Added.
* web-platform-tests/encoding/api-replacement-encodings.html: Added.
* web-platform-tests/encoding/api-surrogates-utf8-expected.txt: Added.
* web-platform-tests/encoding/api-surrogates-utf8.html: Added.
* web-platform-tests/encoding/big5-encoder-expected.txt: Added.
* web-platform-tests/encoding/big5-encoder.html: Added.
* web-platform-tests/encoding/gb18030-encoder-expected.txt: Added.
* web-platform-tests/encoding/gb18030-encoder.html: Added.
* web-platform-tests/encoding/gbk-encoder-expected.txt: Added.
* web-platform-tests/encoding/gbk-encoder.html: Added.
* web-platform-tests/encoding/idlharness-expected.txt: Added.
* web-platform-tests/encoding/idlharness.html: Added.
* web-platform-tests/encoding/iso-2022-jp-decoder-expected.txt: Added.
* web-platform-tests/encoding/iso-2022-jp-decoder.html: Added.
* web-platform-tests/encoding/iso-2022-jp-encoder-expected.txt: Added.
* web-platform-tests/encoding/iso-2022-jp-encoder.html: Added.
* web-platform-tests/encoding/resources: Added.
* web-platform-tests/encoding/resources/encodings.js: Added.
* web-platform-tests/encoding/resources/single-byte-raw.py: Added.
(main):
* web-platform-tests/encoding/resources/text-plain-charset.py: Added.
(main):
* web-platform-tests/encoding/single-byte-decoder-expected.txt: Added.
* web-platform-tests/encoding/single-byte-decoder.html: Added.
* web-platform-tests/encoding/textdecoder-byte-order-marks-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-byte-order-marks.html: Added.
* web-platform-tests/encoding/textdecoder-fatal-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-fatal-single-byte-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-fatal-single-byte.html: Added.
* web-platform-tests/encoding/textdecoder-fatal-streaming-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-fatal-streaming.html: Added.
* web-platform-tests/encoding/textdecoder-fatal.html: Added.
* web-platform-tests/encoding/textdecoder-ignorebom-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-ignorebom.html: Added.
* web-platform-tests/encoding/textdecoder-labels-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-labels.html: Added.
* web-platform-tests/encoding/textdecoder-streaming-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-streaming.html: Added.
* web-platform-tests/encoding/textdecoder-utf16-surrogates-expected.txt: Added.
* web-platform-tests/encoding/textdecoder-utf16-surrogates.html: Added.
* web-platform-tests/encoding/textencoder-constructor-non-utf-expected.txt: Added.
* web-platform-tests/encoding/textencoder-constructor-non-utf.html: Added.
* web-platform-tests/encoding/textencoder-utf16-surrogates-expected.txt: Added.
* web-platform-tests/encoding/textencoder-utf16-surrogates.html: Added.

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

3 years ago[JSC] forbid "use strict" directive in generator functions with non-simple parameters
caitp@igalia.com [Wed, 19 Oct 2016 21:27:51 +0000 (21:27 +0000)]
[JSC] forbid "use strict" directive in generator functions with non-simple parameters
https://bugs.webkit.org/show_bug.cgi?id=163683

Reviewed by Geoffrey Garen.

JSTests:

Update various generator*-non-simple-param.js tests to be passing.

* test262.yaml:

Source/JavaScriptCore:

Because generator functions and async functions both have an implicit
inner function whose arguments are inherited from its parent, "use strict"
directives within these functions did not yield a SyntaxError.

Now, the correct syntax error is reported, fixing several test262 failures
for generators and async functions.

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

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

3 years agoUnreviewed, rolling out r207557.
ryanhaddad@apple.com [Wed, 19 Oct 2016 21:14:04 +0000 (21:14 +0000)]
Unreviewed, rolling out r207557.

This change caused animations/font-variations tests to time
out on pre-Sierra Macs.

Reverted changeset:

"[macOS] [iOS] Disable variation fonts on macOS El Capitan and
iOS 9"
https://bugs.webkit.org/show_bug.cgi?id=163374
http://trac.webkit.org/changeset/207557

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

3 years ago[CSS Parser] Support -webkit-border-fit
hyatt@apple.com [Wed, 19 Oct 2016 20:45:08 +0000 (20:45 +0000)]
[CSS Parser] Support -webkit-border-fit
https://bugs.webkit.org/show_bug.cgi?id=163687

Reviewed by Zalan Bujtas.

Add support for -webkit-border-fit to isValidKeywordPropertyAndValue.

* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):

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

3 years agoBaseline JIT should use AutomaticThread
fpizlo@apple.com [Wed, 19 Oct 2016 20:37:20 +0000 (20:37 +0000)]
Baseline JIT should use AutomaticThread
https://bugs.webkit.org/show_bug.cgi?id=163686

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

Change the JITWorklist to use AutomaticThread, so that the Baseline JIT's concurrent
compiler thread shuts down automatically after inactivity.

With this change, all of JSC's threads shut down automatically. If you run splay for a few
seconds (which fires up all threads - compiler and GC) and then go to sleep for a second,
you'll see that the only threads left are the main thread and the bmalloc thread.

* jit/JITWorklist.cpp:
(JSC::JITWorklist::Thread::Thread):
(JSC::JITWorklist::JITWorklist):
(JSC::JITWorklist::completeAllForVM):
(JSC::JITWorklist::poll):
(JSC::JITWorklist::compileLater):
(JSC::JITWorklist::compileNow):
(JSC::JITWorklist::finalizePlans):
(JSC::JITWorklist::runThread): Deleted.
* jit/JITWorklist.h:

Source/WTF:

Added a AutomaticThreadCondition::wait() method, so that if you really want to use one
common condition for your thread and something else, you can do it. This trivially works
if you only use notifyAll(), and behaves as you'd expect for notifyOne() (i.e. it's
dangerous, since you don't know who will wake up).

The Baseline JIT used the one-true-Condition idiom because it used notifyAll() in an
optimal way: there are just two threads talking to each other, so it wakes up at most one
thread and that thread is exactly the one you want woken up. Adding wait() means that I did
not have to change that code.

* wtf/AutomaticThread.cpp:
(WTF::AutomaticThreadCondition::wait):
* wtf/AutomaticThread.h:

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

3 years ago[CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
hyatt@apple.com [Wed, 19 Oct 2016 20:34:14 +0000 (20:34 +0000)]
[CSS Parser] class and id parsing need to be case-insensitive in HTML quirks mode
https://bugs.webkit.org/show_bug.cgi?id=163685

Reviewed by Zalan Bujtas.

Class and ID parsing should be case-insensitive in quirks mode. Apply the same hack
that the old parser did and lowercase the class and ids in place.

* css/parser/CSSSelectorParser.cpp:
(WebCore::CSSSelectorParser::consumeId):
(WebCore::CSSSelectorParser::consumeClass):

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

3 years agoAX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects ...
n_wang@apple.com [Wed, 19 Oct 2016 20:33:23 +0000 (20:33 +0000)]
AX: crash: com.apple.WebCore: WebCore::AccessibilityObject::findMatchingObjects + 600
https://bugs.webkit.org/show_bug.cgi?id=163682

Reviewed by Chris Fleizach.

Source/WebCore:

There's a null pointer crash when we ask for startObject->parentObjectUnignored() in
AccessibilityObject::findMatchingObject. Added a null check for the startObject to fix that.

Test: accessibility/mac/search-predicate-crash.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::findMatchingObjects):

LayoutTests:

* accessibility/mac/search-predicate-crash-expected.txt: Added.
* accessibility/mac/search-predicate-crash.html: Added.

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