WebKit-https.git
4 years ago[Cocoa] API tests using the Modern WebKit API should be able to create web process...
aestes@apple.com [Sun, 23 Aug 2015 22:31:32 +0000 (22:31 +0000)]
[Cocoa] API tests using the Modern WebKit API should be able to create web process plug-ins
https://bugs.webkit.org/show_bug.cgi?id=148317

Reviewed by Dan Bernstein.

Added the ability for Modern WebKit API tests to create WKWebProcessPlugIns. A test can create a plug-in by
creating a class that conforms to WKWebProcessPlugIn, adding it to the WebProcessPlugIn target, and using the
WKWebViewConfiguration returned by +[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]
when creating WKWebViews.

Since TestWebKitAPI relies on a bundle parameter to know which test class to instantiate in the plug-in, I also
added a new API test for bundle parameters.

* TestWebKitAPI/Configurations/WebProcessPlugIn.xcconfig: Added. Named the bundle TestWebKitAPI.wkbundle and
named its executable TestWebKitAPI.bundle.
* TestWebKitAPI/PlatformUtilities.h: Declared TestPlugInClassNameParameter.
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Added the WebProcessPlugIn target.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParameters.mm: Added.
(TEST): Tested bundle parameters by verifying that parameter changes in the UI process are observed in the bundle.
* TestWebKitAPI/Tests/WebKit2Cocoa/BundleParametersPlugIn.mm: Added.
(-[BundleParametersPlugIn webProcessPlugIn:didCreateBrowserContextController:]): Started observing changes to a
bundle parameter and asked for an initial notification.
(-[BundleParametersPlugIn dealloc]): Stopped observing changes to a bundle parameter.
(-[BundleParametersPlugIn observeValueForKeyPath:ofObject:change:context:]): When a bundle parameter changes,
mirror its value in the main frame's JSContext.
* TestWebKitAPI/WKWebViewConfigurationExtras.h: Added.
* TestWebKitAPI/WKWebViewConfigurationExtras.mm: Added.
(+[WKWebViewConfiguration testwebkitapi_configurationWithTestPlugInClassName:]): Created a configuration with
TestWebKitAPI's bundle URL and set a bundle parameter indicating the test plug-in's class name.
* TestWebKitAPI/cocoa/PlatformUtilitiesCocoa.mm: Defined TestPlugInClassNameParameter.
* TestWebKitAPI/cocoa/WebProcessPlugIn/Info.plist: Added. Set the principal class to WebProcessPlugIn.
* TestWebKitAPI/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm: Added.
(-[WebProcessPlugIn webProcessPlugIn:initializeWithObject:]): Forwarded to a newly-created test class instance.
(-[WebProcessPlugIn respondsToSelector:]): Returned YES if the test class instance response.
(-[WebProcessPlugIn forwardingTargetForSelector:]): Forwarded unimplemented methods to the test class instance.

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

4 years agoTypo fix after r188842.
ossy@webkit.org [Sun, 23 Aug 2015 21:42:50 +0000 (21:42 +0000)]
Typo fix after r188842.

* CMakeLists.txt:

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

4 years agoSpeculative buildfix after r188828.
ossy@webkit.org [Sun, 23 Aug 2015 21:37:43 +0000 (21:37 +0000)]
Speculative buildfix after r188828.

* CMakeLists.txt:

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

4 years agoUnreviewed, rolling back in r188803.
ggaren@apple.com [Sun, 23 Aug 2015 21:28:38 +0000 (21:28 +0000)]
Unreviewed, rolling back in r188803.

"Debugger's VM should never be null"
https://bugs.webkit.org/show_bug.cgi?id=148341
http://trac.webkit.org/changeset/188803

Source/JavaScriptCore:

* debugger/Debugger.cpp:
(JSC::Debugger::Debugger):
(JSC::Debugger::attach):
(JSC::Debugger::detach):
(JSC::Debugger::isAttached):
(JSC::Debugger::setSteppingMode):
(JSC::Debugger::registerCodeBlock):
(JSC::Debugger::toggleBreakpoint):
(JSC::Debugger::recompileAllJSFunctions):
(JSC::Debugger::setBreakpoint):
(JSC::Debugger::clearBreakpoints):
(JSC::Debugger::clearDebuggerRequests):
(JSC::Debugger::setBreakpointsActivated):
(JSC::Debugger::breakProgram):
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::didExecuteProgram):
* debugger/Debugger.h:
* inspector/JSGlobalObjectScriptDebugServer.cpp:
(Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
(Inspector::JSGlobalObjectScriptDebugServer::removeListener):
(Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
(Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions): Deleted.
* inspector/JSGlobalObjectScriptDebugServer.h:
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::ScriptDebugServer):
* inspector/ScriptDebugServer.h:

Source/WebCore:

* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::PageScriptDebugServer):
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
(WebCore::PageScriptDebugServer::didPause):
(WebCore::PageScriptDebugServer::runEventLoopWhilePaused):

Source/WebKit/mac:

* WebView/WebScriptDebugger.mm:
(toWebFrame):
(WebScriptDebugger::WebScriptDebugger):

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

4 years agoURTBF after r188828.
ossy@webkit.org [Sun, 23 Aug 2015 21:27:33 +0000 (21:27 +0000)]
URTBF after r188828.

* WebKitTestRunner/PlatformWebView.h:

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

4 years agoRemove SVGFrameLoaderClient and dataProtocolFrameLoader
antti@apple.com [Sun, 23 Aug 2015 16:37:01 +0000 (16:37 +0000)]
Remove SVGFrameLoaderClient and dataProtocolFrameLoader
https://bugs.webkit.org/show_bug.cgi?id=148370

Reviewed by Darin Adler.

With data protocol handled internally in WebKit these are no longer needed.

This mostly reverts code changes from http://trac.webkit.org/179626 keeping the tests.

* loader/FrameLoaderClient.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::loadDataURL):
(WebCore::ResourceLoader::setDataBufferingPolicy):
(WebCore::ResourceLoader::dataProtocolFrameLoader): Deleted.
* loader/ResourceLoader.h:
(WebCore::ResourceLoader::documentLoader):
(WebCore::ResourceLoader::originalRequest):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::finishLoading):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):
* svg/graphics/SVGImage.h:
* svg/graphics/SVGImageClients.h:

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

4 years agobuild.webkit.org/dashboard: Combined queues don't turn orange on internal failure
ap@apple.com [Sun, 23 Aug 2015 16:33:01 +0000 (16:33 +0000)]
build.webkit.org/dashboard: Combined queues don't turn orange on internal failure
https://bugs.webkit.org/show_bug.cgi?id=148356

Reviewed by Darin Adler.

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

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

4 years agoWeb Inspector: Drop webkit prefixes from animation, keyframes and transform
timothy@apple.com [Sun, 23 Aug 2015 16:31:16 +0000 (16:31 +0000)]
Web Inspector: Drop webkit prefixes from animation, keyframes and transform
https://bugs.webkit.org/show_bug.cgi?id=148364

Reviewed by Darin Adler.

* UserInterface/Views/BreakpointTreeElement.css:
(.breakpoint-generic-line-icon .icon > span):
(.data-updated.breakpoint-generic-line-icon .icon > span):
* UserInterface/Views/ColorPicker.css:
(.color-picker > .slider):
* UserInterface/Views/DashboardContainerView.css:
(.toolbar .dashboard):
(.toolbar .dashboard.slide-out-up):
(.toolbar .dashboard.slide-out-down):
(.toolbar .dashboard.slide-in-up):
(.toolbar .dashboard.slide-in-down):
(@keyframes slide-top-edge):
(@keyframes slide-bottom-edge):
(@-webkit-keyframes slide-top-edge): Deleted.
(@-webkit-keyframes slide-bottom-edge): Deleted.
* UserInterface/Views/DebuggerDashboardView.css:
(.dashboard.debugger .navigation-bar .item.button > .glyph):
(@keyframes pulse-pause-button):
(@-webkit-keyframes pulse-pause-button): Deleted.
* UserInterface/Views/DefaultDashboardView.css:
(.toolbar .dashboard.default > .item.pulsing):
(@keyframes console-item-pulse):
(@-webkit-keyframes console-item-pulse): Deleted.
* UserInterface/Views/GoToLineDialog.css:
(.go-to-line-dialog):
* UserInterface/Views/HoverMenu.css:
(.hover-menu):
* UserInterface/Views/IndeterminateProgressSpinner.css:
(@keyframes discrete-spinner):
(.indeterminate-progress-spinner):
(@-webkit-keyframes discrete-spinner): Deleted.
* UserInterface/Views/Main.css:
(.bouncy-highlight):
(@keyframes bouncy-highlight-animation):
(@-webkit-keyframes bouncy-highlight-animation): Deleted.
* UserInterface/Views/ProbeSetDataGrid.css:
(.details-section.probe-set .data-grid tr.revealed.highlighted):
(@keyframes blink-frame-highlight):
(.details-section.probe-set .data-grid > tr.data-updated):
(@keyframes blink-probe-frame):
(@-webkit-keyframes blink-frame-highlight): Deleted.
(@-webkit-keyframes blink-probe-frame): Deleted.
* UserInterface/Views/TextEditor.css:
(.text-editor > .CodeMirror .highlighted):
(@keyframes text-editor-highlight-fadeout):
(.text-editor > .CodeMirror .hovered-expression-highlight):
(@keyframes text-editor-hovered-expression-highlight-fadeout):
(@-webkit-keyframes text-editor-highlight-fadeout): Deleted.
(@-webkit-keyframes text-editor-hovered-expression-highlight-fadeout): Deleted.
* UserInterface/Views/TimelineOverview.css:
(.timeline-overview.frames > .timeline-ruler > .markers > .divider):
(.timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .selection-handle.right):
(.timeline-overview.frames > .timeline-ruler:not(.both-handles-clamped) > .shaded-area.right):
* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .header > .divider):
(.timeline-ruler > .markers > .divider):
(.timeline-ruler > .markers > .marker):
(.timeline-ruler > .selection-handle.left):
(.timeline-ruler > .selection-handle.right):

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

4 years agobuild.webkit.org/dashboard: Respect step's hidden flag
ap@apple.com [Sun, 23 Aug 2015 16:29:45 +0000 (16:29 +0000)]
build.webkit.org/dashboard: Respect step's hidden flag
https://bugs.webkit.org/show_bug.cgi?id=148357

Reviewed by Darin Adler.

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

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

4 years agoAX: Fix accessibility/deleting-iframe-destroys-axcache.html test
commit-queue@webkit.org [Sun, 23 Aug 2015 16:26:29 +0000 (16:26 +0000)]
AX: Fix accessibility/deleting-iframe-destroys-axcache.html test
https://bugs.webkit.org/show_bug.cgi?id=148328

Patch by Nan Wang <n_wang@apple.com> on 2015-08-23
Reviewed by Darin Adler.

Tools:

We should only expose stringValue() when value attribute is set.

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::stringValue):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::stringValue):

LayoutTests:

* platform/mac/TestExpectations:

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

4 years agoRemove style checking rule regarding OwnPtr and PassOwnPtr
gyuyoung.kim@webkit.org [Sun, 23 Aug 2015 10:35:19 +0000 (10:35 +0000)]
Remove style checking rule regarding OwnPtr and PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=148360

Reviewed by Darin Adler.

OwnPtr and PassOwnPtr were totally removed though, style rule is still alive.
Removed it.

* Scripts/do-webcore-rename:
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(PassPtrTest.test_pass_own_ptr_in_function): Deleted.
(PassPtrTest.test_pass_ref_ptr_return_value): Deleted.
(PassPtrTest.test_own_ptr_parameter_value): Deleted.
(WebKitStyleTest.test_names): Deleted.

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

4 years agoFactor out and add logging to swipe-start hysteresis code
timothy_horton@apple.com [Sun, 23 Aug 2015 04:14:44 +0000 (04:14 +0000)]
Factor out and add logging to swipe-start hysteresis code
https://bugs.webkit.org/show_bug.cgi?id=148361

Reviewed by Darin Adler.

* UIProcess/ViewGestureController.cpp:
(WebKit::ViewGestureController::ViewGestureController):
* UIProcess/mac/ViewGestureController.h:
(WebKit::ViewGestureController::wheelEventWasNotHandledByWebCore):
(WebKit::ViewGestureController::shouldIgnorePinnedState):
(WebKit::ViewGestureController::setShouldIgnorePinnedState):
(WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
(WebKit::ViewGestureController::PendingSwipeTracker::shouldIgnorePinnedState):
(WebKit::ViewGestureController::PendingSwipeTracker::setShouldIgnorePinnedState):
Move pending-swipe members into PendingSwipeTracker.

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::scrollEventCanInfluenceSwipe):
(WebKit::deltaShouldCancelSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
(WebKit::ViewGestureController::handleScrollWheelEvent):
(WebKit::ViewGestureController::PendingSwipeTracker::handleEvent):
(WebKit::ViewGestureController::PendingSwipeTracker::eventWasNotHandledByWebCore):
(WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
(WebKit::ViewGestureController::PendingSwipeTracker::reset):
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::setDidMoveSwipeSnapshotCallback):
Move pending-swipe methods into PendingSwipeTracker.
Clean up the logic a bit.
Add some logging.

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

4 years agoChange image for type profiler and code coverage profiler blog post.
saambarati1@gmail.com [Sun, 23 Aug 2015 02:28:09 +0000 (02:28 +0000)]
Change image for type profiler and code coverage profiler blog post.

* blog-files/type-profiler-and-code-coverage-profiler/code-coverage-1x.png:
* blog-files/type-profiler-and-code-coverage-profiler/code-coverage-2x.png:

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

4 years agoChange video for type profiler and code coverage profiler blog post.
saambarati1@gmail.com [Sat, 22 Aug 2015 23:05:36 +0000 (23:05 +0000)]
Change video for type profiler and code coverage profiler blog post.

* blog-files/type-profiler-and-code-coverage-profiler/types-changing.mov:

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

4 years agoAdd 1x/2x resources for type profiler and code coverage profiler blog post.
saambarati1@gmail.com [Sat, 22 Aug 2015 22:46:53 +0000 (22:46 +0000)]
Add 1x/2x resources for type profiler and code coverage profiler blog post.

* blog-files/type-profiler-and-code-coverage-profiler/code-coverage-1x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/code-coverage-2x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/code-coverage.png: Removed.
* blog-files/type-profiler-and-code-coverage-profiler/subtle-bug-1x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/subtle-bug-2x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/subtle-bug.png: Removed.
* blog-files/type-profiler-and-code-coverage-profiler/type-profiler-api-view-1x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/type-profiler-api-view-2x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/type-profiler-api-view.png: Removed.
* blog-files/type-profiler-and-code-coverage-profiler/types-everywhere-1x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/types-everywhere-2x.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/types-everywhere.png: Removed.

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

4 years agoNodeList should not have a named getter
cdumez@apple.com [Sat, 22 Aug 2015 22:29:26 +0000 (22:29 +0000)]
NodeList should not have a named getter
https://bugs.webkit.org/show_bug.cgi?id=148117

Reviewed by Darin Adler.

Source/WebCore:

Drop the named property getter on NodeList to match the specification:
https://dom.spec.whatwg.org/#interface-nodelist

This change could be a bit risky but:
1. Firefox and IE never had this named property getter on NodeList.
2. Chrome successfuly dropped this named property getter in early 2014:
   https://src.chromium.org/viewvc/blink?revision=166356&view=revision
3. Our named property getter on NodeList is only partly functional:
   It only matches by 'id' attribute, not by 'name' attribute.
4. Our APIs that were wrongly returning a NodeList instead of an
   HTMLCollection (getElementsByTagName() / getElementsByClassName())
   have been fixed in r188735 and r188809. HTMLCollection does have
   a named property getter.
5. This named getter adds code complexity.

* bindings/js/JSNodeListCustom.cpp:
(WebCore::createWrapper): Deleted.
* dom/ChildNodeList.cpp:
(WebCore::ChildNodeList::invalidateCache): Deleted.
* dom/ChildNodeList.h:
* dom/LiveNodeList.cpp:
* dom/LiveNodeList.h:
* dom/NodeList.h:
* dom/NodeList.idl:
* dom/StaticNodeList.cpp:
(WebCore::StaticElementList::length): Deleted.
(WebCore::StaticElementList::item): Deleted.
* dom/StaticNodeList.h:
* html/HTMLCollection.h:

LayoutTests:

* fast/dom/childnode-item-after-itemname-expected.txt: Removed.
* fast/dom/childnode-item-after-itemname.html: Removed.
Drop test as it is no longer relevant now that NodeList no longer
has a named property getter.

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

4 years agoWebKitTestRunner should use WKWebView on OS X and iOS
timothy_horton@apple.com [Sat, 22 Aug 2015 22:20:46 +0000 (22:20 +0000)]
WebKitTestRunner should use WKWebView on OS X and iOS
https://bugs.webkit.org/show_bug.cgi?id=143743
<rdar://problem/16947123>

Reviewed by Anders Carlsson.
Patch by Enrica Casucci and myself.

* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::windowSnapshotEnabled): Deleted.
Add a PlatformWebView constructor that takes a WKWebViewConfiguration
instead of WKContext and WKPageGroup.

