WebKit-https.git
5 years agoChanges method of quitting iOS Simulator to be more correct.
jacob_nielsen@apple.com [Fri, 17 Apr 2015 01:28:45 +0000 (01:28 +0000)]
Changes method of quitting iOS Simulator to be more correct.
https://bugs.webkit.org/show_bug.cgi?id=143847
<rdar://problem/20530344>

Reviewed by Darin Adler.

Fixes by addressing the app by ID rather than by name.

* Scripts/webkitdirs.pm:
(quitIOSSimulator):
* Scripts/webkitpy/port/ios.py:
(IOSSimulatorPort.check_sys_deps):

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

5 years agoUse UNUSED_PARAM instead of the void casting to suppress unused parameter warnings.
commit-queue@webkit.org [Fri, 17 Apr 2015 01:25:08 +0000 (01:25 +0000)]
Use UNUSED_PARAM instead of the void casting to suppress unused parameter warnings.
https://bugs.webkit.org/show_bug.cgi?id=143750

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-04-16
Reviewed by Darin Adler.

No new tests, no behavior change.

* WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
(WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):

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

5 years agoUse less memory when compiling content extensions
achristensen@apple.com [Fri, 17 Apr 2015 01:12:51 +0000 (01:12 +0000)]
Use less memory when compiling content extensions
https://bugs.webkit.org/show_bug.cgi?id=143857

Reviewed by Benjamin Poulain.

When compiling a content extension, we convert the rule list into several intermediate forms:

1) A String.
2) A JSValue from JSONParse in loadEncodedRules.
3) A Vector of ContentExtensionRules.
4) A CombinedURLFilters object representing the pieces of the regular expressions from the triggers.
5) A Vector of NFAs.
6) A DFA for each NFA.
7) A Vector of DFABytecode.

Each one of these contains all the information contained in the content extension,
so we do not need to keep them all in memory at the same time like we are doing now.
When we are done with one, we can free that memory to greatly reduce the maximum memory usage while compiling.
The next step will be to reduce the copies of the original JSON String and to generate NFAs one at a time.

* contentextensions/CombinedURLFilters.cpp:
(WebCore::ContentExtensions::CombinedURLFilters::clear):
* contentextensions/CombinedURLFilters.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
Clear structures when finished using them.

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

5 years agoGardening: fix CLOOP build after r182927.
mark.lam@apple.com [Fri, 17 Apr 2015 01:03:55 +0000 (01:03 +0000)]
Gardening: fix CLOOP build after r182927.

Not reviewed.

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::print):

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

5 years agoWeb Inspector: Should include "Log Value" context menu item in Preview and Collapsed...
joepeck@webkit.org [Fri, 17 Apr 2015 01:00:21 +0000 (01:00 +0000)]
Web Inspector: Should include "Log Value" context menu item in Preview and Collapsed ObjectTree
https://bugs.webkit.org/show_bug.cgi?id=143845

Reviewed by Timothy Hatcher.

Give previews the same "Log Value" context menu so that if you just log
a bunch of objects to the console you can quickly turn that entire object
into a $n reference in the console to interact with.

* UserInterface/Views/ObjectPreviewView.js:
(WebInspector.ObjectPreviewView.prototype.setOriginatingObjectInfo):
(WebInspector.ObjectPreviewView.prototype._contextMenuHandler):
Provide API to refer to a RemoteObject and optional PropertyPath
that can be used to give the preview a "Log Value" context menu.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._appendFormattedArguments):
Include the RemoteObject without a path for a preview context menu.

* UserInterface/Views/ObjectTreeView.js:
(WebInspector.ObjectTreeView):
Include the RemoteObject with a path if we knew it for a preview context menu.

* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype.createGetterElement):
The context menu can never be empty, since we always added at least one item above.

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

5 years agoCompiling a content extension fails when user's home directory is on a different...
beidson@apple.com [Fri, 17 Apr 2015 00:53:19 +0000 (00:53 +0000)]
Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
https://bugs.webkit.org/show_bug.cgi?id=143834

Reviewed by Anders Carlsson.

Source/WebCore:

- Add moveFile() for a WK2 call site to use.
- Remove renameFile() as it is now dead code.

* platform/FileSystem.h:

* platform/gtk/FileSystemGtk.cpp:
(WebCore::renameFile): Deleted.

* platform/mac/FileSystemMac.mm:
(WebCore::moveFile):

* platform/posix/FileSystemPOSIX.cpp:
(WebCore::renameFile): Deleted.

* platform/win/FileSystemWin.cpp:
(WebCore::renameFile): Deleted.

Source/WebKit2:

* UIProcess/API/APIUserContentExtensionStore.cpp:
(API::compiledToFile): Use moveFile() instead of renameFile()

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

5 years agoRebaseline mouse-cursor-image-set results after r182869
timothy_horton@apple.com [Fri, 17 Apr 2015 00:49:11 +0000 (00:49 +0000)]
Rebaseline mouse-cursor-image-set results after r182869

* fast/events/mouse-cursor-image-set-expected.txt:
* platform/win/fast/events/mouse-cursor-image-set-expected.txt:
* platform/mac/TestExpectations:
Un-skip and land new results.

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

5 years agoDeprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore
andersca@apple.com [Fri, 17 Apr 2015 00:46:07 +0000 (00:46 +0000)]
Deprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore
https://bugs.webkit.org/show_bug.cgi?id=143844

Reviewed by Dan Bernstein.

Source/WebKit2:

* Shared/API/Cocoa/WKFoundation.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _validate]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
* mac/postprocess-framework-headers.sh:

Tools:

* MiniBrowser/mac/AppDelegate.m:
(-[BrowserAppDelegate newPrivateWindow:]):
* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController initWithConfiguration:]):
(-[WK2BrowserWindowController fetchWebsiteData:]):
(-[WK2BrowserWindowController fetchAndClearWebsiteData:]):
(-[WK2BrowserWindowController clearWebsiteData:]):

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

5 years agoInline JSFunction allocation in FTL
commit-queue@webkit.org [Fri, 17 Apr 2015 00:44:58 +0000 (00:44 +0000)]
Inline JSFunction allocation in FTL
https://bugs.webkit.org/show_bug.cgi?id=143851

Patch by Basile Clement <basile_clement@apple.com> on 2015-04-16
Reviewed by Filip Pizlo.

JSFunction allocation is a simple operation that should be inlined when possible.

* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::LowerDFGToLLVM::compileNewFunction):
* runtime/JSFunction.h:
(JSC::JSFunction::allocationSize):

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

5 years agoExpose JavaScriptMarkupEnabled preference for WebKit1
weinig@apple.com [Fri, 17 Apr 2015 00:28:20 +0000 (00:28 +0000)]
Expose JavaScriptMarkupEnabled preference for WebKit1
<rdar://problem/19939450>
https://bugs.webkit.org/show_bug.cgi?id=143855

Reviewed by Dan Bernstein.

* WebView/WebPreferenceKeysPrivate.h:
Add new key, WebKitJavaScriptMarkupEnabledPreferenceKey

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
Initialize WebKitJavaScriptMarkupEnabledPreferenceKey to YES.

(-[WebPreferences isJavaScriptMarkupEnabled]):
(-[WebPreferences setJavaScriptMarkupEnabled:]):
Implement getter/setter.

* WebView/WebPreferencesPrivate.h:
Add new property, javaScriptMarkupEnabled.

* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):
Map the new preference to WebCore's scriptMarkupEnabled setting.

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

5 years agoAdd $vm debugging tool.
mark.lam@apple.com [Fri, 17 Apr 2015 00:25:14 +0000 (00:25 +0000)]
Add $vm debugging tool.
https://bugs.webkit.org/show_bug.cgi?id=143809

Reviewed by Geoffrey Garen.

For debugging VM bugs, it would be useful to be able to dump VM data structures
from JS code that we instrument.  To this end, let's introduce a
JS_enableDollarVM option that, if true, installs an $vm property into each JS
global object at creation time.  The $vm property refers to an object that
provides a collection of useful utility functions.  For this initial
implementation, $vm will have the following:

    crash() - trigger an intentional crash.

    dfgTrue() - returns true if the current function is DFG compiled, else returns false.
    jitTrue() - returns true if the current function is compiled by the baseline JIT, else returns false.
    llintTrue() - returns true if the current function is interpreted by the LLINT, else returns false.

    gc() - runs a full GC.
    edenGC() - runs an eden GC.

    codeBlockForFrame(frameNumber) - gets the codeBlock at the specified frame (0 = current, 1 = caller, etc).
    printSourceFor(codeBlock) - prints the source code for the codeBlock.
    printByteCodeFor(codeBlock) - prints the bytecode for the codeBlock.

    print(str) - prints a string to dataLog output.
    printCallFrame() - prints the current CallFrame.
    printStack() - prints the JS stack.
    printInternal(value) - prints the JSC internal info for the specified value.

With JS_enableDollarVM=true, JS code can use the above functions like so:

    $vm.print("Using $vm features\n");

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::printCallOp):
- FTL compiled functions don't like it when we try to compute the CallLinkStatus.
  Hence, we skip this step if we're dumping an FTL codeBlock.

* heap/Heap.cpp:
(JSC::Heap::collectAndSweep):
(JSC::Heap::collectAllGarbage): Deleted.
* heap/Heap.h:
(JSC::Heap::collectAllGarbage):
- Add ability to do an Eden collection and sweep.

* interpreter/StackVisitor.cpp:
(JSC::printIndents):
(JSC::log):
(JSC::logF):
(JSC::StackVisitor::Frame::print):
(JSC::jitTypeName): Deleted.
(JSC::printif): Deleted.
- Modernize the implementation of StackVisitor::Frame::print(), and remove some
  now redundant code.
- Also fix it so that it downgrades gracefully when encountering inlined DFG
  and compiled FTL functions.

(DebugPrintFrameFunctor::DebugPrintFrameFunctor): Deleted.
(DebugPrintFrameFunctor::operator()): Deleted.
(debugPrintCallFrame): Deleted.
(debugPrintStack): Deleted.
- these have been moved into JSDollarVMPrototype.cpp.

* interpreter/StackVisitor.h:
- StackVisitor::Frame::print() is now enabled for release builds as well so that
  we can call it from $vm.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
- Added the $vm instance to global objects conditional on the JSC_enableDollarVM
  option.

* runtime/Options.h:
- Added the JSC_enableDollarVM option.

* tools/JSDollarVM.cpp: Added.
* tools/JSDollarVM.h: Added.
(JSC::JSDollarVM::createStructure):
(JSC::JSDollarVM::create):
(JSC::JSDollarVM::JSDollarVM):

* tools/JSDollarVMPrototype.cpp: Added.
- This file contains 2 sets of functions:

  a. a C++ implementation of debugging utility functions that are callable when
     doing debugging from lldb.  To the extent possible, these functions try to
     be cautious and not cause unintended crashes should the user call them with
     the wrong info.  Hence, they are designed to be robust rather than speedy.

  b. the native implementations of JS functions in the $vm object.  Where there
     is overlapping functionality, these are built on top of the C++ functions
     above to do the work.

  Note: it does not make sense for all of the $vm functions to have a C++
  counterpart for lldb debugging.  For example, the $vm.dfgTrue() function is
  only useful for JS code, and works via the DFG intrinsics mechanism.
  When doing debugging via lldb, the optimization level of the currently
  executing JS function can be gotten by dumping the current CallFrame instead.

(JSC::currentThreadOwnsJSLock):
(JSC::ensureCurrentThreadOwnsJSLock):
(JSC::JSDollarVMPrototype::addFunction):
(JSC::functionCrash): - $vm.crash()
(JSC::functionDFGTrue): - $vm.dfgTrue()
(JSC::CallerFrameJITTypeFunctor::CallerFrameJITTypeFunctor):
(JSC::CallerFrameJITTypeFunctor::operator()):
(JSC::CallerFrameJITTypeFunctor::jitType):
(JSC::functionLLintTrue): - $vm.llintTrue()
(JSC::functionJITTrue): - $vm.jitTrue()
(JSC::gc):
(JSC::functionGC): - $vm.gc()
(JSC::edenGC):
(JSC::functionEdenGC): - $vm.edenGC()
(JSC::isValidCodeBlock):
(JSC::codeBlockForFrame):
(JSC::functionCodeBlockForFrame): - $vm.codeBlockForFrame(frameNumber)
(JSC::codeBlockFromArg):
(JSC::functionPrintSourceFor): - $vm.printSourceFor(codeBlock)
(JSC::functionPrintByteCodeFor): - $vm.printBytecodeFor(codeBlock)
(JSC::functionPrint): - $vm.print(str)
(JSC::PrintFrameFunctor::PrintFrameFunctor):
(JSC::PrintFrameFunctor::operator()):
(JSC::printCallFrame):
(JSC::printStack):
(JSC::functionPrintCallFrame): - $vm.printCallFrame()
(JSC::functionPrintStack): - $vm.printStack()
(JSC::printValue):
(JSC::functionPrintValue): - $vm.printValue()
(JSC::JSDollarVMPrototype::finishCreation):
* tools/JSDollarVMPrototype.h: Added.
(JSC::JSDollarVMPrototype::create):
(JSC::JSDollarVMPrototype::createStructure):
(JSC::JSDollarVMPrototype::JSDollarVMPrototype):

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

5 years ago32-bit build fix.
achristensen@apple.com [Fri, 17 Apr 2015 00:09:44 +0000 (00:09 +0000)]
32-bit build fix.

* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformResetPreferencesToConsistentValues):
(WTR::TestController::platformConfigureViewForTest):
Added WK_API_ENABLED.

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

5 years agoI will be investigating this in the short term, but skip these failing test for
bdakin@apple.com [Thu, 16 Apr 2015 23:52:32 +0000 (23:52 +0000)]
I will be investigating this in the short term, but skip these failing test for
now.

* platform/mac-wk2/TestExpectations:

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

5 years agoMedia element time displays shouldn't wrap.
roger_fong@apple.com [Thu, 16 Apr 2015 23:45:22 +0000 (23:45 +0000)]
Media element time displays shouldn't wrap.
https://bugs.webkit.org/show_bug.cgi?id=143854.
<rdar://problem/20284766>

Reviewed by Brent Fulgham.

* Modules/mediacontrols/mediaControlsApple.css:
(::-webkit-media-controls): Don't wrap any text.
(audio::-webkit-media-controls-time-remaining-display): Also increase remaining time display width by 1.
(audio::-webkit-media-controls-time-remaining-display.five-digit-time): Ditto.
(audio::-webkit-media-controls-time-remaining-display.six-digit-time): Ditto.

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

5 years agoAdd assertions to make sure ActiveDOMObject::suspend() / resume() / stop() overrides...
cdumez@apple.com [Thu, 16 Apr 2015 23:41:27 +0000 (23:41 +0000)]
Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop() overrides don't fire events
https://bugs.webkit.org/show_bug.cgi?id=143850

Reviewed by Alexey Proskuryakov.

Add assertions to make sure ActiveDOMObject::suspend() / resume() / stop()
overrides don't fire events as this is not allowed. This would cause
arbitrary JS execution which would be very dangerous in these stages.

Firing JS events from these functions is a common source of crashes.

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::suspend):
(WebCore::WebSocket::resume):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
(WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
(WebCore::ScriptExecutionContext::stopActiveDOMObjects):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::suspend):
(WebCore::XMLHttpRequest::resume):
(WebCore::XMLHttpRequest::stop):

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

5 years agoRemoved unused WKUserContentFilterRef.
achristensen@apple.com [Thu, 16 Apr 2015 23:41:22 +0000 (23:41 +0000)]
Removed unused WKUserContentFilterRef.
https://bugs.webkit.org/show_bug.cgi?id=143852

