WebKit-https.git
4 years agoPartial revert of r203811 - this key is not needed.
ap@apple.com [Fri, 19 Aug 2016 18:58:56 +0000 (18:58 +0000)]
Partial revert of r203811 - this key is not needed.

* LayoutTestRelay/LayoutTestRelay/LTRelayController.m: (-[LTRelayController installApp]):

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

4 years agoWeb Inspector: Console log counter on the dashboard should be better at displaying...
commit-queue@webkit.org [Fri, 19 Aug 2016 18:41:08 +0000 (18:41 +0000)]
Web Inspector: Console log counter on the dashboard should be better at displaying large numbers
https://bugs.webkit.org/show_bug.cgi?id=160054

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-08-19
Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Base/Utilities.js:
(Number.abbreviate):
Add logic for formatting a number as "#K", "#M", and "#B" when it is very large.

* UserInterface/Views/DefaultDashboardView.js:
(WebInspector.DefaultDashboardView.prototype._updateDisplay):
(WebInspector.DefaultDashboardView.prototype._formatPossibleLargeNumber): Deleted.
(WebInspector.DefaultDashboardView.prototype._setConsoleItemValue):

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

4 years agoResource Timing: Make PerformanceEntryList a sequence as per spec
commit-queue@webkit.org [Fri, 19 Aug 2016 18:30:10 +0000 (18:30 +0000)]
Resource Timing: Make PerformanceEntryList a sequence as per spec
https://bugs.webkit.org/show_bug.cgi?id=160963

Patch by Johan K. Jensen <johan_jensen@apple.com> on 2016-08-19
Reviewed by Alex Christensen.

Source/WebCore:

Change PerformanceEntryList to be a sequence of PerformanceEntry instead of an object.

Test: http/tests/performance/performance-resource-timing-entries-iterable.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorGObject.pm:
Remove references to {JS,}PerformanceEntryList.{cpp,h,idl}.

* page/Performance.cpp:
(WebCore::Performance::getEntries):
(WebCore::Performance::getEntriesByType):
(WebCore::Performance::getEntriesByName):
* page/Performance.h:
Methods now operate on a Vector of PerformanceEntry.

* page/Performance.idl:
Typedef PerformanceEntryList as a sequence of PerformanceEntry.

* page/PerformanceEntryList.cpp: Removed.
(WebCore::PerformanceEntryList::PerformanceEntryList): Deleted.
(WebCore::PerformanceEntryList::~PerformanceEntryList): Deleted.
(WebCore::PerformanceEntryList::length): Deleted.
(WebCore::PerformanceEntryList::item): Deleted.
(WebCore::PerformanceEntryList::append): Deleted.
(WebCore::PerformanceEntryList::appendAll): Deleted.
(WebCore::PerformanceEntryList::sort): Deleted.
* page/PerformanceEntryList.h: Removed.
(WebCore::PerformanceEntryList::create): Deleted.
* page/PerformanceEntryList.idl: Removed.

LayoutTests:

Testing that PerformanceEntryList (window.performance.getEntries()) is iterable.

* http/tests/performance/performance-resource-timing-entries-iterable-expected.txt: Added.
* http/tests/performance/performance-resource-timing-entries-iterable.html: Added.

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

4 years agoAnother attempt to fix the iOS 9.3 build
dbates@webkit.org [Fri, 19 Aug 2016 18:24:50 +0000 (18:24 +0000)]
Another attempt to fix the iOS 9.3 build

Define WK_EMPTY_, WK_NOT_, and WK_NOT_YES.

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:

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

4 years ago[Mac] fix PiP context menu typos
eric.carlson@apple.com [Fri, 19 Aug 2016 18:21:35 +0000 (18:21 +0000)]
[Mac] fix PiP context menu typos
https://bugs.webkit.org/show_bug.cgi?id=160999
<rdar://problem/27885070>

Reviewed by Jer Noble.

* English.lproj/Localizable.strings: "Picture-in-Picture" -> "Picture in Picture".

* platform/LocalizedStrings.cpp:
(WebCore::contextMenuItemTagEnterVideoEnhancedFullscreen): Ditto.
(WebCore::contextMenuItemTagExitVideoEnhancedFullscreen): Ditto.

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

4 years agoRename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2...
simon.fraser@apple.com [Fri, 19 Aug 2016 18:10:23 +0000 (18:10 +0000)]
Rename didLayout(LayoutMilestones) to didReachLayoutMilestone(), and related WK2 functions
https://bugs.webkit.org/show_bug.cgi?id=160923

Reviewed by Tim Horton.

Source/WebCore:

didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones)
dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones)

* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
* loader/EmptyClients.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::didReachLayoutMilestone):
(WebCore::FrameLoader::didLayout): Deleted.
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* page/FrameView.cpp:
(WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
(WebCore::FrameView::firePaintRelatedMilestonesIfNeeded):
* page/LayoutMilestones.h: Formatting
* page/Page.cpp:
(WebCore::Page::addRelevantRepaintedObject):

Source/WebKit/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
(WebFrameLoaderClient::dispatchDidLayout): Deleted.

Source/WebKit/win:

didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones)
dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones)

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
(WebFrameLoaderClient::dispatchDidLayout): Deleted.
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:

didLayout(LayoutMilestones) -> didReachLayoutMilestone(LayoutMilestones)
dispatchDidLayout(LayoutMilestones) -> dispatchDidReachLayoutMilestone(LayoutMilestones)

Avoided changing functions that are exposed as API/SPI.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didReachLayoutMilestone):
(API::LoaderClient::didLayout): Deleted.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didLayoutForCustomContentProvider):
(WebKit::WebPageProxy::didReachLayoutMilestone):
(WebKit::WebPageProxy::didLayout): Deleted.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::didCommitLayerTree):
* UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(didReachLayoutMilestone):
(setUpPageLoaderClient):
(didLayout): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
(WebKit::InjectedBundlePageLoaderClient::didReachLayoutMilestone):
(WebKit::InjectedBundlePageLoaderClient::didLayout): Deleted.
* WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
(WebKit::WebFrameLoaderClient::dispatchDidLayout): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::dispatchDidReachLayoutMilestone):
(WebKit::DrawingArea::dispatchDidLayout): Deleted.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::dispatchDidReachLayoutMilestone):
(WebKit::WebPage::dispatchDidLayout): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::dispatchDidReachLayoutMilestone):
(WebKit::RemoteLayerTreeDrawingArea::dispatchDidLayout): Deleted.

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

4 years ago[Win] Warning fix.
pvollan@apple.com [Fri, 19 Aug 2016 17:10:57 +0000 (17:10 +0000)]
[Win] Warning fix.
https://bugs.webkit.org/show_bug.cgi?id=160994

Reviewed by Anders Carlsson.

Ignore warning when function declared with __declspec(noreturn) has non void return type.

* Source/cmake/OptionsWin.cmake:

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

4 years agoAttempt to fix the iOS 9.3 build
dbates@webkit.org [Fri, 19 Aug 2016 17:07:32 +0000 (17:07 +0000)]
Attempt to fix the iOS 9.3 build

Reorder the keys in the text-based stubs to make linker happy.

* WebKitPrivateFrameworkStubs/iOS/9/AppSupport.framework/AppSupport.tbd:
* WebKitPrivateFrameworkStubs/iOS/9/AssertionServices.framework/AssertionServices.tbd:
* WebKitPrivateFrameworkStubs/iOS/9/CorePDF.framework/CorePDF.tbd:
* WebKitPrivateFrameworkStubs/iOS/9/GraphicsServices.framework/GraphicsServices.tbd:
* WebKitPrivateFrameworkStubs/iOS/9/IOSurface.framework/IOSurface.tbd:

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

4 years ago[Win] Warning fix.
pvollan@apple.com [Fri, 19 Aug 2016 16:41:27 +0000 (16:41 +0000)]
[Win] Warning fix.
https://bugs.webkit.org/show_bug.cgi?id=160995

Avoid setting unknown compile option on source file.

Reviewed by Anders Carlsson.

* CMakeLists.txt:

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

4 years agoUnskip tests that now pass on ios-simulator.
ryanhaddad@apple.com [Fri, 19 Aug 2016 16:08:18 +0000 (16:08 +0000)]
Unskip tests that now pass on ios-simulator.

Unreviewed test gardening.

* platform/ios-simulator-wk2/TestExpectations:

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

4 years agoDumpRenderTree crashed in com.apple.WebCore: WebCore::DOMWindow::resetDOMWindowProper...
cdumez@apple.com [Fri, 19 Aug 2016 15:46:42 +0000 (15:46 +0000)]
DumpRenderTree crashed in com.apple.WebCore: WebCore::DOMWindow::resetDOMWindowProperties + 607
https://bugs.webkit.org/show_bug.cgi?id=160983
<rdar://problem/26768524>

Reviewed by Brent Fulgham.

Update DOMWindow::frameDestroyed() to ref the window object as the crash
traces seem to indicate it can get destroyed during the execution of this
method. Also update the code in the ~Frame destructor to not iterate over
the list of FrameDestructionObservers because observers remove themselves
from the list when they get destroyed.

No new tests, do not know how to reproduce.

* page/DOMWindow.cpp:
(WebCore::DOMWindow::frameDestroyed):
* page/Frame.cpp:
(WebCore::Frame::~Frame):

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

4 years agoWebKit should unset event propagation flags after dispatch
cdumez@apple.com [Fri, 19 Aug 2016 15:36:55 +0000 (15:36 +0000)]
WebKit should unset event propagation flags after dispatch
https://bugs.webkit.org/show_bug.cgi?id=160853

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/events/Event-dispatch-multiple-stopPropagation-expected.txt:
* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-propagation-expected.txt:

Source/WebCore:

WebKit should unset event propagation flags after dispatch to reflect
the latest DOM specification:
- https://github.com/whatwg/dom/commit/806d4aab584f6fc38c21f8e088b51b8ba3e27e20

No new tests, rebaselined existing tests.

* dom/Event.h:
(WebCore::Event::resetPropagationFlags):
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent):
* dom/EventTarget.cpp:
(WebCore::EventTarget::dispatchEvent):

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

4 years agoRemove Yosemite Leaks bot from config.json
lforschler@apple.com [Fri, 19 Aug 2016 07:26:22 +0000 (07:26 +0000)]
Remove Yosemite Leaks bot from config.json

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

4 years agoLd warns of non-existent PrivateFrameworks directory when building WebKit with the...
dbates@webkit.org [Fri, 19 Aug 2016 03:07:15 +0000 (03:07 +0000)]
Ld warns of non-existent PrivateFrameworks directory when building WebKit with the public iOS 9.3 SDK
https://bugs.webkit.org/show_bug.cgi?id=160979

Rubber-stamped by Simon Fraser.

Only add the SDK PrivateFrameworks directory to the FRAMEWORK_SEARCH_PATH when building for
iOS Simulator, building with an iOS SDK that does not support text-based stubs, or building
an Apple-internal build.

Source/WebCore:

* Configurations/Base.xcconfig: Define WK_TARGET_IOS_VERSION_MAJOR.
* Configurations/WebCore.xcconfig:

Source/WebKit/mac:

* Configurations/WebKitLegacy.xcconfig:

Source/WebKit2:

* Configurations/BaseTarget.xcconfig:

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

4 years agoRe-landing:
weinig@apple.com [Fri, 19 Aug 2016 02:53:58 +0000 (02:53 +0000)]
Re-landing:

Support WebIDL unions (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=160769

Reviewed by Chris Dumez.

This is the first part of an effort to add support for union types
in our code generators. This change:
- Adds a domType struct to hold the parsed type information. For now, we only
  use it temporarily while parsing, and don't expose it to the code generators,
  but that will change in a later patch.
- Remove support for scoped identifiers for types. They are not supported by WebIDL.
- Make debugging the parser easier by providing backtraces when asserting.

There should be no observable changes.

* bindings/scripts/IDLParser.pm:

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

4 years agoUnreviewed, Fix CMake build after r204614
hs85.jeong@samsung.com [Fri, 19 Aug 2016 02:44:59 +0000 (02:44 +0000)]
Unreviewed, Fix CMake build after r204614

* PlatformMac.cmake:

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

4 years agoMove prefix / namespaceURI / localName attributes from Node to Attr / Element
cdumez@apple.com [Fri, 19 Aug 2016 02:40:11 +0000 (02:40 +0000)]
Move prefix / namespaceURI / localName attributes from Node to Attr / Element
https://bugs.webkit.org/show_bug.cgi?id=160988

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C test now that more checks are passing.

* web-platform-tests/dom/historical-expected.txt:
* web-platform-tests/dom/interfaces-expected.txt:

Source/WebCore:

Move prefix / namespaceURI / localName attributes from Node to Attr / Element
as per the latest DOM specification:
- https://dom.spec.whatwg.org/#element
- https://dom.spec.whatwg.org/#attr

Firefox and Chrome match the specification.

No new tests, rebaselined existing tests.

* dom/Attr.h:
* dom/Attr.idl:
* dom/Element.h:
* dom/Element.idl:
* dom/Node.idl:

LayoutTests:

Update existing layout tests to reflect behavior change.

* fast/dom/Node/initial-values-expected.txt:
* fast/dom/Node/script-tests/initial-values.js:
* http/tests/misc/createElementNamespace1-expected.txt:
* http/tests/misc/createElementNamespace1.xml:
* http/tests/misc/createElementNamespace2-expected.txt:
* http/tests/misc/createElementNamespace2.xhtml:
* http/tests/misc/createElementNamespace3-expected.txt:
* http/tests/misc/createElementNamespace3.html:
* js/dom/dom-static-property-for-in-iteration-expected.txt:

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

4 years agoRe-sync DOM web platform tests from upstream
cdumez@apple.com [Fri, 19 Aug 2016 02:37:52 +0000 (02:37 +0000)]
Re-sync DOM web platform tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=160980

Reviewed by Ryosuke Niwa.

Re-sync DOM web platform tests from upstream.

* web-platform-tests/dom/events/Event-initEvent-expected.txt:
* web-platform-tests/dom/events/Event-initEvent.html:
* web-platform-tests/dom/events/Event-propagation-expected.txt:
* web-platform-tests/dom/events/Event-propagation.html:
* web-platform-tests/dom/nodes/Node-properties.html:

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

4 years ago[iOS] Network Processes & Database processes do not exit promptly
cdumez@apple.com [Fri, 19 Aug 2016 01:07:45 +0000 (01:07 +0000)]
[iOS] Network Processes & Database processes do not exit promptly
https://bugs.webkit.org/show_bug.cgi?id=160978
<rdar://problem/27914081>

Reviewed by Anders Carlsson.

Network Processes & Database processes do not exit promptly. They hang
for 10 seconds until they log the following message:
> com.apple.WebKit.Networking: (WebKit) #WK: Exiting process early due to unacknowledged closed-connection

Then forcefully call exit(0).

To address the issue, we now call ChildProcess::stopRunLoop() instead
of RunLoop::current().stop(). stopRunLoop() works as expected on iOS
after r202723.

There is no impact on Mac because stopRunLoop() calls
RunLoop::current().stop().

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::didClose):
(WebKit::DatabaseProcess::didReceiveInvalidMessage):
* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::didClose):
(WebKit::NetworkProcess::didReceiveInvalidMessage):

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