Remove the unused, always-true windowSnapshotEnabled().
While technically some platforms don't have window snapshotting,
they just return null instead of implementing windowSnapshotEnabled().

* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):
(WTR::TestController::createWebViewWithOptions):
Delegate to the various platforms for creating PlatformWebView instances,
for creating WKContexts, and for accessing WKPreferences,
so that they can do special things (like, use WKWebView instead!).

(WTR::TestController::resetPreferencesToConsistentValues):
Make explicit WebKitTestRunner's desired default for two preferences
which have differing defaults between the antique and modern API,
for consistency's sake.

(WTR::TestController::resetStateToConsistentValues):
Add platformResetStateToConsistentValues.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::dumpResults):
Adjust to the aforementioned removal of windowSnapshotEnabled().

* WebKitTestRunner/ios/TestControllerCocoa.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::TestController::platformPreferences):
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
(WTR::TestController::platformInitializeConfiguration):
Implement the new platform functions for the Modern WebKit2 API,
in a new TestControllerCocoa file that is shared between iOS and Mac.

For platformMaybeCreateContext, use the trick that we know we can cast
the WKProcessPool to a WKContextRef to retrieve a WKContextRef from
WKWebView's configuration.

Ditto for WKPreferencesRef and WKPreferences.

Remove user content filters on the WKWebView's userContentController.

* WebKitTestRunner/mac/TestControllerMac.mm:
* WebKitTestRunner/ios/TestControllerIOS.mm:
Move code into TestControllerCocoa.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::addUserScript):
(WTR::TestRunner::addUserStyleSheet):
Adopt WKBundlePage API for user scripts/sheets.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
Make and keep a WKWebView instead of a WKView.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
Reach inside the WKWebView to the WKView when dispatching events.
This is fairly ugly and we should come up with a better solution.
Also, fix some flipping and style errors.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _windowOcclusionDetectionEnabled]):
(-[WKWebView _setWindowOcclusionDetectionEnabled:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add SPI to disable window occlusion detection, for WebKitTestRunner's use.

* Shared/WebPreferencesDefinitions.h:
Remove a completely unused WebPreference. It is a WebCore Setting,
but in the API it's exposed as a WKPage setter and WKView and WKWebView property
instead of as a WKPreference, so there's no need for the WebPreference.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageAddUserScript):
(WKBundlePageAddUserStyleSheet):
(WKBundlePageRemoveAllUserContent):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addUserScript):
(WebKit::WebPage::addUserStyleSheet):
(WebKit::WebPage::removeAllUserContent):
* WebProcess/WebPage/WebPage.h:
Add WKBundlePage functions for user script and style sheet manipulation.
These use the WebPage's WebUserContentController instead of the WebPageGroupProxy's
(used by the WKBundle functions), so they work correctly with the modern API.

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

4 years agoTweak a test that became flaky on some machines after r188793.
ap@apple.com [Sat, 22 Aug 2015 19:29:44 +0000 (19:29 +0000)]
Tweak a test that became flaky on some machines after r188793.

* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html:

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

4 years agoUnreviewed, attempt to fix GTK build after r188718
mcatanzaro@igalia.com [Sat, 22 Aug 2015 18:38:29 +0000 (18:38 +0000)]
Unreviewed, attempt to fix GTK build after r188718

Source/WebKit2:

* CMakeLists.txt: Build WKPageConfigurationRef.cpp
* PlatformEfl.cmake: Don't build WKPageConfigurationRef.cpp

Tools:

* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):

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

4 years agoDFG string concatenation shouldn't be playing fast and loose with effects and OSR...
fpizlo@apple.com [Sat, 22 Aug 2015 18:35:47 +0000 (18:35 +0000)]
DFG string concatenation shouldn't be playing fast and loose with effects and OSR exit
https://bugs.webkit.org/show_bug.cgi?id=148338

Reviewed by Michael Saboff and Saam Barati.

Prior to this change, DFG string concatenation appeared to have various different ways of
creating an OSR exit right after a side effect. That's bad, because the exit will cause
us to reexecute the side effect. The code appears to have some hacks for avoiding this,
but some cases are basically unavoidable, like the OOM case of string concatenation: in
trunk that could cause two executions of the toString operation.

This changes the string concatenation code to either be speculative or effectful but
never both. It's already the case that when this code needs to be effectful, it also
needs to be slow (it does int->string conversions, calls JS functions, etc). So, this is
a small price to pay for sanity.

The biggest part of this change is the introduction of StrCat, which is like MakeRope but
does toString conversions on its own instead of relying on separate nodes. StrCat can
take either 2 or 3 children. It's the effectful but not speculative version of MakeRope.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGBackwardsPropagationPhase.cpp:
(JSC::DFG::BackwardsPropagationPhase::propagate):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::convertStringAddUse):
(JSC::DFG::FixupPhase::fixupToStringOrCallStringConstructor):
(JSC::DFG::FixupPhase::attemptToMakeFastStringAdd):
(JSC::DFG::FixupPhase::canOptimizeStringObjectAccess):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::JSValueOperand::JSValueOperand):
(JSC::DFG::JSValueOperand::~JSValueOperand):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
(JSC::DFG::Validate::validate):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):
(JSC::FTL::DFG::LowerDFGToLLVM::compileStrCat):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub):
* jit/JITOperations.h:
* tests/stress/exception-effect-strcat.js: Added. This test previously failed.
* tests/stress/exception-in-strcat-string-overflow.js: Added. An earlier version of this patch made this fail.
* tests/stress/exception-in-strcat.js: Added.

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

4 years ago[JSC] Static hash tables should be 100% compile-time constant.
akling@apple.com [Sat, 22 Aug 2015 18:05:50 +0000 (18:05 +0000)]
[JSC] Static hash tables should be 100% compile-time constant.
<https://webkit.org/b/148359>

Reviewed by Michael Saboff.

Source/JavaScriptCore:

We were dirtying the memory pages containing static hash tables the
first time they were used, when a dynamically allocated index-to-key
table was built and cached in the HashTable struct.

It turns out that this "optimization" was completely useless, since
we've long since decoupled static hash tables from the JSC::VM and
we can get the key for an index via HashTable::values[index].m_key!

We also get rid of VM::keywords which was a little wrapper around
a VM-specific copy of JSC::mainTable. There was nothing VM-specific
about it at all, so clients now use JSC::mainTable directly.

After this change all fooHashTable structs end up in __DATA __const
and no runtime initialization/allocation takes place.

* create_hash_table:
* jsc.cpp:
* parser/Lexer.cpp:
(JSC::isLexerKeyword):
(JSC::Lexer<LChar>::parseIdentifier):
(JSC::Lexer<UChar>::parseIdentifier):
(JSC::Lexer<CharacterType>::parseIdentifierSlowCase):
(JSC::Keywords::Keywords): Deleted.
* parser/Lexer.h:
(JSC::Keywords::isKeyword): Deleted.
(JSC::Keywords::getKeyword): Deleted.
(JSC::Keywords::~Keywords): Deleted.
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::tryJSONPParse):
* runtime/Lookup.cpp:
(JSC::HashTable::createTable): Deleted.
(JSC::HashTable::deleteTable): Deleted.
* runtime/Lookup.h:
(JSC::HashTable::entry):
(JSC::HashTable::ConstIterator::key):
(JSC::HashTable::ConstIterator::skipInvalidKeys):
(JSC::HashTable::copy): Deleted.
(JSC::HashTable::initializeIfNeeded): Deleted.
(JSC::HashTable::begin): Deleted.
(JSC::HashTable::end): Deleted.
* runtime/VM.cpp:
(JSC::VM::VM): Deleted.
* runtime/VM.h:
* testRegExp.cpp:

Source/WebCore:

Adjust WebCore bindings generator for new JSC::HashTable layout
and rebaseline the bindings tests for that change.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHashTable):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
* bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
* bindings/scripts/test/JS/JSTestException.cpp:
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
* bindings/scripts/test/JS/JSTestTypedefs.cpp:

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

4 years agoUnreviewed, fix build without ENABLE_CSS_GRID_LAYOUT after r188582
mcatanzaro@igalia.com [Sat, 22 Aug 2015 17:42:46 +0000 (17:42 +0000)]
Unreviewed, fix build without ENABLE_CSS_GRID_LAYOUT after r188582

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalWidthInRegion):

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

4 years agostd::once_flag needs to be static.
andersca@apple.com [Sat, 22 Aug 2015 17:14:22 +0000 (17:14 +0000)]
std::once_flag needs to be static.

* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
(WTF::MainThreadFunctionTracker::singleton):

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

4 years agoPage::renderTreeSize() does not include anonymous renderers.
zalan@apple.com [Sat, 22 Aug 2015 13:38:01 +0000 (13:38 +0000)]
Page::renderTreeSize() does not include anonymous renderers.
https://bugs.webkit.org/show_bug.cgi?id=148352

Reviewed by Andreas Kling.

Anonymous renderes take the document as their node. Instead
of checking whether the node is the document, we could just check
if the RenderView is available.

* rendering/RenderObject.cpp:
(WebCore::RenderObject::RenderObject):
(WebCore::RenderObject::~RenderObject):
* rendering/RenderView.cpp:
(WebCore::RenderView::RenderView): Deleted.
* rendering/RenderView.h: Include the RenderView in render tree size as well.

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

4 years agoDecode data URLs in web process
antti@apple.com [Sat, 22 Aug 2015 09:57:23 +0000 (09:57 +0000)]
Decode data URLs in web process
https://bugs.webkit.org/show_bug.cgi?id=148128

Reviewed by Darin Adler.

Source/WebCore:

We currenly send data URLs to networking layer for decoding. This involves a long and slow roundtrip through IPC and API layers.

* WebCore.xcodeproj/project.pbxproj:
* loader/ResourceLoadScheduler.cpp:
(WebCore::ResourceLoadScheduler::maybeLoadQuickLookResource): Deleted.

    Remove this awkward interface for WebKit2.

* loader/ResourceLoadScheduler.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start):
(WebCore::ResourceLoader::loadDataURL):

    Load using DataURLDecoder.

* loader/ResourceLoader.h:

    Make start() public and export it so it can be called directly from WebKit2.

* platform/network/DataURLDecoder.cpp: Added.
(WebCore::DataURLDecoder::decodeQueue):
(WebCore::DataURLDecoder::DecodeTask::DecodeTask):
(WebCore::DataURLDecoder::createDecodeTask):

    Parse data URL metadata and initialize the decode task.

(WebCore::DataURLDecoder::decodeBase64):
(WebCore::DataURLDecoder::decodeEscaped):
(WebCore::DataURLDecoder::decode):

    Asynchronously decode in a concurrent distpatch queue.

* platform/network/DataURLDecoder.h: Added.
* platform/network/ios/QuickLook.h:
* platform/text/DecodeEscapeSequences.h:
(WebCore::URLEscapeSequence::findEndOfRun):
(WebCore::URLEscapeSequence::decodeRun):

    Factor buffer generation to a function.

(WebCore::decodeEscapeSequences):
(WebCore::decodeURLEscapeSequencesAsData):

    Add decode function that produces bytes instead of a String.

Source/WebKit2:

* WebProcess/Network/WebResourceLoadScheduler.cpp:
(WebKit::WebResourceLoadScheduler::scheduleLoad):

    Don't send data: loads to the network process, handle them locally.

(WebKit::WebResourceLoadScheduler::startLocalLoad):

    Call ResourceLoder::start() directly.

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

4 years agoAX: aria-table-content.html test failing on windows
commit-queue@webkit.org [Sat, 22 Aug 2015 07:20:33 +0000 (07:20 +0000)]
AX: aria-table-content.html test failing on windows
https://bugs.webkit.org/show_bug.cgi?id=148354

Update TestExpectation for Windows to Skip test.

Patch by Doug Russell <d_russell@apple.com> on 2015-08-22
Reviewed by Tim Horton.

* platform/win/TestExpectations:

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

4 years agoWeb Inspector: Type profiler shows 'Undefined' annotation for functions with no retur...
commit-queue@webkit.org [Sat, 22 Aug 2015 03:27:24 +0000 (03:27 +0000)]
Web Inspector: Type profiler shows 'Undefined' annotation for functions with no return statements
https://bugs.webkit.org/show_bug.cgi?id=146882

Patch by Saam barati <sbarati@apple.com> on 2015-08-21
Reviewed by Joseph Pecoraro.

* UserInterface/Controllers/TypeTokenAnnotator.js:
(WebInspector.TypeTokenAnnotator.prototype._insertTypeToken):
* UserInterface/Models/ScriptSyntaxTree.js:
(WebInspector.ScriptSyntaxTree.prototype._createInternalSyntaxTree):
(WebInspector.ScriptSyntaxTree):

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

4 years agoUnreviewed, rolling out r188807, r188813, and r188815.
commit-queue@webkit.org [Sat, 22 Aug 2015 02:32:41 +0000 (02:32 +0000)]
Unreviewed, rolling out r188807, r188813, and r188815.
https://bugs.webkit.org/show_bug.cgi?id=148349