Reviewed by Sam Weinig.

Source/WebKit2:

* Shared/WebCompiledContentExtension.cpp:
(WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): Deleted.
(WebKit::LegacyContentExtensionCompilationClient::writeBytecode): Deleted.
(WebKit::LegacyContentExtensionCompilationClient::writeActions): Deleted.
(WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): Deleted.
* Shared/WebCompiledContentExtension.h:
* UIProcess/API/C/WKUserContentFilterRef.cpp: Removed.
* UIProcess/API/C/WKUserContentFilterRef.h: Removed.
* UIProcess/API/C/WebKit2_C.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.h:
* UIProcess/API/Cocoa/_WKUserContentFilter.mm:
(-[_WKUserContentFilter initWithName:serializedRules:]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

Tools:

* TestWebKitAPI/Tests/WebKit2Cocoa/_WKUserContentExtensionStore.mm:
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::TestController::platformResetPreferencesToConsistentValues):
(WTR::TestController::platformConfigureViewForTest):

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

5 years agoSpeculative fix after r182915
benjamin@webkit.org [Thu, 16 Apr 2015 23:28:21 +0000 (23:28 +0000)]
Speculative fix after r182915
https://bugs.webkit.org/show_bug.cgi?id=143404

Patch by Geoffrey Garen <ggaren@apple.com> on 2015-04-16
Reviewed by Alexey Proskuryakov.

* runtime/SymbolConstructor.h:

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

5 years agoRubber-stamped by Tim Horton.
bdakin@apple.com [Thu, 16 Apr 2015 23:22:12 +0000 (23:22 +0000)]
Rubber-stamped by Tim Horton.

Fixing a small mistake in http://trac.webkit.org/changeset/182912 which should
make sure to use the most up-to-date pressure information when setting the force
on a WebMouseEvent.

* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebMouseEvent):

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

5 years agoFixed some typos in a comment.
mark.lam@apple.com [Thu, 16 Apr 2015 23:21:01 +0000 (23:21 +0000)]
Fixed some typos in a comment.

Not reviewed.

* dfg/DFGGenerationInfo.h:

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

5 years agoMedia element can manipulate DOM during Document destruction.
ap@apple.com [Thu, 16 Apr 2015 23:04:00 +0000 (23:04 +0000)]
Media element can manipulate DOM during Document destruction.
rdar://problem/20553898 and https://bugs.webkit.org/show_bug.cgi?id=143780

Patch by Brady Eidson <beidson@apple.com> on 2015-04-16
Reviewed by Jer Noble.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::configureMediaControls): Bail if the element has no active document.

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

5 years agoUnreviewed. Adding myself as a commiter in contributers.json.
jacob_nielsen@apple.com [Thu, 16 Apr 2015 22:58:22 +0000 (22:58 +0000)]
Unreviewed. Adding myself as a commiter in contributers.json.

* Scripts/webkitpy/common/config/contributors.json:

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

5 years agoIt is very hard to attach a debugger to WebProcess to debug tests
ap@apple.com [Thu, 16 Apr 2015 22:54:46 +0000 (22:54 +0000)]
It is very hard to attach a debugger to WebProcess to debug tests
https://bugs.webkit.org/show_bug.cgi?id=143837

Reviewed by Chris Dumez.

--no-timeout used to only affect waitUntilDone timeout, but not IPC timeout in
WebKitTestRunner, and not pipe reading timeout in run-webkit-tests.

Now it disables all timeouts in tools, as is best for debugging tests.

* Scripts/webkitpy/port/driver.py: (Driver.run_test): Respect --no-timeout, so
that the script doesn't terminate DRT/WKTR when there is no output for a long time.

* WebKitTestRunner/Options.cpp: Removed --no-timeout-at-all, as --no-timeout
now has the same functionality.

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

5 years ago[ES6] Implement Symbol.for and Symbol.keyFor
utatane.tea@gmail.com [Thu, 16 Apr 2015 22:46:35 +0000 (22:46 +0000)]
[ES6] Implement Symbol.for and Symbol.keyFor
https://bugs.webkit.org/show_bug.cgi?id=143404

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This patch implements Symbol.for and Symbol.keyFor.
SymbolRegistry maintains registered StringImpl* symbols.
And to make this mapping enabled over realms,
VM owns this mapping (not JSGlobalObject).

While there's Default AtomicStringTable per thread,
SymbolRegistry should not exist over VMs.
So everytime VM is created, SymbolRegistry is also created.

In SymbolRegistry implementation, we don't leverage WeakGCMap (or weak reference design).
Theres are several reasons.
1. StringImpl* which represents identity of Symbols is not GC-managed object.
   So we cannot use WeakGCMap directly.
   While Symbol* is GC-managed object, holding weak reference to Symbol* doesn't maintain JS symbols (exposed primitive values to users) liveness,
   because distinct Symbol* can exist.
   Distinct Symbol* means the Symbol* object that pointer value (Symbol*) is different from weakly referenced Symbol* but held StringImpl* is the same.

2. We don't use WTF::WeakPtr. If we add WeakPtrFactory into StringImpl's member, we can track StringImpl*'s liveness by WeakPtr.
   However there's problem about when we prune staled entries in SymbolRegistry.
   Since the memory allocated for the Symbol is typically occupied by allocated symbolized StringImpl*'s content,
   and it is not in GC-heap.
   While heavily registering Symbols and storing StringImpl* into SymbolRegistry, Heap's EdenSpace is not so occupied.
   So GC typically attempt to perform EdenCollection, and it doesn't call WeakGCMap's pruleStaleEntries callback.
   As a result, before pruning staled entries in SymbolRegistry, fast malloc-ed memory fills up the system memory.

So instead of using Weak reference, we take relatively easy design.
When we register symbolized StringImpl* into SymbolRegistry, symbolized StringImpl* is aware of that.
And when destructing it, it removes its reference from SymbolRegistry as if atomic StringImpl do so with AtomicStringTable.

* CMakeLists.txt:
* DerivedSources.make:
* runtime/SymbolConstructor.cpp:
(JSC::SymbolConstructor::getOwnPropertySlot):
(JSC::symbolConstructorFor):
(JSC::symbolConstructorKeyFor):
* runtime/SymbolConstructor.h:
* runtime/VM.cpp:
* runtime/VM.h:
(JSC::VM::symbolRegistry):
* tests/stress/symbol-registry.js: Added.
(test):

Source/WTF:

When we register symbolized StringImpl* into SymbolRegistry, symbolized StringImpl* is aware of that.
And when destructing it, it removes its reference from SymbolRegistry as if atomic StringImpl do so with AtomicStringTable.
While AtomicStringTable (in WebCore case) exists in thread local storage,
SymbolRegistry exists per VM and StringImpl* has a reference to the registered SymbolRegistry.

Since StringImpl has isSymbol etc. members, it's class is aware of Symbol use cases.
So introduce SymbolRegistry in WTF layers as if AtomicStringTable.

* WTF.vcxproj/WTF.vcxproj:
* WTF.vcxproj/WTF.vcxproj.filters:
* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/AtomicString.cpp:
(WTF::AtomicString::addSlowCase):
(WTF::AtomicString::findSlowCase):
(WTF::AtomicString::findInternal):
(WTF::AtomicString::find): Deleted.
* wtf/text/AtomicString.h:
(WTF::AtomicString::find):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::~StringImpl):
(WTF::StringImpl::createSymbol):
(WTF::StringImpl::createSymbolEmpty):
* wtf/text/StringImpl.h:
(WTF::StringImpl::StringImpl):
(WTF::StringImpl::extractFoldedStringInSymbol):
(WTF::StringImpl::symbolRegistry):
(WTF::StringImpl::createSymbolEmpty): Deleted.
* wtf/text/SymbolRegistry.cpp: Copied from Source/JavaScriptCore/runtime/SymbolConstructor.h.
(WTF::SymbolRegistry::~SymbolRegistry):
(WTF::SymbolRegistry::symbolForKey):
(WTF::SymbolRegistry::keyForSymbol):
(WTF::SymbolRegistry::remove):
* wtf/text/SymbolRegistry.h: Added.
(WTF::SymbolRegistryKey::hash):
(WTF::SymbolRegistryKey::impl):
(WTF::SymbolRegistryKey::isHashTableDeletedValue):
(WTF::SymbolRegistryKey::hashTableDeletedValue):
(WTF::DefaultHash<SymbolRegistryKey>::Hash::hash):
(WTF::DefaultHash<SymbolRegistryKey>::Hash::equal):
(WTF::HashTraits<SymbolRegistryKey>::isEmptyValue):
(WTF::SymbolRegistryKey::SymbolRegistryKey):

LayoutTests:

Add tests to check Symbol's identity over different realms.

* js/dom/cross-frame-symbols-expected.txt: Added.
* js/dom/cross-frame-symbols.html: Added.
* js/dom/script-tests/cross-frame-symbols.js: Added.

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