4 years agoBinding NULL pointer to reference in WebCore::RenderObject
commit-queue@webkit.org [Fri, 19 Aug 2016 01:01:47 +0000 (01:01 +0000)]
Binding NULL pointer to reference in WebCore::RenderObject
https://bugs.webkit.org/show_bug.cgi?id=160830

Patch by Jonathan Bedard <jbedard@apple.com> on 2016-08-18
Reviewed by Myles C. Maxfield.

No new tests needed, existing functionality not changed.

Fixes a dereferenced NULL pointer bound to a reference through a minor re-factor.

* rendering/InlineIterator.h:
(WebCore::InlineIterator::clear): Explicit clear occurs, instead of a call to moveTo.
(WebCore::InlineIterator::moveToStartOf): Swapped pointer for reference.
(WebCore::InlineIterator::moveTo): Swapped pointer for reference.
(WebCore::InlineIterator::increment): Explicitly call clear for clarity.
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::commitLineBreakClear): Commit a line break and clear the iterator.
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth): Swapped pointer for reference.
(WebCore::BreakingContext::InlineIteratorHistory::moveTo): Swapped pointer for reference.
(WebCore::BreakingContext::increment): Explicitly call clear for clarity.
(WebCore::BreakingContext::handleBR): Swapped pointer for passed reference.
(WebCore::BreakingContext::handleReplaced): Explicitly call clear for clarity.
(WebCore::tryHyphenating): Swapped pointer for passed reference.
(WebCore::BreakingContext::handleText): Replaced all render object passing with references.  Note that the caller explicitly checks if m_current.renderer() exists before calling this function.
(WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded): Explicitly call clear for clarity.
(WebCore::BreakingContext::handleEndOfLine): Explicitly call clear for clarity.

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

4 years agoWindows build fix after r204611. Use the fully qualified name to avoid the ambiguity...
rniwa@webkit.org [Fri, 19 Aug 2016 00:55:42 +0000 (00:55 +0000)]
Windows build fix after r204611. Use the fully qualified name to avoid the ambiguity in VC++.

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeCallback):
* bindings/js/JSCustomElementInterface.h:
(WebCore::JSCustomElementInterface::invokeCallback):

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

4 years agoSupport passing preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat
dino@apple.com [Fri, 19 Aug 2016 00:50:36 +0000 (00:50 +0000)]
Support passing preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat
https://bugs.webkit.org/show_bug.cgi?id=160982
<rdar://problem/27915946>

Reviewed by Simon Fraser.

Source/WebCore:

Update WebGLContextAttributes to be compliant with the specification,
by adding preferLowPowerToHighPerformance and failIfMajorPerformanceCaveat.
They are not implemented yet, so asking the created context what
values it used should give the default.

Test: fast/canvas/webgl/context-creation-attributes.html

* html/canvas/WebGLContextAttributes.cpp:
(WebCore::WebGLContextAttributes::preferLowPowerToHighPerformance):
(WebCore::WebGLContextAttributes::setPreferLowPowerToHighPerformance):
(WebCore::WebGLContextAttributes::failIfMajorPerformanceCaveat):
(WebCore::WebGLContextAttributes::setFailIfMajorPerformanceCaveat):
* html/canvas/WebGLContextAttributes.h:
* html/canvas/WebGLContextAttributes.idl:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create): Deleted.
* platform/graphics/GraphicsContext3D.h:
(WebCore::GraphicsContext3D::Attributes::Attributes): Deleted.

LayoutTests:

Very simple test that creates some WebGL contexts with various
creation attributes and outputs the result.

* fast/canvas/webgl/context-creation-attributes-expected.txt: Added.
* fast/canvas/webgl/context-creation-attributes.html: Added.

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

4 years agoMove an NPAPI-only function from WebCore to WebKit
andersca@apple.com [Fri, 19 Aug 2016 00:12:27 +0000 (00:12 +0000)]
Move an NPAPI-only function from WebCore to WebKit
https://bugs.webkit.org/show_bug.cgi?id=160967

Reviewed by Sam Weinig.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* bindings/js/ScriptController.cpp:
(WebCore::ScriptController::createScriptObjectForPluginElement): Deleted.
* bindings/js/ScriptController.h:
* bridge/NP_jsobject.h:

Source/WebKit/mac:

* Plugins/WebNetscapePluginView.h:
* Plugins/WebNetscapePluginView.mm:
(-[WebNetscapePluginView getVariable:value:]):
(-[WebNetscapePluginView _destroyPlugin]):

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::~PluginView):
(WebCore::PluginView::PluginView):
(WebCore::PluginView::getValue):
* Plugins/PluginView.h:

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

4 years agoBuilding test fix after r204611.
rniwa@webkit.org [Thu, 18 Aug 2016 23:15:05 +0000 (23:15 +0000)]
Building test fix after r204611.

* bindings/scripts/test/TestObj.idl:

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

4 years ago[Cocoa] API::Number needs to be wrapped by an NSNumber
mitz@apple.com [Thu, 18 Aug 2016 23:11:05 +0000 (23:11 +0000)]
[Cocoa] API::Number needs to be wrapped by an NSNumber
https://bugs.webkit.org/show_bug.cgi?id=160977
<rdar://problem/27877735>

Reviewed by Anders Carlsson.

Source/WebKit2:

We introduce a single WKNSNumber class to wrap three distinct API::Number instantiations
corresponding to the Boolean, UInt64 and Double types.

Test: TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Create a WKNSNumber to contain any of the number types, and set
  its _type ivar accordingly.
* Shared/Cocoa/WKNSNumber.h: Added.
(WebKit::wrapper):
* Shared/Cocoa/WKNSNumber.mm: Added.
(-[WKNSNumber dealloc]): Call the appropriate destructor.
(-[WKNSNumber objCType]): Implement this NSValue primitive method.
(-[WKNSNumber getValue:]): Ditto.
(-[WKNSNumber boolValue]): Implement this NSNumber method corresponding to one of our
  possible types.
(-[WKNSNumber doubleValue]): Ditto.
(-[WKNSNumber unsignedLongLongValue]): Ditto.
(-[WKNSNumber copyWithZone:]): Implement this NSCopying method by retaining self.
(-[WKNSNumber _apiObject]): Implement this WKObject method by returning the appropriate
  API object.

* WebKit2.xcodeproj/project.pbxproj: Added references to new files.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKNSNumber.mm: Added.
(TestWebKitAPI::TEST):

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

4 years agoUnreviewed, nit fix after r204605 reported by Darin.
cdumez@apple.com [Thu, 18 Aug 2016 23:03:47 +0000 (23:03 +0000)]
Unreviewed, nit fix after r204605 reported by Darin.

* platform/text/TextCodecICU.cpp:

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

4 years agoScopedArguments is using the wrong owner object for a write barrier.
mark.lam@apple.com [Thu, 18 Aug 2016 22:55:05 +0000 (22:55 +0000)]
ScopedArguments is using the wrong owner object for a write barrier.
https://bugs.webkit.org/show_bug.cgi?id=160976
<rdar://problem/27328506>

Reviewed by Keith Miller.

JSTests:

* stress/scoped-arguments-write-barrier-should-be-on-scope-object.js: Added.

Source/JavaScriptCore:

* runtime/ScopedArguments.h:
(JSC::ScopedArguments::setIndexQuickly):

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

4 years agoAdd basic support for connected and disconnected callbacks
rniwa@webkit.org [Thu, 18 Aug 2016 22:19:59 +0000 (22:19 +0000)]
Add basic support for connected and disconnected callbacks
https://bugs.webkit.org/show_bug.cgi?id=160950

Reviewed by Chris Dumez.

Source/WebCore:

Added the basic support for custom elements' connectedCallback and disconnectedCallback. These callbacks
are enqueued by inserting and removing a node as spec'ed by https://dom.spec.whatwg.org/#concept-node-insert
and https://dom.spec.whatwg.org/#concept-node-remove

For now, we only support callbacks on appendChild and removeChild to limit the amount of code changes and
tests that need to be included in this patch.

This patch also renames InvokesCustomElementLifecycleCallbacks IDL attribute to CEReactions to match
the latest specification: https://html.spec.whatwg.org/multipage/scripting.html#cereactions

Tests: fast/custom-elements/connected-callbacks.html
       fast/custom-elements/disconnected-callbacks.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::invokeCallback): Extracted from invokeAttributeChangedCallback.
(WebCore::JSCustomElementInterface::setConnectedCallback): Added.
(WebCore::JSCustomElementInterface::invokeConnectedCallback): Added.
(WebCore::JSCustomElementInterface::setDisconnectedCallback): Added.
(WebCore::JSCustomElementInterface::invokeDisconnectedCallback): Added.
(WebCore::JSCustomElementInterface::setAttributeChangedCallback):
(WebCore::JSCustomElementInterface::invokeAttributeChangedCallback): Renamed from attributeChanged.
* bindings/js/JSCustomElementInterface.h: Added m_connectedCallback and m_disconnectedCallback as instance
variables. Also removed the superfluous mutable qualifier from m_constructor m_attributeChangedCallback.
* bindings/js/JSCustomElementsRegistryCustom.cpp:
(WebCore::JSCustomElementsRegistry::define): Store connectedCallback and disconnectedCallback.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/IDLAttributes.txt:
* dom/CustomElementsRegistry.idl:
* dom/Element.cpp:
(WebCore::Element::insertedInto): Call enqueueConnectedCallbackIfNeeded.
(WebCore::Element::removedFrom): Call enqueueDisconnectedCallbackIfNeeded.
* dom/Element.idl:
* dom/LifecycleCallbackQueue.cpp:
(WebCore::LifecycleQueueItem::invoke): Added calls to invokeConnectedCallback and invokeDisconnectedCallback.
(WebCore::findInterfaceForCustomElement): Extracted from enqueueAttributeChangedCallbackIfNeeded.
(WebCore::LifecycleCallbackQueue::enqueueConnectedCallbackIfNeeded): Added.
(WebCore::LifecycleCallbackQueue::enqueueDisconnectedCallbackIfNeeded): Added.
(WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded):
(WebCore::CustomElementLifecycleProcessingStack::ensureCurrentQueue):
* dom/LifecycleCallbackQueue.h:
* dom/Node.idl:

LayoutTests:

Added W3C style testharness.js tests for connectedCallback and disconnectedCallback.

Four test cases are failing due to a bug in window-less document's custom element registry,
which will be addressed in a future patch.

* fast/custom-elements/connected-callbacks-expected.txt: Added.
* fast/custom-elements/connected-callbacks.html: Added.
* fast/custom-elements/disconnected-callbacks-expected.txt: Added.
* fast/custom-elements/disconnected-callbacks.html: Added.

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

4 years agoUpdate the accessibility titles for list insertion
bdakin@apple.com [Thu, 18 Aug 2016 21:19:26 +0000 (21:19 +0000)]
Update the accessibility titles for list insertion
https://bugs.webkit.org/show_bug.cgi?id=160972
-and corresponding-
rdar://problem/27750446

Reviewed by Chris Fleizach.

Update accessibility titles based on feedback.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::insertListTypeNone):
(WebCore::insertListTypeBulleted):
(WebCore::insertListTypeBulletedAccessibilityTitle):
(WebCore::insertListTypeNumbered):
(WebCore::insertListTypeNumberedAccessibilityTitle):
(WebCore::insertListTypeNoneAccessibilityTitle): Deleted.
* platform/LocalizedStrings.h:

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

4 years agoAdd LLINT probe() macro for X86_64.
mark.lam@apple.com [Thu, 18 Aug 2016 20:25:30 +0000 (20:25 +0000)]
Add LLINT probe() macro for X86_64.
https://bugs.webkit.org/show_bug.cgi?id=160968