lots of 32-bit build problems, better to resolve separately
and try again (Requested by thorton on #webkit).

Reverted changesets:

"WebKitTestRunner should use WKWebView on OS X and iOS"
https://bugs.webkit.org/show_bug.cgi?id=143743
http://trac.webkit.org/changeset/188807

"Stop building WebKitTestRunner for 32-bit platforms"
https://bugs.webkit.org/show_bug.cgi?id=143743
http://trac.webkit.org/changeset/188813

"Stop building WebKitTestRunner for 32-bit platforms"
https://bugs.webkit.org/show_bug.cgi?id=143743
http://trac.webkit.org/changeset/188815

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

4 years agoWeb Inspector: WebInspector.domTreeManager.regionLayoutUpdated does not exist
commit-queue@webkit.org [Sat, 22 Aug 2015 02:27:23 +0000 (02:27 +0000)]
Web Inspector: WebInspector.domTreeManager.regionLayoutUpdated does not exist
https://bugs.webkit.org/show_bug.cgi?id=148348

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-21
Reviewed by Timothy Hatcher.

* UserInterface/Protocol/CSSObserver.js:
(WebInspector.CSSObserver.prototype.regionLayoutUpdated):
Just do the same as the new event name.

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

4 years agoStop building WebKitTestRunner for 32-bit platforms
timothy_horton@apple.com [Sat, 22 Aug 2015 01:43:10 +0000 (01:43 +0000)]
Stop building WebKitTestRunner for 32-bit platforms
https://bugs.webkit.org/show_bug.cgi?id=143743
<rdar://problem/16947123>

* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
This is a restriction on the valid set, not the desired set.

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

4 years agoMake Dashboard.Branches be objects of the form (repository, "branch name") and update...
commit-queue@webkit.org [Sat, 22 Aug 2015 01:39:48 +0000 (01:39 +0000)]
Make Dashboard.Branches be objects of the form (repository, "branch name") and update existing code
to work with these new objects.
https://bugs.webkit.org/show_bug.cgi?id=148188

Patch by Jason Marcell <jmarcell@apple.com> on 2015-08-21
Reviewed by Daniel Bates.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Buildbot.js:
(Buildbot.prototype._normalizeQueueInfo): Renamed BuildbotQueue.branch to BuildbotQueue.branches.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotCombinedQueueView.js:
(BuildbotCombinedQueueView): Changed to work with new branch objects which represent a
(repository, "branch name")-pair.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js: Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueue.js:
(BuildbotQueue): Renamed BuildbotQueue.branch to BuildbotQueue.branches.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._appendPendingRevisionCount): Changed to work with new branch
objects which represent a (repository, "branch name")-pair.
(BuildbotQueueView.prototype._presentPopoverForPendingCommits): Ditto.
(BuildbotQueueView.prototype._revisionContentWithPopoverForIteration): Ditto.
(BuildbotQueueView.prototype._addDividerToPopover): Ditto.
(BuildbotQueueView.prototype.revisionContentForIteration): Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Main.js: Renamed
BuildbotQueue.branch to BuildbotQueue.branches.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot.prototype.get defaultBranches): Changed to new (repository, "branch name") format.

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

4 years agoStop building WebKitTestRunner for 32-bit platforms
timothy_horton@apple.com [Sat, 22 Aug 2015 01:34:47 +0000 (01:34 +0000)]
Stop building WebKitTestRunner for 32-bit platforms
https://bugs.webkit.org/show_bug.cgi?id=143743
<rdar://problem/16947123>

* WebKitTestRunner/Configurations/DebugRelease.xcconfig:
WKWebView is not available on 32-bit OS X.

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

4 years ago[Win] Unreviewed test correction after r188709.
bfulgham@apple.com [Sat, 22 Aug 2015 01:26:50 +0000 (01:26 +0000)]
[Win] Unreviewed test correction after r188709.

I removed a function argument that happened to be mirrored by a global
value with the same name. This prevented a compile error, but testing
showed that the wrong value was being used in the function.

* DumpRenderTree/win/FrameLoadDelegate.cpp:
(FrameLoadDelegate::willPerformClientRedirectToURL): Put function argument
back

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

4 years agoUnreviewed, rolling out r188792 and r188803.
commit-queue@webkit.org [Sat, 22 Aug 2015 00:53:55 +0000 (00:53 +0000)]
Unreviewed, rolling out r188792 and r188803.
https://bugs.webkit.org/show_bug.cgi?id=148347

broke lots of tests, ggaren is going to investigate and reland
(Requested by thorton on #webkit).

Reverted changesets:

"Unify code paths for manually deleting all code"
https://bugs.webkit.org/show_bug.cgi?id=148280
http://trac.webkit.org/changeset/188792

"Debugger's VM should never be null"
https://bugs.webkit.org/show_bug.cgi?id=148341
http://trac.webkit.org/changeset/188803

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

4 years agodocument.getElementsByTagName should return an HTMLCollection
cdumez@apple.com [Sat, 22 Aug 2015 00:50:13 +0000 (00:50 +0000)]
document.getElementsByTagName should return an HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=110611

Reviewed by Darin Adler.

Source/WebCore:

Update getElementsByTagName*() to return an HTMLCollection as per
the specification:
- https://dom.spec.whatwg.org/#interface-document
- https://dom.spec.whatwg.org/#interface-element

Firefox, Chrome and IE all match the specification but WebKit was
returning a NodeList.

Performance:
DOM/get-elements-by-tag-name-traversal-uncached.html is ~4.5% faster.

Test: fast/dom/getElementsByTagName-return-type.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
Rename TagNodeList.* to TagCollection.*

* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers):
Update the function to use descendantsOfType<>() instead of
getElementsByTagName(). The code is both shorter and more efficient.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByTagName):
(WebCore::ContainerNode::getElementsByTagNameForObjC):
(WebCore::ContainerNode::getElementsByTagNameNS):
(WebCore::ContainerNode::getElementsByTagNameNSForObjC):
* dom/ContainerNode.h:
- Have getElementsByTagName*() return an HTMLCollection.
- Introduce versions used by the ObjC bindings that return a NodeList
  for API compatibility reasons.
- Move the localName null check to the *ForObjC versions and use a
  simple assertion for the non ObjC versions. This gets rid of a
  branch for our JS bindings as this function is hot. It is currently
  impossible to get a null AtomicString from our JS bindings code because
  getElementsByTagName() and getElementsByTagName(undefined) in JS end up
  calling ContainerNode::getElementsByTagName("undefined").
  Also getElementsByTagName(null) in JS ends up calling
  ContainerNode::getElementsByTagName("null"). I have also gotten rid of
  most of the getElementsByTagName() calls from our native code. The
  remaining ones either call with a non-null AtomicString and they now
  have a null-check.

* dom/Document.idl:
* dom/Element.idl:
Have getElementsByTagName*() return an HTMLCollection except for ObjC
bindings in order to maintain legacy API compatibility.

* dom/Node.cpp:
(WebCore::Document::invalidateNodeListAndCollectionCaches):
(WebCore::NodeListsNodeData::invalidateCaches):
HTMLCollection::invalidateCache(attr) is now renamed to
invalidateCacheForAttribute(attr) to avoid ambiguity with
HTMLCollection::invalidateCache(doc) and for consistency
with LiveNodeList.

* dom/NodeRareData.h:
Make necessary updates now that TagNodeList is renamed to TagCollection
and is an HTMLCollection.

* dom/TagCollection.cpp: Renamed from Source/WebCore/dom/TagNodeList.cpp.
* dom/TagCollection.h: Renamed from Source/WebCore/dom/TagNodeList.h.
Rename TagNodeList / HTMLTagNodeList to TagCollection / HTMLTagCollection
and inherit CachedHTMLCollection instead of CachedLiveNodeList.

* editing/Editor.cpp:
(WebCore::Editor::applyEditingStyleToBodyElement):
Update code using getElementsByTagName() to reflect the fact that it
now returns an HTMLCollection and item() returns an Element*. This
function is matching any Element with "body" tag, not just HTMLBodyElement
so I did not refactor it to use an descendantsOfType<HTMLBodyElement>().
It is not clear to me what the intention of this code is.

* editing/markup.cpp:
(WebCore::createFragmentFromMarkup):
* editing/markup.h:
- Return a Ref<> instead of a PassRefPtr<> as it can never return null.
- Use descendantsOfType<HTMLAttachmentElement>(fragment) instead of
  getElementsByTagName() as it results in both shorter and more efficient
  code.

* html/CollectionType.h:
Add new ByTag / ByHTMLTag collection types for TagCollection /
HTMLTabCollection.

* html/GenericCachedHTMLCollection.cpp:
(WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
Handle new ByTag / ByHTMLTag collection types in the switch statement.

* html/HTMLCollection.cpp:
(WebCore::invalidationTypeExcludingIdAndNameAttributes):
(WebCore::HTMLCollection::~HTMLCollection):
Handle new ByTag / ByHTMLTag collection types in switch statements.

(WebCore::HTMLCollection::tags):
Add a null-check on localName() before calling getElementsByTagName().
This function is currently for ObjC bindings only.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::restartSimilarPlugIns):
Simplify / optimize the code by using descendantsOfType<HTMLPlugInImageElement>()
instead of getElementsByTagName().

* html/MediaDocument.cpp:
(WebCore::descendantVideoElement):
Use descendantsOfType<HTMLVideoElement> instead of getElementsByTagNameNS().

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame _documentFragmentWithMarkupString:baseURLString:]):
Use .ptr() as createFragmentFromMarkup() now returns a
Ref<> instead of a RefPtr<>.

Source/WebKit/win:

* DOMCoreClasses.cpp:
(DOMDocument::getElementsByTagName):
(DOMDocument::getElementsByTagNameNS):
Add null checks for localName() before calling
ContainerNode::getElementsByTagName*().

LayoutTests:

* fast/dom/getElementsByTagName-return-type-expected.txt: Added.
* fast/dom/getElementsByTagName-return-type.html: Added.
New test checking that getElementsByTagName*() returns an HTMLcollection.

* fast/dom/NodeList/script-tests/nodelist-item-call-as-function.js:
* fast/dom/domListEnumeration-expected.txt:
* fast/dom/named-items-with-symbol-name-expected.txt:
* fast/dom/script-tests/domListEnumeration.js:
* fast/dom/wrapper-classes-expected.txt:
* fast/dom/wrapper-classes.html:
* js/dom/constructor-expected.txt:
* js/dom/script-tests/constructor.js:
* platform/mac/fast/dom/wrapper-classes-objc-expected.txt:
* platform/mac/fast/dom/wrapper-classes-objc.html:
Rebaseline / update.

* fast/dom/non-numeric-values-numeric-parameters-expected.txt:
One of the checks is now failing because HTMLCollection.item()'s
parameter is optional. The specification says the parameter should
be mandatory so I did not update the test. It was previously passing
because NodeList.item()'s parameter is mandatory.

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

4 years agoParse control flow statements in WebAssembly
commit-queue@webkit.org [Sat, 22 Aug 2015 00:49:20 +0000 (00:49 +0000)]
Parse control flow statements in WebAssembly
https://bugs.webkit.org/show_bug.cgi?id=148333

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-08-21
Reviewed by Geoffrey Garen.

Parse control flow statements in WebAssembly files generated by pack-asmjs
<https://github.com/WebAssembly/polyfill-prototype-1>.

* wasm/WASMConstants.h:
* wasm/WASMFunctionParser.cpp:
(JSC::WASMFunctionParser::parseStatement):
(JSC::WASMFunctionParser::parseIfStatement):
(JSC::WASMFunctionParser::parseIfElseStatement):
(JSC::WASMFunctionParser::parseWhileStatement):
(JSC::WASMFunctionParser::parseDoStatement):
(JSC::WASMFunctionParser::parseLabelStatement):
(JSC::WASMFunctionParser::parseBreakStatement):
(JSC::WASMFunctionParser::parseBreakLabelStatement):
(JSC::WASMFunctionParser::parseContinueStatement):
(JSC::WASMFunctionParser::parseContinueLabelStatement):
(JSC::WASMFunctionParser::parseSwitchStatement):
* wasm/WASMFunctionParser.h:
(JSC::WASMFunctionParser::WASMFunctionParser):
* wasm/WASMReader.cpp:
(JSC::WASMReader::readCompactInt32):
(JSC::WASMReader::readSwitchCase):
* wasm/WASMReader.h:

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

4 years agoWebKitTestRunner should use WKWebView on OS X and iOS
timothy_horton@apple.com [Sat, 22 Aug 2015 00:34:31 +0000 (00:34 +0000)]
WebKitTestRunner should use WKWebView on OS X and iOS
https://bugs.webkit.org/show_bug.cgi?id=143743
<rdar://problem/16947123>

Reviewed by Anders Carlsson.
Patch by Enrica Casucci and myself.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _windowOcclusionDetectionEnabled]):
(-[WKWebView _setWindowOcclusionDetectionEnabled:]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
Add SPI to disable window occlusion detection, for WebKitTestRunner's use.

* Shared/WebPreferencesDefinitions.h:
Remove a completely unused WebPreference. It is a WebCore Setting,
but in the API it's exposed as a WKPage setter and WKView and WKWebView property
instead of as a WKPreference, so there's no need for the WebPreference.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageAddUserScript):
(WKBundlePageAddUserStyleSheet):
(WKBundlePageRemoveAllUserContent):
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::addUserScript):
(WebKit::WebPage::addUserStyleSheet):
(WebKit::WebPage::removeAllUserContent):
* WebProcess/WebPage/WebPage.h:
Add WKBundlePage functions for user script and style sheet manipulation.
These use the WebPage's WebUserContentController instead of the WebPageGroupProxy's
(used by the WKBundle functions), so they work correctly with the modern API.

* WebKitTestRunner/PlatformWebView.h:
(WTR::PlatformWebView::windowSnapshotEnabled): Deleted.
Add a PlatformWebView constructor that takes a WKWebViewConfiguration
instead of WKContext and WKPageGroup.

Remove the unused, always-true windowSnapshotEnabled().
While technically some platforms don't have window snapshotting,
they just return null instead of implementing windowSnapshotEnabled().

* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createOtherPage):
(WTR::TestController::initialize):
(WTR::TestController::createWebViewWithOptions):
Delegate to the various platforms for creating PlatformWebView instances,
for creating WKContexts, and for accessing WKPreferences,
so that they can do special things (like, use WKWebView instead!).

(WTR::TestController::resetPreferencesToConsistentValues):
Make explicit WebKitTestRunner's desired default for two preferences
which have differing defaults between the antique and modern API,
for consistency's sake.

(WTR::TestController::resetStateToConsistentValues):
Add platformResetStateToConsistentValues.

* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::dumpResults):
Adjust to the aforementioned removal of windowSnapshotEnabled().

* WebKitTestRunner/ios/TestControllerCocoa.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::TestController::platformPreferences):
(WTR::TestController::platformCreateWebView):
(WTR::TestController::platformCreateOtherPage):
(WTR::TestController::platformInitializeConfiguration):
Implement the new platform functions for the Modern WebKit2 API,
in a new TestControllerCocoa file that is shared between iOS and Mac.

For platformMaybeCreateContext, use the trick that we know we can cast
the WKProcessPool to a WKContextRef to retrieve a WKContextRef from
WKWebView's configuration.

Ditto for WKPreferencesRef and WKPreferences.

Remove user content filters on the WKWebView's userContentController.

* WebKitTestRunner/mac/TestControllerMac.mm:
* WebKitTestRunner/ios/TestControllerIOS.mm:
Move code into TestControllerCocoa.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::addUserScript):
(WTR::TestRunner::addUserStyleSheet):
Adopt WKBundlePage API for user scripts/sheets.

* WebKitTestRunner/ios/PlatformWebViewIOS.mm:
* WebKitTestRunner/mac/PlatformWebViewMac.mm:
Make and keep a WKWebView instead of a WKView.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseUp):
(WTR::EventSenderProxy::mouseMoveTo):
Reach inside the WKWebView to the WKView when dispatching events.
This is fairly ugly and we should come up with a better solution.
Also, fix some flipping and style errors.

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

4 years agoBuild fix.
andersca@apple.com [Sat, 22 Aug 2015 00:03:34 +0000 (00:03 +0000)]
Build fix.

* wtf/MainThread.h:

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

4 years agoDebugger's VM should never be null
ggaren@apple.com [Fri, 21 Aug 2015 23:57:07 +0000 (23:57 +0000)]
Debugger's VM should never be null
https://bugs.webkit.org/show_bug.cgi?id=148341