5 years ago[iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager...
jer.noble@apple.com [Thu, 16 Apr 2015 22:42:58 +0000 (22:42 +0000)]
[iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
https://bugs.webkit.org/show_bug.cgi?id=143680

Reviewed by Simon Fraser.

Source/WebCore:

Add getters for the video's fullscreen layer, and be more tolerant about the order in which setVideoElement() and
setWebVideoFullscreenInterface are called.

* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::videoFullscreenLayer): Added simple getter.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenModelVideoElement.h:
(WebCore::WebVideoFullscreenModelVideoElement::videoElement): Added simple getter.
(WebCore::WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Deleted. Moved to .mm file.
* platform/ios/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement): Initialize ivars in the .h file.
(WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface): Call those methods skipped in setVideoElement()
    if m_videoFullscreenInterface had not yet been set.
(WebVideoFullscreenModelVideoElement::setVideoElement): Null-check m_videoFullscreenInterface.

Source/WebKit2:

The original assumption of WebVideoFullscreenManager and -Proxy was that the two classes would represent a
single video element and its full screen state. With multiple animations in and out of fullscreen combined with
multiple fullscreen modes, this assumption no longer holds true.

Rather than having a WebVideoFullscreenManager which /isa/ WebVideoFullscreenModelVideoElement, the manager now
/hasa/ WebVideoFullscreenModelVideoElement (or has many such models). Ditto for WebVideoFullscreenManager and
WebVideoFullscreenInterfaceAVKit. The WebVideoFullscreenInterfaceAVKit still needs a WebVideoFullscreenModel to
communicate with, so a new wrapper class is used for that purpose, WebVideoFullscreenModelContext. Ditto for
WebVideoFullscreenModelVideoElement and the new class WebVideoFullscreenInterfaceContext. These context classes
are paired and share a contextId, allowing the manager and its proxy to route messages between the UIProcess's
WebVideoFullscreenInterfaceAVKit to-and-from the WebProcess's WebVideoFullscreenModelVideoElement.

Both the WebVideoFullscreenModelContext and the WebVideoFullscreenInterfaceContext take a back-pointer to their
manager or manager proxy, and each method on the context simply calls the matching method on the manager and
passes its contextId as a parameter.

Both the WebVideoFullscreenManager and the WebVideoFullscreenManagerProxy pass that contextId in each of their
cross-process messages.

On the other side, the manager and proxy also have a map between contextIds and their matching
WebVideoFullscreenModelVideoElement (in the case of WebVideoFullscreenManager) or
WebVideoFullscreenInterfaceAVKit (in the case of WebVideoFullscreenManagerProxy).

While this change is large by LoC, it is almost entirely boilerplate.  The new and interesting pieces are these:

* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): No longer a WebVideoFullscreenInterfaceAVKit.
(WebKit::WebVideoFullscreenManagerProxy::invalidate): Walk through the models and interfaces, invalidating each.
(WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface): Added. Return a new model and interface tuple.
(WebKit::WebVideoFullscreenManagerProxy::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap
    a new model and interface object.
(WebKit::WebVideoFullscreenManagerProxy::ensureModel): Return the model half of ensureModelAndInterface().
(WebKit::WebVideoFullscreenManagerProxy::ensureInterface): Return the interface half of ensureModelAndInterface().
(WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Walk through the outstanding interface objects, and if
    any have a fullscreen mode which matches the about-to-be-fullscreen interface, request that that other interface
    exit fullscreen.
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::nextContextId): Static, incrementing counter used as a contextId source.
(WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): No longer a WebVideoFullscreenModelVideoElement.
(WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Walk through the models and interfaces, invalidating each.
(WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Return a new model and interface tuple.
(WebKit::WebVideoFullscreenManager::ensureModelAndInterface):  Added. Lazily create, and add to the m_contextMap
    a new model and interface object.
(WebKit::WebVideoFullscreenManager::ensureModel): Return the model half of ensureModelAndInterface().
(WebKit::WebVideoFullscreenManager::ensureInterface): Return the interface half of ensureModelAndInterface().

New classes and methods which just forward on to their owning objects:

* UIProcess/ios/WebVideoFullscreenManagerProxy.h:
(WebKit::WebVideoFullscreenModelContext::create):
(WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
(WebKit::WebVideoFullscreenModelContext::invalidate):
(WebKit::WebVideoFullscreenModelContext::layerHost):
(WebKit::WebVideoFullscreenModelContext::setLayerHost):
(WebKit::WebVideoFullscreenModelContext::setInitialVideoLayerFrame):
(WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::play):
(WebKit::WebVideoFullscreenModelContext::pause):
(WebKit::WebVideoFullscreenModelContext::togglePlayState):
(WebKit::WebVideoFullscreenModelContext::beginScrubbing):
(WebKit::WebVideoFullscreenModelContext::endScrubbing):
(WebKit::WebVideoFullscreenModelContext::seekToTime):
(WebKit::WebVideoFullscreenModelContext::fastSeek):
(WebKit::WebVideoFullscreenModelContext::beginScanningForward):
(WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
(WebKit::WebVideoFullscreenModelContext::endScanning):
(WebKit::WebVideoFullscreenModelContext::requestExitFullscreen):
(WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame):
(WebKit::WebVideoFullscreenModelContext::videoLayerFrame):
(WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity):
(WebKit::WebVideoFullscreenModelContext::videoLayerGravity):
(WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
(WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
(WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged):
(WebKit::WebVideoFullscreenModelContext::didSetupFullscreen):
(WebKit::WebVideoFullscreenModelContext::didEnterFullscreen):
(WebKit::WebVideoFullscreenModelContext::didExitFullscreen):
(WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen):
(WebKit::WebVideoFullscreenModelContext::fullscreenMayReturnToInline):
* WebProcess/ios/WebVideoFullscreenManager.h:
(WebKit::WebVideoFullscreenInterfaceContext::create):
(WebKit::WebVideoFullscreenInterfaceContext::invalidate):
(WebKit::WebVideoFullscreenInterfaceContext::layerHostingContext):
(WebKit::WebVideoFullscreenInterfaceContext::isAnimating):
(WebKit::WebVideoFullscreenInterfaceContext::setIsAnimating):
(WebKit::WebVideoFullscreenInterfaceContext::targetIsFullscreen):
(WebKit::WebVideoFullscreenInterfaceContext::setTargetIsFullscreen):
(WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode):
(WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode):
(WebKit::WebVideoFullscreenInterfaceContext::isFullscreen):
(WebKit::WebVideoFullscreenInterfaceContext::setIsFullscreen):
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
(WebKit::WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext):
(WebKit::WebVideoFullscreenInterfaceContext::setLayerHostingContext):
(WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
(WebKit::WebVideoFullscreenInterfaceContext::setDuration):
(WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
(WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
(WebKit::WebVideoFullscreenInterfaceContext::setRate):
(WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions):
(WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
(WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
(WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
(WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
(WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):

Cross-process methods which now take a contextId parameter:

* UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
(WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
(WebKit::WebVideoFullscreenManagerProxy::setCurrentTime):
(WebKit::WebVideoFullscreenManagerProxy::setBufferedTime):
(WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions):
(WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
(WebKit::WebVideoFullscreenManagerProxy::setCanPlayFastReverse):
(WebKit::WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions):
(WebKit::WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions):
(WebKit::WebVideoFullscreenManagerProxy::setExternalPlaybackProperties):
(WebKit::WebVideoFullscreenManagerProxy::setDuration):
(WebKit::WebVideoFullscreenManagerProxy::setRate):
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
(WebKit::WebVideoFullscreenManagerProxy::play):
(WebKit::WebVideoFullscreenManagerProxy::pause):
(WebKit::WebVideoFullscreenManagerProxy::togglePlayState):
(WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
(WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
(WebKit::WebVideoFullscreenManagerProxy::seekToTime):
(WebKit::WebVideoFullscreenManagerProxy::fastSeek):
(WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
(WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
(WebKit::WebVideoFullscreenManagerProxy::endScanning):
(WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity):
(WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
(WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
(WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
(WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
(WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Deleted.
* WebProcess/ios/WebVideoFullscreenManager.messages.in:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenManager::resetMediaState):
(WebKit::WebVideoFullscreenManager::setDuration):
(WebKit::WebVideoFullscreenManager::setCurrentTime):
(WebKit::WebVideoFullscreenManager::setBufferedTime):
(WebKit::WebVideoFullscreenManager::setRate):
(WebKit::WebVideoFullscreenManager::setVideoDimensions):
(WebKit::WebVideoFullscreenManager::setSeekableRanges):
(WebKit::WebVideoFullscreenManager::setCanPlayFastReverse):
(WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
(WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
(WebKit::WebVideoFullscreenManager::setExternalPlayback):
(WebKit::WebVideoFullscreenManager::play):
(WebKit::WebVideoFullscreenManager::pause):
(WebKit::WebVideoFullscreenManager::togglePlayState):
(WebKit::WebVideoFullscreenManager::beginScrubbing):
(WebKit::WebVideoFullscreenManager::endScrubbing):
(WebKit::WebVideoFullscreenManager::seekToTime):
(WebKit::WebVideoFullscreenManager::fastSeek):
(WebKit::WebVideoFullscreenManager::beginScanningForward):
(WebKit::WebVideoFullscreenManager::beginScanningBackward):
(WebKit::WebVideoFullscreenManager::endScanning):
(WebKit::WebVideoFullscreenManager::requestExitFullscreen):
(WebKit::WebVideoFullscreenManager::selectAudioMediaOption):
(WebKit::WebVideoFullscreenManager::selectLegibleMediaOption):
(WebKit::WebVideoFullscreenManager::fullscreenModeChanged):
(WebKit::WebVideoFullscreenManager::didSetupFullscreen):
(WebKit::WebVideoFullscreenManager::didEnterFullscreen):
(WebKit::WebVideoFullscreenManager::didExitFullscreen):
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
(WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum):
(WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
(WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
(WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.

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

5 years agoForgot to edit this TestExpectation file for
bdakin@apple.com [Thu, 16 Apr 2015 22:29:10 +0000 (22:29 +0000)]
Forgot to edit this TestExpectation file for
http://trac.webkit.org/changeset/182912

* platform/mac-wk1/TestExpectations:

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

5 years agoForce mouse events should go through normal mouse event handling code paths
bdakin@apple.com [Thu, 16 Apr 2015 22:18:35 +0000 (22:18 +0000)]
Force mouse events should go through normal mouse event handling code paths
https://bugs.webkit.org/show_bug.cgi?id=143749
-and corresponding-
rdar://problem/20472895

Reviewed by Dean Jackson.

Source/WebCore:

This patch moves all of the code to dispatch mouseforcedown, mouseforceup, and
mouseforcechanged into normal mouse event dispatching code. This patch leaves
behind the cancel and click events because we plan to remove those, and it also
leaves mouseforcewillbegin because that is necessarily a very different event more
tied to the NSImmediateActionGestureRecognizer than these other events which are
tied to NSResponder’s pressureChangeWithEvent.

New helper functions.
* dom/Document.cpp:
(WebCore::Document::hasListenerTypeForEventType):
* dom/Document.h:
* dom/Element.cpp:
(WebCore::isForceEvent):

Move the code to ensure the force events have listeners in order to fire to
dispatchMouseEvent, and delete the old implementations.
(WebCore::Element::dispatchMouseEvent):
(WebCore::Element::dispatchMouseForceChanged): Deleted.
(WebCore::Element::dispatchMouseForceDown): Deleted.
(WebCore::Element::dispatchMouseForceUp): Deleted.
* dom/Element.h:

Perform a hit test and pipe the events through dispatchMouseEvent().
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseForceEvent):
* page/EventHandler.h:

New types for the new events.
* platform/PlatformEvent.h:

Forward to EventHandler.
* replay/UserInputBridge.cpp:
(WebCore::UserInputBridge::handleMouseForceEvent):
* replay/UserInputBridge.h:

Source/WebKit2:

This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the
NSEventTypePressures that is gets and sends those down to the web process.

Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an
NSEventTypePressure, the new name makes it clear how the second parameter differs
from the first.
* Shared/NativeWebMouseEvent.h:

New event types for the new types of events.
* Shared/WebEvent.h:
* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
* Shared/mac/NativeWebMouseEventMac.mm:
(WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
* Shared/mac/WebEventFactory.h:

All of the square-peg, round-hole problems of massaging the NSEventTypePressures
events into WebMouseEvents is taken care of here.
* Shared/mac/WebEventFactory.mm:
(WebKit::mouseButtonForEvent):
(WebKit::globalPointForEvent):
(WebKit::pointForEvent):
(WebKit::WebEventFactory::createWebMouseEvent):

Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent
and handle it.
* UIProcess/API/mac/WKView.mm:
(-[WKView pressureChangeWithEvent:]):

Handle the new types.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didReceiveEvent):

Can delete inputDeviceForceDidChange since it’s no longer used.
(WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
* UIProcess/WebPageProxy.h:

Handle the new types of mouse events properly.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleMouseEvent):

Delete inputDeviceForceDidChange() and m_lastForceStage.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::inputDeviceForceDidChange): Deleted.

Handle new WebEvent types.
* WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:

Tools:

Add mouseForceDown/mouseForceUp/mouseForceChanged support to WebKitTestRunner.
Since there is not a way to create an NSEventTypePressure from scratch, we
subclass NSEvent and override all of the critical methods.

* WebKitTestRunner/EventSenderProxy.h:
* WebKitTestRunner/InjectedBundle/Bindings/EventSendingController.idl:
* WebKitTestRunner/InjectedBundle/EventSendingController.cpp:
(WTR::EventSendingController::mouseForceDown):
(WTR::EventSendingController::mouseForceUp):
(WTR::EventSendingController::mouseForceChanged):
* WebKitTestRunner/InjectedBundle/EventSendingController.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::didReceiveSynchronousMessageFromInjectedBundle):
* WebKitTestRunner/mac/EventSenderProxy.mm:
(-[EventSenderPressureEvent initAtLocation:globalLocation:stage:pressure:phase:time:eventNumber:]):
(-[EventSenderPressureEvent timestamp]):
(-[EventSenderPressureEvent type]):
(-[EventSenderPressureEvent locationInWindow]):
(-[EventSenderPressureEvent location]):
(-[EventSenderPressureEvent stage]):
(-[EventSenderPressureEvent pressure]):
(-[EventSenderPressureEvent phase]):
(-[EventSenderPressureEvent eventNumber]):
(WTR::EventSenderProxy::mouseForceDown):
(WTR::EventSenderProxy::mouseForceUp):
(WTR::EventSenderProxy::mouseForceChanged):

LayoutTests:

Just a few new tests. More to come.
* fast/events/mouse-force-changed-expected.txt: Added.
* fast/events/mouse-force-changed.html: Added.
* fast/events/mouse-force-down-expected.txt: Added.
* fast/events/mouse-force-down.html: Added.
* fast/events/mouse-force-up-expected.txt: Added.
* fast/events/mouse-force-up.html: Added.

Right now the new tests will only work on Mac 10.10.3 and beyond.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac-mavericks/TestExpectations:
* platform/win/TestExpectations:

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

5 years ago[ES6] Use specific functions for @@iterator functions
utatane.tea@gmail.com [Thu, 16 Apr 2015 21:35:30 +0000 (21:35 +0000)]
[ES6] Use specific functions for @@iterator functions
https://bugs.webkit.org/show_bug.cgi?id=143838

Reviewed by Geoffrey Garen.

In ES6, some methods are defined with the different names.

For example,

Map.prototype[Symbol.iterator] === Map.prototype.entries
Set.prototype[Symbol.iterator] === Set.prototype.values
Array.prototype[Symbol.iterator] === Array.prototype.values
%Arguments%[Symbol.iterator] === Array.prototype.values

However, current implementation creates different function objects per name.
This patch fixes it by setting the object that is used for the other method to @@iterator.
e.g. Setting Array.prototype.values function object to Array.prototype[Symbol.iterator].

And we drop Arguments' iterator implementation and replace Argument[@@iterator] implementation
with Array.prototype.values to conform to the spec.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* inspector/JSInjectedScriptHost.cpp:
(Inspector::JSInjectedScriptHost::subtype):
(Inspector::JSInjectedScriptHost::getInternalProperties):
(Inspector::JSInjectedScriptHost::iteratorEntries):
* runtime/ArgumentsIteratorConstructor.cpp: Removed.
* runtime/ArgumentsIteratorConstructor.h: Removed.
* runtime/ArgumentsIteratorPrototype.cpp: Removed.
* runtime/ArgumentsIteratorPrototype.h: Removed.
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
* runtime/ArrayPrototype.h:
* runtime/ClonedArguments.cpp:
(JSC::ClonedArguments::getOwnPropertySlot):
(JSC::ClonedArguments::put):
(JSC::ClonedArguments::deleteProperty):
(JSC::ClonedArguments::defineOwnProperty):
(JSC::ClonedArguments::materializeSpecials):
* runtime/ClonedArguments.h:
* runtime/CommonIdentifiers.h:
* runtime/DirectArguments.cpp:
(JSC::DirectArguments::overrideThings):
* runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::getOwnPropertySlot):
(JSC::GenericArguments<Type>::getOwnPropertyNames):
(JSC::GenericArguments<Type>::put):
(JSC::GenericArguments<Type>::deleteProperty):
(JSC::GenericArguments<Type>::defineOwnProperty):
* runtime/JSArgumentsIterator.cpp: Removed.
* runtime/JSArgumentsIterator.h: Removed.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::arrayProtoValuesFunction):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/ScopedArguments.cpp:
(JSC::ScopedArguments::overrideThings):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
* tests/stress/arguments-iterator.js: Added.
(test):
(testArguments):
* tests/stress/iterator-functions.js: Added.
(test):
(argumentsTests):

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

5 years agoSites with both width=device-width and height=device-height load zoomed out
timothy_horton@apple.com [Thu, 16 Apr 2015 21:24:23 +0000 (21:24 +0000)]
Sites with both width=device-width and height=device-height load zoomed out
https://bugs.webkit.org/show_bug.cgi?id=143795
<rdar://problem/20369671>

Reviewed by Ben Poulain.

* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::shouldIgnoreVerticalScalingConstraints):
Some sites specify both width=device-width and height=device-height, and
then lay out to device width but with a large amount of vertically scrollable content
(so, height=device-height was a lie).

In all other cases where we use device-width and device-height, we prefer
width=device-width over height=device-height, but in the code to ignore scaling constraints,
the two paths were completely separate. On sites that specify both, this
resulted in us attempting to zoom out to fit the entire height of the very tall page,
which isn't at all what we wanted. So, ignore height=device-height if a width is specified.

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

5 years agoWeb Inspector: "Log Value" of a value inside of an array, does not log the innermost...
joepeck@webkit.org [Thu, 16 Apr 2015 20:54:31 +0000 (20:54 +0000)]
Web Inspector: "Log Value" of a value inside of an array, does not log the innermost value
https://bugs.webkit.org/show_bug.cgi?id=143793

Reviewed by Brian Burg.

Context menu handlers were being handled in the capturing event phase, so
the outer most handler, instead of the inner most handler, was getting
first access. Change this so the events happen in the bubbling phase.

DOM Nodes may appear inside of Object Trees, for instance when shown
in a collection like an array or set. In an effort to standardize on
"inner most" behavior, change the DOMTreeOutline context handler
to also be in bubbling.

In the rare instances where a node object is in the console but
not displayed in an outline (console.dir(node)), then include a
Copy as HTML context menu like you would expect in a DOM tree.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline):
* UserInterface/Views/GeneralTreeElement.js:
(WebInspector.GeneralTreeElement.prototype.onattach):
(WebInspector.GeneralTreeElement.prototype.ondetach):
* UserInterface/Views/ObjectTreeBaseTreeElement.js:
(WebInspector.ObjectTreeBaseTreeElement.prototype._appendMenusItemsForObject):
(WebInspector.ObjectTreeBaseTreeElement):

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

5 years agoWeb Inspector: Allow toggling the edibility of a DOMTreeOutline
joepeck@webkit.org [Thu, 16 Apr 2015 20:32:58 +0000 (20:32 +0000)]
Web Inspector: Allow toggling the edibility of a DOMTreeOutline
https://bugs.webkit.org/show_bug.cgi?id=143814

Reviewed by Brian Burg.

By default a DOMTreeOutline will not be editable, but it will
provide a setter to enable editability for DOMTreeContentViews.

* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView):
Content Views always have editable DOM trees.

* UserInterface/Views/DOMTreeElement.js:
(WebInspector.DOMTreeElement.prototype.get editable):
(WebInspector.DOMTreeElement.prototype.onattach):
(WebInspector.DOMTreeElement.prototype.ondelete):
(WebInspector.DOMTreeElement.prototype.onenter):
(WebInspector.DOMTreeElement.prototype.ondblclick):
(WebInspector.DOMTreeElement.prototype._populateTagContextMenu):
(WebInspector.DOMTreeElement.prototype._populateTextContextMenu):
(WebInspector.DOMTreeElement.prototype._populateNodeContextMenu):
(WebInspector.DOMTreeElement.prototype._startEditing):
Do not provide editability options for shadow DOM or non-editable DOM tree.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline):
(WebInspector.DOMTreeOutline.prototype.get editable):
(WebInspector.DOMTreeOutline.prototype.set editable):
New state.

* UserInterface/Views/FormattedValue.css:
(.formatted-node > .dom-tree-outline li):
Nodes inside object trees were showing text selection when you right
clicked them. Normal selection is not possible. So force no selection.

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

5 years ago<rdar://problem/20575744> Also include a definition of __NSd_{current deployment...
mitz@apple.com [Thu, 16 Apr 2015 20:32:40 +0000 (20:32 +0000)]
<rdar://problem/20575744> Also include a definition of __NSd_{current deployment target} in WKFoundation.h.

Reviewed by Tim Horton.

* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoAdd JSC_functionOverrides=<overrides file> debugging tool.
mark.lam@apple.com [Thu, 16 Apr 2015 19:59:47 +0000 (19:59 +0000)]
Add JSC_functionOverrides=<overrides file> debugging tool.
https://bugs.webkit.org/show_bug.cgi?id=143717

Reviewed by Geoffrey Garen.

This tool allows us to do runtime replacement of function bodies with alternatives
for debugging purposes.  For example, this is useful when we need to debug VM bugs
which manifest in scripts executing in webpages downloaded from remote servers
that we don't control.  The tool allows us to augment those scripts with logging
or test code to help isolate the bugs.

This tool works by substituting the SourceCode at FunctionExecutable creation
time.  It identifies which SourceCode to substitute by comparing the source
string against keys in a set of key value pairs.

The keys are function body strings defined by 'override' clauses in the overrides
file specified by in the JSC_functionOverrides option.  The values are function
body strings defines by 'with' clauses in the overrides file.
See comment blob at top of FunctionOverrides.cpp on the formatting
of the overrides file.

At FunctionExecutable creation time, if the SourceCode string matches one of the
'override' keys from the overrides file, the tool will replace the SourceCode with
a new one based on the corresponding 'with' value string.  The FunctionExecutable
will then be created with the new SourceCode instead.

Some design decisions:
1. We opted to require that the 'with' clause appear on a separate line than the
   'override' clause because this makes it easier to read and write when the
   'override' clause's function body is single lined and long.

2. The user can use any sequence of characters for the delimiter (except for '{',
   '}' and white space characters) because this ensures that there can always be
   some delimiter pattern that does not appear in the function body in the clause
   e.g. in the body of strings in the JS code.

   '{' and '}' are disallowed because they are used to mark the boundaries of the
   function body string.  White space characters are disallowed because they can
   be error prone (the user may not be able to tell between spaces and tabs).

3. The start and end delimiter must be an identical sequence of characters.

   I had considered allowing the use of complementary characters like <>, [], and
   () for making delimiter pairs like:
       [[[[ ... ]]]]
       <[([( ... )])]>

   But in the end, decided against it because:
   a. These sequences of complementary characters can exists in JS code.
      In contrast, a repeating delimiter like %%%% is unlikely to appear in JS
      code.
   b. It can be error prone for the user to have to type the exact complement
      character for the end delimiter in reverse order.
      In contrast, a repeating delimiter like %%%% is much easier to type and
      less error prone.  Even a sequence like @#$%^ is less error prone than
      a complementary sequence because it can be copy-pasted, and need not be
      typed in reverse order.
   c. It is easier to parse for the same delimiter string for both start and end.

4. The tool does a lot of checks for syntax errors in the overrides file because
   we don't want any overrides to fail silently.  If a syntax error is detected,
   the tool will print an error message and call exit().  This avoids the user
   wasting time doing debugging only to be surprised later that their specified
   overrides did not take effect because of some unnoticed typo.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedFunctionExecutable::link):
* runtime/Executable.h:
* runtime/Options.h:
* tools/FunctionOverrides.cpp: Added.
(JSC::FunctionOverrides::overrides):
(JSC::FunctionOverrides::FunctionOverrides):
(JSC::initializeOverrideInfo):
(JSC::FunctionOverrides::initializeOverrideFor):
(JSC::hasDisallowedCharacters):
(JSC::parseClause):
(JSC::FunctionOverrides::parseOverridesInFile):
* tools/FunctionOverrides.h: Added.

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

5 years agoWeb Inspector: Give DOM Nodes a Context Menu to Log Element to the console
joepeck@webkit.org [Thu, 16 Apr 2015 19:47:41 +0000 (19:47 +0000)]
Web Inspector: Give DOM Nodes a Context Menu to Log Element to the console
https://bugs.webkit.org/show_bug.cgi?id=143813

Reviewed by Brian Burg.

Always give DOM Nodes a "Log Element" context menu to log it to the console.
This will give a $n reference, and is a convenient alternative to $0 or
the now removed $1-$9.

* Localizations/en.lproj/localizedStrings.js:
New "Log Element" and "Selected Element" strings.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline):
(WebInspector.DOMTreeOutline.prototype._contextMenuEventFired):
(WebInspector.DOMTreeOutline.prototype._updateModifiedNodes):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu.revealElement):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu.logElement):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu):
Always include the "Log Element" context menu/

* UserInterface/Views/FormattedValue.js:
(WebInspector.FormattedValue.createElementForNode):
This uses all the defaults.

* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView):
This enables all the extra behavior.

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

5 years agoRegression(r182517): WebSocket::suspend() causes error event to be fired
cdumez@apple.com [Thu, 16 Apr 2015 19:39:50 +0000 (19:39 +0000)]
Regression(r182517): WebSocket::suspend() causes error event to be fired
https://bugs.webkit.org/show_bug.cgi?id=143806
<rdar://problem/20559812>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

WebSocket::suspend() causes an error event to be fired after r182517.
This is not allowed as firing the event could trigger arbitrary JS
execution, which is no longer allowed at this point.

This patch delays the error event firing until after
WebSocket::resume() is called, similarly to what we already do for
the close event.

Also add assertions in WebSocket::suspend() / WebSocket::resume()
that will be hit if JS events are fired from within these functions.
The pre-existing closed-when-entering-page-cache.html test is hitting
one of these assertions without the fix above.

Tests:
  - http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
  - http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::suspend):
(WebCore::WebSocket::resume):
(WebCore::WebSocket::resumeTimerFired):
(WebCore::WebSocket::stop):
(WebCore::WebSocket::didReceiveMessageError):
(WebCore::WebSocket::didClose):
(WebCore::WebSocket::dispatchOrQueueEvent):
* Modules/websockets/WebSocket.h:

LayoutTests:

* http/tests/websocket/tests/hybi/closed-when-entering-page-cache-expected.txt:
* http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html:
Extend WebSocket PageCache test to make sure that the error event is
fired after restoring the page from the PageCache and before the close
Event is fired.

* http/tests/websocket/tests/hybi/resources/page-cache-websocket.html: Added.
* http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler-expected.txt: Copied from LayoutTests/http/tests/websocket/tests/hybi/closed-when-entering-page-cache-expected.txt.
* http/tests/websocket/tests/hybi/stop-on-resume-in-error-handler.html: Copied from LayoutTests/http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html.
Add layout test to cover the case where WebSocket::stop() is called
while firing the pending events upon restoring the page from PageCache.

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

5 years agoAdjustments to button graphics for media controls.
roger_fong@apple.com [Thu, 16 Apr 2015 19:20:08 +0000 (19:20 +0000)]
Adjustments to button graphics for media controls.
https://bugs.webkit.org/show_bug.cgi?id=143797.
<rdar://problem/20083708>

Reviewed by Dean Jackson.

These changes are visual in nature and mainly affect the buttons.
I've gotten rid of the text-shadow for all the buttons,
used plus-lighter blending mode and changed the button opacity to reflect the specs,
and made all the buttons turn opaque white when active.

* Modules/mediacontrols/mediaControlsApple.css:
(audio::-webkit-media-controls-panel button):
(audio::-webkit-media-controls-rewind-button):
(audio::-webkit-media-controls-play-button):
(audio::-webkit-media-controls-play-button.paused):
(video::-webkit-media-controls-volume-max-button):
(video::-webkit-media-controls-volume-slider):
(video::-webkit-media-controls-volume-min-button):
(audio::-webkit-media-controls-wireless-playback-picker-button):
(audio::-webkit-media-controls-toggle-closed-captions-button):
(audio::-webkit-media-controls-closed-captions-container li.selected:hover::before):
(audio::-webkit-media-controls-fullscreen-button):
(audio::-webkit-media-controls-fullscreen-button.exit):
(audio::-webkit-media-controls-status-display):
(audio::-webkit-media-controls-timeline):
(audio::-webkit-media-controls-time-remaining-display):
(video:-webkit-full-screen::-webkit-media-controls-volume-max-button):
(video:-webkit-full-screen::-webkit-media-controls-volume-min-button):
(video:-webkit-full-screen::-webkit-media-controls-play-button):
(video:-webkit-full-screen::-webkit-media-controls-play-button.paused):
(video:-webkit-full-screen::-webkit-media-controls-seek-back-button):
(video:-webkit-full-screen::-webkit-media-controls-seek-forward-button):
(video::-webkit-media-controls-volume-max-button:active):
(video::-webkit-media-controls-volume-min-button:active):
(audio::-webkit-media-controls-toggle-closed-captions-button:active):
(audio::-webkit-media-controls-rewind-button:active):
(audio::-webkit-media-controls-play-button:active):
(video:-webkit-full-screen::-webkit-media-controls-volume-max-button:active):
(video:-webkit-full-screen::-webkit-media-controls-volume-min-button:active):
(video:-webkit-full-screen::-webkit-media-controls-play-button:active):
(video:-webkit-full-screen::-webkit-media-controls-seek-back-button:active):
(video:-webkit-full-screen::-webkit-media-controls-seek-forward-button:active):
(audio::-webkit-media-controls-fullscreen-button:active):

Using the pseudo id itself here currently does not work, which is why we rely on the button.* selector for these.
(video:-webkit-full-screen::-webkit-media-controls-panel button.paused:active):
(audio::-webkit-media-controls-panel button.paused:active):
(audio::-webkit-media-controls-panel button.exit:active):

Draw volume slider knob as opaque white when active.
Adjust colors of timeline and volume sliders now that we are using plus-lighter blending.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller):
(Controller.prototype.createControls):
(Controller.prototype.handleVolumeSliderMouseDown):
(Controller.prototype.handleVolumeSliderMouseUp):
(Controller.prototype.drawTimelineBackground):
(Controller.prototype.drawVolumeBackground):

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

5 years agoExtract the allocation profile from JSFunction into a rare object
commit-queue@webkit.org [Thu, 16 Apr 2015 19:15:09 +0000 (19:15 +0000)]
Extract the allocation profile from JSFunction into a rare object
https://bugs.webkit.org/show_bug.cgi?id=143807
.:

Patch by Basile Clement <basile_clement@apple.com> on 2015-04-16
Reviewed by Filip Pizlo.

* WebKit.xcworkspace/contents.xcworkspacedata:

Source/JavaScriptCore:

Patch by Basile Clement <basile_clement@apple.com> on 2015-04-16
Reviewed by Filip Pizlo.

The allocation profile is only needed for those functions that are used
to create objects with [new].
Extracting it into its own JSCell removes the need for JSFunction and
JSCallee to be JSDestructibleObjects, which should improve performances in most
cases at the cost of an extra pointer dereference when the allocation profile
is actually needed.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* dfg/DFGOperations.cpp:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_create_this):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_create_this):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/FunctionRareData.cpp: Added.
(JSC::FunctionRareData::create):
(JSC::FunctionRareData::destroy):
(JSC::FunctionRareData::createStructure):
(JSC::FunctionRareData::visitChildren):
(JSC::FunctionRareData::FunctionRareData):
(JSC::FunctionRareData::~FunctionRareData):
(JSC::FunctionRareData::finishCreation):
* runtime/FunctionRareData.h: Added.
(JSC::FunctionRareData::offsetOfAllocationProfile):
(JSC::FunctionRareData::allocationProfile):
(JSC::FunctionRareData::allocationStructure):
(JSC::FunctionRareData::allocationProfileWatchpointSet):
* runtime/JSBoundFunction.cpp:
(JSC::JSBoundFunction::destroy): Deleted.
* runtime/JSBoundFunction.h:
* runtime/JSCallee.cpp:
(JSC::JSCallee::destroy): Deleted.
* runtime/JSCallee.h:
* runtime/JSFunction.cpp:
(JSC::JSFunction::JSFunction):
(JSC::JSFunction::createRareData):
(JSC::JSFunction::visitChildren):
(JSC::JSFunction::put):
(JSC::JSFunction::defineOwnProperty):
(JSC::JSFunction::destroy): Deleted.
(JSC::JSFunction::createAllocationProfile): Deleted.
* runtime/JSFunction.h:
(JSC::JSFunction::offsetOfRareData):
(JSC::JSFunction::rareData):
(JSC::JSFunction::allocationStructure):
(JSC::JSFunction::allocationProfileWatchpointSet):
(JSC::JSFunction::offsetOfAllocationProfile): Deleted.
(JSC::JSFunction::allocationProfile): Deleted.
* runtime/JSFunctionInlines.h:
(JSC::JSFunction::JSFunction):
* runtime/VM.cpp:
(JSC::VM::VM):
* runtime/VM.h:

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

5 years agoPull emoji-position adjustment code into its own function
simon.fraser@apple.com [Thu, 16 Apr 2015 18:47:53 +0000 (18:47 +0000)]
Pull emoji-position adjustment code into its own function
https://bugs.webkit.org/show_bug.cgi?id=143592

Reviewed by Myles C. Maxfield.

First step to cleaning up FontCascade::drawGlyphs(). Pull iOS-only code related to
emoji positioning into its own function.

* platform/graphics/cocoa/FontCascadeCocoa.mm:
(WebCore::pointAdjustedForEmoji):
(WebCore::FontCascade::drawGlyphs):

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

5 years agoProvide a mechanism through the legacy SPI to know when swipe gestures begin and end
timothy_horton@apple.com [Thu, 16 Apr 2015 18:31:00 +0000 (18:31 +0000)]
Provide a mechanism through the legacy SPI to know when swipe gestures begin and end
https://bugs.webkit.org/show_bug.cgi?id=143740
<rdar://problem/20468540>

Reviewed by Dan Bernstein.

In the C SPI, add three WKPageLoaderClient callbacks for the three
navigation gesture events (did begin, will end, did end).

* UIProcess/API/C/WKPageLoaderClient.h:
Add the callbacks.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::navigationGestureDidBegin):
(API::LoaderClient::navigationGestureWillEnd):
(API::LoaderClient::navigationGestureDidEnd):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::navigationGestureDidBegin):
(WebKit::WebPageProxy::navigationGestureWillEnd):
(WebKit::WebPageProxy::navigationGestureDidEnd):
Dispatch navigation gesture events to the loader client as well as
(after a bounce through the PageClient) the navigation delegate.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
Call the callbacks.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::willEndSwipeGesture):
While we were already informing WebPageProxy of 'did begin' and 'did end'
navigation gesture events, we were missing 'will end'. Add it.

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

5 years agoDispatching multiple asynchronous animated resizes in parallel causes page scale...
timothy_horton@apple.com [Thu, 16 Apr 2015 18:25:00 +0000 (18:25 +0000)]
Dispatching multiple asynchronous animated resizes in parallel causes page scale to detach from reality
https://bugs.webkit.org/show_bug.cgi?id=143812
<rdar://problem/19866038>

Reviewed by Simon Fraser.

* Shared/VisibleContentRectUpdateInfo.h:
(WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
No cats in transaction (more of these below, too).

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::handleTap):
(WebKit::WebPage::commitPotentialTap):
(WebKit::WebPage::dynamicViewportSizeUpdate):
Add an incrementing ID to dynamicViewportSizeUpdates. The UI process keeps
the current ID, and it is bounced through the Web process (dynamicViewportSizeUpdates)
back to the UI process (dynamicViewportUpdateChangedTarget). If we have
dispatched another dynamicViewportSizeUpdate in the interim, ignore
the intermediate target.

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

5 years agoUse CommonCrypto for SHA1 and MD5
antti@apple.com [Thu, 16 Apr 2015 17:44:13 +0000 (17:44 +0000)]
Use CommonCrypto for SHA1 and MD5
https://bugs.webkit.org/show_bug.cgi?id=143826

Reviewed by Anders Carlsson.

CommonCrypto SHA1 implementation is ~4x faster than the naive WTF one. Use it when available.

These are covered by existing API tests.

* wtf/MD5.cpp:
(WTF::MD5::MD5):
(WTF::MD5::addBytes):
(WTF::MD5::checksum):
* wtf/MD5.h:
* wtf/SHA1.cpp:
(WTF::SHA1::SHA1):
(WTF::SHA1::addBytes):
(WTF::SHA1::computeHash):

    Remove the side effect where computeHash resets the state. No one relies on it.

(WTF::SHA1::hexDigest):
(WTF::SHA1::computeHexDigest):
* wtf/SHA1.h:

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

5 years ago[iOS] Delete hardcoded font fallback tables
mmaxfield@apple.com [Thu, 16 Apr 2015 17:32:27 +0000 (17:32 +0000)]
[iOS] Delete hardcoded font fallback tables
https://bugs.webkit.org/show_bug.cgi?id=143583

Reviewed by Darin Adler

Source/WebCore:

Instead of hardcoding which font to use for a particular character, use
CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage().

Updated test expected results:
    editing/selection/vertical-rl-rtl-extend-line-backward-br.html
    editing/selection/vertical-rl-rtl-extend-line-backward-p.html
    editing/selection/vertical-rl-rtl-extend-line-forward-br.html
    editing/selection/vertical-rl-rtl-extend-line-forward-p.html
    fast/text/international/danda-space.html
    fast/text/international/thai-baht-space.html

* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::getSystemFontFallbackForCharacters):
(WebCore::FontCache::systemFallbackForCharacters):
* platform/spi/cocoa/CoreTextSPI.h:

LayoutTests:

Updating expected results.

* editing/selection/vertical-rl-rtl-extend-line-backward-br.html: Updating expected results
* editing/selection/vertical-rl-rtl-extend-line-backward-p.html: Updating expected results
* editing/selection/vertical-rl-rtl-extend-line-forward-br.html: Updating expected results
* editing/selection/vertical-rl-rtl-extend-line-forward-p.html: Updating expected results
* fast/text/international/danda-space.html: Updating expected results
* fast/text/international/thai-baht-space.html: Updating expected results

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

5 years agoMore flaky tests in http/tests/security/mixedContent
ap@apple.com [Thu, 16 Apr 2015 17:30:20 +0000 (17:30 +0000)]
More flaky tests in http/tests/security/mixedContent
https://bugs.webkit.org/show_bug.cgi?id=143804

Reviewed by Csaba Osztrogonác.

Start secondary window loading in onload, so that it doesn't race with main document
finishing to load.

* http/tests/security/mixedContent/about-blank-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/about-blank-iframe-in-main-frame.html:
* http/tests/security/mixedContent/insecure-audio-video-in-main-frame.html:
* http/tests/security/mixedContent/insecure-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/insecure-iframe-in-main-frame.html:
* http/tests/security/mixedContent/insecure-image-in-main-frame.html:
* http/tests/security/mixedContent/insecure-xhr-in-main-frame.html:
* http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/redirect-http-to-https-iframe-in-main-frame.html:
* http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame-expected.txt:
* http/tests/security/mixedContent/redirect-https-to-http-iframe-in-main-frame.html:

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

5 years agoRemove PluginController::isPluginVisible().
commit-queue@webkit.org [Thu, 16 Apr 2015 17:28:34 +0000 (17:28 +0000)]
Remove PluginController::isPluginVisible().
https://bugs.webkit.org/show_bug.cgi?id=143830

Patch by Sungmann Cho <sungmann.cho@navercorp.com> on 2015-04-16
Reviewed by Darin Adler.

PluginController::isPluginVisible() was introduced by http://webkit.org/b/60285.
This method had been used only for WebKit2 on Windows, and no one uses it now.
So we can remove it.

No new tests, no behavior change.

* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::isPluginVisible): Deleted.
* PluginProcess/PluginControllerProxy.h:
* WebProcess/Plugins/PluginController.h:
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::isPluginVisible): Deleted.
* WebProcess/Plugins/PluginView.h:

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

5 years ago[WinCairo] Compile error when environment variable WEBKITLIBRARIESDIR is not defined.
peavo@outlook.com [Thu, 16 Apr 2015 17:03:23 +0000 (17:03 +0000)]
[WinCairo] Compile error when environment variable WEBKITLIBRARIESDIR is not defined.
https://bugs.webkit.org/show_bug.cgi?id=143828

Reviewed by Brent Fulgham.

Python throws an exception when calling os.environ['WEBKITLIBRARIESDIR'] and
WEBKITLIBRARIESDIR is not defined. WEBKITLIBRARIESDIR is obsolete, we can remove it.

* AVFoundationSupport.py:
(lookFor):

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

5 years agoRemove the unnecessary WTF_CHANGES define
ossy@webkit.org [Thu, 16 Apr 2015 16:53:19 +0000 (16:53 +0000)]
Remove the unnecessary WTF_CHANGES define
https://bugs.webkit.org/show_bug.cgi?id=143825

Reviewed by Andreas Kling.

* config.h:

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

5 years agoMinor AudioContext cleanup
ap@apple.com [Thu, 16 Apr 2015 16:19:09 +0000 (16:19 +0000)]
Minor AudioContext cleanup
https://bugs.webkit.org/show_bug.cgi?id=143816

Reviewed by Jer Noble.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::~AudioContext):
(WebCore::AudioContext::lazyInitialize):
(WebCore::AudioContext::stop):
(WebCore::AudioContext::derefNode):
(WebCore::AudioContext::scheduleNodeDeletion):
(WebCore::AudioContext::deleteMarkedNodes):
(WebCore::AudioContext::stopDispatch): Deleted.
(WebCore::AudioContext::deleteMarkedNodesDispatch): Deleted.
* Modules/webaudio/AudioContext.h:

* Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::~AudioNode):

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

5 years agoWeb Inspector: Remove unnecessary intermediate object from DOMTreeOutline
commit-queue@webkit.org [Thu, 16 Apr 2015 15:43:30 +0000 (15:43 +0000)]
Web Inspector: Remove unnecessary intermediate object from DOMTreeOutline
https://bugs.webkit.org/show_bug.cgi?id=143811

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-16
Reviewed by Brian Burg.

* UserInterface/Views/DOMTreeOutline.js:
(WebInspector.DOMTreeOutline):
(WebInspector.DOMTreeOutline.prototype._selectedNodeChanged):
(WebInspector.DOMTreeOutline.prototype.addEventListener): Deleted.
(WebInspector.DOMTreeOutline.prototype.removeEventListener): Deleted.
This object used to be used to handle event dispatching, but
TreeOutlines themselves are now WebInspector.Objects so we
can remove the intermediary.

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

5 years agoUnreviewed attempt to fix Windows build after r182881.
cdumez@apple.com [Thu, 16 Apr 2015 15:18:52 +0000 (15:18 +0000)]
Unreviewed attempt to fix Windows build after r182881.

Add missing header include.

* page/PageConsoleClient.h:

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

5 years ago[EFL] Disable a flaky ewk_context_network_process_model() API test
gyuyoung.kim@webkit.org [Thu, 16 Apr 2015 13:55:08 +0000 (13:55 +0000)]
[EFL] Disable a flaky ewk_context_network_process_model() API test
https://bugs.webkit.org/show_bug.cgi?id=143824

Reviewed by Csaba Osztrogonác.

ewk_context_network_process_model has been often failed. Though Bug 142967
was filed to fix this issue, it is not solved yet. To maintain EFL bot, this patch
disables it until fixing it.

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

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

5 years ago[EFL] Bump LLVM to version 3.6.0 on X86_64
ossy@webkit.org [Thu, 16 Apr 2015 13:39:25 +0000 (13:39 +0000)]
[EFL] Bump LLVM to version 3.6.0 on X86_64
https://bugs.webkit.org/show_bug.cgi?id=143604

Reviewed by Gyuyoung Kim.

.:

* Source/cmake/FindLLVM.cmake: Added version handling.
* Source/cmake/OptionsEfl.cmake: Require LLVM 3.6.0 on X86_64 and patched LLVM 3.5.0 on AArch64.

Tools:

* efl/jhbuild.modules:
* efl/patches/llvm-elf-add-stackmaps-arm64.patch: Added the necessary part of llvm-elf-add-stackmaps.patch.
* efl/patches/llvm-elf-add-stackmaps.patch: Removed, it is included in LLVM 3.6.0 release.
* efl/patches/llvm-elf-allow-fde-references-outside-the-2gb-range.patch: Removed, it is included in LLVM 3.6.0 release.
* efl/patches/llvm-version-arm64.patch: Added. Set PACKAGE_VERSION to "3.5.0ftl" to be able to ensure we use patched LLVM on AArch64.

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

5 years ago[WK2] Forwarding headers generator shouldn't generate unnecessary headers
ossy@webkit.org [Thu, 16 Apr 2015 13:37:53 +0000 (13:37 +0000)]
[WK2] Forwarding headers generator shouldn't generate unnecessary headers
https://bugs.webkit.org/show_bug.cgi?id=143820

Reviewed by Carlos Garcia Campos.

* Scripts/generate-forwarding-headers.pl:
(collectNeededHeaders):

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

5 years ago[EFL] Remove an unnecessary workaround from jhbuildrc
ossy@webkit.org [Thu, 16 Apr 2015 13:27:31 +0000 (13:27 +0000)]
[EFL] Remove an unnecessary workaround from jhbuildrc
https://bugs.webkit.org/show_bug.cgi?id=143823

Reviewed by Gyuyoung Kim.

* efl/jhbuildrc:

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

5 years ago[GTK] Run forwarding headers generator unconditionally
ossy@webkit.org [Thu, 16 Apr 2015 11:46:27 +0000 (11:46 +0000)]
[GTK] Run forwarding headers generator unconditionally
https://bugs.webkit.org/show_bug.cgi?id=143819

Reviewed by Carlos Garcia Campos.

Source/WebKit2:

* PlatformGTK.cmake:

Tools:

* TestWebKitAPI/PlatformGTK.cmake:
* WebKitTestRunner/PlatformGTK.cmake:

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

5 years agoTests introduced in r182877 are flaky
cdumez@apple.com [Thu, 16 Apr 2015 07:47:31 +0000 (07:47 +0000)]
Tests introduced in r182877 are flaky
https://bugs.webkit.org/show_bug.cgi?id=143784

Reviewed by Alexey Proskuryakov.

Tests introduced in r182877 are flaky as the line number sometimes
appears in the console messages. This patch updates the console
logging code so that no Document is provided when logging. Therefore,
no line number will ever be displayed. In this case, I don't think
having the line number is terribly useful anyway.

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):

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

5 years agoWe should dump GraphicsLayer's anchorPoint z component
simon.fraser@apple.com [Thu, 16 Apr 2015 05:59:18 +0000 (05:59 +0000)]
We should dump GraphicsLayer's anchorPoint z component
https://bugs.webkit.org/show_bug.cgi?id=143815

Reviewed by Tim Horton.

We didn't include the z component of a layer's anchor point when dumping.
Dump if it's non-zero (to avoid having to change lots of test output).
No test with non-zero z appears to dump layers.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
* rendering/style/RenderStyle.cpp:
(WebCore::requireTransformOrigin): Remove a FIXME which, on further consideration,
is wrong.

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

5 years ago[Mac] Disable "Save to Downloads" option for local files
bfulgham@apple.com [Thu, 16 Apr 2015 03:57:51 +0000 (03:57 +0000)]
[Mac] Disable "Save to Downloads" option for local files
https://bugs.webkit.org/show_bug.cgi?id=143794

Reviewed by Tim Horton.

Disable the Image and Media download options if the download
target is a local file. We can only download web resources;
anything else is actually a no-op.

Source/WebCore:

* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::checkOrEnableIfNeeded): Disable
menu item if appropriate.