Reviewed by Geoffrey Garen.

* llint/LowLevelInterpreter.asm:

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

4 years ago[Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
aestes@apple.com [Thu, 18 Aug 2016 19:55:41 +0000 (19:55 +0000)]
[Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
https://bugs.webkit.org/show_bug.cgi?id=160964

Reviewed by Anders Carlsson.

Followed the guidelines for SPI naming.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _isCookieStoragePartitioningEnabled]): Renamed from -cookieStoragePartitioningEnabled.
(-[WKProcessPool _setCookieStoragePartitioningEnabled:]): Renamed from -setCookieStoragePartitioningEnabled:.
(-[WKProcessPool cookieStoragePartitioningEnabled]): Renamed to -_isCookieStoragePartitioningEnabled.
(-[WKProcessPool setCookieStoragePartitioningEnabled:]): Renamed to -_setCookieStoragePartitioningEnabled:.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:

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

4 years agoAlign our encoding labels with the encoding specification
cdumez@apple.com [Thu, 18 Aug 2016 19:53:35 +0000 (19:53 +0000)]
Align our encoding labels with the encoding specification
https://bugs.webkit.org/show_bug.cgi?id=160931

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline W3C test now that we are passing a lot more checks. For reference,
Firefox 48 passes 624 out of 654, and Chrome 52 passes 651 out of 654.
Before this change, WebKit was only passing 501 out of 654 and is now passing
651. The only checks we're failing is due to "Big5-HKSCS" not being an alias
to "Big5".

* web-platform-tests/dom/nodes/Document-characterSet-normalization-expected.txt:

Source/WebCore:

Align our encoding labels with the encoding specification:
- https://encoding.spec.whatwg.org/#names-and-labels

This also aligns with Firefox and Chrome.

No new tests, rebaselined existing test.

* platform/text/TextCodecICU.cpp:
(WebCore::TextCodecICU::registerEncodingNames):
* platform/text/TextCodecLatin1.cpp:
(WebCore::TextCodecLatin1::registerEncodingNames):
(WebCore::newStreamingTextDecoderWindowsLatin1): Deleted.
(WebCore::TextCodecLatin1::registerCodecs): Deleted.
* platform/text/TextCodecUTF8.cpp:
(WebCore::TextCodecUTF8::registerEncodingNames):

LayoutTests:

Update / rebaseline existing tests to reflect the code change.
The new baselines match Chrome and Firefox.

* fast/encoding/bracket-in-tag-expected.txt:
* fast/encoding/charset-invalid-expected.txt:
* fast/encoding/charset-replacement-expected.txt:
* fast/encoding/misplaced-xml-declaration-expected.txt:
* fast/encoding/pseudo-xml-expected.txt:
* http/tests/misc/char-encoding-bocu-1-blacklisted-expected.txt:
* http/tests/misc/char-encoding-bocu-1-blacklisted.html:
* http/tests/misc/char-encoding-in-hidden-charset-field-default-expected.txt:
* http/tests/misc/char-encoding-scsu-blacklisted-expected.txt:
* http/tests/misc/char-encoding-scsu-blacklisted.html:
* http/tests/misc/frame-default-enc-different-domain-expected.txt:

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

4 years agoGenerated messages headers should use #pragma once
aestes@apple.com [Thu, 18 Aug 2016 19:04:28 +0000 (19:04 +0000)]
Generated messages headers should use #pragma once
https://bugs.webkit.org/show_bug.cgi?id=160965

Reviewed by Anders Carlsson.

* Scripts/webkit/messages.py:
(generate_messages_header): Used #pragma once instead of a header guard.

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

4 years ago[Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
aestes@apple.com [Thu, 18 Aug 2016 18:59:20 +0000 (18:59 +0000)]
[Cocoa] Add SPI to WKProcessPool for enabling cookie storage partitioning
https://bugs.webkit.org/show_bug.cgi?id=160964

Reviewed by Brent Fulgham.

Source/WebCore:

* page/Settings.cpp:
(WebCore::Settings::setCookieStoragePartitioningEnabled): Deleted.
* page/Settings.h:
(WebCore::Settings::cookieStoragePartitioningEnabled): Deleted.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp: Defined cookieStoragePartitioningEnabled.
(WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Set cookieStoragePartitioningEnabled.
(WebCore::cookieStoragePartition): Used cookieStoragePartitioningEnabled instead of Settings::cookieStoragePartitioningEnabled().

Source/WebKit2:

* NetworkProcess/NetworkProcess.h: Declared setCookieStoragePartitioningEnabled().
* NetworkProcess/NetworkProcess.messages.in: Added message SetCookieStoragePartitioningEnabled.
* NetworkProcess/NetworkProcessCreationParameters.cpp:
(WebKit::NetworkProcessCreationParameters::encode): Encoded cookieStoragePartitioningEnabled.
(WebKit::NetworkProcessCreationParameters::decode): Decoded cookieStoragePartitioningEnabled.
* NetworkProcess/NetworkProcessCreationParameters.h: Declared cookieStoragePartitioningEnabled.
* NetworkProcess/cocoa/NetworkProcessCocoa.mm:
(WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
Called NetworkStorageSession::setCookieStoragePartitioningEnabled() given the cookieStoragePartitioningEnabled parameter.
(WebKit::NetworkProcess::setCookieStoragePartitioningEnabled):
Called NetworkStorageSession::setCookieStoragePartitioningEnabled().
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool cookieStoragePartitioningEnabled]): Returned WebProcessPool::cookieStoragePartitioningEnabled().
(-[WKProcessPool setCookieStoragePartitioningEnabled:]): Called WebProcessPool::setCookieStoragePartitioningEnabled().
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Declared cookieStoragePartitioningEnabled as a property.
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeNetworkProcess):
Set the cookieStoragePartitioningEnabled parameter from m_cookieStoragePartitioningEnabled.
(WebKit::WebProcessPool::setCookieStoragePartitioningEnabled):
Set m_cookieStoragePartitioningEnabled and sent the NetworkProcess::SetCookieStoragePartitioningEnabled message.
* UIProcess/WebProcessPool.h: Declared cookieStoragePartitioningEnabled.

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

4 years agoLand test expectations for rdar://problem/27723718.
ryanhaddad@apple.com [Thu, 18 Aug 2016 18:06:45 +0000 (18:06 +0000)]
Land test expectations for rdar://problem/27723718.

* platform/mac-wk1/TestExpectations:

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

4 years agoAX: Audio Description tracks are not labeled correctly, causing user confusion
eric.carlson@apple.com [Thu, 18 Aug 2016 18:05:56 +0000 (18:05 +0000)]
AX: Audio Description tracks are not labeled correctly, causing user confusion
https://bugs.webkit.org/show_bug.cgi?id=160652
<rdar://problem/27742208>

Reviewed by Antoine Quint.

* http/tests/media/hls/hls-accessiblity-describes-video-menu-expected.txt: Added.
* http/tests/media/hls/hls-accessiblity-describes-video-menu.html: Added.

* media/trackmenu-test.js:
(clickCCButton): Fail immediately if "video" is null or not a media element. Make failure
logging more descriptive.

* platform/gtk/TestExpectations: Skip new test.

* platform/ios-simulator/media/video-controls-captions-trackmenu-expected.txt: Updated for
clickCCButton error message change.
* platform/ios-simulator/media/video-controls-captions-trackmenu-hide-on-click-expected.txt: Ditto.
* platform/ios-simulator/media/video-controls-captions-trackmenu-localized-expected.txt: Ditto.
* platform/ios-simulator/media/video-controls-captions-trackmenu-sorted-expected.txt: Ditto.

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

4 years agoRemove unused SlotVisitor::append() variant.
mark.lam@apple.com [Thu, 18 Aug 2016 17:54:27 +0000 (17:54 +0000)]
Remove unused SlotVisitor::append() variant.
https://bugs.webkit.org/show_bug.cgi?id=160961

Reviewed by Saam Barati.

* heap/SlotVisitor.h:
* jit/JITWriteBarrier.h:
(JSC::JITWriteBarrier::get):
(JSC::SlotVisitor::append): Deleted.

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

4 years agoFix WinCairo build after r204592.
achristensen@apple.com [Thu, 18 Aug 2016 17:26:28 +0000 (17:26 +0000)]
Fix WinCairo build after r204592.

* PlatformAppleWin.cmake:
* PlatformWin.cmake:

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

4 years agoMake @Array(size) a bytecode intrinsic
sbarati@apple.com [Thu, 18 Aug 2016 17:17:41 +0000 (17:17 +0000)]
Make @Array(size) a bytecode intrinsic
https://bugs.webkit.org/show_bug.cgi?id=160867

Reviewed by Mark Lam.

There were a few places in the code where we were emitting `@Array(size)`
or `new @Array(size)`. Since we have a bytecode operation that already
represents this, called new_array_with_size, it's faster to just make a
bytecode intrinsic for the this operation. This patch does that and
the intrinsic is called `@newArrayWithSize`. This might be around a
1% speedup on ES6 sample bench, but it's within the noise. This is just
a good bytecode operation to have because it's common enough to
create arrays and it's good to make that fast in all tiers.

* builtins/ArrayConstructor.js:
(of):
(from):
* builtins/ArrayPrototype.js:
(filter):
(map):
(sort.stringSort):
(sort):
(concatSlowPath):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_isObject):
(JSC::BytecodeIntrinsicNode::emit_intrinsic_newArrayWithSize):

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

4 years agoRebaseline js/dom/global-constructors-attributes.html after r204594.
ryanhaddad@apple.com [Thu, 18 Aug 2016 16:10:26 +0000 (16:10 +0000)]
Rebaseline js/dom/global-constructors-attributes.html after r204594.

Unreviewed test gardening.

* platform/mac-wk1/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@204596 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 years ago[MediaStream] cleanup MediaConstraints
eric.carlson@apple.com [Thu, 18 Aug 2016 16:06:19 +0000 (16:06 +0000)]
[MediaStream] cleanup MediaConstraints
https://bugs.webkit.org/show_bug.cgi?id=160957

Reviewed by Antoine Quint.

No new tests, no behavior change.

* Modules/mediastream/CaptureDeviceManager.cpp:
(CaptureDeviceManager::sessionSupportsConstraint): Use MediaConstraint::type

* bindings/js/JSMediaDevicesCustom.cpp:
(WebCore::initializeStringConstraintWithList): MediaConstraint::create now takes the constraint
type, not name.
(WebCore::createStringConstraint): Ditto.
(WebCore::createBooleanConstraint): Ditto.
(WebCore::createDoubleConstraint): Ditto.
(WebCore::createIntConstraint): Ditto.
(WebCore::parseMediaTrackConstraintSetForKey): Pass constraint type.

* platform/mediastream/MediaConstraints.cpp:
(WebCore::MediaConstraint::create): MediaConstraint constructor now takes the constraint.
(WebCore::IntConstraint::create): Take type, not name.
(WebCore::IntConstraint::setMin): Ditto.
(WebCore::DoubleConstraint::create): Ditto.
(WebCore::BooleanConstraint::create): Ditto.
(WebCore::StringConstraint::create): Ditto.
* platform/mediastream/MediaConstraints.h:

* platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
(WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Make static.
(WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Ditto.
* platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:

* platform/mediastream/mac/AVCaptureDeviceManager.mm:
(WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Use MediaConstraint::type

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::applyConstraints): nameForConstraint is a static method. Add
error logging.

* platform/mock/MediaConstraintsMock.cpp:
(WebCore::isSatisfiable): Use constraint type.

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

4 years ago[web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
commit-queue@webkit.org [Thu, 18 Aug 2016 13:58:37 +0000 (13:58 +0000)]
[web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
https://bugs.webkit.org/show_bug.cgi?id=156096

Patch by Rawinder Singh <rawinder.singh-webkit@cisra.canon.com.au> on 2016-08-18
Reviewed by Dean Jackson.

Adds:
Source/JavaScriptCore:

- Animatable interface and implementation of getAnimations in Element.
- Interface and implementation for Document getAnimations method.
- AnimationEffect interface and class stub.
- KeyframeEffect interface and constructor implementation.
- 'Animation' interface, constructor and query methods for effect and timeline.
- Remove runtime condition on Web animation interfaces (compile time flag is specified).

* runtime/CommonIdentifiers.h:

Source/WebCore:

- Animatable interface and implementation of getAnimations in Element.
- Interface and implementation for Document getAnimations method.
- AnimationEffect interface and class stub.
- KeyframeEffect interface and constructor implementation.
- 'Animation' interface, constructor and query methods for effect and timeline.
- Remove runtime condition on Web animation interfaces (compile time flag is specified).

Test: webanimations/Document.html

* CMakeLists.txt:
* DerivedSources.make:
* PlatformGTK.cmake:
* WebCore.xcodeproj/project.pbxproj:
* animation/Animatable.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
* animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/AnimationTimeline.cpp.
(WebCore::AnimationEffect::AnimationEffect):
(WebCore::AnimationEffect::~AnimationEffect):
(WebCore::AnimationEffect::setAnimation):
(WebCore::AnimationEffect::isCurrent):
(WebCore::AnimationEffect::isInEffect):
* animation/AnimationEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
* animation/AnimationEffect.idl: Copied from Source/WebCore/animation/DocumentAnimation.idl.
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::destroy):
(WebCore::AnimationTimeline::attachAnimation):
(WebCore::AnimationTimeline::detachAnimation):
* animation/AnimationTimeline.h:
* animation/AnimationTimeline.idl:
* animation/DocumentAnimation.cpp:
(WebCore::DocumentAnimation::timeline):
(WebCore::DocumentAnimation::getAnimations):
(WebCore::DocumentAnimation::addAnimation):
(WebCore::DocumentAnimation::removeAnimation):
* animation/DocumentAnimation.h:
(WebCore::DocumentAnimation::getAnimations):
* animation/DocumentAnimation.idl:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::create):
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::attach):
(WebCore::DocumentTimeline::detach):
* animation/DocumentTimeline.h:
* animation/DocumentTimeline.idl:
* animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
(WebCore::KeyframeEffect::create):
(WebCore::KeyframeEffect::KeyframeEffect):
(WebCore::KeyframeEffect::~KeyframeEffect):
* animation/KeyframeEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.h.
* animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
* animation/WebAnimation.cpp: Copied from Source/WebCore/animation/DocumentAnimation.cpp.
(WebCore::WebAnimation::create):
(WebCore::WebAnimation::WebAnimation):
(WebCore::WebAnimation::~WebAnimation):
* animation/WebAnimation.h: Copied from Source/WebCore/animation/DocumentAnimation.h.
* animation/WebAnimation.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
* bindings/scripts/CodeGeneratorGObject.pm:
* dom/Element.cpp:
(WebCore::Element::getAnimations):
* dom/Element.h:
* dom/Element.idl:

Source/WebKit/mac:

- Setup interface for enabling runtime flag for Web animations through preferences.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences webAnimationsEnabled]):
(-[WebPreferences setWebAnimationsEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

LayoutTests:

- Animatable interface and implementation of getAnimations in Element.
- Interface and implementation for Document getAnimations method.
- AnimationEffect interface and class stub.
- KeyframeEffect interface and constructor implementation.
- 'Animation' interface, constructor and query methods for effect and timeline.
- Remove runtime condition on Web animation interfaces (compile time flag is specified).

* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* webanimations/Document-expected.txt: Added.
* webanimations/Document.html: Added.
* webanimations/script-tests/Document.js: Added.

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

4 years agoUnreviewed test gardening.
pvollan@apple.com [Thu, 18 Aug 2016 09:23:32 +0000 (09:23 +0000)]
Unreviewed test gardening.

Update test expectations on Windows for failing tests. These failures are tracked in
https://bugs.webkit.org/show_bug.cgi?id=160447.

* platform/win/TestExpectations:

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

4 years ago[Cocoa] Migrate off of deprecated CoreGraphics API CGContextSelectFont() and CGContex...
mmaxfield@apple.com [Thu, 18 Aug 2016 06:38:14 +0000 (06:38 +0000)]
[Cocoa] Migrate off of deprecated CoreGraphics API CGContextSelectFont() and CGContextShowTextAtPoint()
https://bugs.webkit.org/show_bug.cgi?id=160895

Reviewed by Dean Jackson.

Source/WebCore:

Migrate to CTLineDraw() instead.

This patch also adds support for linking to the existing CoreText framework on Windows.

No new tests because there is no behavior change.

* PlatformWin.cmake:
* page/cocoa/ResourceUsageOverlayCocoa.mm:
(WebCore::showText):
* platform/graphics/ca/PlatformCALayer.cpp:
(WebCore::PlatformCALayer::drawTextAtPoint):
* platform/ios/LegacyTileCache.mm:
(WebCore::LegacyTileCache::drawLayer):
* platform/spi/win/CoreTextSPIWin.cpp: Added.
* platform/spi/win/CoreTextSPIWin.h: Added.

Source/WebKit:

Link to the existing CoreText framework.

* PlatformWin.cmake:

Tools:

Link to the existing CoreText framework.

* DumpRenderTree/PlatformWin.cmake:
* TestWebKitAPI/PlatformWin.cmake:

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

4 years ago[CSS] The parser should not get rid of empty namespace specification in front of...
benjamin@webkit.org [Thu, 18 Aug 2016 06:22:40 +0000 (06:22 +0000)]
[CSS] The parser should not get rid of empty namespace specification in front of element name selectors
https://bugs.webkit.org/show_bug.cgi?id=160936

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/dom/nodes/ParentNode-querySelector-All-expected.txt:
* web-platform-tests/dom/nodes/ParentNode-querySelector-All-xht-expected.txt:

Source/WebCore:

There are two places where you can specify an empty namespace
in selectors:
    - Element name (e.g. "|name")
    - Attribute name (e.g. "[|name]")
In the first case, if we have an empty namespace, the selector
should match that.
In the second case, the default namespace of attribute is already
empty so it is just the same as "[name]".

Our code was just discarding any empty namespace. This is fine
for attributes but for names that is transforming "|name" into "name"
which is invalid.

This patch updates those cases to differentiate:
- Null prefix -> There was no namespace specified.
- Empty prefix -> There was a namespace prefix and it is empty.

Test: fast/selectors/empty-namespace-with-element-selector.html

* css/CSSGrammar.y.in:
* css/CSSParser.cpp:
(WebCore::CSSParser::determineNameInNamespace):
(WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded):
(WebCore::CSSParser::rewriteSpecifiersWithElementName):
* css/CSSParser.h:
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelectorList.cpp:
(WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::determineNamespace): Deleted.

LayoutTests:

* fast/css/css-selector-text-expected.txt:
* fast/css/css-selector-text.html:
* fast/css/css-set-selector-text-expected.txt:
* fast/css/css-set-selector-text.html:
* fast/selectors/empty-namespace-with-element-selector-expected.txt: Added.
* fast/selectors/empty-namespace-with-element-selector.html: Added.

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

4 years ago[Web IDL] Add support for dictionary members of dictionary types
cdumez@apple.com [Thu, 18 Aug 2016 03:07:31 +0000 (03:07 +0000)]
[Web IDL] Add support for dictionary members of dictionary types
https://bugs.webkit.org/show_bug.cgi?id=160902

Reviewed by Sam Weinig.

Add support for dictionary members of dictionary types.

No new tests, updated bindings tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
* bindings/scripts/test/TestObj.idl:

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

4 years agoAdd WASM support for i64 simple opcodes.
keith_miller@apple.com [Thu, 18 Aug 2016 01:35:55 +0000 (01:35 +0000)]
Add WASM support for i64 simple opcodes.
https://bugs.webkit.org/show_bug.cgi?id=160928

Reviewed by Michael Saboff.

This patch also removes the unsigned int32 mod operator, which is not supported by B3 yet.

* wasm/WASMB3IRGenerator.cpp:
(JSC::WASM::toB3Op):
(JSC::WASM::B3IRGenerator::unaryOp):
* wasm/WASMFunctionParser.h:
(JSC::WASM::WASMFunctionParser<Context>::parseExpression):
* wasm/WASMOps.h:

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

4 years agoAdd support for additional networks
andersca@apple.com [Thu, 18 Aug 2016 00:46:17 +0000 (00:46 +0000)]
Add support for additional networks
https://bugs.webkit.org/show_bug.cgi?id=160951
rdar://problem/27807479

Reviewed by Sam Weinig.

Source/WebCore:

* Modules/applepay/ApplePaySession.cpp:
(WebCore::createSupportedNetworks):
(WebCore::createPaymentRequest):
(WebCore::ApplePaySession::create):
* Modules/applepay/PaymentRequest.cpp:
(WebCore::isAdditionalValidSupportedNetwork):
(WebCore::PaymentRequest::isValidSupportedNetwork):
* Modules/applepay/PaymentRequest.h:
(WebCore::PaymentRequest::supportedNetworks):
(WebCore::PaymentRequest::setSupportedNetworks):
* Modules/applepay/PaymentRequestValidator.cpp:
(WebCore::PaymentRequestValidator::validateSupportedNetworks):
* Modules/applepay/PaymentRequestValidator.h:

Source/WebKit2:

* Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
(IPC::ArgumentCoder<PaymentRequest>::decode):
(IPC::ArgumentCoder<PaymentRequest::SupportedNetworks>::encode): Deleted.
(IPC::ArgumentCoder<PaymentRequest::SupportedNetworks>::decode): Deleted.
* Shared/WebCoreArgumentCoders.h:
* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::toAdditionalSupportedNetwork):
(WebKit::toSupportedNetwork):
(WebKit::toSupportedNetworks):
* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::supportsVersion):

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

4 years agoWe allow assignments to const variables when in a for-in/for-of loop
commit-queue@webkit.org [Wed, 17 Aug 2016 23:57:03 +0000 (23:57 +0000)]
We allow assignments to const variables when in a for-in/for-of loop
https://bugs.webkit.org/show_bug.cgi?id=156673

Patch by JF Bastien <jfbastien@apple.com> on 2016-08-17
Reviewed by Filip Pizlo.

JSTests:

* stress/for-in-of-const.js: Added.
(expect_nothrow):
(expect_throw):
(capture):

Source/JavaScriptCore:

for-in and for-of weren't checking whether iteration variable from
parent scopes were const. Assigning to such variables should
throw, but used not to.

* bytecompiler/NodesCodegen.cpp:
(JSC::ForInNode::emitLoopHeader):
(JSC::ForOfNode::emitBytecode):

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

4 years agoUse find_library within Windows build
commit-queue@webkit.org [Wed, 17 Aug 2016 23:29:50 +0000 (23:29 +0000)]
Use find_library within Windows build
https://bugs.webkit.org/show_bug.cgi?id=160904

Patch by Don Olmstead <don.olmstead@am.sony.com> on 2016-08-17
Reviewed by Brent Fulgham.

.:

* Source/cmake/FindICU.cmake:
* Source/cmake/OptionsWin.cmake:

Source/WTF:

* wtf/CMakeLists.txt:

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

4 years ago[Win] Remove old libraries from build inputs
bfulgham@apple.com [Wed, 17 Aug 2016 23:08:26 +0000 (23:08 +0000)]
[Win] Remove old libraries from build inputs
https://bugs.webkit.org/show_bug.cgi?id=160949

Reviewed by Dean Jackson.

Modify the download script to remove the old 'icuuc.lib' and
'icuin.lib' files for Windows builds.

* Scripts/update-webkit-auxiliary-libs:

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

4 years agoWeb Inspector: Network Tab should not layout if not visible
mattbaker@apple.com [Wed, 17 Aug 2016 23:02:08 +0000 (23:02 +0000)]
Web Inspector: Network Tab should not layout if not visible
https://bugs.webkit.org/show_bug.cgi?id=160920
<rdar://problem/27876629>

Reviewed by Timothy Hatcher.

Avoid updating the current time when the Network tab is hidden.
The timer, and any debounced timer cancellations, need to be stopped
as soon as the view is hidden.

* UserInterface/Views/NetworkGridContentView.js:
(WebInspector.NetworkGridContentView.prototype.hidden):
(WebInspector.NetworkGridContentView.prototype._networkTimelineRecordAdded):
(WebInspector.NetworkGridContentView.prototype._stopUpdatingCurrentTime):
(WebInspector.NetworkGridContentView):

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

4 years agoExtra logging for crash reason
commit-queue@webkit.org [Wed, 17 Aug 2016 22:18:36 +0000 (22:18 +0000)]
Extra logging for crash reason
https://bugs.webkit.org/show_bug.cgi?id=160943

Patch by Jonathan Bedard <jbedard@apple.com> on 2016-08-17
Reviewed by Alexey Proskuryakov.

A number of tests have been erroneously marked as crashed, this should help diagnose these false crashes.

* Scripts/webkitpy/port/server_process.py:
(ServerProcess.write): Add extra logging to determine why a process has been marked as crashed.
(ServerProcess._wait_for_data_and_update_buffers_using_select): Ditto.
(ServerProcess.has_crashed): Ditto.

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

4 years agoFixed a potential bug in MarkedArgumentBuffer.
ggaren@apple.com [Wed, 17 Aug 2016 21:22:46 +0000 (21:22 +0000)]
Fixed a potential bug in MarkedArgumentBuffer.
https://bugs.webkit.org/show_bug.cgi?id=160948
<rdar://problem/27889416>

Reviewed by Oliver Hunt.

I haven't been able to produce an observable test case after some trying.

* runtime/ArgList.cpp:
(JSC::MarkedArgumentBuffer::addMarkSet): New helper function -- I broke
this out from existing code for clarity, but the behavior is the same.

(JSC::MarkedArgumentBuffer::expandCapacity): Ditto.

(JSC::MarkedArgumentBuffer::slowAppend): Always addMarkSet() on the slow
path. This is faster than the old linear scan, and I think it might
avoid cases the old scan could miss.

* runtime/ArgList.h:
(JSC::MarkedArgumentBuffer::append): Account for the case where someone
has called clear() or removeLast().

(JSC::MarkedArgumentBuffer::mallocBase): No behavior change -- but it's
clearer to test the buffers directly instead of inferring what they
might be based on capacity.

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

4 years agoWeb Inspector: Select elements in DOM hierarchy are misaligned
commit-queue@webkit.org [Wed, 17 Aug 2016 21:20:59 +0000 (21:20 +0000)]
Web Inspector: Select elements in DOM hierarchy are misaligned
https://bugs.webkit.org/show_bug.cgi?id=160885

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-08-17
Reviewed by Timothy Hatcher.

* UserInterface/Views/HierarchicalPathComponent.css:
(.hierarchical-path-component > select):

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

4 years agoRemove an invalid assertion in the DFG backend's GetById emitter.
mark.lam@apple.com [Wed, 17 Aug 2016 21:00:45 +0000 (21:00 +0000)]
Remove an invalid assertion in the DFG backend's GetById emitter.
https://bugs.webkit.org/show_bug.cgi?id=160925
<rdar://problem/27248961>