Reviewed by Joseph Pecoraro.

It doesn't make sense for a Debugger's VM to be null, and code related
to maintaining that illusion just caused the Web Inspector to crash on
launch (https://bugs.webkit.org/show_bug.cgi?id=148312). So, let's stop
doing that.

Now, Debugger requires its subclass to provide a never-null VM&.

Source/JavaScriptCore:

Also took the opportunity, based on review feedback, to remove some
confusion in the virtual recompileAllJSFunctions hierarchy, by eliminating
the pure virtual in ScriptDebugServer and the unnecessary override in
JSGlobalObjectScriptDebugServer.

* debugger/Debugger.cpp:
(JSC::Debugger::Debugger):
(JSC::Debugger::attach):
(JSC::Debugger::detach):
(JSC::Debugger::isAttached):
(JSC::Debugger::setSteppingMode):
(JSC::Debugger::registerCodeBlock):
(JSC::Debugger::toggleBreakpoint):
(JSC::Debugger::recompileAllJSFunctions):
(JSC::Debugger::setBreakpoint):
(JSC::Debugger::clearBreakpoints):
(JSC::Debugger::clearDebuggerRequests):
(JSC::Debugger::setBreakpointsActivated):
(JSC::Debugger::breakProgram):
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::didExecuteProgram):
* debugger/Debugger.h:
* inspector/JSGlobalObjectScriptDebugServer.cpp:
(Inspector::JSGlobalObjectScriptDebugServer::JSGlobalObjectScriptDebugServer):
(Inspector::JSGlobalObjectScriptDebugServer::recompileAllJSFunctions):
(Inspector::JSGlobalObjectScriptDebugServer::runEventLoopWhilePaused):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::ScriptDebugServer):
* inspector/ScriptDebugServer.h:

Source/WebCore:

* bindings/js/WorkerScriptDebugServer.cpp:
(WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
(WebCore::WorkerScriptDebugServer::recompileAllJSFunctions):
(WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
* inspector/PageScriptDebugServer.cpp:
(WebCore::PageScriptDebugServer::recompileAllJSFunctions):
(WebCore::PageScriptDebugServer::didPause):

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

4 years ago[OS X] Remove dead code from FontCache::systemFallbackForCharacters()
mmaxfield@apple.com [Fri, 21 Aug 2015 23:50:21 +0000 (23:50 +0000)]
[OS X] Remove dead code from FontCache::systemFallbackForCharacters()
https://bugs.webkit.org/show_bug.cgi?id=148218

Reviewed by Daniel Bates.

lookupCTFont() in FontCacheMac.mm will always return the best font (because
CTFontCreateForCharactersWithLanguage() does so). Also, all fonts that will
be created on WebKit's behalf are already printer fonts.

No new tests because there is no behavior change.

* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::systemFallbackForCharacters): Deleted.

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

4 years ago[Win] Unreviewed build fix.
bfulgham@apple.com [Fri, 21 Aug 2015 23:48:52 +0000 (23:48 +0000)]
[Win] Unreviewed build fix.

* win/tools/vsprops/common.props: Ignore a warning that is filling the
build logs with useless cruft.

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

4 years agoRe-mark accessibility/mac/search-with-frames.html flaky
timothy_horton@apple.com [Fri, 21 Aug 2015 23:46:17 +0000 (23:46 +0000)]
Re-mark accessibility/mac/search-with-frames.html flaky

* platform/mac/TestExpectations:
It's still not 100%.

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

4 years agoFix build.
andersca@apple.com [Fri, 21 Aug 2015 23:41:40 +0000 (23:41 +0000)]
Fix build.

* platform/network/win/NetworkStateNotifierWin.cpp:
(WebCore::NetworkStateNotifier::addrChangeCallback):
(WebCore::NetworkStateNotifier::callAddressChanged): Deleted.

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

4 years agoAddress review feedback from Darin.
andersca@apple.com [Fri, 21 Aug 2015 23:37:24 +0000 (23:37 +0000)]
Address review feedback from Darin.

* wtf/MainThread.h:
* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
(WTF::callOnMainThread):
(WTF::cancelCallOnMainThread):

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

4 years ago[Cocoa] Clean up Font class
mmaxfield@apple.com [Fri, 21 Aug 2015 23:34:07 +0000 (23:34 +0000)]
[Cocoa] Clean up Font class
https://bugs.webkit.org/show_bug.cgi?id=148216

Reviewed by Dean Jackson.

No new tests because there is no behavior change.

* platform/graphics/Font.cpp:
(WebCore::Font::platformGlyphInit): Deleted.
* platform/graphics/Font.h:
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):

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

4 years agoRemove unused code relative to allocation sinking
basile_clement@apple.com [Fri, 21 Aug 2015 23:30:40 +0000 (23:30 +0000)]
Remove unused code relative to allocation sinking
https://bugs.webkit.org/show_bug.cgi?id=148342

Reviewed by Mark Lam.

This removes two things:

 - The DFGPromoteHeapAccess.h file which is a relic of the old sinking
   phase and is no longer used (it has been subsumed by
   ObjectAllocationSinking::promoteLocalHeap)

 - Code in the allocation sinking phase for sinking
   MaterializeCreateActivation and MaterializeNewObject. Handling those
   is no longer necessary since the phase no longer runs in a fixpoint
   and thus will never see those nodes, since no other phase creates
   them.

* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGPromoteHeapAccess.h: Removed.

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

4 years ago[Cocoa] Unify two more FontCache functions
mmaxfield@apple.com [Fri, 21 Aug 2015 23:28:08 +0000 (23:28 +0000)]
[Cocoa] Unify two more FontCache functions
https://bugs.webkit.org/show_bug.cgi?id=148217

Reviewed by Dean Jackson.

Move duplicated code from FontCacheMac and FontCacheIOS into
FontCacheCoreText.

No new tests because there is no behavior change.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::toTraitsMask):
(WebCore::isFontWeightBold):
(WebCore::FontCache::similarFont):
(WebCore::FontCache::getTraitsInFamily):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::similarFont): Deleted.
(WebCore::toTraitsMask): Deleted.
(WebCore::FontCache::getTraitsInFamily): Deleted.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::toTraitsMask): Deleted.
(WebCore::FontCache::similarFont): Deleted.
(WebCore::FontCache::getTraitsInFamily): Deleted.

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

4 years agoEdit a resource for type profiler and code coverage profiler blog post.
saambarati1@gmail.com [Fri, 21 Aug 2015 23:16:48 +0000 (23:16 +0000)]
Edit a resource for type profiler and code coverage profiler blog post.

* blog-files/type-profiler-and-code-coverage-profiler/types-everywhere.png:

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

4 years agoImprove how UI events are dispatched by WebKitTestRunner
ap@apple.com [Fri, 21 Aug 2015 23:09:54 +0000 (23:09 +0000)]
Improve how UI events are dispatched by WebKitTestRunner
https://bugs.webkit.org/show_bug.cgi?id=148326

Reviewed by Anders Carlsson.

Source/WebKit2:

Added "fully synchronous mode for testing", in which all messages are dispatched
synchronously.

When an async message is sent in this mode, it is wrapped into a sync one automatically.

A client must opt in, either by using WKBundlePagePostSynchronousMessageForTesting(),
or by calling WKContextConfigurationAllowFullySynchronousModeForTesting().
This makes sure that we don't increase potential for IPC misuse.

* WebProcess/WebPage/WebPage.messages.in: Yay, fewer messages!

* UIProcess/API/C/WKPage.cpp:
(WKPageSetShouldSendEventsSynchronously): Deleted.
* UIProcess/API/C/WKPagePrivate.h:
We no longer need WKPageSetShouldSendEventsSynchronously and associated custom messages.

* WebProcess/WebPage/EventDispatcher.cpp:
(WebKit::EventDispatcher::wheelEvent):
(WebKit::updateWheelEventTestTriggersIfNeeded): Deleted.
Removed code that was only needed to support pseudo-syncronous scrolling in tests.

* Platform/IPC/Connection.cpp:
(IPC::Connection::sendMessage):
(IPC::Connection::dispatchSyncMessage):
(IPC::Connection::dispatchMessage):
* Platform/IPC/Connection.h:
(IPC::Connection::allowFullySynchronousModeForTesting):
(IPC::Connection::sendSync):
* Platform/IPC/MessageDecoder.cpp:
(IPC::MessageDecoder::shouldDispatchMessageWhenWaitingForSyncReply):
(IPC::MessageDecoder::shouldUseFullySynchronousModeForTesting):
(IPC::MessageDecoder::setImportanceAssertion):
(IPC::MessageDecoder::unwrapForTesting):
* Platform/IPC/MessageDecoder.h:
(IPC::MessageDecoder::UUID):
* Platform/IPC/MessageEncoder.cpp:
(IPC::MessageEncoder::setShouldDispatchMessageWhenWaitingForSyncReply):
(IPC::MessageEncoder::setFullySynchronousModeForTesting):
(IPC::MessageEncoder::wrapForTesting):
* Platform/IPC/MessageEncoder.h:
(IPC::MessageEncoder::UUID):
* Platform/IPC/MessageFlags.h:
* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationSetMediaKeysStorageDirectory):
(WKContextConfigurationAllowFullySynchronousModeForTesting):
* UIProcess/API/C/WKContextConfigurationRef.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::handleMouseEvent):
(WebKit::WebPageProxy::sendWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleTouchEvent):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::renderTreeSize):
(WebKit::WebPageProxy::setShouldSendEventsSynchronously): Deleted.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processDidFinishLaunching):
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePagePostMessage):
(WKBundlePagePostSynchronousMessageForTesting):
(WKBundlePagePostSynchronousMessage): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::mouseEvent):
(WebKit::handleWheelEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::handleKeyEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::validateCommand):
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::scroll):
(WebKit::WebPage::postMessage):
(WebKit::WebPage::postSynchronousMessageForTesting):
(WebKit::WebPage::mouseEventSyncForTesting): Deleted.
(WebKit::WebPage::wheelEventSyncForTesting): Deleted.
(WebKit::WebPage::keyEventSyncForTesting): Deleted.
(WebKit::WebPage::touchEventSyncForTesting): Deleted.
(WebKit::WebPage::postSynchronousMessage): Deleted.
* WebProcess/WebPage/WebPage.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
Removed asyncScrolling from mouseScrollByWithWheelAndMomentumPhases, it's now always
asynchronous (and really, it has always been for the most part).

* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseDown): Updated for WKBundlePagePostSynchronousMessage renaming.
(WTR::EventSendingController::mouseUp): Ditto.
(WTR::EventSendingController::mouseMoveTo): Ditto.
(WTR::EventSendingController::mouseForceDown): Ditto.
(WTR::EventSendingController::mouseForceUp): Ditto.
(WTR::EventSendingController::mouseForceChanged): Ditto.
(WTR::EventSendingController::leapForward): Ditto.
(WTR::EventSendingController::scheduleAsynchronousClick): Ditto.
(WTR::EventSendingController::keyDown): Ditto.
(WTR::EventSendingController::scheduleAsynchronousKeyDown): Ditto.
(WTR::EventSendingController::mouseScrollBy): Force a scrolling tree commit. It used
to be done in custom WebKit2 code for test wheel event handling.
(WTR::EventSendingController::mouseScrollByWithWheelAndMomentumPhases): Got rid of sync version.
(WTR::EventSendingController::continuousMouseScrollBy): Added a FIXME. This one is weird.
(WTR::EventSendingController::contextClick): Updated for WKBundlePagePostSynchronousMessage renaming.
(WTR::EventSendingController::addTouchPoint): Ditto.
(WTR::EventSendingController::updateTouchPoint): Ditto.
(WTR::EventSendingController::setTouchModifier): Ditto.
(WTR::EventSendingController::setTouchPointRadius): Ditto.
(WTR::EventSendingController::touchStart): Ditto.
(WTR::EventSendingController::touchMove): Ditto.
(WTR::EventSendingController::touchEnd): Ditto.
(WTR::EventSendingController::touchCancel): Ditto.
(WTR::EventSendingController::clearTouchPoints): Ditto.
(WTR::EventSendingController::releaseTouchPoint): Ditto.
(WTR::EventSendingController::cancelTouchPoint): Ditto.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::postSetWindowIsKey):
(WTR::InjectedBundle::postSimulateWebNotificationClick):
(WTR::InjectedBundle::isGeolocationProviderActive):
(WTR::InjectedBundle::shouldProcessWorkQueue):
Updated for WKBundlePagePostSynchronousMessage renaming.

* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::secureEventInputIsEnabled): Ditto.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::initialize): Allow handling the new test style messages.
(WTR::TestController::didReceiveKeyDownMessageFromInjectedBundle): Removed calls
to WKPageSetShouldSendEventsSynchronously, which we no longer need.
(WTR::TestController::didReceiveMessageFromInjectedBundle):
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle): Moved
"MouseScrollBy" to async section, and got rid of WKPageSetShouldSendEventsSynchronously.

* WebKitTestRunner/mac/EventSenderProxy.mm:
(WTR::EventSenderProxy::mouseMoveTo): Got rid of WKPageSetShouldSendEventsSynchronously.
(WTR::EventSenderProxy::keyDown): Ditto.
(WTR::EventSenderProxy::mouseScrollBy): Ditto.
(WTR::EventSenderProxy::mouseScrollByWithWheelAndMomentumPhases): Ditto.

LayoutTests:

* fast/events/clear-drag-state-expected.txt:
* fast/events/clear-drag-state.html:
* platform/mac-wk2/TestExpectations:
This test used to accidentally pass in WebKit2, but it didn't actually check
for the problem. This patch improves WK2 behavior, which makes the test fail.
Changed the test to not pass accidentally, and added it to WK2 test expectations.

* fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt:
* fast/events/scroll-in-scaled-page-with-overflow-hidden.html:
Updated the test to be fully async.

* fast/events/wheelevent-basic-expected.txt:
* fast/events/wheelevent-basic.html:
Updated the test to be fully async, got rid of tab characters.

* fast/events/wheelevent-mousewheel-interaction.html:
* fast/forms/search/search-scroll-hidden-decoration-container-crash.html:
* fast/frames/flattening/scrolling-in-object.html:
Updated these tests to be fully async. Since they check for something that happens
asynchronously, and doesn't have an end event, they have to use setTimeout.

* fast/scrolling/latching/iframe_in_iframe.html:
* fast/scrolling/latching/scroll-div-latched-div.html:
* fast/scrolling/latching/scroll-div-latched-mainframe.html:
* fast/scrolling/latching/scroll-div-no-latching.html:
* fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html:
* fast/scrolling/latching/scroll-iframe-fragment.html:
* fast/scrolling/latching/scroll-iframe-latched-iframe.html:
* fast/scrolling/latching/scroll-iframe-latched-mainframe.html:
* fast/scrolling/latching/scroll-iframe-webkit1-latching-bug.html:
* fast/scrolling/latching/scroll-latched-nested-div.html:
* fast/scrolling/latching/scroll-nested-iframe.html:
* fast/scrolling/latching/scroll-select-bottom-test.html:
* fast/scrolling/latching/scroll-select-latched-mainframe.html:
* fast/scrolling/latching/scroll-select-latched-select.html:
Removed extra testRunner.mouseScrollByWithWheelAndMomentumPhases() calls.
We no longer need multiple events for scroll snap animation to start, and due to
the way we coalesce events, having multiple events resulted in getting too high velocity.
Removed async scrolling argument form the function calls, because it's now always async.