Source/WebKit/mac:

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForImage]):
(-[WebActionMenuController _defaultMenuItemsForVideo]):

Source/WebKit2:

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _defaultMenuItemsForVideo]):
(-[WKActionMenuController _defaultMenuItemsForImage]):

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

5 years agoMake MarkedBlock and WeakBlock 4x smaller.
akling@apple.com [Thu, 16 Apr 2015 03:40:14 +0000 (03:40 +0000)]
Make MarkedBlock and WeakBlock 4x smaller.
<https://webkit.org/b/143802>

Reviewed by Mark Hahnenberg.

To reduce GC heap fragmentation and generally use less memory, reduce the size of MarkedBlock
and its buddy WeakBlock by 4x, bringing them from 64kB+4kB to 16kB+1kB.

In a sampling of cool web sites, I'm seeing ~8% average reduction in overall GC heap size.
Some examples:

           apple.com:  6.3MB ->  5.5MB (14.5% smaller)
          reddit.com:  4.5MB ->  4.1MB ( 9.7% smaller)
         twitter.com: 23.2MB -> 21.4MB ( 8.4% smaller)
    cuteoverload.com: 24.5MB -> 23.6MB ( 3.8% smaller)

Benchmarks look mostly neutral.
Some small slowdowns on Octane, some slightly bigger speedups on Kraken and SunSpider.