Reviewed by Filip Pizlo.

JSTests:

* stress/dfg-get-by-id-should-not-assert-non-null-prediction.js: Added.

Source/JavaScriptCore:

The DFG backend's GetById assertion that the node's prediction not be SpecNone
is just plain wrong.  It assumes that we can never have a GetById node without a
type prediction, but this is not true.  The following test case proves otherwise:

    function foo() {
        "use strict";
        return --arguments["callee"];
    }

Will remove the assertion.  Nothing else needs to change as the DFG is working
correctly without the assertion.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

4 years agoRemove a couple of unused WKSI function pointers
andersca@apple.com [Wed, 17 Aug 2016 20:22:24 +0000 (20:22 +0000)]
Remove a couple of unused WKSI function pointers
https://bugs.webkit.org/show_bug.cgi?id=160946

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.

Source/WebKit2:

* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.

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

4 years agoMove WKSignedPublicKeyAndChallengeString into WebCore and make it proper C++
andersca@apple.com [Wed, 17 Aug 2016 19:58:00 +0000 (19:58 +0000)]
Move WKSignedPublicKeyAndChallengeString into WebCore and make it proper C++
https://bugs.webkit.org/show_bug.cgi?id=160945

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::getSubjectPublicKey):
(WebCore::signPublicKeyAndChallenge):
(WebCore::signedPublicKeyAndChallengeString):

Source/WTF:

* wtf/RetainPtr.h:
(WTF::RetainPtr::operator&):
Cast this to the right type.

* wtf/spi/cocoa/SecuritySPI.h:
Add new SPI.

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

4 years agoRemove CSS_IMAGE_SET feature define
antti@apple.com [Wed, 17 Aug 2016 19:56:28 +0000 (19:56 +0000)]
Remove CSS_IMAGE_SET feature define
https://bugs.webkit.org/show_bug.cgi?id=160944

Reviewed by Dean Jackson.

Source/WebCore:

This seems to be enabled everywhere already (except Mac cmake build which it keep breaking).

* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::CSSCursorImageValue):
(WebCore::CSSCursorImageValue::cachedImage):
(WebCore::CSSCursorImageValue::cachedOrPendingImage):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::cloneForCSSOM):
* css/CSSImageSetValue.h:
* css/CSSParser.cpp:
(WebCore::CSSParser::parseVariableDependentValue):
(WebCore::isImageSetFunctionValue):
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseContent):
(WebCore::CSSParser::parseFillImage):
(WebCore::CSSParser::parseBorderImage):
(WebCore::CSSParser::parseImageResolution):
(WebCore::CSSParser::parseImageSet):
* css/CSSParser.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapNinePieceImage):
* css/CSSValue.cpp:
(WebCore::CSSValue::traverseSubresources):
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
(WebCore::CSSValue::cloneForCSSOM):
* css/CSSValue.h:
(WebCore::CSSValue::isImageGeneratorValue):
(WebCore::CSSValue::isGradientValue):
(WebCore::CSSValue::isNamedImageValue):
(WebCore::CSSValue::isImageSetValue):
(WebCore::CSSValue::isImageValue):
(WebCore::CSSValue::isInheritedValue):
* css/StyleBuilderConverter.h:
(WebCore::isImageShape):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueContent):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleImage):
(WebCore::StyleResolver::generatedOrPendingFromValue):
(WebCore::StyleResolver::setOrPendingFromValue):
(WebCore::StyleResolver::cursorOrPendingFromValue):
* css/StyleResolver.h:
(WebCore::StyleResolver::applyPropertyToRegularStyle):
* css/makeprop.pl:
(generateFillLayerPropertyValueSetter):
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue):
* rendering/style/StylePendingImage.h:
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):

Source/WTF:

* wtf/FeatureDefines.h:

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

4 years ago[Cocoa] -[NSString isEqualToString:] returns NO for any WKNSString argument
mitz@apple.com [Wed, 17 Aug 2016 19:19:05 +0000 (19:19 +0000)]
[Cocoa] -[NSString isEqualToString:] returns NO for any WKNSString argument
https://bugs.webkit.org/show_bug.cgi?id=160938
<rdar://problem/27876652>

Reviewed by Anders Carlsson.

Source/WebKit2:

-[NSString isEqualToString:] calls an internal NSObject method on its argument, which
NSString subclasses override to return YES, but WKObject does not override and does not
forward to its target NSString.

To fix this issue and other similar issues, we make WKObject a root class instead of an
NSObject subclass.

Test: TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm

* Platform/spi/Cocoa/objcSPI.h: Added.

* Shared/Cocoa/WKObject.h: Make WKObject a root class instead of inhereting from NSObject.

* Shared/Cocoa/WKObject.mm:
(+[WKObject class]): Return self.
(-[WKObject allowsWeakReference]): Added. Called by the Objective-C runtime.
(-[WKObject retainWeakReference]): Ditto.
(-[WKObject hash]): If we don’t have a target, return our address.
(-[WKObject superclass]): Implement this NSObject protocol method.
(-[WKObject class]): Ditto.
(-[WKObject self]): Ditto.
(-[WKObject performSelector:]): Ditto.
(-[WKObject performSelector:withObject:]): Ditto.
(-[WKObject performSelector:withObject:withObject:]): Ditto.
(-[WKObject isProxy]): Ditto.
(-[WKObject respondsToSelector:]): Changed to not call super.
(-[WKObject conformsToProtocol:]): Ditto.
(-[WKObject description]): Ditto.
(-[WKObject retain]): Implement this NSObject protocol method.
(-[WKObject release]): Ditto.
(-[WKObject autorelease]): Ditto.
(-[WKObject retainCount]): Ditto.
(-[WKObject zone]): Ditto.
(-[WKObject dealloc]): Deleted.
(-[WKObject classForCoder]): Deleted.
(-[WKObject classForKeyedArchiver]): Deleted.
(-[WKObject _cfTypeID]): Deleted.

* WebKit2.xcodeproj/project.pbxproj: Added reference to new file.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKObject.mm: Added.
(TestWebKitAPI::TEST):

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

4 years agoTry to fix CMake build.
antti@apple.com [Wed, 17 Aug 2016 18:15:58 +0000 (18:15 +0000)]
Try to fix CMake build.

* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::cssValue):

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

4 years agoAX: Support abbreviations in iOS
cfleizach@apple.com [Wed, 17 Aug 2016 18:01:41 +0000 (18:01 +0000)]
AX: Support abbreviations in iOS
https://bugs.webkit.org/show_bug.cgi?id=160907

Reviewed by Joanmarie Diggs.

Source/WebCore:

Expose the expandedTextValue attribute for iOS, so that VoiceOver can speak abbreviations correctly.

Test: accessibility/ios-simulator/abbreviation.html

* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper textMarkersForRange:]):
(-[WebAccessibilityObjectWrapper accessibilityExpandedTextValue]):
(-[WebAccessibilityObjectWrapper accessibilityIdentifier]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(AXAttributeStringSetSpelling):
(AXAttributeStringSetExpandedTextValue):
(AXAttributedStringAppendText):
(AXAttributeStringSetexpandedTextValue): Deleted.

Tools:

* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::stringAttributeValue):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::stringAttributeValue):

LayoutTests:

* accessibility/ios-simulator/abbreviation-expected.txt: Added.
* accessibility/ios-simulator/abbreviation.html: Added.

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

4 years agoWeb Inspector: rapid updates to status icons in Visual Styles sidebar causes flicker
commit-queue@webkit.org [Wed, 17 Aug 2016 17:48:59 +0000 (17:48 +0000)]
Web Inspector: rapid updates to status icons in Visual Styles sidebar causes flicker
https://bugs.webkit.org/show_bug.cgi?id=160887

Patch by Devin Rousso <dcrousso+webkit@gmail.com> on 2016-08-17
Reviewed by Timothy Hatcher.

* UserInterface/Views/VisualStyleBasicInput.js:
(WebInspector.VisualStyleBasicInput):

* UserInterface/Views/VisualStyleColorPicker.js:
(WebInspector.VisualStyleColorPicker):

* UserInterface/Views/VisualStyleNumberInputBox.js:
(WebInspector.VisualStyleNumberInputBox):
(WebInspector.VisualStyleNumberInputBox.prototype._valueNumberInputKeyDown):

* UserInterface/Views/VisualStylePropertyNameInput.js:
(WebInspector.VisualStylePropertyNameInput):

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

4 years agoRemove StyleCachedImageSet
antti@apple.com [Wed, 17 Aug 2016 16:37:45 +0000 (16:37 +0000)]
Remove StyleCachedImageSet
https://bugs.webkit.org/show_bug.cgi?id=160941

Reviewed by Simon Fraser.

It is almost the same as StyleCachedImage. Just use that.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSCursorImageValue.cpp:
(WebCore::CSSCursorImageValue::cachedImage):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::detachPendingImage):
(WebCore::CSSImageSetValue::~CSSImageSetValue):
(WebCore::CSSImageSetValue::fillImageSet):
(WebCore::CSSImageSetValue::bestImageForScaleFactor):
(WebCore::CSSImageSetValue::bestFitImage):
(WebCore::CSSImageSetValue::cachedOrPendingImageSet):
(WebCore::CSSImageSetValue::customCSSText):
(WebCore::CSSImageSetValue::traverseSubresources):
(WebCore::CSSImageSetValue::cachedImageSet): Deleted.
* css/CSSImageSetValue.h:
(WebCore::CSSImageSetValue::create):
(WebCore::CSSImageSetValue::compareByScaleFactor):
* css/StyleResolver.cpp:
* page/EventHandler.cpp:
* rendering/style/ShapeValue.cpp:
(WebCore::ShapeValue::isImageValid):
* rendering/style/StyleAllInOne.cpp:
* rendering/style/StyleCachedImage.cpp:
(WebCore::StyleCachedImage::StyleCachedImage):

    Add scale factor and CSSImageSetValue backpointer, the only additional features of StyleCachedImageSet.

(WebCore::StyleCachedImage::cssValue):
(WebCore::StyleCachedImage::imageSize):
(WebCore::StyleCachedImage::imageHasRelativeWidth):
* rendering/style/StyleCachedImage.h:
* rendering/style/StyleCachedImageSet.cpp: Removed.
* rendering/style/StyleCachedImageSet.h: Removed.
* rendering/style/StyleImage.h:
(WebCore::StyleImage::isCachedImage):
(WebCore::StyleImage::isPendingImage):
(WebCore::StyleImage::isGeneratedImage):
(WebCore::StyleImage::StyleImage):
(WebCore::StyleImage::isCachedImageSet): Deleted.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):

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

4 years ago[EFL] Bump efl version from 1.17 to 1.18
commit-queue@webkit.org [Wed, 17 Aug 2016 14:59:18 +0000 (14:59 +0000)]
[EFL] Bump efl version from 1.17 to 1.18
https://bugs.webkit.org/show_bug.cgi?id=160899

Patch by Gyuyoung Kim <gyuyoung.kim@navercorp.com> on 2016-08-17
Reviewed by Antonio Gomes.

.:

* Source/cmake/OptionsEfl.cmake: Update ewebkit version to 1.18.0.

Tools:

To use efl-1.18, EFL port needs to update install dependencies as well.

* efl/install-dependencies:
* efl/jhbuild.modules:

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

4 years ago[Win] Add tests for linked fonts.
pvollan@apple.com [Wed, 17 Aug 2016 14:39:23 +0000 (14:39 +0000)]
[Win] Add tests for linked fonts.
https://bugs.webkit.org/show_bug.cgi?id=160898

Reviewed by Brent Fulgham.

Add tests for https://trac.webkit.org/changeset/204502.

Source/WebCore:

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::appendLinkedFonts):
(WebCore::getLinkedFonts):

Tools:

* TestWebKitAPI/PlatformWin.cmake:
* TestWebKitAPI/Tests/WebCore/win/LinkedFonts.cpp: Added.
(TestWebKitAPI::TEST):

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

4 years ago[EFL] Fix test_ewk2_view after r203612
hs85.jeong@samsung.com [Wed, 17 Aug 2016 11:12:46 +0000 (11:12 +0000)]
[EFL] Fix test_ewk2_view after r203612
https://bugs.webkit.org/show_bug.cgi?id=160937

Reviewed by Gyuyoung Kim.

Default parameter values for window.alert() / prompt() / confirm() was
changed from "undefined" to the empty string after r203612.

* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

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

4 years agoUnreviewed. Fix GObject DOM bindings API break after r204449, r204450 and r204451.
carlosgc@webkit.org [Wed, 17 Aug 2016 11:07:06 +0000 (11:07 +0000)]
Unreviewed. Fix GObject DOM bindings API break after r204449, r204450 and r204451.

Attributes designMode, embeds, plugins, scripts and compatMode have been moved from HTMLDocument to Document.

* bindings/gobject/WebKitDOMDeprecated.cpp:
(webkit_dom_html_document_get_design_mode):
(webkit_dom_html_document_set_design_mode):
(webkit_dom_html_document_get_compat_mode):
(webkit_dom_html_document_get_embeds):
(webkit_dom_html_document_get_plugins):
(webkit_dom_html_document_get_scripts):
* bindings/gobject/WebKitDOMDeprecated.h:
* bindings/gobject/WebKitDOMDeprecated.symbols:
* bindings/gobject/webkitdom.symbols:

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