* platform/mac-wk1/TestExpectations:
* platform/mac/TestExpectations:
Moved fast/scrolling/latching/scroll-div-with-nested-nonscrollable-iframe.html
to WK1 expectations, because the test needn't be skipped on WK2.

* scrollbars/scroll-rtl-or-bt-layer.html: Made the test fully async, and refactored
it for clarity.

* tiled-drawing/scrolling/fast-scroll-div-latched-div-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-div-latched-div.html:
* tiled-drawing/scrolling/fast-scroll-div-latched-mainframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-div-latched-mainframe.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-iframe.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-mainframe.html:
* tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html:
* tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-mainframe-with-handler.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-mainframe.html:
* tiled-drawing/scrolling/fast-scroll-select-latched-select.html:
* tiled-drawing/scrolling/iframe_in_iframe.html:
* tiled-drawing/scrolling/overflow-scroll-reduced-content.html:
* tiled-drawing/scrolling/overflow-scroll-zero-delta-wheel-events.html:
* tiled-drawing/scrolling/root-overflow-with-mousewheel.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-iframe.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-2d-overflow.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-horizontal.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-horizontal.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-slow-vertical.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-mainframe-vertical.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow-stateless.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-overflow.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-padding.html:
* tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-rotated.html:
* tiled-drawing/scrolling/wheel-events-with-no-delta.html:
Same testRunner.mouseScrollByWithWheelAndMomentumPhases changes as in fast/scrolling/latching.

* tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler-expected.txt:
* tiled-drawing/scrolling/fast-scroll-select-latched-select-with-handler.html:
Removed debug output about how many events are received. The number may vary due
to coalescing.

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

4 years agoUnify code paths for manually deleting all code
ggaren@apple.com [Fri, 21 Aug 2015 22:48:49 +0000 (22:48 +0000)]
Unify code paths for manually deleting all code
https://bugs.webkit.org/show_bug.cgi?id=148280

Reviewed by Saam Barati.

We used to have three paths for manually deleting all code. Now we have
one shared path.

* debugger/Debugger.cpp:
(JSC::Debugger::attach): Notify the debugger of all previous code when
it attaches. We used to do this when recompiling, which was only correct
by accident.

(JSC::Debugger::recompileAllJSFunctions): Switch to the shared path.

* heap/Heap.h:
(JSC::Heap::compiledCode):

* inspector/agents/InspectorRuntimeAgent.cpp:
(Inspector::InspectorRuntimeAgent::getRuntimeTypesForVariablesAtOffsets):
(Inspector::InspectorRuntimeAgent::willDestroyFrontendAndBackend):
(Inspector::InspectorRuntimeAgent::setTypeProfilerEnabledState):
(Inspector::InspectorRuntimeAgent::getBasicBlocks):
(Inspector::TypeRecompiler::visit): Deleted.
(Inspector::TypeRecompiler::operator()): Deleted.
(Inspector::recompileAllJSFunctionsForTypeProfiling): Deleted. Switch
to the shared path.

* runtime/VM.cpp:
(JSC::VM::afterVMExit): Added a helper for scheduling an activity after
VM exit. We can't delete code while it's on the stack, and we can't
delete auxiliary profiling data while profiling code is on the stack,
so in those cases, we schedule the deletion for the next time we exit.

(JSC::VM::deleteAllCode): Use afterVMExit because we might have code
on the stack when debugger, profiler, or watchdog state changes.

* runtime/VM.h:

* runtime/VMEntryScope.cpp:
(JSC::VMEntryScope::VMEntryScope):
(JSC::VMEntryScope::addDidPopListener):
(JSC::VMEntryScope::~VMEntryScope):
(JSC::VMEntryScope::setEntryScopeDidPopListener): Deleted.
* runtime/VMEntryScope.h:
(JSC::VMEntryScope::globalObject): Removed the uniquing feature from
the scope pop listener list because we don't have a client that wants
it, and it's not convenient to use correctly since you can't take
the address of a member function, a lambda, or an std::function. We can
add this feature back if we discover that we want it.

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

4 years agoAdd resources for type profiler and code coverage profiler blog post.
saambarati1@gmail.com [Fri, 21 Aug 2015 22:12:53 +0000 (22:12 +0000)]
Add resources for type profiler and code coverage profiler blog post.

* blog-files/type-profiler-and-code-coverage-profiler: Added.
* blog-files/type-profiler-and-code-coverage-profiler/code-coverage-video.mp4: Added.
* blog-files/type-profiler-and-code-coverage-profiler/code-coverage.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/compiler-pipeline.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/subtle-bug.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/type-profiler-api-view.png: Added.
* blog-files/type-profiler-and-code-coverage-profiler/types-changing.mov: Added.
* blog-files/type-profiler-and-code-coverage-profiler/types-everywhere.png: Added.

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

4 years agoDeprecate the old school callOnMainThread/cancelCallOnMainThread functions
andersca@apple.com [Fri, 21 Aug 2015 22:06:25 +0000 (22:06 +0000)]
Deprecate the old school callOnMainThread/cancelCallOnMainThread functions
https://bugs.webkit.org/show_bug.cgi?id=148327

Reviewed by Sam Weinig.

* wtf/MainThread.cpp:
(WTF::functionQueue):
(WTF::dispatchFunctionsFromMainThread):
(WTF::callOnMainThread):
Change the function queue to be a queue of std::function<void ()> and get rid of dead code.

* wtf/MainThread.h:
Conditionalize callOnMainThread and cancelCallOnMainThread because Safari on Mavericks still expects to them to be
declared in MainThread.h under 10.9.

* wtf/mac/DeprecatedSymbolsUsedBySafari.mm:
Add a MainThreadFunctionTracker singleton that keeps track of scheduled functions so we can ensure that they're not
called if they're cancelled.

(WTF::MainThreadFunctionTracker::singleton):
Return the singleton.

(WTF::MainThreadFunctionTracker::callOnMainThread):
Add the function/context pair to our map and schedule the function to be run on the main thread.
If the function has been removed, don't call it.

(WTF::MainThreadFunctionTracker::cancelCallOnMainThread):
Remove all entries with the given function/context pair.

(WTF::MainThreadFunctionTracker::addFunction):
Add the function/context pair to the map and return the unique identifier.

(WTF::MainThreadFunctionTracker::removeIdentifier):
Look up the identifier and remove it if it still exists. If it exists we know that it hasn't been canceled and that we can call it.

(WTF::MainThreadFunctionTracker::removeFunctions):
Remove all function identifiers matched by the function/context pair.

(WTF::callOnMainThread):
Implement using MainThreadFunctionTracker.

(WTF::cancelCallOnMainThread):
Implement using MainThreadFunctionTracker.

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

4 years agoStop using the old callOnMainThread variant on Windows
andersca@apple.com [Fri, 21 Aug 2015 22:01:02 +0000 (22:01 +0000)]
Stop using the old callOnMainThread variant on Windows
https://bugs.webkit.org/show_bug.cgi?id=148332

Reviewed by Tim Horton.

Source/WebCore:

* platform/network/cf/CookieStorageCFNet.cpp:
(WebCore::notifyCookiesChanged):
(WebCore::notifyCookiesChangedOnMainThread): Deleted.
* platform/network/win/NetworkStateNotifierWin.cpp:
(WebCore::NetworkStateNotifier::addrChangeCallback):

Source/WebKit/win:

* Plugins/PluginMainThreadScheduler.cpp:
(WebCore::PluginMainThreadScheduler::scheduleCall):
(WebCore::PluginMainThreadScheduler::mainThreadCallback): Deleted.
* Plugins/PluginMainThreadScheduler.h:
* WebDatabaseManager.cpp:
(DidModifyOriginData::dispatchToMainThread):
* WebIconDatabase.cpp:
(WebIconDatabase::scheduleNotificationDelivery):

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

4 years agoImplement WebAssembly function parser
commit-queue@webkit.org [Fri, 21 Aug 2015 21:46:22 +0000 (21:46 +0000)]
Implement WebAssembly function parser
https://bugs.webkit.org/show_bug.cgi?id=147738

Patch by Sukolsak Sakshuwong <sukolsak@gmail.com> on 2015-08-21
Reviewed by Filip Pizlo.

Implement WebAssembly function parser for WebAssembly files produced by pack-asmjs
<https://github.com/WebAssembly/polyfill-prototype-1>. This patch parses only
some instructions on statements and int32 expressions. Parsing of the rest
will be implemented in subsequent patches. The instruction lists in WASMConstants.h
are slightly modified from
<https://github.com/WebAssembly/polyfill-prototype-1/blob/master/src/shared.h>.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* wasm/WASMConstants.h: Added.
* wasm/WASMFormat.h:
* wasm/WASMFunctionParser.cpp: Added.
(JSC::WASMFunctionParser::checkSyntax):
(JSC::WASMFunctionParser::parseFunction):
(JSC::WASMFunctionParser::parseLocalVariables):
(JSC::WASMFunctionParser::parseStatement):
(JSC::WASMFunctionParser::parseSetLocalStatement):
(JSC::WASMFunctionParser::parseReturnStatement):
(JSC::WASMFunctionParser::parseBlockStatement):
(JSC::WASMFunctionParser::parseExpression):
(JSC::WASMFunctionParser::parseExpressionI32):
(JSC::WASMFunctionParser::parseImmediateExpressionI32):
* wasm/WASMFunctionParser.h: Added.
(JSC::WASMFunctionParser::WASMFunctionParser):
* wasm/WASMFunctionSyntaxChecker.h: Renamed from Source/JavaScriptCore/wasm/WASMMagicNumber.h.
* wasm/WASMModuleParser.cpp:
(JSC::WASMModuleParser::WASMModuleParser):
(JSC::WASMModuleParser::parseFunctionDefinitionSection):
(JSC::WASMModuleParser::parseFunctionDefinition):
* wasm/WASMModuleParser.h:
* wasm/WASMReader.cpp:
(JSC::WASMReader::readType):
(JSC::WASMReader::readExpressionType):
(JSC::WASMReader::readExportFormat):
(JSC::WASMReader::readOpStatement):
(JSC::WASMReader::readOpExpressionI32):
(JSC::WASMReader::readVariableTypes):
(JSC::WASMReader::readOp):
* wasm/WASMReader.h:
(JSC::WASMReader::offset):
(JSC::WASMReader::setOffset):

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

4 years agoDFG::PutStackSinkingPhase doesn't need to emit KillStack nodes
fpizlo@apple.com [Fri, 21 Aug 2015 21:44:11 +0000 (21:44 +0000)]
DFG::PutStackSinkingPhase doesn't need to emit KillStack nodes
https://bugs.webkit.org/show_bug.cgi?id=148331

Reviewed by Geoffrey Garen.

PutStackSinkingPhase previously emitted a KillStack node when it sank a PutStack. This
isn't necessary because KillStack is only interesting for OSR exit, and PutStack nodes
that are relevant to OSR will already be preceded by a KillStack/MovHint pair.

* dfg/DFGPutStackSinkingPhase.cpp:

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

4 years agoMedia Session: let UI clients change the volume of the focused media element
mrajca@apple.com [Fri, 21 Aug 2015 21:41:53 +0000 (21:41 +0000)]
Media Session: let UI clients change the volume of the focused media element
https://bugs.webkit.org/show_bug.cgi?id=148289

Reviewed by Tim Horton.

WebCore:
* page/Page.cpp:
(WebCore::Page::setVolumeOfMediaElement):
* page/Page.h:

WebKit2:
* UIProcess/API/C/WKMediaSessionFocusManager.cpp:
(WKMediaSessionFocusManagerSetVolumeOfFocusedMediaElement):
* UIProcess/API/C/WKMediaSessionFocusManager.h:
* UIProcess/WebMediaSessionFocusManager.cpp:
(WebKit::WebMediaSessionFocusManager::updatePlaybackAttribute):
(WebKit::WebMediaSessionFocusManager::setVolumeOfFocusedMediaElement):
* UIProcess/WebMediaSessionFocusManager.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setVolumeOfMediaElement):
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setVolumeOfMediaElement):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

4 years agoGet rid of uses of the old callOnMainThread function that takes a function ptr +...
andersca@apple.com [Fri, 21 Aug 2015 20:50:59 +0000 (20:50 +0000)]
Get rid of uses of the old callOnMainThread function that takes a function ptr + context
https://bugs.webkit.org/show_bug.cgi?id=148324

Reviewed by Tim Horton.

Source/WebCore:

* Modules/webaudio/AsyncAudioDecoder.cpp:
(WebCore::AsyncAudioDecoder::DecodingTask::decode):
(WebCore::AsyncAudioDecoder::DecodingTask::notifyCompleteDispatch): Deleted.
* Modules/webaudio/AsyncAudioDecoder.h:
* Modules/webaudio/OfflineAudioDestinationNode.cpp:
(WebCore::OfflineAudioDestinationNode::offlineRender):
(WebCore::OfflineAudioDestinationNode::notifyCompleteDispatch): Deleted.
* Modules/webaudio/OfflineAudioDestinationNode.h:
* Modules/webaudio/ScriptProcessorNode.cpp:
(WebCore::ScriptProcessorNode::process):
(WebCore::ScriptProcessorNode::fireProcessEventDispatch): Deleted.
* Modules/webaudio/ScriptProcessorNode.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::scheduleForNotification):
(WebCore::DatabaseTracker::notifyDatabasesChanged):
* Modules/webdatabase/DatabaseTracker.h:
* platform/graphics/cg/ImageCG.cpp:
(WebCore::patternReleaseCallback):
(WebCore::patternReleaseOnMainThreadCallback): Deleted.
* platform/graphics/cg/PatternCG.cpp:
(WebCore::patternReleaseCallback):
(WebCore::patternReleaseOnMainThreadCallback): Deleted.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::invalidateFontCache):
(WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
* platform/network/BlobResourceHandle.cpp:
(WebCore::doNotifyFinish):
(WebCore::BlobResourceHandle::notifyFinish):
* platform/network/cf/FormDataStreamCFNet.cpp:
(WebCore::formFinalize):
(WebCore::formFinishFinalizationOnMainThread): Deleted.

Source/WebKit/mac:

* Storage/WebDatabaseManagerClient.mm:
(DidModifyOriginData::dispatchToMainThread):
(DidModifyOriginData::dispatchDidModifyOriginOnMainThread): Deleted.
* Storage/WebStorageTrackerClient.h:
* Storage/WebStorageTrackerClient.mm:
(WebStorageTrackerClient::dispatchDidModifyOrigin):
(WebStorageTrackerClient::dispatchDidModifyOriginOnMainThread): Deleted.

Source/WebKit2:

* UIProcess/mac/WKPrintingView.mm:
(prepareDataForPrintingOnSecondaryThread):
(-[WKPrintingView knowsPageRange:]):

Source/WTF:

* wtf/text/cf/StringImplCF.cpp:
(WTF::StringWrapperCFAllocator::deallocate):
(WTF::StringWrapperCFAllocator::deallocateOnMainThread): Deleted.

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

4 years agoDFG::NodeOrigin should have a flag determining if exiting is OK right now
fpizlo@apple.com [Fri, 21 Aug 2015 20:48:59 +0000 (20:48 +0000)]
DFG::NodeOrigin should have a flag determining if exiting is OK right now
https://bugs.webkit.org/show_bug.cgi?id=148323

Reviewed by Saam Barati.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::currentNodeOrigin):
(JSC::DFG::ByteCodeParser::branchData):
* dfg/DFGInsertionSet.h:
(JSC::DFG::InsertionSet::insertConstant):
(JSC::DFG::InsertionSet::insertConstantForUse):
(JSC::DFG::InsertionSet::insertBottomConstantForUse):
* dfg/DFGIntegerCheckCombiningPhase.cpp:
(JSC::DFG::IntegerCheckCombiningPhase::handleBlock):
* dfg/DFGLICMPhase.cpp:
(JSC::DFG::LICMPhase::attemptHoist):
* dfg/DFGNodeOrigin.h:
(JSC::DFG::NodeOrigin::NodeOrigin):
(JSC::DFG::NodeOrigin::isSet):
(JSC::DFG::NodeOrigin::withSemantic):
* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