* heap/MarkedBlock.h:
* heap/WeakBlock.h:
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LowLevelInterpreter.asm:

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

5 years agoAdd a console message when a stylesheet is not parsed due to invalid MIME type
cdumez@apple.com [Thu, 16 Apr 2015 02:53:44 +0000 (02:53 +0000)]
Add a console message when a stylesheet is not parsed due to invalid MIME type
https://bugs.webkit.org/show_bug.cgi?id=143784

Reviewed by Joseph Pecoraro.

Source/WebCore:

After r180020, we no longer have a quirks mode exception for CSS MIME
types. This means that we'll start rejecting stylesheets that were
previously accepted due to this quirk. In this case we log a console
message to help Web developers understand why their stylesheet is being
rejected.

* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::setCSSStyleSheet):

* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parseAuthorStyleSheet):
- Initialize hasValidMIMEType to true so that it ends up being false
  only when canUseSheet(hasValidMIMEType) is called and we've determined
  the MIME type is indeed invalid. Otherwise, hasValidMIMEType would
  also be false when m_data is null or empty in
  CachedCSSStyleSheet::sheetText() and we don't want to display the MIME
  type error in this case.
- If hasValidMIMEType is false, display the console message and abort
  early. We don't need to execute the rest of the function in this case
  as sheetText is a null String and there is no point in trying to parse
  it.
- Drop handling of !hasValidMIMEType && !hasSyntacticallyValidCSSHeader()
  as this can no longer be reached. This handling no longer makes sense
  after r180020 as sheetText() will now always return a null String if
  the MIME type is invalid (as we no longer support the CSS MIME type
  quirks mode).

* css/StyleSheetContents.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setCSSStyleSheet):

LayoutTests:

Update expectations for tests that are using stylesheets served with wrong
MIME type as we now display a console message in this case.

* http/tests/inspector/css/bad-mime-type-expected.txt:
* http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-and-css-extension-expected.txt:
* http/tests/mime/standard-mode-does-not-load-stylesheet-with-text-plain-expected.txt:
* http/tests/misc/css-accept-any-type-expected.txt:
* http/tests/misc/css-reject-any-type-in-strict-mode-expected.txt:

* http/tests/security/cross-origin-css-1-expected.txt: Added.
* http/tests/security/cross-origin-css-1.html: Added.
* http/tests/security/cross-origin-css-2-expected.txt: Added.
* http/tests/security/cross-origin-css-2.html: Added.
* http/tests/security/cross-origin-css-3-expected.txt: Added.
* http/tests/security/cross-origin-css-3.html: Added.
* http/tests/security/cross-origin-css-4-expected.txt: Added.
* http/tests/security/cross-origin-css-4.html: Added.
* http/tests/security/cross-origin-css-5-expected.txt: Added.
* http/tests/security/cross-origin-css-5.html: Added.
* http/tests/security/cross-origin-css-6-expected.txt: Added.
* http/tests/security/cross-origin-css-6.html: Added.
* http/tests/security/cross-origin-css-7-expected.txt: Added.
* http/tests/security/cross-origin-css-7.html: Added.
* http/tests/security/cross-origin-css-8-expected.txt: Added.
* http/tests/security/cross-origin-css-8.html: Added.
* http/tests/security/cross-origin-css-expected.txt: Removed.
* http/tests/security/cross-origin-css.html: Removed.
Split http/tests/security/cross-origin-css.html into several tests. The
test would be flaky otherwise as console messages could appear in
different order for every run.