4 years agoUnreviewed. Fix GObject DOM bindings API break after r204312.
carlosgc@webkit.org [Wed, 17 Aug 2016 08:50:11 +0000 (08:50 +0000)]
Unreviewed. Fix GObject DOM bindings API break after r204312.

HTMLInputElement capture attribute now returns the actual capture value, instead of whether it's present or
not. This patch renames webkit_dom_html_input_element_get_capture as
webkit_dom_html_input_element_get_capture_type and deprecates webkit_dom_html_input_element_get_capture.

* bindings/gobject/WebKitDOMDeprecated.cpp:
(webkit_dom_html_input_element_get_capture):
* bindings/gobject/WebKitDOMDeprecated.h:
* bindings/gobject/WebKitDOMDeprecated.symbols:
* bindings/gobject/webkitdom.symbols:
* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateProperty):
(GetEffectiveFunctionName):

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

4 years ago[iOS WK2] Don't throw touchMove events on the floor
simon.fraser@apple.com [Wed, 17 Aug 2016 05:48:27 +0000 (05:48 +0000)]
[iOS WK2] Don't throw touchMove events on the floor
https://bugs.webkit.org/show_bug.cgi?id=160935

Reviewed by Tim Horton.

Source/WebKit2:

EventDispatcher claimed to coalesce touchMove events, but actually threw away any
touchMove if there was one in the queue when the next non-move event came along.

Fix to strictly coalesce touchMove events, so a start/move/end stream always fires
a move event. This is necessary for move-based interaction to work in testing,
for example the added range slider test.

Test: fast/forms/ios/drag-range-thumb.html

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::touchEvent):

LayoutTests:

Test for range slider interaction with synthesized touch events.

* fast/forms/ios/drag-range-thumb-expected.txt: Added.
* fast/forms/ios/drag-range-thumb.html: Added.

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

4 years agocustomElements.define should retrieve lifecycle callbacks
rniwa@webkit.org [Wed, 17 Aug 2016 04:42:53 +0000 (04:42 +0000)]
customElements.define should retrieve lifecycle callbacks
https://bugs.webkit.org/show_bug.cgi?id=160797

Reviewed by Chris Dumez.

Source/WebCore:

Updated JSCustomElementInterface to invoke Get(constructor, "prototype") and Get(prototype, callbackName)
for each lifecycle callback as required by the latest specification:
https://html.spec.whatwg.org/#dom-customelementsregistry-define

Also added the support for "observedAttributes" property on the custom elements constructor which defines
the list of attributes for which attributeChangedCallback is invoked.

Test: fast/custom-elements/CustomElementsRegistry.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::setAttributeChangedCallback): Added.
(WebCore::JSCustomElementInterface::attributeChanged): Invoke m_attributeChangedCallback instead of on the
result of Get(element, "attributeChangedCallback").
* bindings/js/JSCustomElementInterface.h:
(WebCore::JSCustomElementInterface::observesAttribute): Added.

* bindings/js/JSCustomElementsRegistryCustom.cpp:
(WebCore::getLifecycleCallback): Added.
(WebCore::JSCustomElementsRegistry::define): Invoke Get(prototype, callbackName) for each callback. Also
store attributedChangedCallback and observedAttributes to JSCustomElementInterface. Other callbacks will
be stored in the future when the support for those callbacks are added.

* dom/Element.cpp:
(WebCore::Element::attributeChanged): Moved more code into enqueueAttributeChangedCallbackIfNeeded.

* dom/LifecycleCallbackQueue.cpp:
(WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded): Added an early exit for when
the given attribute is not observed by the custom element. Also moved the logic to retrieve
JSCustomElementInterface from Element::attributeChanged and renamed it from enqueueAttributeChangedCallback.

* bindings/js/JSDOMBinding.h:
(WebCore::toNativeArray): Throw a TypeError when the argument is not an object.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<Vector<T>>::convert): Removed a FIXME comment.

LayoutTests:

Added test cases for CustomElementsRegistry.define to make sure it invokes Get(constructor, "prototype")
and Get(prototype, callbackName) for each lifecycle callback.

Also updated the tests to reflect the support for observedAttributes which specifies the list of attributes
for which attributeChangedCallback is invoked.

* fast/custom-elements/CustomElementsRegistry-expected.txt: Renamed from Document-defineElement-expected.txt.
* fast/custom-elements/CustomElementsRegistry.html: Renamed from Document-defineElement.html.
* fast/custom-elements/Document-defineElement-expected.txt: Removed.
* fast/custom-elements/Document-defineElement.html: Removed.
* fast/custom-elements/attribute-changed-callback-expected.txt:
* fast/custom-elements/attribute-changed-callback.html: Added test cases for "observedAttributes".
* fast/custom-elements/lifecycle-callback-timing.html:

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

4 years agoSubpixel rendering: Cleanup RenderLayerBacking::updateGeometry.
zalan@apple.com [Wed, 17 Aug 2016 03:18:21 +0000 (03:18 +0000)]
Subpixel rendering: Cleanup RenderLayerBacking::updateGeometry.
https://bugs.webkit.org/show_bug.cgi?id=156860
<rdar://problem/25432352>

Reviewed by Simon Fraser.

Source/WebCore:

This patch cleans up the subpixel adjustment computation for the graphics layers
in RenderLayerBacking::updateGeometry.
It also fixes subpixel jiggling with clipping layers (both ancestor and child containment layers).

Tests: compositing/hidpi-ancestor-subpixel-clipping.html
       compositing/hidpi-sibling-composited-content-offset.html
       compositing/hidpi-subpixel-transform-origin.html
       fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::beginTransparencyLayers):
(WebCore::RenderLayer::paint):
(WebCore::RenderLayer::clipToRect):
(WebCore::RenderLayer::setupClipPath):
(WebCore::RenderLayer::paintLayerByApplyingTransform):
(WebCore::RenderLayer::paintBackgroundForFragments):
(WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
(WebCore::RenderLayer::paintOutlineForFragments):
(WebCore::RenderLayer::paintMaskForFragments):
(WebCore::RenderLayer::paintChildClippingMaskForFragments):
(WebCore::RenderLayer::paintOverflowControlsForFragments):
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::subpixelOffsetFromRendererChanged):
(WebCore::subpixelForLayerPainting):
(WebCore::computeOffsetFromRenderer):
(WebCore::snappedGraphicsLayerRect):
(WebCore::computeOffsetFromAncestorGraphicsLayer):
(WebCore::ComputedOffsets::ComputedOffsets): This is a helper class to hold offset values.
(WebCore::ComputedOffsets::fromAncestorGraphicsLayer):
(WebCore::ComputedOffsets::fromParentGraphicsLayer):
(WebCore::ComputedOffsets::fromPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::computePrimaryGraphicsLayerRect):
(WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
(WebCore::RenderLayerBacking::updateGeometry):
(WebCore::RenderLayerBacking::updateMaskingLayerGeometry):
(WebCore::RenderLayerBacking::contentOffsetInCompostingLayer):
(WebCore::RenderLayerBacking::setContentsNeedDisplayInRect):
(WebCore::RenderLayerBacking::paintIntoLayer):
(WebCore::RenderLayerBacking::paintContents):
(WebCore::devicePixelFractionGapFromRendererChanged): Deleted.
(WebCore::pixelFractionForLayerPainting): Deleted.
(WebCore::calculateDevicePixelOffsetFromRenderer): Deleted.
(WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Deleted.
* rendering/RenderLayerBacking.h:

LayoutTests:

* compositing/hidpi-ancestor-subpixel-clipping-expected.html: Added.
* compositing/hidpi-ancestor-subpixel-clipping.html: Added.
* compositing/hidpi-sibling-composited-content-offset-expected.html: Added.
* compositing/hidpi-sibling-composited-content-offset.html: Added.
* compositing/hidpi-subpixel-transform-origin-expected.html: Added.
* compositing/hidpi-subpixel-transform-origin.html: Added.
* fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt: Added.
* fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html: Added.

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

4 years agoUnreviewed, rolling out r204540, r204545, and r204547.
commit-queue@webkit.org [Wed, 17 Aug 2016 03:17:04 +0000 (03:17 +0000)]
Unreviewed, rolling out r204540, r204545, and r204547.
https://bugs.webkit.org/show_bug.cgi?id=160932

Broke Windows builds (Requested by rniwa on #webkit).

Reverted changesets:

"customElements.define should retrieve lifecycle callbacks"
https://bugs.webkit.org/show_bug.cgi?id=160797
http://trac.webkit.org/changeset/204540

"Windows build fix attempt after r204540."
http://trac.webkit.org/changeset/204545

"Another Windows build fix attempt. The error message doesn't
make any sense to me."
http://trac.webkit.org/changeset/204547

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

4 years agoUnreviewed, CMake build fix after r204532
hs85.jeong@samsung.com [Wed, 17 Aug 2016 02:42:51 +0000 (02:42 +0000)]
Unreviewed, CMake build fix after r204532

* PlatformMac.cmake:

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

4 years agoprepare-ChangeLog: Extract logic from generateFunctionLists() into a function that...
dbates@webkit.org [Wed, 17 Aug 2016 02:30:27 +0000 (02:30 +0000)]
prepare-ChangeLog: Extract logic from generateFunctionLists() into a function that takes a delegate object
https://bugs.webkit.org/show_bug.cgi?id=160924

Reviewed by Stephanie Lewis.

Towards adding unit tests for generateFunctionLists() we move its logic into actuallyGenerateFunctionLists()
and have actuallyGenerateFunctionLists() take a delegate object to use to query the file system and SCM.
We modify generateFunctionLists() to call actuallyGenerateFunctionLists(). This will make is possible to
test the generate function list machinery without requiring a SCM checkout by substituting a delegate
object that mocks out the file system and SCM operations.

* Scripts/VCSUtils.pm:
(parseDiffStartLine): Parses an SVN or Git start line and returns the path to the target file.
* Scripts/prepare-ChangeLog:
(generateFunctionLists): Move functionality to actually generate the function lists to actuallyGenerateFunctionLists(),
abstracting the logic to query the file system and SCM into functions on a delegate object that
we pass to it.
(actuallyGenerateFunctionLists): Extracted from generateFunctionLists().
(diffHeaderFormat): Deleted.

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

4 years agoUnreviewed, CMake build fix
hs85.jeong@samsung.com [Wed, 17 Aug 2016 02:29:30 +0000 (02:29 +0000)]
Unreviewed, CMake build fix

* PlatformMac.cmake:

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

4 years agoAnother Windows build fix attempt. The error message doesn't make any sense to me.
rniwa@webkit.org [Wed, 17 Aug 2016 02:23:23 +0000 (02:23 +0000)]
Another Windows build fix attempt. The error message doesn't make any sense to me.

* bindings/js/JSCustomElementsRegistryCustom.cpp:
(WebCore::JSCustomElementsRegistry::define):

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

4 years ago[JSC] Update the documentation of B3's Return opcode
commit-queue@webkit.org [Wed, 17 Aug 2016 02:01:03 +0000 (02:01 +0000)]
[JSC] Update the documentation of B3's Return opcode
https://bugs.webkit.org/show_bug.cgi?id=160912

Patch by Benjamin Poulain <bpoulain@apple.com> on 2016-08-16
Reviewed by Filip Pizlo.

* docs/b3/intermediate-representation.html:

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

4 years agoWindows build fix attempt after r204540.
rniwa@webkit.org [Wed, 17 Aug 2016 01:55:14 +0000 (01:55 +0000)]
Windows build fix attempt after r204540.

* bindings/js/JSBindingsAllInOne.cpp:

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

4 years agoURLParser should parse URLs without credentials
achristensen@apple.com [Wed, 17 Aug 2016 00:41:30 +0000 (00:41 +0000)]
URLParser should parse URLs without credentials
https://bugs.webkit.org/show_bug.cgi?id=160913

Reviewed by Brady Eidson.

Source/WebCore:

When parsing a URL, after the scheme we do not know if we are parsing a username and password
or if we are parsing the host until we hit a '@' indicating the end of the credentials or a /, ?, or #
indicating the end of the host.  Because there are significantly different rules for serializing usernames,
passwords, and hosts (all of which have yet to be implemented in URLParser) we put the code points after the
scheme in a special buffer that will be processed once we know what we are parsing.

In the future, this could be optimized by assuming that we are parsing the host and if we encounter a '@' character,
then do some extra work.  This would save us the effort of copying the host twice because most URLs don't have credentials.

This is covered by a new URLParser API test.

* platform/Logging.h:
* platform/URLParser.cpp:
(WebCore::isC0Control):
(WebCore::isC0ControlOrSpace):
(WebCore::isTabOrNewline):
(WebCore::isSpecialScheme):
(WebCore::URLParser::parse):
(WebCore::URLParser::authorityEndReached):
(WebCore::URLParser::hostEndReached):
(WebCore::URLParser::allValuesEqual):
(WebCore::isASCIIDigit): Deleted.
(WebCore::isASCIIAlpha): Deleted.
(WebCore::isASCIIAlphanumeric): Deleted.
* platform/URLParser.h:
(WebCore::URLParser::parse):

Tools:

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:
(TestWebKitAPI::s):
(TestWebKitAPI::checkURL):
(TestWebKitAPI::TEST_F):

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

4 years agoAdd support for ShadowRoot.mode attribute
cdumez@apple.com [Wed, 17 Aug 2016 00:25:36 +0000 (00:25 +0000)]
Add support for ShadowRoot.mode attribute
https://bugs.webkit.org/show_bug.cgi?id=160919

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that one more check is passing.

* web-platform-tests/dom/interfaces-expected.txt:

Source/WebCore:

Add support for ShadowRoot.mode attribute:
- https://dom.spec.whatwg.org/#interface-shadowroot

Test: fast/shadow-dom/ShadowRoot-mode.html

* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::matchRecursively):
* dom/Element.cpp:
(WebCore::Element::bindingsOffsetParent):
(WebCore::Element::addShadowRoot):
(WebCore::Element::attachShadow):
(WebCore::Element::shadowRootForBindings):
(WebCore::Element::userAgentShadowRoot):
(WebCore::Element::ensureUserAgentShadowRoot):
* dom/Node.cpp:
(WebCore::Node::isUnclosedNode):
(WebCore::Node::assignedSlotForBindings):
(WebCore::Node::isInUserAgentShadowTree):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::ShadowRoot):
(WebCore::ShadowRoot::styleResolver):
* dom/ShadowRoot.h:
* dom/ShadowRoot.idl:
* dom/SlotAssignment.cpp:
(WebCore::SlotAssignment::didChangeSlot):
* html/HTMLSummaryElement.cpp:
(WebCore::HTMLSummaryElement::create):
* inspector/InspectorDOMAgent.cpp:
(WebCore::shadowRootType):
(WebCore::InspectorDOMAgent::buildObjectForNode):
* rendering/HitTestResult.cpp:
(WebCore::moveOutOfUserAgentShadowTree):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::selectionPseudoStyle):
* rendering/RenderLayer.cpp:
(WebCore::rendererForScrollbar):
* svg/SVGElement.cpp:
(WebCore::SVGElement::correspondingUseElement):
* testing/Internals.cpp:
(WebCore::Internals::shadowRootType):