4 years agoAX: Fix accessibility/mac/search-with-frames.html test
commit-queue@webkit.org [Fri, 21 Aug 2015 20:00:48 +0000 (20:00 +0000)]
AX: Fix accessibility/mac/search-with-frames.html test
https://bugs.webkit.org/show_bug.cgi?id=148313

Patch by Nan Wang <n_wang@apple.com> on 2015-08-21
Reviewed by Chris Fleizach.

uiElementForSearchPredicate function needs five parameters for DumpRenderTree.

* accessibility/mac/search-with-frames.html:
* platform/mac/TestExpectations:

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

4 years agoAX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow
commit-queue@webkit.org [Fri, 21 Aug 2015 19:55:53 +0000 (19:55 +0000)]
AX: Table with CSS that makes a row anonymous can return NULL from cellForColumnAndRow
https://bugs.webkit.org/show_bug.cgi?id=148293

Patch by Doug Russell <d_russell@apple.com> on 2015-08-21
Reviewed by Chris Fleizach.

When RenderTableRows are anonymous, they may not be added to the accessible data
table's internal row list. However, when calculating the row range for a cell,
we were still accounting for those anonymous sections.
Change how the row range is calculated to directly ask the accessible parent row
for its index. This will ensure it’s more inline with what’s being represented to
the accessibility API.

Source/WebCore:

Test: accessibility/aria-table-content.html

* accessibility/AccessibilityTableCell.cpp:
(WebCore::AccessibilityTableCell::parentRow):
(WebCore::AccessibilityTableCell::rowIndexRange):
* accessibility/AccessibilityTableCell.h:

LayoutTests:

* accessibility/aria-table-content-expected.txt: Added.
* accessibility/aria-table-content.html: Added.

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

4 years agoWeb Inspector: REGRESSION(173684): Edit as HTML not working
commit-queue@webkit.org [Fri, 21 Aug 2015 19:36:58 +0000 (19:36 +0000)]
Web Inspector: REGRESSION(173684): Edit as HTML not working
https://bugs.webkit.org/show_bug.cgi?id=148268

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-21
Reviewed by Chris Dumez.

Source/WebCore:

Tests: inspector/dom/getOuterHTML.html
       inspector/dom/setOuterHTML.html

* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::innerPatchChildren):
Revert the optimization change made in r173684. The optimization changes
had a few issues. It changed the logic to potentially drop out of the
loop before all new items were processed and using a node reference
to track an index did not account for the modifications insertBefore
may have made to that node's index in the list.

LayoutTests:

* inspector/dom/getOuterHTML-expected.txt: Added.
* inspector/dom/getOuterHTML.html: Added.
* inspector/dom/setOuterHTML-expected.txt: Added.
* inspector/dom/setOuterHTML.html: Added.

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

4 years agoSkip no-llint tests that fail due to running out of executable memory after r188969
utatane.tea@gmail.com [Fri, 21 Aug 2015 19:33:01 +0000 (19:33 +0000)]
Skip no-llint tests that fail due to running out of executable memory after r188969
https://bugs.webkit.org/show_bug.cgi?id=148273

Reviewed by Michael Saboff.

Tools:

* Scripts/run-jsc-stress-tests:

LayoutTests:

r188969 is causing the "no-llint" variation of some tests to fail due to "ran out of executable memory".
These failures are caused because put_by_val and get_by_val aggressively generate the ICs even if the op is executed only once.
The failing tests call eval("contains byVal ops") with the different strings repeatedly under the "no-llint" variation.
In those cases, each eval call creates byId IC for byVal and exhausts executable memory.

We will fix this issue by generating the IC in the second call[1]. In the meantime, we skip these tests.

[1]: https://bugs.webkit.org/show_bug.cgi?id=148288

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

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

4 years agoWeb Inspector: inspector/css/modify-rule-selector.html is flaky on some bots
bburg@apple.com [Fri, 21 Aug 2015 19:25:43 +0000 (19:25 +0000)]
Web Inspector: inspector/css/modify-rule-selector.html is flaky on some bots
https://bugs.webkit.org/show_bug.cgi?id=148321

Unreviewed, enable extra logging to stderr so we can hopefully see
why the test is occasionally timing out with no output to the test page.

* inspector/css/modify-rule-selector.html:

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

4 years agoHistoryItems will null CachedPages should never be left in the list of items;
bdakin@apple.com [Fri, 21 Aug 2015 19:23:09 +0000 (19:23 +0000)]
HistoryItems will null CachedPages should never be left in the list of items;
causes crash
https://bugs.webkit.org/show_bug.cgi?id=148237
-and corresponding-
rdar://problem/22356782

Reviewed by Brady Eidson.

Setting the CachedPage to nullptr will destroy the CachedPage, destroy the
FrameView, re-enter layout, and potentially try to modify items in the PageCache
based on that layout. So, we should not modify CachedPage in this way while the
item is still in the list of HistoryItems.
* history/PageCache.cpp:
(WebCore::PageCache::take):
(WebCore::PageCache::remove):
(WebCore::PageCache::prune):

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

4 years agoDFG callOperations should not implicitly emit an exception check. At callOperation...
saambarati1@gmail.com [Fri, 21 Aug 2015 19:11:36 +0000 (19:11 +0000)]
DFG callOperations should not implicitly emit an exception check. At callOperation call sites, we should explicitly emit exception checks
https://bugs.webkit.org/show_bug.cgi?id=147988

Reviewed by Geoffrey Garen.

This is in preparation for the DFG being able to handle exceptions.
To do this, we need more control over when we emit exception checks.
Specifically, we want to be able to silentFill before emitting an exception check.
This patch does that. This patch also allows us to easily see which
operations do and do not emit exception checks. Finding this information
out before was a pain.

* assembler/AbortReason.h:
* dfg/DFGArrayifySlowPathGenerator.h:
* dfg/DFGCallArrayAllocatorSlowPathGenerator.h:
* dfg/DFGCallCreateDirectArgumentsSlowPathGenerator.h:
* dfg/DFGJITCompiler.h:
(JSC::DFG::JITCompiler::appendCall):
(JSC::DFG::JITCompiler::exceptionCheck):
* dfg/DFGSaneStringGetByValSlowPathGenerator.h:
* dfg/DFGSlowPathGenerator.h:
(JSC::DFG::CallSlowPathGenerator::CallSlowPathGenerator):
(JSC::DFG::CallSlowPathGenerator::tearDown):
(JSC::DFG::CallResultAndNoArgumentsSlowPathGenerator::CallResultAndNoArgumentsSlowPathGenerator):
(JSC::DFG::CallResultAndOneArgumentSlowPathGenerator::CallResultAndOneArgumentSlowPathGenerator):
(JSC::DFG::CallResultAndTwoArgumentsSlowPathGenerator::CallResultAndTwoArgumentsSlowPathGenerator):
(JSC::DFG::CallResultAndThreeArgumentsSlowPathGenerator::CallResultAndThreeArgumentsSlowPathGenerator):
(JSC::DFG::CallResultAndFourArgumentsSlowPathGenerator::CallResultAndFourArgumentsSlowPathGenerator):
(JSC::DFG::CallResultAndFiveArgumentsSlowPathGenerator::CallResultAndFiveArgumentsSlowPathGenerator):
(JSC::DFG::slowPathCall):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIn):
(JSC::DFG::SpeculativeJIT::compileCurrentBlock):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compileArithRound):
(JSC::DFG::SpeculativeJIT::compileNewFunction):
(JSC::DFG::SpeculativeJIT::compileCreateActivation):
(JSC::DFG::SpeculativeJIT::compileCreateScopedArguments):
(JSC::DFG::SpeculativeJIT::compileCreateClonedArguments):
(JSC::DFG::SpeculativeJIT::compileNotifyWrite):
(JSC::DFG::SpeculativeJIT::compileRegExpExec):
(JSC::DFG::SpeculativeJIT::compileAllocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileReallocatePropertyStorage):
(JSC::DFG::SpeculativeJIT::compileToStringOrCallStringConstructorOnCell):
(JSC::DFG::SpeculativeJIT::emitSwitchImm):
(JSC::DFG::SpeculativeJIT::emitSwitchStringOnString):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
(JSC::DFG::SpeculativeJIT::callOperationWithCallFrameRollbackOnException):
(JSC::DFG::SpeculativeJIT::prepareForExternalCall):
(JSC::DFG::SpeculativeJIT::appendCall):
(JSC::DFG::SpeculativeJIT::appendCallWithCallFrameRollbackOnException):
(JSC::DFG::SpeculativeJIT::appendCallWithCallFrameRollbackOnExceptionSetResult):
(JSC::DFG::SpeculativeJIT::appendCallSetResult):
(JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheck): Deleted.
(JSC::DFG::SpeculativeJIT::appendCallWithExceptionCheckSetResult): Deleted.
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeBranch):
(JSC::DFG::CompareAndBoxBooleanSlowPathGenerator::CompareAndBoxBooleanSlowPathGenerator):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeCompare):
(JSC::DFG::SpeculativeJIT::nonSpeculativePeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::nonSpeculativeNonPeepholeStrictEq):
(JSC::DFG::SpeculativeJIT::emitCall):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLIntrinsicRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::callCheck):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::jitAssertArgumentCountSane):
(JSC::AssemblyHelpers::jitAssertNoException):
(JSC::AssemblyHelpers::callExceptionFuzz):
(JSC::AssemblyHelpers::emitExceptionCheck):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::jitAssertIsInt32):
(JSC::AssemblyHelpers::jitAssertIsJSInt32):
(JSC::AssemblyHelpers::jitAssertIsNull):
(JSC::AssemblyHelpers::jitAssertTagsInPlace):
(JSC::AssemblyHelpers::jitAssertArgumentCountSane):
(JSC::AssemblyHelpers::jitAssertNoException):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* runtime/VM.h:
(JSC::VM::scratchBufferForSize):
(JSC::VM::exceptionFuzzingBuffer):

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

4 years agoREGRESSION (r188714): RELEASE_ASSERT in JSC::Heap::incrementDeferralDepth() opening...
ggaren@apple.com [Fri, 21 Aug 2015 18:39:27 +0000 (18:39 +0000)]
REGRESSION (r188714): RELEASE_ASSERT in JSC::Heap::incrementDeferralDepth() opening Web Inspector on daringfireball.net
https://bugs.webkit.org/show_bug.cgi?id=148312

Reviewed by Mark Lam.

* debugger/Debugger.cpp:
(JSC::Debugger::recompileAllJSFunctions): Use our vm argument instead of
m_vm because sometimes they are different and m_vm is null. (This behavior
is very strange, and we should probably eliminate it -- but we need a
fix for this serious regression right now.)

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

4 years agodispatch_group_t objects may not be retained properly when not backed by Objective...
ddkilzer@apple.com [Fri, 21 Aug 2015 18:37:29 +0000 (18:37 +0000)]
dispatch_group_t objects may not be retained properly when not backed by Objective-C objects under garbage collection
<http://webkit.org/b/148229>

Reviewed by Eric Carlson.

When compiled with garbage collection enabled, libdispatch
objects are not backed by Objective-C objects, so they don't get
the benefit of automatic reference counting when captured by a
block or a lambda.  To address this, we use OSObjectPtr<> which
always increments the reference count of the contained object.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
Switch to use OSObjectPtr<>.

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

4 years agoWeb Inspector: clean up uses of `new` with zero-argument constructors and factory...
bburg@apple.com [Fri, 21 Aug 2015 18:27:01 +0000 (18:27 +0000)]
Web Inspector: clean up uses of `new` with zero-argument constructors and factory methods
https://bugs.webkit.org/show_bug.cgi?id=148311

Reviewed by Timothy Hatcher.

* UserInterface/Protocol/InspectorFrontendHostStub.js:
* UserInterface/Views/ClusterContentView.js:
(WebInspector.ClusterContentView):
* UserInterface/Views/ColorPicker.js:
(WebInspector.ColorPicker):
* UserInterface/Views/ContentView.js:
(WebInspector.ContentView.createFromRepresentedObject): This was causing a console assertion
when a breakpoint tree element was selected and the inspector tried to restore the view state
after a reload or back/forward navigation.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView):

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

4 years ago[Mac] accessibility/selection-states.html fails
commit-queue@webkit.org [Fri, 21 Aug 2015 18:26:23 +0000 (18:26 +0000)]
[Mac] accessibility/selection-states.html fails
https://bugs.webkit.org/show_bug.cgi?id=116637

Patch by Nan Wang <n_wang@apple.com> on 2015-08-21
Reviewed by Chris Fleizach.

Source/WebCore:

Added accessibilityAttributeValue callback for isMultiSelectable attribute.

Updated expectation for accessibility/selection-states.html on mac.

* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):

Tools:

Implemented isSelectable() and isMultiSelectable().

* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::isSelectable):
(AccessibilityUIElement::isMultiSelectable):
(AccessibilityUIElement::isSelectedOptionActive):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::AccessibilityUIElement::isSelectable):
(WTR::AccessibilityUIElement::isMultiSelectable):
(WTR::AccessibilityUIElement::isVisible):

LayoutTests:

* platform/mac/TestExpectations:

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

4 years agoFix iteration over repositories on bot watcher's dashboard.
ap@apple.com [Fri, 21 Aug 2015 18:10:17 +0000 (18:10 +0000)]
Fix iteration over repositories on bot watcher's dashboard.

Patch by Jason Marcell <jmarcell@apple.com> on 2015-08-21
Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._presentPopoverForPendingCommits): Don't reuse the same index variable.

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

4 years agoFixed status features JSON formatting.
jond@apple.com [Fri, 21 Aug 2015 17:10:36 +0000 (17:10 +0000)]
Fixed status features JSON formatting.

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

4 years agoWeb Inspector: add a regression test for the fix introduced in r188679
bburg@apple.com [Fri, 21 Aug 2015 17:05:59 +0000 (17:05 +0000)]
Web Inspector: add a regression test for the fix introduced in r188679
https://bugs.webkit.org/show_bug.cgi?id=148223

Reviewed by Joseph Pecoraro.

Source/WebInspectorUI:

Turns out that we were possibly leaking a single DOMTree on reload.
Always clear the main frame's DOMTree as well as those of sub-frames.

* UserInterface/Base/Object.js: Add back single-fire listeners.
(WebInspector.Object.singleFireEventListener.let.wrappedCallback):
(WebInspector.Object.singleFireEventListener):
(WebInspector.Object.retainedObjectsWithPrototype):
(WebInspector.Object.prototype.singleFireEventListener):
(WebInspector.Object.prototype.retainedObjectsWithPrototype):
* UserInterface/Models/Frame.js:
(WebInspector.Frame.prototype.removeAllChildFrames): Clear own tree too.

LayoutTests:

Add a regression test to check the number of DOMTree instances that
listen to DOMTreeManager.

* TestExpectations: Don't skip the inspector/dom/ directory.
* http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation-expected.txt: Added.
* http/tests/inspector/dom/disconnect-dom-tree-after-main-frame-navigation.html: Added.
* http/tests/inspector/dom/resources/nested-frame-1-deep.html: Added.
* http/tests/inspector/dom/resources/nested-frame-2-deep.html: Added.
* http/tests/inspector/dom/resources/nested-frame-base.html: Added.

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