* platform/mac/http/tests/misc/acid3-expected.txt:

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

5 years agoMinimum font size pref breaks SVG text very badly.
said@apple.com [Thu, 16 Apr 2015 02:50:29 +0000 (02:50 +0000)]
Minimum font size pref breaks SVG text very badly.
https://bugs.webkit.org/show_bug.cgi?id=143590.

Reviewed by Simon Fraser.

Source/WebCore:

When enabling the minimum font size perf, the computed font size is set
to the minimum font size if the computed value is smaller than the minimum.
The bug happens because the SVG text element applies its scaling on the
computed value after applying the minimum fort size rule. This means the
final computed value for the font size will be the scaling of the minimum
font size and not minimum font size itself. What we need is to postpone
applying the minimum font size rules, till the SVG scaling is applied.

Tests: svg/text/font-small-enlarged-minimum-larger.svg
       svg/text/font-small-enlarged-minimum-smaller.svg

* rendering/svg/RenderSVGInlineText.cpp:
(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle): Call
computedFontSizeFromSpecifiedSizeForSVGInlineText() even if scalingFactor
is 1. We need to make sure the minimum font size rules are applied. This
function was assuming the mininum font size rule was applied when resolving
the style. This is not true anymore for the SVG text.

* style/StyleFontSizeFunctions.cpp:
(WebCore::Style::computedFontSizeFromSpecifiedSize): Do not apply the
minimum size rules for the SVG element until it applies its scaling to
the font size.

LayoutTests:

When enabling the minimum font size perf, the SVG text element should
apply the minimum font size rules on the scaled font.

* svg/text/font-small-enlarged-minimum-larger-expected.svg: Added.
* svg/text/font-small-enlarged-minimum-larger.svg: Added.
Minimum font size is larger than the scaled font size. Also the expected
file makes sure the minimum font size rules are still applied if no scaling
is applied.

* svg/text/font-small-enlarged-minimum-smaller-expected.svg: Added.
* svg/text/font-small-enlarged-minimum-smaller.svg: Added.
Minimum font size is smaller than the scaled font size. So the minimim font
size rule should not have any effect on the final computed font size.

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

5 years agoMake websiteDataStore on WKWebViewConfiguration public
andersca@apple.com [Thu, 16 Apr 2015 02:25:28 +0000 (02:25 +0000)]
Make websiteDataStore on WKWebViewConfiguration public
https://bugs.webkit.org/show_bug.cgi?id=143810

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration websiteDataStore]):
(-[WKWebViewConfiguration setWebsiteDataStore:]):
(-[WKWebViewConfiguration _websiteDataStore]):
(-[WKWebViewConfiguration _setWebsiteDataStore:]):

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

5 years ago[EFL] Add gnutls to jhbuild.module
gyuyoung.kim@webkit.org [Thu, 16 Apr 2015 00:45:48 +0000 (00:45 +0000)]
[EFL] Add gnutls to jhbuild.module
https://bugs.webkit.org/show_bug.cgi?id=143777

Reviewed by Csaba Osztrogonác.

EFL port has required at least 3.0.0 version of gnutls since r176712.
However some old linux distributions don't support 3.0.0 version. Besides
other projects sometimes need to use lower version of gnutls.

This patch supports to download gnutls through jhbuild, and use it.

* efl/install-dependencies: Add nettle-dev dependency and remove libgnutls28-dev.
* efl/jhbuild.modules: Download 3.3 version because 3.3 version is stable version.

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

5 years agoMake WKWebsiteDataStore public
andersca@apple.com [Thu, 16 Apr 2015 00:45:24 +0000 (00:45 +0000)]
Make WKWebsiteDataStore public
https://bugs.webkit.org/show_bug.cgi?id=143805

Reviewed by Dan Bernstein.

Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the
types of the defaultDataStore and nonPersistentDataStore class methods.

Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore
and forwards the defaultDataStore and nonPersistentDataStore method calls.

* Shared/API/Cocoa/WebKit.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView initWithFrame:configuration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration _websiteDataStore]):
* UIProcess/API/Cocoa/WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm.
(+[WKWebsiteDataStore defaultDataStore]):
(+[WKWebsiteDataStore nonPersistentDataStore]):
(-[WKWebsiteDataStore dealloc]):
(-[WKWebsiteDataStore isNonPersistent]):
(toSystemClockTime):
(-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
(-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
(toWebsiteDataRecords):
(-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
(-[WKWebsiteDataStore _apiObject]):
* UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h.
(WebKit::wrapper):
* UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
(+[_WKWebsiteDataStore defaultDataStore]):
(+[_WKWebsiteDataStore nonPersistentDataStore]):
(-[_WKWebsiteDataStore dealloc]): Deleted.
(-[_WKWebsiteDataStore isNonPersistent]): Deleted.
(toWebsiteDataTypes): Deleted.
(toSystemClockTime): Deleted.
(-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): Deleted.
(-[_WKWebsiteDataStore _apiObject]): Deleted.
* WebKit2.xcodeproj/project.pbxproj:

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

5 years agoString.prototype.startsWith/endsWith/includes have wrong length in r182673
commit-queue@webkit.org [Thu, 16 Apr 2015 00:15:11 +0000 (00:15 +0000)]
String.prototype.startsWith/endsWith/includes have wrong length in r182673
https://bugs.webkit.org/show_bug.cgi?id=143659

Patch by Jordan Harband <ljharb@gmail.com> on 2015-04-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Fix lengths of String.prototype.{includes,startsWith,endsWith} per spec
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.includes
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):

LayoutTests:

* js/script-tests/string-includes.js:
* js/string-includes-expected.txt:

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

5 years agoRemove obsolete VMInspector debugging tool.
mark.lam@apple.com [Thu, 16 Apr 2015 00:10:57 +0000 (00:10 +0000)]
Remove obsolete VMInspector debugging tool.
https://bugs.webkit.org/show_bug.cgi?id=143798

Reviewed by Michael Saboff.

Source/JavaScriptCore:

I added the VMInspector tool 3 years ago to aid in VM hacking work.  Some of it
has bit rotted, and now the VM also has better ways to achieve its functionality.
Hence this code is now obsolete and should be removed.

* CMakeLists.txt:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
* JavaScriptCore.xcodeproj/project.pbxproj:
* interpreter/CallFrame.h:
* interpreter/VMInspector.cpp: Removed.
* interpreter/VMInspector.h: Removed.
* llint/LowLevelInterpreter.cpp:

Source/WebCore:

No new tests needed.  Just removing obsolete code.

* ForwardingHeaders/interpreter/VMInspector.h: Removed.

Tools:

* TestWebKitAPI/CMakeLists.txt:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj:
* TestWebKitAPI/TestWebKitAPI.vcxproj/TestWebKitAPI.vcxproj.filters:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/JavaScriptCore/VMInspector.cpp: Removed.

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

5 years agoWeb Inspector: InspectorTest frontend console methods redirected to the frontend...
commit-queue@webkit.org [Wed, 15 Apr 2015 23:21:47 +0000 (23:21 +0000)]
Web Inspector: InspectorTest frontend console methods redirected to the frontend are wrong
https://bugs.webkit.org/show_bug.cgi?id=143801

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-15
Reviewed by Brian Burg.

* UserInterface/Base/Test.js:
(InspectorTest.evaluateInPage):
Properly if check for the existence of an agent.

(global):
Properly hook up console redirect handlers so they
will output the right type and arguments strings.

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

5 years agoCustom CSS cursors do not use -webkit-image-set on retina displays
timothy_horton@apple.com [Wed, 15 Apr 2015 23:21:42 +0000 (23:21 +0000)]
Custom CSS cursors do not use -webkit-image-set on retina displays
https://bugs.webkit.org/show_bug.cgi?id=120783
.:

Reviewed by Beth Dakin.

Add a manual test for custom CSS cursors on retina displays.

* ManualTests/retina-cursors.html: Added.

Source/WebCore:

<rdar://problem/14921432>

Reviewed by Beth Dakin.

Scale NSCursor images correctly so custom CSS cursors work with
-webkit-image-set on retina displays.

* WebCore.exp.in:
* page/EventHandler.cpp:
(WebCore::EventHandler::selectCursor):
* platform/mac/CursorMac.mm:
(WebCore::createCustomCursor):
(WebCore::Cursor::ensurePlatformCursor):

Source/WebKit2:

Reviewed by Beth Dakin.

Serialize the cursor image scale for SetCursor messages so custom
CSS cursors work with -webkit-image-set on retina displays.

* Shared/WebCoreArgumentCoders.cpp:
(CoreIPC::ArgumentCoder<Cursor>::encode):
(CoreIPC::ArgumentCoder<Cursor>::decode):

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

5 years agoMath.imul has wrong length in Safari 8.0.4
commit-queue@webkit.org [Wed, 15 Apr 2015 23:14:55 +0000 (23:14 +0000)]
Math.imul has wrong length in Safari 8.0.4
https://bugs.webkit.org/show_bug.cgi?id=143658

Patch by Jordan Harband <ljharb@gmail.com> on 2015-04-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Correcting function length from 1, to 2, to match spec
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul

* runtime/MathObject.cpp:
(JSC::MathObject::finishCreation):

LayoutTests:

* js/script-tests/math.js:

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

5 years agoWeb Inspector: Handle all possible Console message Source types in IssueMessage
commit-queue@webkit.org [Wed, 15 Apr 2015 23:09:27 +0000 (23:09 +0000)]
Web Inspector: Handle all possible Console message Source types in IssueMessage
https://bugs.webkit.org/show_bug.cgi?id=143803

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-15
Reviewed by Brian Burg.

* UserInterface/Models/IssueMessage.js:
(WebInspector.IssueMessage):
Update the switch to handle all possible console message sources.
"wml" was legacy and no longer supported.

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

5 years agoNo thread safety when passing ThreadableLoaderOptions from a worker thread
ap@apple.com [Wed, 15 Apr 2015 22:56:56 +0000 (22:56 +0000)]
No thread safety when passing ThreadableLoaderOptions from a worker thread
https://bugs.webkit.org/show_bug.cgi?id=143790

Reviewed by Geoffrey Garen.

* loader/ThreadableLoader.h:
* loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy): Added.

* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Don't just send
a structure with strings to a different thread, that's bad.

* platform/CrossThreadCopier.h: I think that this is dead code, but for this bug,
just removing a clearly wrong specialization.

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

5 years agoProgress towards CMake on Mac.
achristensen@apple.com [Wed, 15 Apr 2015 22:45:51 +0000 (22:45 +0000)]
Progress towards CMake on Mac.
https://bugs.webkit.org/show_bug.cgi?id=143785

Reviewed by Csaba Osztrogonác.

.:

* CMakeLists.txt:
* Source/cmake/OptionsMac.cmake:
* Source/cmake/WebKitFS.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformMac.cmake:

Source/WebKit:

* PlatformMac.cmake:

Source/WebKit/mac:

* WebView/WebPDFDocumentExtras.mm:
* WebView/WebPDFView.mm:

Source/WebKit2:

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:

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

5 years agoClean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
dbates@webkit.org [Wed, 15 Apr 2015 22:35:42 +0000 (22:35 +0000)]
Clean up: Have SVGTextLayoutEngine::beginTextPathLayout() take a reference to a
RenderSVGTextPath instead of a pointer
https://bugs.webkit.org/show_bug.cgi?id=143787

Reviewed by Andreas Kling.

SVGTextLayoutEngine::beginTextPathLayout() assumes that the passed RenderObject is a
non-null pointer to a RenderSVGTextPath object. Instead we should have this function take a
reference to a RenderSVGTextPath object to help callers catch bad usage and better document
the expectation of a valid RenderSVGTextPath object.

* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Downcast the renderer of the
inline box to a RenderSVGTextPath object and pass it to SVGTextLayoutEngine::beginTextPathLayout().
We ensured that this cast is safe earlier in this function.
SVGTextLayoutEngine::beginTextPathLayout().
* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::beginTextPathLayout): Change type of first parameter from
RenderObject* to RenderSVGTextPath. Remove ASSERT() that was checking for a non-null
RenderObject pointer since we are passing the renderer by reference and a well-formed
reference must refer to a valid object.
* rendering/svg/SVGTextLayoutEngine.h: Substitute RenderSVGTextPath& for RenderObject*.

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

5 years agoNumber.parseInt in nightly r182673 has wrong length
commit-queue@webkit.org [Wed, 15 Apr 2015 21:49:25 +0000 (21:49 +0000)]
Number.parseInt in nightly r182673 has wrong length
https://bugs.webkit.org/show_bug.cgi?id=143657

Patch by Jordan Harband <ljharb@gmail.com> on 2015-04-15
Reviewed by Benjamin Poulain.

Source/JavaScriptCore:

Correcting funciton length from 1, to 2, to match spec
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.parseint

* runtime/NumberConstructor.cpp:
(JSC::NumberConstructor::finishCreation):

LayoutTests:

* js/number-constructor-expected.txt:
* js/script-tests/number-constructor.js:

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

5 years agoMake WKWebsiteDataRecord public
andersca@apple.com [Wed, 15 Apr 2015 21:48:00 +0000 (21:48 +0000)]
Make WKWebsiteDataRecord public
https://bugs.webkit.org/show_bug.cgi?id=143796

Reviewed by Dan Bernstein.

Rename _WKWebsiteDataRecord and associated files to WKWebsiteDataRecord and
add a new _WKWebsiteDataRecord.h with a class @interface declaration that just
inherits from WKWebsiteDataRecord. We don't need an @implementation since nobody is expected
to allocate _WKWebsiteDataRecord objects.

* Shared/API/Cocoa/WebKit.h:
* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
* UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h.
* UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm.
(-[WKWebsiteDataRecord dealloc]):
(dataTypesToString):
(-[WKWebsiteDataRecord description]):
(-[WKWebsiteDataRecord displayName]):
(-[WKWebsiteDataRecord dataTypes]):
(-[WKWebsiteDataRecord _apiObject]):
* UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h.
(WebKit::wrapper):
(WebKit::toWebsiteDataTypes):
(WebKit::toWKWebsiteDataTypes):
* UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
* UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
(toWebsiteDataRecords):
* WebKit2.xcodeproj/project.pbxproj:

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