LayoutTests:

Add layout test coverage.

* fast/shadow-dom/ShadowRoot-mode-expected.txt: Added.
* fast/shadow-dom/ShadowRoot-mode.html: Added.

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

4 years agoHeap::collectAllGarbage() should work with JSC_useImmortalObjects=true.
mark.lam@apple.com [Wed, 17 Aug 2016 00:18:43 +0000 (00:18 +0000)]
Heap::collectAllGarbage() should work with JSC_useImmortalObjects=true.
https://bugs.webkit.org/show_bug.cgi?id=160917

Reviewed by Filip Pizlo.

If we do an synchronous GC when JSC_useImmortalObjects=true, we'll get a
RELEASE_ASSERT failure:

    $ JSC_useImmortalObjects=true jsc
    >>> gc()
    Trace/BPT trap: 5

This is because Heap::collectAllGarbage() is doing an explicit sweep of the
MarkedSpace, and the sweeper is expecting to see no RetiredBlocks.  However, we
make objects immortal by retiring their blocks.  As a result, there is a mismatch
in expectancy.

The fix is simply to not run the sweeper when JSC_useImmortalObjects=true.

* heap/Heap.cpp:
(JSC::Heap::collectAllGarbage):

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

4 years agoEnable WebAssembly in the build.
keith_miller@apple.com [Tue, 16 Aug 2016 23:59:19 +0000 (23:59 +0000)]
Enable WebAssembly in the build.
https://bugs.webkit.org/show_bug.cgi?id=160916

Reviewed by Benjamin Poulain.

This patch turns on WebAssembly on all the platforms that support B3.
Turning on WebAssembly by default lets us check the build on every
platform.

* wtf/FeatureDefines.h:

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

4 years agocustomElements.define should retrieve lifecycle callbacks
rniwa@webkit.org [Tue, 16 Aug 2016 23:55:49 +0000 (23:55 +0000)]
customElements.define should retrieve lifecycle callbacks
https://bugs.webkit.org/show_bug.cgi?id=160797

Reviewed by Chris Dumez.

Source/WebCore:

Updated JSCustomElementInterface to invoke Get(constructor, "prototype") and Get(prototype, callbackName)
for each lifecycle callback as required by the latest specification:
https://html.spec.whatwg.org/#dom-customelementsregistry-define

Also added the support for "observedAttributes" property on the custom elements constructor which defines
the list of attributes for which attributeChangedCallback is invoked.

Test: fast/custom-elements/CustomElementsRegistry.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::setAttributeChangedCallback): Added.
(WebCore::JSCustomElementInterface::attributeChanged): Invoke m_attributeChangedCallback instead of on the
result of Get(element, "attributeChangedCallback").
* bindings/js/JSCustomElementInterface.h:
(WebCore::JSCustomElementInterface::observesAttribute): Added.

* bindings/js/JSCustomElementsRegistryCustom.cpp:
(WebCore::getLifecycleCallback): Added.
(WebCore::JSCustomElementsRegistry::define): Invoke Get(prototype, callbackName) for each callback. Also
store attributedChangedCallback and observedAttributes to JSCustomElementInterface. Other callbacks will
be stored in the future when the support for those callbacks are added.

* dom/Element.cpp:
(WebCore::Element::attributeChanged): Moved more code into enqueueAttributeChangedCallbackIfNeeded.

* dom/LifecycleCallbackQueue.cpp:
(WebCore::LifecycleCallbackQueue::enqueueAttributeChangedCallbackIfNeeded): Added an early exit for when
the given attribute is not observed by the custom element. Also moved the logic to retrieve
JSCustomElementInterface from Element::attributeChanged and renamed it from enqueueAttributeChangedCallback.

* bindings/js/JSDOMBinding.h:
(WebCore::toNativeArray): Throw a TypeError when the argument is not an object.
* bindings/js/JSDOMConvert.h:
(WebCore::Converter<Vector<T>>::convert): Removed a FIXME comment.

LayoutTests:

Added test cases for CustomElementsRegistry.define to make sure it invokes Get(constructor, "prototype")
and Get(prototype, callbackName) for each lifecycle callback.

Also updated the tests to reflect the support for observedAttributes which specifies the list of attributes
for which attributeChangedCallback is invoked.

* fast/custom-elements/CustomElementsRegistry-expected.txt: Renamed from Document-defineElement-expected.txt.
* fast/custom-elements/CustomElementsRegistry.html: Renamed from Document-defineElement.html.
* fast/custom-elements/Document-defineElement-expected.txt: Removed.
* fast/custom-elements/Document-defineElement.html: Removed.
* fast/custom-elements/attribute-changed-callback-expected.txt:
* fast/custom-elements/attribute-changed-callback.html: Added test cases for "observedAttributes".
* fast/custom-elements/lifecycle-callback-timing.html:

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

4 years agoAdd WASM I32 simple operators.
keith_miller@apple.com [Tue, 16 Aug 2016 23:31:38 +0000 (23:31 +0000)]
Add WASM I32 simple operators.
https://bugs.webkit.org/show_bug.cgi?id=160914

Reviewed by Benjamin Poulain.

This patch adds support for the i32 simple binary operators.

* wasm/WASMB3IRGenerator.cpp:
(JSC::WASM::toB3Op):
(JSC::WASM::B3IRGenerator::binaryOp):
* wasm/WASMFunctionParser.h:
(JSC::WASM::WASMFunctionParser<Context>::parseExpression):
* wasm/WASMOps.h:

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

4 years agoFix a thinko.
andersca@apple.com [Tue, 16 Aug 2016 23:05:59 +0000 (23:05 +0000)]
Fix a thinko.

* wtf/Scope.h:

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

4 years agoFix build.
andersca@apple.com [Tue, 16 Aug 2016 23:00:33 +0000 (23:00 +0000)]
Fix build.

* Configurations/WebCore.xcconfig:

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

4 years agoAlign isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
cdumez@apple.com [Tue, 16 Aug 2016 22:56:02 +0000 (22:56 +0000)]
Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification
https://bugs.webkit.org/show_bug.cgi?id=160911

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline W3C test now that more checks are passing.

* web-platform-tests/dom/nodes/Node-lookupNamespaceURI-expected.txt:

Source/WebCore:

Align isDefaultNamespace() / lookupPrefix() / lookupNamespaceURI() with the specification:
- https://dom.spec.whatwg.org/#dom-node-isdefaultnamespace
- https://dom.spec.whatwg.org/#dom-node-lookupprefix
- https://dom.spec.whatwg.org/#dom-node-lookupnamespaceuri

Our implementation now matches closely the text of the DOM specification
and we pass more W3C tests as it fixes the following bug:
- isDefaultNamespace(null) / isDefaultNamespace('') was not returning true for in cases
  where the node's default namespace was null. Our implementation was returning false
  instead of comparing the node's default namespace (in this case null) with the input
  namespace (in this case null).

No new tests, rebaselined existing test.

* dom/Node.cpp:
(WebCore::locateDefaultNamespace):
(WebCore::Node::isDefaultNamespace):
(WebCore::Node::lookupNamespaceURI):
(WebCore::locateNamespacePrefix):
(WebCore::Node::lookupPrefix):
(WebCore::appendTextContent): Deleted.
(WebCore::Node::textContent): Deleted.
(WebCore::Node::setTextContent): Deleted.
* dom/Node.h:
* xml/NativeXPathNSResolver.cpp:
(WebCore::NativeXPathNSResolver::lookupNamespaceURI):

LayoutTests:

Drop several outdated tests.

* dom/xhtml/level3/core/nodeisdefaultnamespace03-expected.txt: Removed.
* dom/xhtml/level3/core/nodeisdefaultnamespace03.js: Removed.
* dom/xhtml/level3/core/nodeisdefaultnamespace03.xhtml: Removed.
* dom/xhtml/level3/core/nodelookupnamespaceuri08-expected.txt: Removed.
* dom/xhtml/level3/core/nodelookupnamespaceuri08.js: Removed.
* dom/xhtml/level3/core/nodelookupnamespaceuri08.xhtml: Removed.
* dom/xhtml/level3/core/nodelookupnamespaceuri09-expected.txt: Removed.
* dom/xhtml/level3/core/nodelookupnamespaceuri09.js: Removed.
* dom/xhtml/level3/core/nodelookupnamespaceuri09.xhtml: Removed.

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

4 years ago[iOS WK2] Clean up form select code
simon.fraser@apple.com [Tue, 16 Aug 2016 22:51:27 +0000 (22:51 +0000)]
[iOS WK2] Clean up form select code
https://bugs.webkit.org/show_bug.cgi?id=160915

Reviewed by Enrica Casucci.

Some minor forms-related cleanup:
1. Give WKFormSelectPopover and WKFormSelectPicker their own header files, making
things easier to find.

2. Remove WKContentView *_view member variables from classes which also stored
the view in their base classes.

Sort the project file.

* UIProcess/ios/forms/WKFormPopover.h:
* UIProcess/ios/forms/WKFormPopover.mm:
(-[WKFormRotatingAccessoryPopover accessoryDone]):
(-[WKFormRotatingAccessoryPopover initWithView:]): Deleted.
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
* UIProcess/ios/forms/WKFormSelectPicker.h: Copied from Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h.
* UIProcess/ios/forms/WKFormSelectPicker.mm:
* UIProcess/ios/forms/WKFormSelectPopover.h: Copied from Source/WebKit2/UIProcess/ios/forms/WKFormSelectControl.h.
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover initWithView:hasGroups:]):
* WebKit2.xcodeproj/project.pbxproj:

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

4 years agoPlaceholder does not show the first time going into picture-in-picture on video witho...
adachan@apple.com [Tue, 16 Aug 2016 22:48:58 +0000 (22:48 +0000)]
Placeholder does not show the first time going into picture-in-picture on video without controls
https://bugs.webkit.org/show_bug.cgi?id=160868

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/controls/pip-placeholder-without-video-controls.html

If the media controls script is not injected by the time webkitpresentationmodechanged
event fires, the script that updates the stylesheet to show the placeholder won't execute.

To fix this, doing one of the following would work:
- Ensure the shadow dom for the video is set up when we schedule the
webkitpresentationmodechanged event.
- Make sure the styles are set up correctly to show the placeholder if needed
when the Controller object (in mediaControlsApple.js) is created.

Doing both here following what we did for the wireless playback status.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller):
Call updatePictureInPicturePlaceholder() so it updates the styles to show the
placeholder if needed.
(Controller.prototype.updatePictureInPicturePlaceholder):
Extract the logic that updates the placeholder into a separate method so it can
be called when we initialize Controller.
(Controller.prototype.handlePresentationModeChange):
Call updatePictureInPicturePlaceholder().
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.updatePictureInPicturePlaceholder):
Renamed from handlePresentationModeChange().
(ControllerIOS.prototype.handlePresentationModeChange): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
Call configureMediaControls() which ensures the shadow root gets added if needed.

LayoutTests:

Test that a video without controls attribute does show after going into picture-in-picture.

* TestExpectations:
* media/controls/pip-placeholder-without-video-controls-expected.txt: Added.
* media/controls/pip-placeholder-without-video-controls.html: Added.
* platform/mac-wk2/TestExpectations:

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

4 years agoRename FrameView::m_layoutDisallowed to m_layoutDisallowedCount
simon.fraser@apple.com [Tue, 16 Aug 2016 22:44:21 +0000 (22:44 +0000)]
Rename FrameView::m_layoutDisallowed to m_layoutDisallowedCount
https://bugs.webkit.org/show_bug.cgi?id=160918

Reviewed by Zalan Bujtas.

m_layoutDisallowedCount makes it clearer that it's accumulated.

* page/FrameView.h:

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

4 years agoRename SSLKeyGeneratorMac.cpp to SSLKeyGeneratorMac.mm.
andersca@apple.com [Tue, 16 Aug 2016 22:41:19 +0000 (22:41 +0000)]
Rename SSLKeyGeneratorMac.cpp to SSLKeyGeneratorMac.mm.