4 years agoRegression(r188698): http/tests/cache/disk-cache/disk-cache-revalidation-new-expire...
cdumez@apple.com [Fri, 21 Aug 2015 16:18:52 +0000 (16:18 +0000)]
Regression(r188698): http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html is very flaky
https://bugs.webkit.org/show_bug.cgi?id=148205

Reviewed by Antti Koivisto.

Source/WebKit2:

After r188640, successful revalidation of resources in the memory cache
would cause us to drop the corresponding resource in the disk cache.
This patch addresses the issue by not removing the cache entry if the
response is a successful revalidation (i.e. status code == 304).

Longer term, we should probably update the entry in the disk cache (if
it exists) when it is revalidated by the memory cache. Currently,
revalidation by the memory cache bypasses the disk cache and goes
straight to the network. Then, when the response comes back as a 304,
we try and store the response in the cache. However, a 304 status code
is not cacheable so the cache rejects it.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::store):

LayoutTests:

* http/tests/cache/disk-cache/disk-cache-revalidation-new-expire-header.html:
Drop temporary fix landed in r188698 to make the test less flaky.

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

4 years agoHave more getElementsBy*() methods return a Ref<>
cdumez@apple.com [Fri, 21 Aug 2015 16:05:20 +0000 (16:05 +0000)]
Have more getElementsBy*() methods return a Ref<>
https://bugs.webkit.org/show_bug.cgi?id=148287

Reviewed by Sam Weinig.

Have more getElementsBy*() methods return a Ref<> instaed of a RefPtr<>
as they cannot return null.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByTagName):
(WebCore::ContainerNode::getElementsByTagNameNS):
(WebCore::ContainerNode::getElementsByName):
(WebCore::ContainerNode::getElementsByClassName):
(WebCore::ContainerNode::getElementsByClassNameForObjC):
(WebCore::ContainerNode::radioNodeList):
* dom/ContainerNode.h:

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

4 years agoDrop NodeListBase class
cdumez@apple.com [Fri, 21 Aug 2015 08:28:07 +0000 (08:28 +0000)]
Drop NodeListBase class
https://bugs.webkit.org/show_bug.cgi?id=148290

Reviewed by Ryosuke Niwa.

Drop NodeListBase class and have HTMLCollection subclass NodeList
directly. There is no reason we need another base class.

* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorObjC.pm:
(GetImplClassName): Deleted.
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByClassNameForObjC):
* dom/ContainerNode.h:
* dom/NodeList.h:
* dom/NodeListBase.h: Removed.
* html/HTMLCollection.h:

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

4 years ago[ES6] prototyping module loader in JSC shell
utatane.tea@gmail.com [Fri, 21 Aug 2015 04:59:59 +0000 (04:59 +0000)]
[ES6] prototyping module loader in JSC shell
https://bugs.webkit.org/show_bug.cgi?id=147876

Reviewed by Saam Barati.

Source/JavaScriptCore:

This patch implements ES6 Module Loader part. The implementation is based on
the latest draft[1, 2]. The naive implementation poses several problems.
This patch attempts to solve the spec issues and proposes the fix[3, 4, 5].

We construct the JSC internal module loader based on the ES6 Promises.
The chain of the promises represents the dependency graph of the modules and
it automatically enables asynchronous module fetching.
To leverage the Promises internally, we use the InternalPromise landed in r188681.

The loader has several platform-dependent hooks. The platform can implement
these hooks to provide the functionality missing in the module loaders, like
"how to fetch the resources". The method table of the JSGlobalObject is extended
to accept these hooks from the platform.

This patch focus on the loading part. So we don't create the module environment
and don't link the modules yet.

To test the current module progress easily, we add the `-m` option to the JSC shell.
When this option is specified, we load the given script as the module. And to use
the module loading inside the JSC shell, we added the simple loader hook for fetching.
It fetches the module content from the file system.

And to use the ES6 Map in the Loader implementation, we added @get and @set methods to the Map.
But it conflicts with the existing `getPrivateName` method. Rename it to `lookUpPrivateName`.

[1]: https://whatwg.github.io/loader/
[2]: https://github.com/whatwg/loader/commit/214c7a6625b445bdf411c39984f36f01139a24be
[3]: https://github.com/whatwg/loader/pull/66
[4]: https://github.com/whatwg/loader/pull/67
[5]: https://github.com/whatwg/loader/issues/68
[6]: https://bugs.webkit.org/show_bug.cgi?id=148136

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::lookUpPrivateName):
(JSC::BuiltinNames::lookUpPublicName):
(JSC::BuiltinNames::getPrivateName): Deleted.
(JSC::BuiltinNames::getPublicName): Deleted.
* builtins/ModuleLoaderObject.js: Added.
(setStateToMax):
(newRegistryEntry):
(forceFulfillPromise):
(fulfillFetch):
(fulfillTranslate):
(fulfillInstantiate):
(instantiation):
(requestFetch):
(requestTranslate):
(requestInstantiate):
(requestResolveDependencies.resolveDependenciesPromise.this.requestInstantiate.then.):
(requestResolveDependencies.resolveDependenciesPromise.this.requestInstantiate.then):
(requestResolveDependencies):
(requestInstantiateAll):
(provide):
* jsc.cpp:
(stringFromUTF):
(jscSource):
(GlobalObject::moduleLoaderFetch):
(functionCheckModuleSyntax):
(dumpException):
(runWithScripts):
(printUsageStatement):
(CommandLine::parseArguments):
(jscmain):
(CommandLine::CommandLine): Deleted.
* parser/Lexer.cpp:
(JSC::Lexer<LChar>::parseIdentifier):
(JSC::Lexer<UChar>::parseIdentifier):
* parser/ModuleAnalyzer.cpp:
(JSC::ModuleAnalyzer::ModuleAnalyzer):
(JSC::ModuleAnalyzer::exportVariable):
(JSC::ModuleAnalyzer::analyze):
* parser/ModuleAnalyzer.h:
(JSC::ModuleAnalyzer::moduleRecord):
* parser/ModuleRecord.cpp:
(JSC::printableName): Deleted.
(JSC::ModuleRecord::dump): Deleted.
* parser/ModuleRecord.h:
(JSC::ModuleRecord::ImportEntry::isNamespace): Deleted.
(JSC::ModuleRecord::create): Deleted.
(JSC::ModuleRecord::appendRequestedModule): Deleted.
(JSC::ModuleRecord::addImportEntry): Deleted.
(JSC::ModuleRecord::addExportEntry): Deleted.
(JSC::ModuleRecord::addStarExportEntry): Deleted.
* parser/Nodes.h:
* parser/NodesAnalyzeModule.cpp:
(JSC::ImportDeclarationNode::analyzeModule):
(JSC::ExportAllDeclarationNode::analyzeModule):
(JSC::ExportNamedDeclarationNode::analyzeModule):
* runtime/CommonIdentifiers.cpp:
(JSC::CommonIdentifiers::lookUpPrivateName):
(JSC::CommonIdentifiers::lookUpPublicName):
(JSC::CommonIdentifiers::getPrivateName): Deleted.
(JSC::CommonIdentifiers::getPublicName): Deleted.
* runtime/CommonIdentifiers.h:
* runtime/Completion.cpp:
(JSC::checkModuleSyntax):
(JSC::evaluateModule):
* runtime/Completion.h:
* runtime/ExceptionHelpers.cpp:
(JSC::createUndefinedVariableError):
* runtime/Identifier.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::moduleLoader):
(JSC::JSGlobalObject::moduleRecordStructure):
* runtime/JSModuleRecord.cpp: Renamed from Source/JavaScriptCore/parser/ModuleRecord.cpp.
(JSC::JSModuleRecord::destroy):
(JSC::JSModuleRecord::finishCreation):
(JSC::printableName):
(JSC::JSModuleRecord::dump):
* runtime/JSModuleRecord.h: Renamed from Source/JavaScriptCore/parser/ModuleRecord.h.
(JSC::JSModuleRecord::ImportEntry::isNamespace):
(JSC::JSModuleRecord::createStructure):
(JSC::JSModuleRecord::create):
(JSC::JSModuleRecord::requestedModules):
(JSC::JSModuleRecord::JSModuleRecord):
(JSC::JSModuleRecord::appendRequestedModule):
(JSC::JSModuleRecord::addImportEntry):
(JSC::JSModuleRecord::addExportEntry):
(JSC::JSModuleRecord::addStarExportEntry):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/ModuleLoaderObject.cpp: Added.
(JSC::ModuleLoaderObject::ModuleLoaderObject):
(JSC::ModuleLoaderObject::finishCreation):
(JSC::ModuleLoaderObject::getOwnPropertySlot):
(JSC::printableModuleKey):
(JSC::ModuleLoaderObject::provide):
(JSC::ModuleLoaderObject::requestInstantiateAll):
(JSC::ModuleLoaderObject::resolve):
(JSC::ModuleLoaderObject::fetch):
(JSC::ModuleLoaderObject::translate):
(JSC::ModuleLoaderObject::instantiate):
(JSC::moduleLoaderObjectParseModule):
(JSC::moduleLoaderObjectRequestedModules):
(JSC::moduleLoaderObjectResolve):
(JSC::moduleLoaderObjectFetch):
(JSC::moduleLoaderObjectTranslate):
(JSC::moduleLoaderObjectInstantiate):
* runtime/ModuleLoaderObject.h: Added.
(JSC::ModuleLoaderObject::create):
(JSC::ModuleLoaderObject::createStructure):
* runtime/Options.h:

Source/WebCore:

Just fill Loader hooks with nullptr.

* bindings/js/JSDOMWindowBase.cpp:
* bindings/js/JSWorkerGlobalScopeBase.cpp:

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

4 years ago[EFL] Revise PlatformWebView ctor according to r188718
gyuyoung.kim@webkit.org [Fri, 21 Aug 2015 04:30:47 +0000 (04:30 +0000)]
[EFL] Revise PlatformWebView ctor according to r188718
https://bugs.webkit.org/show_bug.cgi?id=148282

Source/WebKit2:

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-08-20
Reviewed by Gyuyoung Kim.

* PlatformEfl.cmake:

Tools:

This patch change PlatformWebView ctor's argument to use WKPageConfigurationRef
instead of WKContextRef and WKPageGroupRef respectively.

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-08-20
Reviewed by Gyuyoung Kim.

* WebKitTestRunner/efl/PlatformWebViewEfl.cpp:
(WTR::PlatformWebView::PlatformWebView):

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

4 years agoWeb Inspector: Better Remember open tab types and order if using JSContext inspector
commit-queue@webkit.org [Fri, 21 Aug 2015 04:22:32 +0000 (04:22 +0000)]
Web Inspector: Better Remember open tab types and order if using JSContext inspector
https://bugs.webkit.org/show_bug.cgi?id=148285

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-20
Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
(WebInspector.contentLoaded):
(WebInspector.activateExtraDomains):
Save and restore extra domain related tabs at the expected saved index.

(WebInspector._rememberOpenTabs):
Keep unsupported tab types in the setting so when they are supported they open.

* UserInterface/Base/Utilities.js:
Add a helper for inserting a single object into an array.

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

4 years agoWeb Inspector: inline errors/warnings are taller than the line height
nvasilyev@apple.com [Fri, 21 Aug 2015 04:19:53 +0000 (04:19 +0000)]
Web Inspector: inline errors/warnings are taller than the line height
https://bugs.webkit.org/show_bug.cgi?id=148232

Reviewed by Timothy Hatcher.

* UserInterface/Views/SourceCodeTextEditor.css:
(.source-code.text-editor > .CodeMirror .issue-widget.inline):
(.source-code.text-editor > .CodeMirror .issue-widget.inline > .text):

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

4 years agoJSContext Inspector: Uncaught Exception opening Search Tab
commit-queue@webkit.org [Fri, 21 Aug 2015 04:18:43 +0000 (04:18 +0000)]
JSContext Inspector: Uncaught Exception opening Search Tab
https://bugs.webkit.org/show_bug.cgi?id=148284

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-08-20
Reviewed by Timothy Hatcher.

* UserInterface/Views/SearchSidebarPanel.js:
(WebInspector.SearchSidebarPanel):
This is copied / pasted code that shouldn't apply to the Search tab.
We want to show results under Resources in the Search tab.

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

4 years agoDFG should have a KnownBooleanUse for cases where we are required to know that the...
fpizlo@apple.com [Fri, 21 Aug 2015 03:59:33 +0000 (03:59 +0000)]
DFG should have a KnownBooleanUse for cases where we are required to know that the child is a boolean and it's not OK to speculate
https://bugs.webkit.org/show_bug.cgi?id=148286

Reviewed by Benjamin Poulain.

This enables us to ensure that the Branch or LogicalNot after an effectful CompareXYZ can
be marked as !mayExit(). I need that for https://bugs.webkit.org/show_bug.cgi?id=145204.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::observeUseKindOnNode):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::SafeToExecuteEdge::operator()):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::speculate):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculateBooleanOperand::SpeculateBooleanOperand):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compileLogicalNot):
(JSC::DFG::SpeculativeJIT::emitBranch):
* dfg/DFGUseKind.cpp:
(WTF::printInternal):
* dfg/DFGUseKind.h:
(JSC::DFG::typeFilterFor):
(JSC::DFG::shouldNotHaveTypeCheck):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::boolify):
(JSC::FTL::DFG::LowerDFGToLLVM::lowBoolean):

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

4 years agoAX: fix accessibility/loading-iframe-updates-axtree.html test for mac
commit-queue@webkit.org [Fri, 21 Aug 2015 03:12:25 +0000 (03:12 +0000)]
AX: fix accessibility/loading-iframe-updates-axtree.html test for mac
https://bugs.webkit.org/show_bug.cgi?id=148251

Patch by Nan Wang <n_wang@apple.com> on 2015-08-20
Reviewed by Chris Fleizach.

Added a container in order to make the frame accessible. Also, added expected results for
both WK1 and WK2.

* accessibility/loading-iframe-updates-axtree-expected.txt:
* accessibility/loading-iframe-updates-axtree.html:
* platform/mac-wk1/accessibility: Added.
* platform/mac-wk1/accessibility/loading-iframe-updates-axtree-expected.txt: Added.
* platform/mac/TestExpectations:

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

4 years agoFix passing null / undefined as NodeFilter parameter for createNodeIterator() / creat...
cdumez@apple.com [Fri, 21 Aug 2015 03:05:02 +0000 (03:05 +0000)]
Fix passing null / undefined as NodeFilter parameter for createNodeIterator() / createTreeWalker()
https://bugs.webkit.org/show_bug.cgi?id=148257

Reviewed by Darin Adler.

Source/WebCore:

Fix passing null / undefined as NodeFilter parameter for createNodeIterator() / createTreeWalker().
It is supposed to be translated into a *null* NodeFilter. However, WebKit was constructing a
NodeFilter in this case.

Chrome and Firefox do not create a NodeFilter in this case.

No new tests, already covered by:
fast/dom/createNodeIterator-parameters.html
fast/dom/createTreeWalker-parameters.html

* bindings/js/JSNodeFilterCustom.cpp:
(WebCore::JSNodeFilter::toWrapped):

LayoutTests:

Rebaseline tests. We are now passing more of the checks.

* fast/dom/createNodeIterator-parameters-expected.txt:
* fast/dom/createTreeWalker-parameters-expected.txt:

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