5 years ago[Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideo...
jer.noble@apple.com [Wed, 15 Apr 2015 20:59:35 +0000 (20:59 +0000)]
[Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
https://bugs.webkit.org/show_bug.cgi?id=143674

Reviewed by Darin Adler.

Source/WebCore:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen): Pass a reference.
(WebCore::HTMLMediaElement::exitFullscreen): exitVideoFullscreen() -> exitVideoFullscreenForVideoElement(...).
* page/ChromeClient.h:

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
(WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
(WebChromeClient::exitVideoFullscreen): Deleted.

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
(WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
(WebChromeClient::exitVideoFullscreen): Deleted.
* WebCoreSupport/WebChromeClient.h:
* WebView.cpp:
(WebView::enterVideoFullscreenForVideoElement): Takes a reference.
(WebView::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
(WebView::exitVideoFullscreen): Deleted.
* WebView.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
(WebKit::WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
(WebKit::WebChromeClient::exitVideoFullscreen): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/ios/WebVideoFullscreenManager.h:
* WebProcess/ios/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
(WebKit::WebVideoFullscreenManager::didEnterFullscreen): Pass a reference.
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
(WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.

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

5 years agoUnreviewed gardening; Make the previous commit apply only _post_ Yosemite.
jer.noble@apple.com [Wed, 15 Apr 2015 20:54:42 +0000 (20:54 +0000)]
Unreviewed gardening; Make the previous commit apply only _post_ Yosemite.

* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:

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

5 years agoUnreviewed gardening; disable FullscreenZoomInitialFrame.WebKit2 API test post-Yosemite.
jer.noble@apple.com [Wed, 15 Apr 2015 20:50:55 +0000 (20:50 +0000)]
Unreviewed gardening; disable FullscreenZoomInitialFrame.WebKit2 API test post-Yosemite.

* TestWebKitAPI/Tests/mac/FullscreenZoomInitialFrame.mm:
(TestWebKitAPI::TEST_F):

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

5 years agoHarden DFGForAllKills
fpizlo@apple.com [Wed, 15 Apr 2015 20:32:20 +0000 (20:32 +0000)]
Harden DFGForAllKills
https://bugs.webkit.org/show_bug.cgi?id=143792

Reviewed by Geoffrey Garen.

Unfortunately, we don't have a good way to test this yet - but it will be needed to prevent
bugs in https://bugs.webkit.org/show_bug.cgi?id=143734.

Previously ForAllKills used the bytecode kill analysis. That seemed like a good idea because
that analysis is cheaper than the full liveness analysis. Unfortunately, it's probably wrong:

- It looks for kill sites at forExit origin boundaries. But, something might have been killed
  by an operation that was logically in between the forExit origins at the boundary, but was
  removed from the DFG for whatever reason. The DFG is allowed to have bytecode instruction
  gaps.

- It overlooked the fact that a MovHint that addresses a local that is always live kills that
  local. For example, storing to an argument means that the prior value of the argument is
  killed.

This fixes the analysis by making it handle MovHints directly, and making it define kills in
the most conservative way possible: it asks if you were live before but dead after. If we
have the compile time budget to afford this more direct approach, then it's definitel a good
idea since it's so fool-proof.

* dfg/DFGArgumentsEliminationPhase.cpp:
* dfg/DFGForAllKills.h:
(JSC::DFG::forAllKilledOperands):
(JSC::DFG::forAllKilledNodesAtNodeIndex):
(JSC::DFG::forAllDirectlyKilledOperands): Deleted.

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

5 years agoNetwork Cache: Inline small body data to record file
antti@apple.com [Wed, 15 Apr 2015 19:54:21 +0000 (19:54 +0000)]
Network Cache: Inline small body data to record file
https://bugs.webkit.org/show_bug.cgi?id=143783

Reviewed by Chris Dumez.

We currently save all body data as separate files. We can improve space efficiency and do less reads and writes
by inlining smaller resource bodies with the header.

* NetworkProcess/cache/NetworkCacheIOChannel.h:
* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::read):
(WebKit::NetworkCache::IOChannel::readSync):
(WebKit::NetworkCache::IOChannel::write):

    Add WorkQueue argument to allow specifying which queue the result is submitted to.

* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::decodeRecordMetaData):

    Add a boolean indicating whether the body is inlined.

(WebKit::NetworkCache::decodeRecordHeader):
(WebKit::NetworkCache::Storage::decodeRecord):
(WebKit::NetworkCache::encodeRecordMetaData):
(WebKit::NetworkCache::Storage::storeBodyAsBlob):
(WebKit::NetworkCache::Storage::encodeRecord):
(WebKit::NetworkCache::Storage::dispatchReadOperation):

    Read the record first, then read the blob if needed.
    Submit the read operation directly from the main queue. Only thing we do is opening an IO channel
    and that uses O_NONBLOCK.
    Process the read results in the IO work queue where we now do the blob retrieval.

(WebKit::NetworkCache::shouldStoreBodyAsBlob):

    The current threshold for saving a separate blob is 16KB.

(WebKit::NetworkCache::Storage::dispatchWriteOperation):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::createRecord): Deleted.
(WebKit::NetworkCache::encodeRecordHeader): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:

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

5 years agoNon-local keyboards don't update scroll view parameters
timothy_horton@apple.com [Wed, 15 Apr 2015 19:43:22 +0000 (19:43 +0000)]
Non-local keyboards don't update scroll view parameters
https://bugs.webkit.org/show_bug.cgi?id=143791
<rdar://problem/18974020>

* Platform/spi/ios/UIKitSPI.h:
Fix the build.

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

5 years agoNon-local keyboards don't update scroll view parameters
timothy_horton@apple.com [Wed, 15 Apr 2015 19:18:00 +0000 (19:18 +0000)]
Non-local keyboards don't update scroll view parameters
https://bugs.webkit.org/show_bug.cgi?id=143791
<rdar://problem/18974020>

Reviewed by Enrica Casucci.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _shouldUpdateKeyboardWithInfo:]):
(-[WKWebView _keyboardWillChangeFrame:]):
(-[WKWebView _keyboardWillShow:]):
Make sure that we update scroll view parameters (obscured insets, etc.)
if we have a non-local keyboard, in addition to the cases where we have an assisted node.

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

5 years agoUnreviewed, skip http/tests/inspector/css/bad-mime-type.html on Windows
cdumez@apple.com [Wed, 15 Apr 2015 19:10:30 +0000 (19:10 +0000)]
Unreviewed, skip http/tests/inspector/css/bad-mime-type.html on Windows

Skip http/tests/inspector/css/bad-mime-type.html on Windows as it times
out. This is already the case for a lot of inspector tests on Windows.

* platform/win/TestExpectations:

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

5 years agoProvide SPI to allow changing whether JSContexts are remote debuggable by default
joepeck@webkit.org [Wed, 15 Apr 2015 19:03:13 +0000 (19:03 +0000)]
Provide SPI to allow changing whether JSContexts are remote debuggable by default
https://bugs.webkit.org/show_bug.cgi?id=143681

Reviewed by Darin Adler.

* API/JSRemoteInspector.h:
* API/JSRemoteInspector.cpp:
(JSRemoteInspectorGetInspectionEnabledByDefault):
(JSRemoteInspectorSetInspectionEnabledByDefault):
Provide SPI to toggle the default enabled inspection state of debuggables.

* API/JSContextRef.cpp:
(JSGlobalContextCreateInGroup):
Respect the default setting.

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

5 years agoHarmonize binary semaphore ifdefs
commit-queue@webkit.org [Wed, 15 Apr 2015 18:22:43 +0000 (18:22 +0000)]
Harmonize binary semaphore ifdefs

They should be either OS(WINDOWS) (in which case we'd need
BinarySemaphoreWin.cpp, which is not shipped by WebKitGTK)
or PLATFORM(WIN) (in which case Mutex/ThreadCondition-based
implementation is used).

This fixes errors like:
  CXX      Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In constructor 'WTF::BinarySemaphore::BinarySemaphore()':
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:34:7: error: class 'WTF::BinarySemaphore' does not have any field named 'm_isSet'
     : m_isSet(false)
       ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'void WTF::BinarySemaphore::signal()':
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:44:24: error: 'm_mutex' was not declared in this scope
     MutexLocker locker(m_mutex);
                        ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:46:5: error: 'm_isSet' was not declared in this scope
     m_isSet = true;
     ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:47:5: error: 'm_condition' was not declared in this scope
     m_condition.signal();
     ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp: In member function 'bool WTF::BinarySemaphore::wait(double)':
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:52:24: error: 'm_mutex' was not declared in this scope
     MutexLocker locker(m_mutex);
                        ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:55:13: error: 'm_isSet' was not declared in this scope
     while (!m_isSet) {
             ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:56:21: error: 'm_condition' was not declared in this scope
         timedOut = !m_condition.timedWait(m_mutex, absoluteTime);
                     ^
../webkitgtk-2.4.8/Source/WTF/wtf/threads/BinarySemaphore.cpp:62:5: error: 'm_isSet' was not declared in this scope
     m_isSet = false;
     ^
GNUmakefile:52762: recipe for target 'Source/WTF/wtf/threads/libWTF_la-BinarySemaphore.lo' failed

[W32] Inconsistent ifdefs in BinarySemaphore.h and BinarySemaphore.cpp
https://bugs.webkit.org/show_bug.cgi?id=143756

Patch by Руслан Ижбулатов <lrn1986@gmail.com> on 2015-04-15
Reviewed by Darin Adler.

* wtf/threads/BinarySemaphore.h:

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

5 years agoJavaScriptCore: Use kCFAllocatorDefault where possible
commit-queue@webkit.org [Wed, 15 Apr 2015 17:55:47 +0000 (17:55 +0000)]
JavaScriptCore: Use kCFAllocatorDefault where possible
https://bugs.webkit.org/show_bug.cgi?id=143747

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2015-04-15
Reviewed by Darin Adler.

* heap/HeapTimer.cpp:
(JSC::HeapTimer::HeapTimer):
* inspector/remote/RemoteInspectorDebuggableConnection.mm:
(Inspector::RemoteInspectorInitializeGlobalQueue):
(Inspector::RemoteInspectorDebuggableConnection::setupRunLoop):
For consistency and readability use the constant instead of
different representations of null.

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

5 years ago<rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of...
mitz@apple.com [Wed, 15 Apr 2015 17:50:44 +0000 (17:50 +0000)]
<rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA
https://bugs.webkit.org/show_bug.cgi?id=143786

Reviewed by Anders Carlsson.

* Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to
insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so
that we can check if the macro is already defined.
* WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase,
replace the placeholder with a definition of __NSi_{current deployment target} if not
already defined.

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

5 years agoMake creating send rights from shared memory more robust
andersca@apple.com [Wed, 15 Apr 2015 17:32:26 +0000 (17:32 +0000)]
Make creating send rights from shared memory more robust
https://bugs.webkit.org/show_bug.cgi?id=143730
rdar://problem/16595870

Reviewed by Darin Adler.

Source/WebCore:

Add a bool conversion operator to MachSendRight and tidy up the default constructor.

* platform/cocoa/MachSendRight.h:
(WebCore::MachSendRight::operator bool):
(WebCore::MachSendRight::MachSendRight): Deleted.

Source/WebKit2:

This cleans up creation of handles and send rights and also fixes a bug where it would be impossible
to send more than 128 MB of shared memory in a single object.

* Platform/SharedMemory.h:
* Platform/mac/SharedMemoryMac.cpp:
(WebKit::makeMemoryEntry):
New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures
that memory objects larger than 128 MB will be handled correctly.

(WebKit::SharedMemory::create):
Call makeMemoryEntry.

(WebKit::SharedMemory::createHandle):
Call createSendRight.

(WebKit::SharedMemory::createSendRight):
Call makeMemoryEntry and add the necessary assertions.

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

5 years ago[Win] DRT does not seem to reset the 'UsesPageCache' setting between tests
cdumez@apple.com [Wed, 15 Apr 2015 16:54:00 +0000 (16:54 +0000)]
[Win] DRT does not seem to reset the 'UsesPageCache' setting between tests
https://bugs.webkit.org/show_bug.cgi?id=143779

Reviewed by Brent Fulgham.

Reset the 'UsesPageCache' setting to FALSE between tests on Windows,
similarly to what is done on Mac / WK1. Without this, PageCache could
stay enabled after page cache tests and cause weird behaviors.

* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):

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

5 years agostreams/reference-implementation/readable-stream.html is flaky
ap@apple.com [Wed, 15 Apr 2015 16:36:29 +0000 (16:36 +0000)]
streams/reference-implementation/readable-stream.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=143778

* TestExpectations: Marking as such.

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

5 years agoGeneralize "isPlayingAudio" to include other media characteristics
eric.carlson@apple.com [Wed, 15 Apr 2015 16:19:39 +0000 (16:19 +0000)]
Generalize "isPlayingAudio" to include other media characteristics
https://bugs.webkit.org/show_bug.cgi?id=143713

Reviewed by Jer Noble.

Source/WebCore:

No new functionality.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::stop): updateIsPlayingAudio -> updateIsPlayingMedia.
(WebCore::AudioContext::isPlayingAudioDidChange): Ditto.

* dom/Document.cpp:
(WebCore::Document::addAudioProducer): Ditto.
(WebCore::Document::removeAudioProducer): Ditto.
(WebCore::Document::updateIsPlayingMedia): Renamed.
(WebCore::Document::updateIsPlayingAudio): Deleted.
* dom/Document.h:

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::setMuted): updateIsPlayingAudio -> updateIsPlayingMedia.
(WebCore::HTMLMediaElement::setPlaying): Ditto.

* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::updateIsPlayingMedia): Renamed.
(WebCore::Page::updateIsPlayingAudio): Deleted.
* page/Page.h:

Source/WebKit2:

* UIProcess/API/C/WKPage.cpp:
(toGenericCallbackFunction): Scope CallbackBase.
(WKPageForceRepaint): Ditto.
(WKPageValidateCommand): Ditto.
(WKPageComputePagesForPrinting): Ditto.