Rubber-stamped by Dan Bernstein.

* platform/mac/SSLKeyGeneratorMac.mm: Renamed from platform/mac/SSLKeyGeneratorMac.cpp.

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

4 years agoMigrate line breaking code from ints to Optional<unsigned>s
mmaxfield@apple.com [Tue, 16 Aug 2016 22:39:10 +0000 (22:39 +0000)]
Migrate line breaking code from ints to Optional<unsigned>s
https://bugs.webkit.org/show_bug.cgi?id=160859

Reviewed by Darin Adler.

Source/WebCore:

Previously, we were using -1 to mean "before the beginning of the string". Now,
Nullopt means that.

This patch also renames break_lines.{h,cpp} to BreakLines.{h.cpp}. This file was
originally named during the KHTML days.

No new tests because there is no behavior change.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/BreakLines.cpp: Renamed from Source/WebCore/rendering/break_lines.cpp.
* rendering/BreakLines.h: Renamed from Source/WebCore/rendering/break_lines.h.
(WebCore::isBreakableSpace):
(WebCore::shouldBreakAfter):
(WebCore::needsLineBreakIterator):
(WebCore::nextBreakablePositionNonLoosely):
(WebCore::nextBreakablePositionLoosely):
(WebCore::nextBreakablePositionKeepingAllWords):
(WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP):
(WebCore::nextBreakablePosition):
(WebCore::nextBreakablePositionIgnoringNBSP):
(WebCore::nextBreakablePositionLoose):
(WebCore::nextBreakablePositionIgnoringNBSPLoose):
(WebCore::isBreakable):
* rendering/InlineIterator.h:
(WebCore::InlineIterator::moveTo):
(WebCore::InlineIterator::nextBreakablePosition):
(WebCore::InlineIterator::setNextBreakablePosition):
(WebCore::InlineIterator::InlineIterator): Deleted.
* rendering/InlineTextBox.cpp:
* rendering/RenderText.cpp:
(WebCore::RenderText::computePreferredLogicalWidths):
* rendering/RenderingAllInOne.cpp:
* rendering/SimpleLineLayoutTextFragmentIterator.h:
* rendering/break_lines.h:
(WebCore::isBreakableSpace): Deleted.
(WebCore::shouldBreakAfter): Deleted.
(WebCore::needsLineBreakIterator): Deleted.
(WebCore::nextBreakablePositionNonLoosely): Deleted.
(WebCore::nextBreakablePositionLoosely): Deleted.
(WebCore::nextBreakablePositionKeepingAllWords): Deleted.
(WebCore::nextBreakablePositionKeepingAllWordsIgnoringNBSP): Deleted.
(WebCore::nextBreakablePosition): Deleted.
(WebCore::nextBreakablePositionIgnoringNBSP): Deleted.
(WebCore::nextBreakablePositionLoose): Deleted.
(WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
(WebCore::isBreakable): Deleted.
* rendering/line/BreakingContext.h:
(WebCore::BreakingContext::commitLineBreakAtCurrentWidth):
(WebCore::BreakingContext::InlineIteratorHistory::nextBreakablePosition):
(WebCore::BreakingContext::InlineIteratorHistory::moveTo):
(WebCore::tryHyphenating):
(WebCore::BreakingContext::handleText):
(WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):

Source/WebKit/ios:

* Misc/WebUIKitSupport.mm:
(WebKitGetLastLineBreakInBuffer):

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

4 years agoRe-sync imported/w3c/web-platform-tests/dom/ranges/Range-mutations.html with upstream
cdumez@apple.com [Tue, 16 Aug 2016 22:33:32 +0000 (22:33 +0000)]
Re-sync imported/w3c/web-platform-tests/dom/ranges/Range-mutations.html with upstream
https://bugs.webkit.org/show_bug.cgi?id=160903

Reviewed by Ryosuke Niwa.

Re-sync imported/w3c/web-platform-tests/dom/ranges/Range-mutations.html with upstream
after https://github.com/w3c/web-platform-tests/pull/3468.

* web-platform-tests/dom/ranges/Range-mutations-expected.txt:
* web-platform-tests/dom/ranges/Range-mutations.html:

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

4 years agoAdd WTF::ScopeExit
andersca@apple.com [Tue, 16 Aug 2016 22:32:50 +0000 (22:32 +0000)]
Add WTF::ScopeExit
https://bugs.webkit.org/show_bug.cgi?id=160908

Reviewed by Geoffrey Garen.

Source/WTF:

WTF::ScopeExit and WTF::makeScopeExit let you define an object that will invoke a function when the
object goes out of scope. This is going to be used to avoid spagetti-code and gotos in a future patch.

The class is modeled after the LWG paper "P0052 - Generic Scope Guard and RAII Wrapper for the Standard Library".

* WTF.xcodeproj/project.pbxproj:
* wtf/Scope.h: Added.
(WTF::makeScopeExit):

Tools:

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

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

4 years agoDOM4: getElementsByClassName should include non StyledElements
cdumez@apple.com [Tue, 16 Aug 2016 22:26:40 +0000 (22:26 +0000)]
DOM4: getElementsByClassName should include non StyledElements
https://bugs.webkit.org/show_bug.cgi?id=94718

Reviewed by Ryosuke Niwa.

Source/WebCore:

getElementsByClassName() now includes non StyledElements as per the latest
DOM specification:
- https://dom.spec.whatwg.org/#concept-getelementsbyclassname

The new behavior is consistent with Firefox and Chrome.

Test: fast/dom/getElementsByClassName/non-styled-element.html

* dom/ClassCollection.h:
(WebCore::ClassCollection::elementMatches):

LayoutTests:

* fast/dom/getElementsByClassName/011-expected.txt: Removed.
* fast/dom/getElementsByClassName/011.xml: Removed.
Drop outdated test. It is failing in Firefox and Chrome.

* fast/dom/getElementsByClassName/non-styled-element-expected.txt: Added.
* fast/dom/getElementsByClassName/non-styled-element.html: Added.
Add layout test coverage.

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

4 years agoEWS logs file are rotated too quickly
aakash_jain@apple.com [Tue, 16 Aug 2016 22:24:23 +0000 (22:24 +0000)]
EWS logs file are rotated too quickly
https://bugs.webkit.org/show_bug.cgi?id=160724

Reviewed by Daniel Bates.

Currently we are rotating the log file after 10 iterations of queue. If the queue
doesn't have any pending patches, these iterations result in very small amount of
logs (1 KB log file). Even if the queue process some patches, logs are few KBs.
This results in a lot of log files in a day. This patch ensures that we rotate the
log file when its file size is greater than or equal to 100 KB.

* EWSTools/start-queue-mac.sh: Added check for file size before rotating log file.

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

4 years agoWKSI static library should be named by major iOS revision, not individual updates
dbates@webkit.org [Tue, 16 Aug 2016 22:20:05 +0000 (22:20 +0000)]
WKSI static library should be named by major iOS revision, not individual updates
https://bugs.webkit.org/show_bug.cgi?id=160727
<rdar://problem/22274848>

Reviewed by Alexey Proskuryakov.

Source/WebKit/mac:

* Configurations/Base.xcconfig:
* Configurations/DebugRelease.xcconfig:
* Configurations/WebKitLegacy.xcconfig:

Source/WebKit2:

* Configurations/Base.xcconfig:
* Configurations/BaseTarget.xcconfig:
* Configurations/DebugRelease.xcconfig:

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig:
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig:
* Scripts/copy-webkitlibraries-to-product-directory:
* WebKitTestRunner/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/DebugRelease.xcconfig:

WebKitLibraries:

* libWebKitSystemInterfaceIOSDevice9.0.a: Removed.
* libWebKitSystemInterfaceIOSDevice9.2.a: Removed.
* libWebKitSystemInterfaceIOSDevice9.a: Renamed from WebKitLibraries/libWebKitSystemInterfaceIOSDevice9.3.a.
* libWebKitSystemInterfaceIOSSimulator9.0.a: Removed.
* libWebKitSystemInterfaceIOSSimulator9.2.a: Removed.
* libWebKitSystemInterfaceIOSSimulator9.a: Renamed from WebKitLibraries/libWebKitSystemInterfaceIOSSimulator9.3.a.

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

4 years agoMake it possible to test iOS select elements, and add iPhone and iPad tests for them
simon.fraser@apple.com [Tue, 16 Aug 2016 22:15:47 +0000 (22:15 +0000)]
Make it possible to test iOS select elements, and add iPhone and iPad tests for them
https://bugs.webkit.org/show_bug.cgi?id=160909

Reviewed by Enrica Casucci.

Source/WebKit2:

Hook up form-related UIScriptController functions, and plumb through the various
<select> pickers the ability to select a row.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dismissFormAccessoryView]):
(-[WKWebView selectFormAccessoryPickerRow:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView selectFormAccessoryPickerRow:]):
* UIProcess/ios/forms/WKFormSelectControl.h:
* UIProcess/ios/forms/WKFormSelectControl.mm:
(-[WKFormSelectControl selectRow:inComponent:extendingSelection:]):
* UIProcess/ios/forms/WKFormSelectPicker.mm:
(-[WKMultipleSelectPicker selectRow:inComponent:extendingSelection:]):
(-[WKSelectSinglePicker selectRow:inComponent:extendingSelection:]):
* UIProcess/ios/forms/WKFormSelectPopover.mm:
(-[WKSelectPopover selectRow:inComponent:extendingSelection:]):

Tools:

Add functions to UIScriptController to dismiss the form accessory view for iOS,
and to programmatically pick a row from a <select> picker.

* WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:
* WebKitTestRunner/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::dismissFormAccessoryView):
(WTR::UIScriptController::selectFormAccessoryPickerRow):
* WebKitTestRunner/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::dismissFormAccessoryView):
(WTR::UIScriptController::selectFormAccessoryPickerRow):

LayoutTests:

Add iPhone and iPad tests for the <select> pickers. The iPhone test has to
use a didShowKeyboardCallback to know when to select the appropriate row,
and to dismiss the picker. The iPad test can just select the row, which also
dismisses the popover.

* fast/forms/ios/choose-select-option-expected.txt: Added.
* fast/forms/ios/choose-select-option.html: Added.
* fast/forms/ios/ipad/choose-select-option-expected.txt: Added.
* fast/forms/ios/ipad/choose-select-option.html: Added.

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

4 years agoCleanup WK2 platform gamepad handling.
beidson@apple.com [Tue, 16 Aug 2016 21:44:25 +0000 (21:44 +0000)]
Cleanup WK2 platform gamepad handling.
https://bugs.webkit.org/show_bug.cgi?id=160871

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No currently testable change in behavior).

This patch does a few things:
1 - Separates the concepts of "monitoring gamepads" and "monitoring gamepad inputs"
2 - Uses this new concept to much more cleanly handle the case where we are not currently
    monitoring gamepad inputs because an interested WKWebView is not front and center.
3 - Pre-populates the "initial set of gamepads" in WebProcesses that start listening for gamepads.

* platform/gamepad/GamepadProviderClient.h:
(WebCore::GamepadProviderClient::setInitialConnectedGamepads):

* platform/gamepad/mac/HIDGamepadProvider.cpp:
(WebCore::HIDGamepadProvider::HIDGamepadProvider):
(WebCore::HIDGamepadProvider::stopMonitoringInput):
(WebCore::HIDGamepadProvider::startMonitoringInput):
(WebCore::HIDGamepadProvider::connectionDelayTimerFired):
* platform/gamepad/mac/HIDGamepadProvider.h:

Source/WebKit2:

This patch does a few things:
1 - Separates the concepts of "monitoring gamepads" and "monitoring gamepad inputs"
2 - Uses this new concept to much more cleanly handle the case where we are not currently
    monitoring gamepad inputs because an interested WKWebView is not front and center.
3 - Pre-populates the "initial set of gamepads" in WebProcesses that start listening for gamepads.

* Platform/Logging.h:

* UIProcess/Gamepad/UIGamepadProvider.cpp:
(WebKit::UIGamepadProvider::gamepadSyncTimerFired):
(WebKit::UIGamepadProvider::setInitialConnectedGamepads):
(WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads):
(WebKit::UIGamepadProvider::viewBecameActive):
(WebKit::UIGamepadProvider::viewBecameInactive):
(WebKit::UIGamepadProvider::stopMonitoringGamepads):
(WebKit::UIGamepadProvider::snapshotGamepads):
(WebKit::UIGamepadProvider::platformStopMonitoringInput):
(WebKit::UIGamepadProvider::platformStartMonitoringInput):
(WebKit::UIGamepadProvider::UIGamepadProvider): Deleted.
(WebKit::UIGamepadProvider::scheduleDisableGamepadMonitoring): Deleted.
(WebKit::UIGamepadProvider::disableMonitoringTimerFired): Deleted.
* UIProcess/Gamepad/UIGamepadProvider.h:

* UIProcess/Gamepad/mac/UIGamepadProviderHID.cpp:
(WebKit::UIGamepadProvider::platformStopMonitoringInput):
(WebKit::UIGamepadProvider::platformStartMonitoringInput):

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::setInitialConnectedGamepads):
* UIProcess/WebProcessPool.h:

* WebProcess/Gamepad/WebGamepadProvider.cpp:
(WebKit::WebGamepadProvider::setInitialGamepads):
* WebProcess/Gamepad/WebGamepadProvider.h:

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::setInitialGamepads):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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