4 years agoMake outline: auto repaint rect inflate more explicit.
zalan@apple.com [Fri, 21 Aug 2015 02:57:32 +0000 (02:57 +0000)]
Make outline: auto repaint rect inflate more explicit.
https://bugs.webkit.org/show_bug.cgi?id=148263

Reviewed by Simon Fraser.

Use RenderObject::adjustRectWithMaximumOutline() when inflating is conditional and call
RenderView::maximalOutlineSize() when it is not.
After this changeset, we can clearly tell calls when inflating is unconditional (adjusting the size of the compositing layer) apart from
calls when we just simply inflate the repaint rect during outline painting phase.

No change in behaviour.

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paint):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paint):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::layoutBlock):
* rendering/RenderDetailsMarker.cpp:
(WebCore::RenderDetailsMarker::paint):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::computeMaxOutlineSize):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLineBoxList.cpp:
(WebCore::isOutlinePhase):
(WebCore::RenderLineBoxList::lineIntersectsDirtyRect):
(WebCore::RenderLineBoxList::paint):
* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::paint):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::adjustRectWithMaximumOutline):
(WebCore::RenderObject::maximalOutlineSize): Deleted.
* rendering/RenderObject.h:
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::overflowRectForFlowThreadPortion):
* rendering/RenderReplaced.cpp:
(WebCore::RenderReplaced::shouldPaint):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paint):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintCollapsedBorders):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::paintObject):
* rendering/RenderView.cpp:
(WebCore::RenderView::setMaximalOutlineSize):
(WebCore::RenderView::RenderView): Deleted.
* rendering/RenderView.h:

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

4 years ago[OS X] Cleaup after r188591
mmaxfield@apple.com [Fri, 21 Aug 2015 02:54:27 +0000 (02:54 +0000)]
[OS X] Cleaup after r188591
https://bugs.webkit.org/show_bug.cgi?id=148219

Unreviewed.

Forgot to update a call site of FontPlatformData().

* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::systemFallbackForCharacters):

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

4 years agoBuild fix after r188716.
achristensen@apple.com [Fri, 21 Aug 2015 02:51:33 +0000 (02:51 +0000)]
Build fix after r188716.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
Add some scope so we can declare a variable (weakPtr) inside a switch statement.

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

4 years agoBuild fix after r188716.
achristensen@apple.com [Fri, 21 Aug 2015 02:41:52 +0000 (02:41 +0000)]
Build fix after r188716.

* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
(WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
Replace m_weakFactory with m_weakPtrFactory which actually exists.

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

4 years agoGTK build fix after r188693.
achristensen@apple.com [Fri, 21 Aug 2015 02:35:35 +0000 (02:35 +0000)]
GTK build fix after r188693.

* UIProcess/API/gtk/PageClientImpl.h:
Delete mediaDocumentNaturalSizeChanged which could be renamed to imageOrMediaDocumentSizeChanged,
but there's no reason to have an empty function overriding another virtual function that is also empty.

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

4 years agoWeb Inspector: Truncate data URIs
nvasilyev@apple.com [Fri, 21 Aug 2015 02:34:34 +0000 (02:34 +0000)]
Web Inspector: Truncate data URIs
https://bugs.webkit.org/show_bug.cgi?id=148212

Reviewed by Timothy Hatcher.

* UserInterface/Base/URLUtilities.js:
(parseURL):
Exit early to avoid an expensive RegExp match on a potentially very large data URI.

(parseQueryString):
Fix typo.

(WebInspector.displayNameForURL):
(WebInspector.truncateURL):
By default, only show first and last 3 characters of data URIs.

* UserInterface/Models/Resource.js:
(WebInspector.Resource.prototype.get displayURL):
For tooltips, show first and last 32 characters of data URIs.

* UserInterface/Models/SourceCodeLocation.js:
(WebInspector.SourceCodeLocation.prototype._locationString):
* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype._updateToolTip):

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

4 years ago[EFL] Fix build error since r188693
commit-queue@webkit.org [Fri, 21 Aug 2015 02:30:06 +0000 (02:30 +0000)]
[EFL] Fix build error since r188693
https://bugs.webkit.org/show_bug.cgi?id=148279

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-08-20
Reviewed by Gyuyoung Kim.

* UIProcess/efl/WebViewEfl.h:

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

4 years agoSource/WebCore:
mmaxfield@apple.com [Fri, 21 Aug 2015 02:12:01 +0000 (02:12 +0000)]
Source/WebCore:
[iOS] Adopt OS X's emoji behavior.
https://bugs.webkit.org/show_bug.cgi?id=148265

Reviewed by Simon Fraser.

Remove our hardcoded hacks which limit the sizes of emoji. This is how
OS X behaves with emoji.

Test: fast/text/emoji.html

* platform/graphics/FontPlatformData.h:
(WebCore::FontPlatformData::hash):
(WebCore::FontPlatformData::isEmoji): Deleted.
(WebCore::FontPlatformData::setIsEmoji): Deleted.
* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::FontCascade::drawGlyphs):
(WebCore::isOnOrAfterIOS6): Deleted.
(WebCore::pointAdjustedForEmoji): Deleted.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::canUseFastGlyphAdvanceGetter):
(WebCore::Font::platformInit): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::ctFont):
(WebCore::FontPlatformData::platformDataInit): Deleted.
(WebCore::FontPlatformData::platformDataAssign): Deleted.
(WebCore::FontPlatformData::platformIsEqual): Deleted.
(WebCore::FontPlatformData::ctFontSize): Deleted.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getSystemFontFallbackForCharacters): Deleted.
(WebCore::FontCache::createFontPlatformData): Deleted.
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::ComplexTextController::adjustGlyphsAndAdvances): Deleted.

LayoutTests:
[iOS] Adopt OS X's emoji behavior
https://bugs.webkit.org/show_bug.cgi?id=148265

Reviewed by Simon Fraser.

* platform/ios-simulator/fast/text/emoji-expected.txt:

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

4 years agoCheck in Mavericks LLVM drops built from the LLVM 3.6.2 open source release.
lforschler@apple.com [Fri, 21 Aug 2015 02:10:46 +0000 (02:10 +0000)]
Check in Mavericks LLVM drops built from the LLVM 3.6.2 open source release.

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

4 years agogetElementsByClassName() should return an HTMLCollection
cdumez@apple.com [Fri, 21 Aug 2015 02:10:29 +0000 (02:10 +0000)]
getElementsByClassName() should return an HTMLCollection
https://bugs.webkit.org/show_bug.cgi?id=147980

Reviewed by Darin Adler.

Source/WebCore:

Update Document.getElementsByClassName() and Element.getElementsByClassName()
to return an HTMLCollection instead of a NodeList, as per the specification:
- https://dom.spec.whatwg.org/#interface-document
- https://dom.spec.whatwg.org/#interface-element

This behavior is also consistent with other major browsers. Due to this and
the fact that NodeList / HTMLCollection pretty much the same API, the
compatibility risk should be fairly low.

I also verified that the performance is the same according to the following
performance test:
PerformanceTests/DOM/get-elements-by-class-name-traversal-uncached.html

Tests: fast/dom/getElementsByClassName/dumpHTMLCollection.html
       fast/dom/getElementsByClassName/return-type.html

* CMakeLists.txt:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.xcodeproj/project.pbxproj:
Rename ClassNodeList.cpp file.

* bindings/scripts/CodeGeneratorObjC.pm:
(GetImplClassName):
Indicate that NodeList is implemented as NodeListBase. This is
needed so that DOMNodeList can have either an HTMLCollection or
a NodeList as internal representation. NodeListBase is a new
common base class for HTMLCollection and NodeList.

* dom/ClassCollection.cpp: Renamed from Source/WebCore/dom/ClassNodeList.cpp.
(WebCore::ClassCollection::create):
(WebCore::ClassCollection::~ClassCollection):
* dom/ClassCollection.h: Renamed from Source/WebCore/dom/ClassNodeList.h.
(WebCore::ClassCollection::ClassCollection):
(WebCore::ClassCollection::elementMatches):
Rename ClassNodeList to ClassCollection and have it subclass
CachedHTMLCollection instead of ClassNodeList.

* dom/ContainerNode.cpp:
(WebCore::ContainerNode::getElementsByClassName):
Have getElementsByClassName return an HTMLCollection instead of a
NodeList.

(WebCore::ContainerNode::getElementsByClassNameForObjC):
New method returns a NodeListBase for ObjC bindings, so they can
convert the return value into a DOMNodeList. We need this to not
break ObjC API compatibility.

* dom/Document.idl:
* dom/Element.idl:
Have getElementsByClassName return an HTMLCollection instead of a
NodeList, except for ObjC bindings.

* dom/NodeList.h:
Have NodeList subclass NodeListBase.

* dom/NodeListBase.h: Added.
New common base interface for HTMLCollection and NodeList. This is
so that the internal representation for ObjC's DOMNodeList can be
a NodeListBase instead of a NodeList. This way, the ObjC API can
keep returning a DOMNodeList, even though our implementation now
returns an HTMLCollection instead of a NodeList.

* dom/NodeRareData.h:
(WebCore::NodeListTypeIdentifier<NameNodeList>::value):
(WebCore::NodeListTypeIdentifier<TagNodeList>::value):
(WebCore::NodeListTypeIdentifier<HTMLTagNodeList>::value):
(WebCore::NodeListTypeIdentifier<RadioNodeList>::value):
(WebCore::NodeListTypeIdentifier<LabelsNodeList>::value):
Drop ClassNodeList from the NodeListTypeIndentifiers.

* html/CollectionType.h:
Add new ByClass CollectionType for ClassCollection.

* html/GenericCachedHTMLCollection.cpp:
(WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
Handle new ByClass CollectionType in the switch statement.

* html/HTMLCollection.cpp:
(WebCore::invalidationTypeExcludingIdAndNameAttributes):
(WebCore::HTMLCollection::~HTMLCollection):
Add support for new ByClass Collection type.

* html/HTMLCollection.h:
Have HTMLCollection subclass the NodeListBase interface.

LayoutTests:

* fast/dom/getElementsByClassName/dumpHTMLCollection-expected.txt: Renamed from LayoutTests/fast/dom/getElementsByClassName/dumpNodeList-expected.txt.
* fast/dom/getElementsByClassName/dumpHTMLCollection.html: Renamed from LayoutTests/fast/dom/getElementsByClassName/dumpNodeList.html.
Rename test now that getElementsByClassName returns an HTMLCollection
and update the test to update the HTMLCollection prototype instead
of the NodeList one.

* fast/dom/getElementsByClassName/return-type-expected.txt: Added.
* fast/dom/getElementsByClassName/return-type.html: Added.
New test that checks that getElementsByClassName() returns an
HTMLCollection.

* inspector/model/remote-object-expected.txt:
Rebaseline.

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

4 years agoFix the iOS build after r188726
mmaxfield@apple.com [Fri, 21 Aug 2015 01:46:36 +0000 (01:46 +0000)]
Fix the iOS build after r188726
https://bugs.webkit.org/show_bug.cgi?id=148278

Unreviewed.

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::systemFallbackForCharacters):

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

4 years agoWeb Inspector: Add flex alignment section to Visual sidebar
drousso@apple.com [Fri, 21 Aug 2015 01:42:21 +0000 (01:42 +0000)]
Web Inspector: Add flex alignment section to Visual sidebar
https://bugs.webkit.org/show_bug.cgi?id=148243

Reviewed by Timothy Hatcher.

Uses select keyword pickers to contain the list of possible values.  Also supports
the upcoming Grid layout keywords in the advanced keyword list.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/VisualStyleDetailsPanel.js:
(WebInspector.VisualStyleDetailsPanel):
(WebInspector.VisualStyleDetailsPanel.prototype._populateFlexboxSection):
(WebInspector.VisualStyleDetailsPanel.prototype._populateAlignmentSection):

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

4 years agoWeb Inspector: Labels in the computed panel are shifted when a filter is applieds
drousso@apple.com [Fri, 21 Aug 2015 01:40:56 +0000 (01:40 +0000)]
Web Inspector: Labels in the computed panel are shifted when a filter is applieds
https://bugs.webkit.org/show_bug.cgi?id=148250

Reviewed by Timothy Hatcher.

Added to the selectors for filtering to ensure they only apply to the rules panel.

* UserInterface/Views/RulesStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label):
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label:not(.filter-section-non-matching) ~ .label):
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label.filter-matching-label):
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label:not(.filter-section-non-matching) + .label.filter-matching-label:not(.filter-section-non-matching)):
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .new-rule):
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .style-declaration-section:not(.filter-section-non-matching) ~ .label:not(.filter-section-non-matching)):
(@media (-webkit-min-device-pixel-ratio: 2)):
(.sidebar > .panel.details.css-style > .content.filter-in-progress .label): Deleted.
(.sidebar > .panel.details.css-style > .content.filter-in-progress .label:not(.filter-section-non-matching) ~ .label): Deleted.
(.sidebar > .panel.details.css-style > .content.filter-in-progress .label.filter-matching-label): Deleted.
(.sidebar > .panel.details.css-style > .content.filter-in-progress .label:not(.filter-section-non-matching) + .label.filter-matching-label:not(.filter-section-non-matching)): Deleted.
(.sidebar > .panel.details.css-style > .content.filter-in-progress .new-rule): Deleted.
(.sidebar > .panel.details.css-style > .content.filter-in-progress .style-declaration-section:not(.filter-section-non-matching) ~ .label:not(.filter-section-non-matching)): Deleted.

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

4 years agoWeb Inspector: Fix "attempted to assign to readonly property" in Visual editor links
drousso@apple.com [Fri, 21 Aug 2015 01:38:56 +0000 (01:38 +0000)]
Web Inspector: Fix "attempted to assign to readonly property" in Visual editor links
https://bugs.webkit.org/show_bug.cgi?id=148264

Reviewed by Timothy Hatcher.

* UserInterface/Views/VisualStylePropertyEditorLink.js:
(WebInspector.VisualStylePropertyEditorLink.prototype.set linked):
No longer attempts to set the "hidden" attribute of the link icons before they exist.

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

4 years agoWeb Inspector: Visual editor adds extra spaces to styles with no properties
drousso@apple.com [Fri, 21 Aug 2015 01:37:40 +0000 (01:37 +0000)]
Web Inspector: Visual editor adds extra spaces to styles with no properties
https://bugs.webkit.org/show_bug.cgi?id=148242

Reviewed by Timothy Hatcher.

* UserInterface/Models/CSSStyleDeclaration.js:
(WebInspector.CSSStyleDeclaration.prototype.set text):
Now trims the text and, if the resulting string has no length or the style is inline,
replaces the text to be set with the trimmed text.

* UserInterface/Views/VisualStylePropertyCombiner.js:
(WebInspector.VisualStylePropertyCombiner.prototype.modifyPropertyText):
Removed unnecessary trim.

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

4 years agoCleanup after r188726
mmaxfield@apple.com [Fri, 21 Aug 2015 01:36:18 +0000 (01:36 +0000)]
Cleanup after r188726

Unreviewed.

No new tests because there is no behavior change.

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::systemFallbackForCharacters):

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

4 years agoWeb Inspector: Font size between computed and set value is off in visual styles popups
drousso@apple.com [Fri, 21 Aug 2015 01:35:32 +0000 (01:35 +0000)]
Web Inspector: Font size between computed and set value is off in visual styles popups
https://bugs.webkit.org/show_bug.cgi?id=148226

Reviewed by Timothy Hatcher.

* UserInterface/Views/VisualStylePropertyEditor.css:
(.visual-style-property-container > .visual-style-property-value-container > .visual-style-special-property-placeholder):
Increased font-size to match the font-size of the overlaid select element.

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