* UIProcess/API/Cocoa/_WKThumbnailView.mm:
(-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.

* UIProcess/API/mac/WKView.mm:
(-[WKView becomeFirstResponder]): Ditto.
(-[WKView updateFontPanelIfNeeded]): Ditto.
(-[WKView validateUserInterfaceItem:]): Ditto.
(-[WKView startSpeaking:]): Ditto.
(-[WKView selectedRangeWithCompletionHandler:]): Ditto.
(-[WKView markedRangeWithCompletionHandler:]): Ditto.
(-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
(-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
(-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
(-[WKView characterIndexForPoint:completionHandler:]): Ditto.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
(WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
* UIProcess/WebPageProxy.h:

* UIProcess/WebPageProxy.messages.in:

* UIProcess/mac/WKFullScreenWindowController.mm:
(-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
(-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.

* UIProcess/mac/WKPrintingView.mm:
(-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
(-[WKPrintingView _askPageToComputePageRects]): Ditto.
(-[WKPrintingView _drawPreview:]): Ditto.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setPluginIsPlayingAudio):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::isPlayingMediaDidChange):
(WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
* WebProcess/WebCoreSupport/WebChromeClient.h:

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

5 years agoNetwork Cache: Add thread-safe accessors for storage paths
antti@apple.com [Wed, 15 Apr 2015 11:19:19 +0000 (11:19 +0000)]
Network Cache: Add thread-safe accessors for storage paths
https://bugs.webkit.org/show_bug.cgi?id=143668

Reviewed by Darin Adler.

Less need to use StringCapture.

* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::Cache::dumpFilePath):
(WebKit::NetworkCache::Cache::storagePath):
* NetworkProcess/cache/NetworkCacheStorage.cpp:
(WebKit::NetworkCache::makeRecordsDirectoryPath):
(WebKit::NetworkCache::Storage::Storage):
(WebKit::NetworkCache::Storage::basePath):
(WebKit::NetworkCache::Storage::versionPath):
(WebKit::NetworkCache::Storage::recordsPath):
(WebKit::NetworkCache::Storage::synchronize):
(WebKit::NetworkCache::Storage::remove):
(WebKit::NetworkCache::Storage::dispatchReadOperation):
(WebKit::NetworkCache::Storage::finishReadOperation):
(WebKit::NetworkCache::Storage::dispatchWriteOperation):
(WebKit::NetworkCache::Storage::traverse):
(WebKit::NetworkCache::Storage::clear):
(WebKit::NetworkCache::Storage::shrink):
(WebKit::NetworkCache::Storage::deleteOldVersions):
(WebKit::NetworkCache::makeRecordDirectoryPath): Deleted.
* NetworkProcess/cache/NetworkCacheStorage.h:
(WebKit::NetworkCache::Storage::baseDirectoryPath): Deleted.
(WebKit::NetworkCache::Storage::directoryPath): Deleted.

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

5 years agoFix Debug build error 'comparison of unsigned expression >= 0 is always true [-Werror...
commit-queue@webkit.org [Wed, 15 Apr 2015 09:52:32 +0000 (09:52 +0000)]
Fix Debug build error 'comparison of unsigned expression >= 0 is always true [-Werror=type-limits]'
https://bugs.webkit.org/show_bug.cgi?id=143751

Patch by Joonghun Park <jh718.park@samsung.com> on 2015-04-15
Reviewed by Csaba Osztrogonác.

No new tests, no new behaviors.

* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk):

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

5 years agoinspector/console/console-api.html is very slow, frequently timing out
ap@apple.com [Wed, 15 Apr 2015 05:44:01 +0000 (05:44 +0000)]
inspector/console/console-api.html is very slow, frequently timing out
https://bugs.webkit.org/show_bug.cgi?id=143719

* TestExpectations: Further adjusted the expectations.

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

5 years agofast/dom/Window/timer-resume-on-navigation-back.html is flaky
ap@apple.com [Wed, 15 Apr 2015 05:28:29 +0000 (05:28 +0000)]
fast/dom/Window/timer-resume-on-navigation-back.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=33685

Reviewed by Brady Eidson.

If the timer fired before navigation, the test passed without going down the code
path that it was supposed to test. If it fired when navigation was in provisional
state, then dumping results was delayed until the navigation was finished, and
thus the intermediate page got dumped, and the test failed.

* fast/dom/Window/timer-resume-on-navigation-back.html:

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

5 years agoMake inline continuation style change logic consistent.
zalan@apple.com [Wed, 15 Apr 2015 04:24:14 +0000 (04:24 +0000)]
Make inline continuation style change logic consistent.
https://bugs.webkit.org/show_bug.cgi?id=143737
rdar://problem/20486596

Reviewed by Simon Fraser.

Do not force RenderBlock type-casting on the first sibling of the continuation's container.
The first sibling of the container of a continuation should be handled as the rest of the siblings.

Source/WebCore:

Test: fast/inline/inline-with-column-span-and-remove-block-child-crash.html

* rendering/RenderInline.cpp:
(WebCore::updateStyleOfAnonymousBlockContinuations):
(WebCore::RenderInline::styleDidChange):

LayoutTests:

* fast/inline/inline-with-column-span-and-remove-block-child-crash-expected.txt: Added.
* fast/inline/inline-with-column-span-and-remove-block-child-crash.html: Added.

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

5 years agoWeb Inspector: Uncaught exception in JSContext inspector when opening
commit-queue@webkit.org [Wed, 15 Apr 2015 03:57:19 +0000 (03:57 +0000)]
Web Inspector: Uncaught exception in JSContext inspector when opening
https://bugs.webkit.org/show_bug.cgi?id=143741

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

* UserInterface/Controllers/TimelineManager.js:
(WebInspector.TimelineManager.shouldShowViewForTimeline):
(WebInspector.TimelineManager.prototype._loadNewRecording):
Before using TimelineAgent, check for its existence first. It may
not exist in JSContext inspection.

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

5 years agoVersioning.
bshafiei@apple.com [Wed, 15 Apr 2015 02:29:21 +0000 (02:29 +0000)]
Versioning.

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

5 years agoRemove JavaScriptCoreUseJIT default from JavaScriptCore
msaboff@apple.com [Wed, 15 Apr 2015 02:16:39 +0000 (02:16 +0000)]
Remove JavaScriptCoreUseJIT default from JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=143746

Reviewed by Mark Lam.

* runtime/VM.cpp:
(JSC::enableAssembler):

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

5 years agoRename test LayoutTests/fast/events/drag-link.html to drag-and-drop-link-into-focused...
dbates@webkit.org [Wed, 15 Apr 2015 01:59:39 +0000 (01:59 +0000)]
Rename test LayoutTests/fast/events/drag-link.html to drag-and-drop-link-into-focused-contenteditable.html
https://bugs.webkit.org/show_bug.cgi?id=143683

Reviewed by Alexey Proskuryakov.

The name of the test LayoutTests/fast/events/drag-link.html is too generic given its purpose, which is
to test that we do not cause an assertion failure when dragging and dropping an HTML hyperlink into
a focused content editable element. We should come up with a more descriptive name for this test that
better describes what it tests.

* fast/events/drag-and-drop-link-into-focused-contenteditable-expected.txt: Renamed from LayoutTests/fast/events/drag-link-expected.txt.
* fast/events/drag-and-drop-link-into-focused-contenteditable.html: Renamed from LayoutTests/fast/events/drag-link.html.
* platform/efl/TestExpectations: Update file because of the rename.
* platform/gtk/TestExpectations: Ditto.
* platform/ios-simulator/TestExpectations: Ditto.
* platform/mac-wk2/TestExpectations: Ditto.

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

5 years agoRegression(r180020): Web Inspector crashes on pages that have a stylesheet with an...
cdumez@apple.com [Wed, 15 Apr 2015 01:39:05 +0000 (01:39 +0000)]
Regression(r180020): Web Inspector crashes on pages that have a stylesheet with an invalid MIME type
https://bugs.webkit.org/show_bug.cgi?id=143745
<rdar://problem/20243916>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

Add assertion in ContentSearchUtilities::findMagicComment() to make
sure the content String is not null or we would crash in
JSC::Yarr::interpret() later.

* inspector/ContentSearchUtilities.cpp:
(Inspector::ContentSearchUtilities::findMagicComment):

Source/WebCore:

After r180020, we are stricter and no longer accept CSS resources that
are not served with a CSS MIME type. Showing Web inspector on a page
with such bad resource would crash because
InspectorPageAgent::cachedResourceContent() would return true but
the result String would be null. This null String would then later
be passed to the Yarr interpreter and crash on a String::is8Bit()
call.

cachedResourceContent() calls CachedCSSStyleSheet::sheetText(). Before
r180020, it would return the text, even if the MIME type was incorrect.
However, this is no longer the case and we now need to make sure that
cachedResourceContent() returns false if sheetText() returns a null
String.

Test: http/tests/inspector/css/bad-mime-type.html

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::cachedResourceContent):

LayoutTests:

Add layout test that shows the Web inspector on a page that has
a stylesheet with an invalid MIME type, to make sure we don't
crash.

* http/tests/inspector/css/bad-mime-type-expected.txt: Added.
* http/tests/inspector/css/bad-mime-type.html: Added.
* http/tests/misc/css-accept-any-type.html:
* http/tests/misc/css-reject-any-type-in-strict-mode.html:
* http/tests/misc/resources/stylesheet-bad-mime-type.php: Renamed from LayoutTests/http/tests/misc/resources/stylesheet.php.

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

5 years agotextPath layout performance improvement.
commit-queue@webkit.org [Wed, 15 Apr 2015 01:34:25 +0000 (01:34 +0000)]
textPath layout performance improvement.
https://bugs.webkit.org/show_bug.cgi?id=141570.

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2015-04-14
Reviewed by Darin Adler.

PerformanceTests:

Cut down the time spent in traversing the path for text by 50%. Instead
of traversing the path twice at a certain length: one time for the position
and the second time for the angle, we can merge these two passes into one.

* SVG/TextOnPathSimple.html: Added.
* SVG/resources/TextOnPathSimple.svg: Added.

Source/WebCore:

The bottleneck of the text-on-path performance is the position and angle
calculations for every single character. If the number of characters is
'n' and the number of path elements is 'm', the total number of processing
the path elements is O(2 x n x m). What makes it really worse is, for every
curve we keep splitting the curve till the split curve is almost a straight
line. The changes we need to do are:
1. Merge the position and the angle traversals in one pass since they are
   returning info for the same length on the path. There is a degenerate
   case for the starting point when calculating the angle. The original
   code was solving this problem by passing an epsilon instead of zero but
   because traversing the path for position and angle are now merged, we
   will pass zero for the starting point as is. All we need is to move one
   step ahead without moving the position. We need the extra step forward
   to calculate the slope of the path at the starting point.
2. We need to add a new mode to traversing a path. The new mode will take
   a vector of lengths and returns a vector of arrow vectors. Every arrow
   vector represents a position and an angle on the path at a certain length.
   This requires changing the SVGTextLayoutEngine to calculate the lengths
   of the characters on the curve first and then passing all of them to the
   path traversal function. Instead of traversing the path for every length,
   we are going to get the required point and angle from the vector of arrow
   vectors.

This patch is addressing the first fix only. The second one will require
refactoring the SVGTextLayoutEngine so I am going to address it in a
different patch.

* platform/graphics/Path.cpp:
(WebCore::pathLengthApplierFunction): It is cleaner to move the function
of this method to PathTraversalState::processPathElement().

(WebCore::Path::length): Use new enum Action value and access methods.

(WebCore::Path::traversalStateAtLength): New function which returns the
traversalState at a certain length on a path.

(WebCore::Path::pointAtLength):
(WebCore::Path::normalAngleAtLength): Use traversalStateAtLength() to get
the traversalState and from it return either the position or the angle.

* platform/graphics/Path.h: Define traversalStateAtLength().

* platform/graphics/PathTraversalState.cpp:
(WebCore::distanceLine): Code clean up.

(WebCore::curveLength): Make the setting of m_previous and m_current happens
only in this function.

(WebCore::PathTraversalState::PathTraversalState): Add an optional parameter
for the desired length and move the initialization of the other members to
the class definition.

(WebCore::PathTraversalState::closeSubpath):
(WebCore::PathTraversalState::moveTo):
(WebCore::PathTraversalState::lineTo): Add the distance to the m_totalLength
instead of returning it since this is what all the callers were doing.

(WebCore::PathTraversalState::quadraticBezierTo):
(WebCore::PathTraversalState::cubicBezierTo): Add the distance to the
m_totalLength. Move the setting of m_previous and m_current to curveLength().
Remove unused members m_control1 and m_control2.

(WebCore::PathTraversalState::processSegment): Deleted.
(WebCore::PathTraversalState::finalizeAppendPathElement): Create a new
name for the function. Handle the case of the angle at the starting point
where m_desiredLength is set to zero. The new flag m_isZeroVector will be
set to notify the caller that the  next iteration will be the last one and
it is only needed for the calculating the angle of a zero vector. m_current
should not change by this last iteration.

(WebCore::PathTraversalState::appendPathElement): This code is moved from
pathLengthApplierFunction().

(WebCore::PathTraversalState::processPathElement): This function is used
by the class Path. It is a wrapper for appendPathElement(). If m_isZeroVector
is set we append the new element to a copy for the PathTraversalState just
to get the angle for the zero vector.

* platform/graphics/PathTraversalState.h: Change the enum values to not
not include the class or the enum class. Make the data members private and
expose the needed ones through access methods. Make all the internal methods
to be private.

(WebCore::PathTraversalState::processPathElement):  Another wrapper for
appendPathElement() which is used by SVGPathTraversalStateBuilder.

(WebCore::PathTraversalState::action):
(WebCore::PathTraversalState::setAction):
(WebCore::PathTraversalState::desiredLength):
(WebCore::PathTraversalState::setDesiredLength):
(WebCore::PathTraversalState::success):
(WebCore::PathTraversalState::totalLength):
(WebCore::PathTraversalState::current):
(WebCore::PathTraversalState::normalAngle): New access methods which are now
needed after making the data members private.

* rendering/svg/SVGRootInlineBox.cpp:
(WebCore::SVGRootInlineBox::layoutCharactersInTextBoxes): Make the casting
of the renderer on the caller side.

* rendering/svg/SVGTextChunk.cpp:
(WebCore::SVGTextChunk::SVGTextChunk): The constructor should append the
elements of m_boxes instead of making this from outside the class.

(WebCore::SVGTextChunk::totalCharacters):
(WebCore::SVGTextChunk::totalLength):
(WebCore::SVGTextChunk::calculateLength): Deleted.
Replace calculateLength() by totalCharacters() and totalLength() to make
the interface cleaner.

(WebCore::SVGTextChunk::totalAnchorShift):
(WebCore::SVGTextChunk::calculateTextAnchorShift): Deleted.
Rename the function name.

(WebCore::SVGTextChunk::layout):
(WebCore::SVGTextChunk::processTextLengthSpacingCorrection):
(WebCore::SVGTextChunk::buildBoxTransformations):
(WebCore::SVGTextChunk::boxSpacingAndGlyphsTransform):
(WebCore::SVGTextChunk::processTextAnchorCorrection):
Move the chunk layout code from SVGTextChunkBuilder::layoutTextChunks()
to the SVGTextChunk::layout(). Move all the helper functions as well.

* rendering/svg/SVGTextChunk.h:
(WebCore::SVGTextChunk::hasTextAnchor):
(WebCore::SVGTextChunk::boxes): Deleted.
Add the new methods and change most of the public methods to be private.

* rendering/svg/SVGTextChunkBuilder.cpp:
(WebCore::SVGTextChunkBuilder::totalCharacters):
(WebCore::SVGTextChunkBuilder::totalLength):
(WebCore::SVGTextChunkBuilder::totalAnchorShift): This code is moved from
SVGTextLayoutEngine. It scans the boxes stored in the SVGTextChunkBuilder
and sums up the total values.

(WebCore::SVGTextChunkBuilder::transformationForTextBox):
(WebCore::SVGTextChunkBuilder::buildTextChunks):
(WebCore::SVGTextChunkBuilder::layoutTextChunks): Code clean up.

(WebCore::SVGTextChunkBuilder::addTextChunk): Deleted.
(WebCore::SVGTextChunkBuilder::processTextChunk): Deleted.
(WebCore::SVGTextChunkBuilder::processTextLengthSpacingCorrection): Deleted.
(WebCore::SVGTextChunkBuilder::processTextAnchorCorrection): Deleted.
(WebCore::SVGTextChunkBuilder::buildSpacingAndGlyphsTransform): Deleted.
This code now lives in SVGTextChunk.

* rendering/svg/SVGTextChunkBuilder.h: Add new methods for code which was
moved from SVGTextLayoutEngine and remove methods for code which was removed
to SVGTextChunk.

* rendering/svg/SVGTextLayoutEngine.cpp:
(WebCore::SVGTextLayoutEngine::beginTextPathLayout): Use the sum up methods
from SVGTextChunkBuilder instead of looping through the chunks. Also get a
clean order for defining variables and doing the calculations.

(WebCore::SVGTextLayoutEngine::finalizeTransformMatrices): Code clean up.

(WebCore::SVGTextLayoutEngine::layoutTextOnLineOrPath): Do a single path
traversal to get the position and the angle for a length on a path.

* svg/SVGAnimateMotionElement.cpp:
(WebCore::SVGAnimateMotionElement::buildTransformForProgress): Do a single
path traversal to get the position and the angle at a length on a path.

* svg/SVGPathTraversalStateBuilder.cpp:
(WebCore::SVGPathTraversalStateBuilder::SVGPathTraversalStateBuilder):
(WebCore::SVGPathTraversalStateBuilder::moveTo):
(WebCore::SVGPathTraversalStateBuilder::lineTo):
(WebCore::SVGPathTraversalStateBuilder::curveToCubic):
(WebCore::SVGPathTraversalStateBuilder::closePath):
(WebCore::SVGPathTraversalStateBuilder::setDesiredLength):
(WebCore::SVGPathTraversalStateBuilder::continueConsuming):
(WebCore::SVGPathTraversalStateBuilder::totalLength):
(WebCore::SVGPathTraversalStateBuilder::currentPoint):
(WebCore::SVGPathTraversalStateBuilder::incrementPathSegmentCount): Deleted.
(WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex): Deleted.
* svg/SVGPathTraversalStateBuilder.h:
(WebCore::SVGPathTraversalStateBuilder::pathSegmentIndex):
Code clean up.

* svg/SVGPathUtilities.cpp:
(WebCore::getSVGPathSegAtLengthFromSVGPathByteStream):
(WebCore::getTotalLengthOfSVGPathByteStream):
(WebCore::getPointAtLengthOfSVGPathByteStream): Use new TraversalState::Action
enum values.

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