WebKit-https.git
5 years ago[Win] Fix clean build after r195545.
achristensen@apple.com [Tue, 26 Jan 2016 17:23:34 +0000 (17:23 +0000)]
[Win] Fix clean build after r195545.
​https://bugs.webkit.org/show_bug.cgi?id=153434

* CMakeLists.txt:
* PlatformWin.cmake:
Derived sources need to be copied after the build, but everything else should be copied before.
This should fix ews issues like the one seen in bug 153473.

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

5 years agoLayoutTest media/airplay-target-availability.html is flaky
eric.carlson@apple.com [Tue, 26 Jan 2016 17:17:49 +0000 (17:17 +0000)]
LayoutTest media/airplay-target-availability.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=153100
<rdar://problem/24346796>

Reviewed by Daniel Bates.

Source/WebCore:

No new tests, media/airplay-target-availability.html was updated

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::clientStateDidChange): Schedule a configuration scan if
  any of the config flags have changed.
(WebCore::WebMediaSessionManager::configurePlaybackTargetMonitoring): Update logging.

LayoutTests:

* media/airplay-target-availability-expected.txt:
* media/airplay-target-availability.html:

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

5 years agoMain frame scrollbars not updated on hovering when using overlay scrollbars
carlosgc@webkit.org [Tue, 26 Jan 2016 17:00:18 +0000 (17:00 +0000)]
Main frame scrollbars not updated on hovering when using overlay scrollbars
https://bugs.webkit.org/show_bug.cgi?id=153304

Reviewed by Michael Catanzaro.

Legacy scrollbars were fixed in r194155, but overlay scrollbars
are not notified when they are hovered. This is because the layer
hit test in RenderView::hitTest always returns true when using
overlay scrollbars and we are returning early in such case,
ignoring the HitTestRequest::AllowFrameScrollbars flag. So, in
case of using overlay scrollbars we still need to check the
RenderView scrollbars even when the layer hit test succeeded.

* rendering/RenderView.cpp:
(WebCore::RenderView::hitTest):

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

5 years agoLayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
dbates@webkit.org [Tue, 26 Jan 2016 16:15:22 +0000 (16:15 +0000)]
LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
https://bugs.webkit.org/show_bug.cgi?id=153250
<rdar://problem/12172843>
And
<rdar://problem/24248040>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Remove an incorrect assertion that the absolute URL associated with a protection space cannot
contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
with the invariants for WebCore::protectionSpaceMapKeyFromURL().

Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
       http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html

* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):

LayoutTests:

The test case http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html was derived
from a test case written by Yongjun Zhang in <https://bugs.webkit.org/attachment.cgi?id=65189> (bug #44461).

* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Added.
* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html: Added.
* http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Added.
* http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html: Added.
* platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Added.

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

5 years agoWebKitTestRunner: Credential cache is not cleared between tests
dbates@webkit.org [Tue, 26 Jan 2016 16:08:21 +0000 (16:08 +0000)]
WebKitTestRunner: Credential cache is not cleared between tests
https://bugs.webkit.org/show_bug.cgi?id=153407
<rdar://problem/24280834>

Reviewed by Alexey Proskuryakov.

Source/WebKit2:

Expose SPI to call CredentialStorage::clearCredentials() on the default network storage
session to clear cached credentials.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::clearCachedCredentials): Added.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in: Added message ClearCachedCredentials().
* UIProcess/API/C/WKContext.cpp:
(WKContextClearCachedCredentials): Added.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::clearCachedCredentials): Notify all web processes and the
network process to clear cached credentials.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::clearCachedCredentials): Clear cached credentials in the default
network storage session.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in: Added message ClearCachedCredentials().

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): Call WKContextClearCachedCredentials()
to clear cached credentials.

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

5 years agoRemove XMLHttpRequestException
dbates@webkit.org [Tue, 26 Jan 2016 16:06:32 +0000 (16:06 +0000)]
Remove XMLHttpRequestException
https://bugs.webkit.org/show_bug.cgi?id=102698
<rdar://problem/24338476>

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

Update test result now that we throw DOMException.{ABORT, NETWORK, TIMEOUT}Error instead of XMLHttpRequestException.{ABORT, NETWORK, TIMEOUT}_ERR.

* web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub-expected.txt:
* web-platform-tests/XMLHttpRequest/send-non-same-origin.sub-expected.txt:
* web-platform-tests/XMLHttpRequest/send-redirect-bogus-sync-expected.txt:
* web-platform-tests/XMLHttpRequest/send-redirect-infinite-sync-expected.txt:
* web-platform-tests/XMLHttpRequest/xmlhttprequest-network-error-sync-expected.txt:

Source/WebCore:

Inspired by a patch by Erik Arvidsson.

As per <https://xhr.spec.whatwg.org> (21 January 2016) and <https://html.spec.whatwg.org/multipage/workers.html#dom-workerglobalscope-importscripts> (25 January 2016)
XMLHttpRequest and WorkerGlobalScope.importScripts() should throw a DOMException object instead
of a XMLHttpRequestException object when a NetworkError, AbortError, or TimeoutError occur. This
makes the behavior of WebKit more closely conform to these standards as well as the behavior of
other browsers.

* CMakeLists.txt: Remove entries for XMLHttpRequestException.idl and XMLHttpRequestException.cpp.
* DerivedSources.make: Remove entry for XMLHttpRequestException.idl.
* WebCore.order: Remove exported symbols for XMLHttpRequestException.
* WebCore.vcxproj/WebCore.vcxproj: Remove entries for JSXMLHttpRequestException.{cpp, h}, XMLHttpRequestException.{cpp, h}
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* bindings/js/JSExceptionBase.cpp:
(WebCore::toExceptionBase): Remove logic for XMLHttpRequestException.
* dom/DOMExceptions.in: Remove entry for XMLHttpRequestException.
* workers/WorkerGlobalScope.cpp:
(WebCore::WorkerGlobalScope::importScripts): Throw DOMException.NETWORK_ERR instead of XMLHttpRequestException.NETWORK_ERR.
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest): Ditto.
(WebCore::XMLHttpRequest::didFail): Throw DOMException.ABORT_ERR instead of XMLHttpRequestException.ABORT_ERR.
(WebCore::XMLHttpRequest::didReachTimeout): Throw DOMException.TIMEOUT_ERR instead of XMLHttpRequestException.TIMEOUT_ERR.
* xml/XMLHttpRequestException.cpp: Removed.
* xml/XMLHttpRequestException.h: Removed.
* xml/XMLHttpRequestException.idl: Removed.

LayoutTests:

Update test result now that we throw DOMException.{ABORT, NETWORK, TIMEOUT}Error instead of XMLHttpRequestException.{ABORT, NETWORK, TIMEOUT}_ERR.

* fast/dom/Window/resources/window-properties.js:
* fast/dom/Window/window-lookup-precedence-expected.txt:
* fast/files/apply-blob-url-to-xhr-expected.txt:
* fast/files/workers/worker-apply-blob-url-to-xhr-expected.txt:
* http/tests/appcache/non-html.xhtml:
* http/tests/appcache/simple.html:
* http/tests/contentextensions/sync-xhr-blocked-expected.txt:
* http/tests/local/fileapi/send-sliced-dragged-file-expected.txt:
* http/tests/workers/worker-importScripts-expected.txt:
* http/tests/xmlhttprequest/XMLHttpRequestException-expected.txt:
* http/tests/xmlhttprequest/XMLHttpRequestException.html:
* http/tests/xmlhttprequest/access-control-and-redirects-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-non-simple-deny-cached-expected.txt:
* http/tests/xmlhttprequest/access-control-basic-post-fail-non-simple-content-type-expected.txt:
* http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-expected.txt:
* http/tests/xmlhttprequest/access-control-sandboxed-iframe-denied-without-wildcard-expected.txt:
* http/tests/xmlhttprequest/connection-error-sync-expected.txt:
* http/tests/xmlhttprequest/cross-origin-no-authorization-expected.txt:
* http/tests/xmlhttprequest/origin-exact-matching-expected.txt:
* http/tests/xmlhttprequest/origin-whitelisting-https-expected.txt:
* http/tests/xmlhttprequest/origin-whitelisting-ip-addresses-with-subdomains-expected.txt:
* http/tests/xmlhttprequest/origin-whitelisting-removal-expected.txt:
* http/tests/xmlhttprequest/workers/access-control-basic-get-fail-non-simple-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:
* http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/TestExpectations:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

5 years agokill-old-processes: allow to specify on the environment of the bot a list of process...
clopez@igalia.com [Tue, 26 Jan 2016 15:47:54 +0000 (15:47 +0000)]
kill-old-processes: allow to specify on the environment of the bot a list of process that should be killed.
https://bugs.webkit.org/show_bug.cgi?id=153483

Reviewed by Csaba Osztrogonác.

* BuildSlaveSupport/kill-old-processes:
(main): Allow to specify extra tasks to kill via the environment variable WEBKITBOT_TASKSTOKILL

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

5 years ago[GTK] WebProcess crashes when quickly attempting many DnD operations
mario@webkit.org [Tue, 26 Jan 2016 09:45:51 +0000 (09:45 +0000)]
[GTK] WebProcess crashes when quickly attempting many DnD operations
https://bugs.webkit.org/show_bug.cgi?id=138468

Reviewed by Michael Catanzaro.

Source/WebKit2:

Do not allow different DnD operations over the same element at the
same time, so that any new attempt to DnD an element happening before
a previous attempt has ended will take precedence, cancelling the older
operation before going ahead with the new one.

This is consistent with how WebCore::EventHandler handles DnD operations,
preventing the web process from crashing in scenarios where the user might
try to perform many DnD operations over the same element very quickly.

* UIProcess/gtk/DragAndDropHandler.cpp:
(WebKit::DragAndDropHandler::DragAndDropHandler): Initialized new member.
(WebKit::DragAndDropHandler::startDrag): Ensure a previous DnD operation
is cancelled before handling the new one that has just started.
(WebKit::DragAndDropHandler::fillDragData): Protect against calling this
function from webkitWebViewBaseDragDataGet for already cancelled operations.
(WebKit::DragAndDropHandler::finishDrag): Protect against calling this
function from webkitWebViewBaseDragEnd for already cancelled operations.
* UIProcess/gtk/DragAndDropHandler.h:

LayoutTests:

New test added to check that the web process does not crash when multiple
DnD operations are quickly attempted over the same draggable element.

* fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash-expected.txt: Added.
* fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html: Added.

Added the new test to the failure expectations for mac-wk2, as there's no
suitable implementation of eventSender in place yet (see bug 42194).

* platform/mac-wk2/TestExpectations: Added failure expectation for the new test.

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

5 years agoFTLB3Output should maintain good block order like the LLVM one does
fpizlo@apple.com [Tue, 26 Jan 2016 08:17:31 +0000 (08:17 +0000)]
FTLB3Output should maintain good block order like the LLVM one does
https://bugs.webkit.org/show_bug.cgi?id=152222

Reviewed by Geoffrey Garen.

Source/JavaScriptCore:

This fixes FTLB3Output to emit an ordered B3 IR. This makes inspecting IR *a lot* easier.
It will also be a performance win whenever we use range-based data structures for
liveness.

Also two small other changes:
- Added some more dumping in integer range optimization phase.
- Refined the disassembler's printing of instruction width suffixes so that "jzl" is not
  a thing. It was using "l" as the suffix because jumps take a 32-bit immediate.

* b3/B3Procedure.cpp:
(JSC::B3::Procedure::addBlock):
(JSC::B3::Procedure::setBlockOrderImpl):
(JSC::B3::Procedure::clone):
* b3/B3Procedure.h:
(JSC::B3::Procedure::frontendData):
(JSC::B3::Procedure::setBlockOrder):
* dfg/DFGIntegerRangeOptimizationPhase.cpp:
* disassembler/udis86/udis86_syn-att.c:
(ud_translate_att):
* ftl/FTLB3Output.cpp:
(JSC::FTL::Output::initialize):
(JSC::FTL::Output::newBlock):
(JSC::FTL::Output::applyBlockOrder):
(JSC::FTL::Output::appendTo):
* ftl/FTLB3Output.h:
(JSC::FTL::Output::setFrequency):
(JSC::FTL::Output::insertNewBlocksBefore):
(JSC::FTL::Output::callWithoutSideEffects):
(JSC::FTL::Output::newBlock): Deleted.
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::lower):

Source/WTF:

In the FTL we need to be able to construct a list by inserting elements before other
specific elements. We didn't already have a scalable way to do this, so this adds such a
data structure to WTF. This also has changes to SentinelLinkedList to make it support
these kinds of insertions.

* WTF.xcodeproj/project.pbxproj:
* wtf/OrderMaker.h: Added.
(WTF::OrderMaker::Node::Node):
(WTF::OrderMaker::OrderMaker):
(WTF::OrderMaker::prepend):
(WTF::OrderMaker::append):
(WTF::OrderMaker::insertBefore):
(WTF::OrderMaker::insertAfter):
(WTF::OrderMaker::iterator::iterator):
(WTF::OrderMaker::iterator::operator*):
(WTF::OrderMaker::iterator::operator++):
(WTF::OrderMaker::iterator::operator==):
(WTF::OrderMaker::iterator::operator!=):
(WTF::OrderMaker::begin):
(WTF::OrderMaker::end):
(WTF::OrderMaker::newNode):
* wtf/SentinelLinkedList.h:
(WTF::BasicRawSentinelNode::isOnList):
(WTF::BasicRawSentinelNode<T>::remove):
(WTF::BasicRawSentinelNode<T>::prepend):
(WTF::BasicRawSentinelNode<T>::append):
(WTF::RawNode>::SentinelLinkedList):
(WTF::RawNode>::push):
(WTF::RawNode>::append):
(WTF::RawNode>::remove):
(WTF::RawNode>::prepend):
(WTF::RawNode>::isOnList):

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

5 years agoWebCoreJSBuiltins do not use to do conditional include
youenn.fablet@crf.canon.fr [Tue, 26 Jan 2016 07:32:28 +0000 (07:32 +0000)]
WebCoreJSBuiltins do not use to do conditional include
https://bugs.webkit.org/show_bug.cgi?id=153306

Reviewed by Alex Christensen.

Removing compilation guards as builtin generator adds them in the files themselves.
Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.

No change in behavior.

* Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
* Modules/mediastream/NavigatorUserMedia.js: Making it @conditional.
* bindings/js/WebCoreJSBuiltins.cpp:
* bindings/js/WebCoreJSBuiltins.h:

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

5 years agoimported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection.html...
youenn.fablet@crf.canon.fr [Tue, 26 Jan 2016 07:28:11 +0000 (07:28 +0000)]
imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection.html asserts frequently
https://bugs.webkit.org/show_bug.cgi?id=152436

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

Adding temporary tests that splits garbage collection readable stream
tests in worker and window mode.

* web-platform-tests/streams-api/readable-streams/garbage-collection-1-expected.txt: Added.
* web-platform-tests/streams-api/readable-streams/garbage-collection-1.html: Added.
* web-platform-tests/streams-api/readable-streams/garbage-collection-2-expected.txt: Added.
* web-platform-tests/streams-api/readable-streams/garbage-collection-2.html: Added.

LayoutTests:

* platform/mac/TestExpectations: Marked imported/w3c/web-platform-tests/streams-api/readable-streams/garbage-collection.html as crash/pass.

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

5 years agoFix internal Windows build
commit-queue@webkit.org [Tue, 26 Jan 2016 06:12:50 +0000 (06:12 +0000)]
Fix internal Windows build
https://bugs.webkit.org/show_bug.cgi?id=153469

Patch by Alex Christensen <achristensen@webkit.org> on 2016-01-25
Reviewed by Brent Fulgham.

.:

* Source/cmake/WebKitMacros.cmake:
Pass the GPERF_EXECUTABLE that we found to make-hash-tools.pl.

Source/WebCore:

* CMakeLists.txt:
Pass the GPERF_EXECUTABLE that we found to perl scripts so they can use it instead of just calling gperf.
This is needed for builds where gperf is not in the PATH.
* DerivedSources.make:
Pass "gperf" as the gperf command to retain existing functionality on mac.
* bindings/scripts/preprocess-idls.pl:
(CygwinPathIfNeeded):
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Add /cygdrive/c/cygwin/bin to the PATH before calling cygpath.
This is needed for builds where we are using cygwin, but C:/cygwin/bin is not in the PATH.
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/makeSelectorPseudoElementsMap.py:
* css/makeprop.pl:
* platform/network/create-http-header-name-table:
Use the gperf executable passed in as a command line parameter if it is given.

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

5 years ago[ES6] Arrow function syntax. Arrow function specific features. Lexical bind "arguments"
commit-queue@webkit.org [Tue, 26 Jan 2016 05:43:11 +0000 (05:43 +0000)]
[ES6] Arrow function syntax. Arrow function specific features. Lexical bind "arguments"
https://bugs.webkit.org/show_bug.cgi?id=145132

Patch by Skachkov Oleksandr <gskachkov@gmail.com> on 2016-01-25
Reviewed by Saam Barati.
Source/JavaScriptCore:

Added support of ES6 arrow function specific feature, lexical bind of arguments.
http://www.ecma-international.org/ecma-262/6.0/#sec-arrow-function-definitions-runtime-semantics-evaluation
'arguments' variable in arrow function must resolve to a binding in a lexically enclosing environment.
In srict mode it points to arguments object, and in non-stric mode it points to arguments object or varible
with name 'arguments' if it was declared.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::BytecodeGenerator):
* parser/Parser.h:
(JSC::Scope::Scope):
(JSC::Scope::setSourceParseMode):
(JSC::Scope::isArrowFunction):
(JSC::Scope::collectFreeVariables):
(JSC::Scope::setIsArrowFunction):
* tests/es6.yaml:
* tests/stress/arrowfunction-lexical-bind-arguments-non-strict-1.js: Added.
* tests/stress/arrowfunction-lexical-bind-arguments-non-strict-2.js: Added.
* tests/stress/arrowfunction-lexical-bind-arguments-strict.js: Added.

Source/WebInspectorUI:

Current patch is implementing lexical bind of arguments, so in this callback we need
to return to ordinary function.

* UserInterface/Base/Object.js:
(WebInspector.Object.singleFireEventListener.let.wrappedCallback):
(WebInspector.Object.singleFireEventListener):

LayoutTests:

* js/arrowfunction-lexical-bind-arguments-non-strict-expected.txt: Added.
* js/arrowfunction-lexical-bind-arguments-non-strict.html: Added.
* js/arrowfunction-lexical-bind-arguments-strict-expected.txt: Added.
* js/arrowfunction-lexical-bind-arguments-strict.html: Added.
* js/script-tests/arrowfunction-lexical-bind-arguments-non-strict.js: Added.
* js/script-tests/arrowfunction-lexical-bind-arguments-strict.js: Added.

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

5 years agoDisplayList items can log paths now
simon.fraser@apple.com [Tue, 26 Jan 2016 05:41:44 +0000 (05:41 +0000)]
DisplayList items can log paths now
https://bugs.webkit.org/show_bug.cgi?id=153417

Reviewed by Zalan Bujtas.

Now that Path supports TextStream logging, clean up its output a little and
enable dumping of Paths in DisplayListItems.

* platform/graphics/Path.cpp:
(WebCore::operator<<):
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::operator<<):

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

5 years agoGive the layout test results file a <title> showing the date and time the tests were run
simon.fraser@apple.com [Tue, 26 Jan 2016 05:40:28 +0000 (05:40 +0000)]
Give the layout test results file a <title> showing the date and time the tests were run
https://bugs.webkit.org/show_bug.cgi?id=153187

Reviewed by Darin Adler.

Tools:

Include a 'date' property in the JSON with the date and time the tests completed.

* Scripts/webkitpy/layout_tests/models/test_run_results.py:
(summarize_results):

LayoutTests:

Generate a <title> element from the 'date' property in the JSON.

* fast/harness/results.html:

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

5 years ago[JSC] We should never use x18 on iOS ARM64
commit-queue@webkit.org [Tue, 26 Jan 2016 04:01:33 +0000 (04:01 +0000)]
[JSC] We should never use x18 on iOS ARM64
https://bugs.webkit.org/show_bug.cgi?id=153461

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

The register x18 is reserved in the iOS variant of the ARM64 ABI.

The weird thing is: if you use it, its value will change completely
randomly. It looks like it is changed by the system on interrupts.

This patch adds x18 to the reserved register and add assertions
to the assembler to prevent similar problems in the future.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::xOrSp):
(JSC::ARM64Assembler::xOrZr):
* assembler/AbstractMacroAssembler.h:
(JSC::isIOS): Deleted.
* assembler/AssemblerCommon.h:
(JSC::isIOS):
* jit/RegisterSet.cpp:
(JSC::RegisterSet::reservedHardwareRegisters):

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

5 years agoFix the comment.
antti@apple.com [Tue, 26 Jan 2016 03:13:03 +0000 (03:13 +0000)]
Fix the comment.

* rendering/style/RenderStyle.h:

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

5 years agoUnreviewed, rolling out r195550.
commit-queue@webkit.org [Tue, 26 Jan 2016 03:12:29 +0000 (03:12 +0000)]
Unreviewed, rolling out r195550.
https://bugs.webkit.org/show_bug.cgi?id=153471

broke animometer bot (and now we have crash logs!) (Requested
by kling on #webkit).

Reverted changeset:

"Restore CodeBlock jettison code Geoff accidentally removed"
https://bugs.webkit.org/show_bug.cgi?id=151241
http://trac.webkit.org/changeset/195550

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

5 years agoMarkedSpace should have more precise allocators.
akling@apple.com [Tue, 26 Jan 2016 02:57:51 +0000 (02:57 +0000)]
MarkedSpace should have more precise allocators.
<https://webkit.org/b/153448>
<rdar://problem/23897477>

Reviewed by Geoffrey Garen.

The four classes responsible for the bulk of MarkedBlock allocations today are:

    - FunctionCodeBlock (640 bytes)
    - UnlinkedFunctionCodeBlock (304 bytes)
    - FunctionExecutable (168 bytes)
    - UnlinkedFunctionExecutable (144 bytes)

Due to the size class distribution in MarkedSpace, we've been wasting quite a lot
of heap space on these objects. Our "precise" allocators allowed allocation sizes
in 16-byte increments up to 128 bytes, but after that point, we'd only allocate
in 256-byte size increments.

Thus each instance of those classes would waste space as follows:

    - FunctionCodeBlock (768-byte cell, 128 bytes wasted)
    - UnlinkedFunctionCodeBlock (512-byte cell, 208 bytes wasted)
    - FunctionExecutable(256-byte cell, 88 bytes wasted)
    - UnlinkedFunctionExecutable(256-byte cell, 112 bytes wasted)

This patch raises the limit for precise allocations from 128 to 768, allowing us
to allocate these objects with far better space efficiency.

The cost of this is 7kB worth of MarkedAllocators and 70 (~2x) more allocators to
iterate whenever we iterate all the allocators.

* heap/MarkedSpace.h:
* heap/MarkedSpace.cpp:
(JSC::MarkedSpace::MarkedSpace):
(JSC::MarkedSpace::resetAllocators):
(JSC::MarkedSpace::forEachAllocator):
(JSC::MarkedSpace::isPagedOut):

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

5 years agoAdd support for DataDetectors in WK (iOS).
enrica@apple.com [Tue, 26 Jan 2016 02:18:13 +0000 (02:18 +0000)]
Add support for DataDetectors in WK (iOS).
https://bugs.webkit.org/show_bug.cgi?id=152989
rdar://problem/22855960

Reviewed by Tim Horton.

Source/WebCore:

Adding new helper functions for data detection related tasks.
The patch also fixes a bug when creating DOM ranges from DDQueryRange
spanning multiple fragments.

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::DataDetection::isDataDetectorLink):
(WebCore::DataDetection::dataDetectorIdentifier):
(WebCore::detectItemAtPositionWithRange):
(WebCore::DataDetection::detectItemAroundHitTestResult):
(WebCore::resultIsURL):
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):
(WebCore::DataDetection::detectContentInRange):

Source/WebKit2:

Moving InteractionInformationAtPosition files to platform folder,
since this is only used on iOS and changing from .cpp to .mm.
The structure is extended to include data detection specific fields
and the relevant encode/decode functions have been updated to
handle the new fields.
The patch also adds a new WKUIDelegatePrivate method to allow
the client to provide additional context for data detection actions.

* Platform/spi/ios/UIKitSPI.h:
* Shared/InteractionInformationAtPosition.cpp: Removed.
* Shared/InteractionInformationAtPosition.h: Removed.
* Shared/ios/InteractionInformationAtPosition.h: Copied from Shared/InteractionInformationAtPosition.h.
* Shared/ios/InteractionInformationAtPosition.mm: Copied from Shared/InteractionInformationAtPosition.cpp.
(WebKit::InteractionInformationAtPosition::encode):
(WebKit::InteractionInformationAtPosition::decode):
* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/WebPageProxy.h:
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant showDataDetectorsSheet]):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView actionSheetAssistantDidStopInteraction:]):
(-[WKContentView dataDetectionContextForActionSheetAssistant:]):
(-[WKContentView selectedTextForActionSheetAssistant:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
* UIProcess/ios/WebPageProxyIOS.mm:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::getPositionInformation):

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

5 years ago[GTK] Unreviewed GTK gardening.
clopez@igalia.com [Tue, 26 Jan 2016 01:56:15 +0000 (01:56 +0000)]
[GTK] Unreviewed GTK gardening.

Skip all inspector/sampling-profiler tests meanwhile the feature is not enabled on the GTK+ port.
Report and mark a new regression on test inspector/dom-debugger/node-removed.html timing out.
Rebaseline a bunch of tests after r194847.

* platform/gtk/TestExpectations:
* platform/gtk/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Rebaseline after r194847.
* platform/gtk/fast/forms/auto-fill-button/input-auto-fill-button-expected.png: Added. Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug1188-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug1188-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug18359-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug18359-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug2479-3-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug2479-3-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug2479-4-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug2479-4-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug29326-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug29326-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug33855-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug33855-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug4382-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug4382-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug96334-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/bugs/bug96334-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/core/margins-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/core/margins-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla/dom/tableDom-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla/dom/tableDom-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug2479-5-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug2479-5-expected.txt: Rebaseline after r194847.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug92647-1-expected.png: Rebaseline after r194847.
* platform/gtk/tables/mozilla_expected_failures/bugs/bug92647-1-expected.txt: Rebaseline after r194847.
* platform/gtk/transforms/2d/zoom-menulist-expected.png: Rebaseline after r194847.
* platform/gtk/transforms/2d/zoom-menulist-expected.txt: Rebaseline after r194847.

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

5 years agoRemove broken cache from CSSFontFaceSource
mmaxfield@apple.com [Tue, 26 Jan 2016 00:35:17 +0000 (00:35 +0000)]
Remove broken cache from CSSFontFaceSource
https://bugs.webkit.org/show_bug.cgi?id=153440

Reviewed by Simon Fraser.

This cache has been broken since 2013 (r158085). Given we didn't notice a perf
hit when it broke, and the fact it's been broken for years, it clearly isn't
necessary.

https://bugs.webkit.org/show_bug.cgi?id=153414 consists of a fairly invasive
change to CSSFontFaceSource; this patch includes a working version of this
cache, along with an easy way to enable/disable it (to measure possible perf
changes).

This patch is a short-term cleanup patch in the mean time until the above
invasive change gets landed.

No new tests because there is no behavior (or performance!) change.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
(WebCore::CSSFontFaceSource::~CSSFontFaceSource): Deleted.
(WebCore::CSSFontFaceSource::pruneTable): Deleted.
(WebCore::CSSFontFaceSource::fontLoaded): Deleted.
* css/CSSFontFaceSource.h:

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

5 years agoWeb Inspector: Have top-level ScriptTimelineDataGridNode events show sample counts
sbarati@apple.com [Tue, 26 Jan 2016 00:25:42 +0000 (00:25 +0000)]
Web Inspector: Have top-level ScriptTimelineDataGridNode events show sample counts
https://bugs.webkit.org/show_bug.cgi?id=153447
<rdar://problem/24334137>

Reviewed by Joseph Pecoraro.

* UserInterface/Models/ScriptTimelineRecord.js:
(WebInspector.ScriptTimelineRecord):
(WebInspector.ScriptTimelineRecord.prototype.get profile):
(WebInspector.ScriptTimelineRecord.prototype.get callCount):
(WebInspector.ScriptTimelineRecord.prototype.isGarbageCollection):
(WebInspector.ScriptTimelineRecord.prototype._initializeProfileFromPayload):
* UserInterface/Views/ScriptTimelineDataGridNode.js:
(WebInspector.ScriptTimelineDataGridNode.prototype.get data):

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

5 years agoTry to fix the simulator build.
weinig@apple.com [Tue, 26 Jan 2016 00:16:31 +0000 (00:16 +0000)]
Try to fix the simulator build.

* platform/spi/cocoa/DataDetectorsCoreSPI.h:

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

5 years agoRoll back in r195559 with a build fix.
weinig@apple.com [Mon, 25 Jan 2016 23:54:57 +0000 (23:54 +0000)]
Roll back in r195559 with a build fix.

* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/DataDetection.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
* platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
* platform/spi/cocoa/DataDetectorsCoreSPI.h:

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

5 years agoFix the comment about FTL_USES_B3.
fpizlo@apple.com [Mon, 25 Jan 2016 23:44:24 +0000 (23:44 +0000)]
Fix the comment about FTL_USES_B3.

* dfg/DFGCommon.h:

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

5 years agoSwitch FTL to B3 on X86_64/Mac
fpizlo@apple.com [Mon, 25 Jan 2016 23:41:01 +0000 (23:41 +0000)]
Switch FTL to B3 on X86_64/Mac
https://bugs.webkit.org/show_bug.cgi?id=153445

Rubber stamped by Geoffrey Garen.

This finally switches from LLVM to B3 in the FTL on X86_64 on the Mac. We recommend that other
X86_64 platforms make the switch as well. We will be focusing our performance work on B3 rather
than LLVM in the future. ARM64 support is also coming soon, so we will be able to remove FTL
LLVM code once that lands.

Right now this mostly appears as perf-neutral on the major tests. However, it does have the
following immediate benefits:

- Dramatic reduction in FTL compile times, on the order of 5x-10x. This means huge speed-ups in
  shorter-running tests like V8Spider (21%) and JSRegress (8%).

- It makes the FTL simpler and more robust because we don't have to do stackmap section
  parsing. This makes it easier to add new FTL features. We are already working on features,
  like the sampling profiler, which will only have a FTL B3 implementation.

- Speed-ups on some throughput benchmarks like mandreel, richards, imaging-gaussian-blur. It's
  still a slow down on other throughput benchmarks, though.

We started writing B3 in October, so it's pretty awesome that the throughput of the code it
generates is already on par with LLVM.

This does not fundamentally change how the FTL works. FTL was built to lower DFG IR to a C-like
SSA IR, and then rely on powerful SSA optimizations and comprehensive instruction selection and
register allocation to turn that code into something that runs fast. B3 also has a C-like SSA
IR, has an instruction selector that is in some ways more powerful than LLVM's (B3 does global
instruction selection rather than block-local like LLVM), and it has a register allocator that
is in some ways more powerful also (B3 uses IRC, a mature graph coloring allocator, while LLVM
does not do graph coloring). We expect FTL B3's performance to improve a lot after we turn it
on and can focus our efforts on tuning it.

I didn't find any test regressions after running both JSC tests and layout tests. Basic
browsing still works. JetStream performance difference is within the margin of error. EWS is
happy.

* dfg/DFGCommon.h:

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

5 years agoUnreviewed, rolling out r195559.
ryanhaddad@apple.com [Mon, 25 Jan 2016 23:38:56 +0000 (23:38 +0000)]
Unreviewed, rolling out r195559.
https://bugs.webkit.org/show_bug.cgi?id=153458

This change broke the iOS build (Requested by ryanhaddad on
#webkit).

Reverted changeset:

"Fix the ASAN build."
http://trac.webkit.org/changeset/195559

Patch by Commit Queue <commit-queue@webkit.org> on 2016-01-25

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

5 years agoResolving direction and writing mode properties should not mutate document
antti@apple.com [Mon, 25 Jan 2016 23:33:05 +0000 (23:33 +0000)]
Resolving direction and writing mode properties should not mutate document
https://bugs.webkit.org/show_bug.cgi?id=153446

Reviewed by Andreas Kling.

Replace directionSetOnDocumentElement/writingModeSetOnDocumentElement document flags them with style flags.

* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueDirection):
(WebCore::StyleBuilderCustom::resetEffectiveZoom):
(WebCore::StyleBuilderCustom::applyValueWebkitWritingMode):
(WebCore::StyleBuilderCustom::applyValueWebkitTextOrientation):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::styleForElement):
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/Document.h:
(WebCore::Document::markers):
(WebCore::Document::directionSetOnDocumentElement): Deleted.
(WebCore::Document::writingModeSetOnDocumentElement): Deleted.
(WebCore::Document::setDirectionSetOnDocumentElement): Deleted.
(WebCore::Document::setWritingModeSetOnDocumentElement): Deleted.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::styleDidChange):
* rendering/style/RenderStyle.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):

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

5 years agoFix the ASAN build.
weinig@apple.com [Mon, 25 Jan 2016 23:12:44 +0000 (23:12 +0000)]
Fix the ASAN build.

* WebCore.xcodeproj/project.pbxproj:
* editing/cocoa/DataDetection.mm:
* platform/cocoa/DataDetectorsCoreSoftLink.mm: Added.
* platform/cocoa/DataDetectorsCoreSoftLink.h: Added.
* platform/spi/cocoa/DataDetectorsCoreSPI.h:

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

5 years agoUnreviewed, rolling out r195543.
commit-queue@webkit.org [Mon, 25 Jan 2016 23:08:03 +0000 (23:08 +0000)]
Unreviewed, rolling out r195543.
https://bugs.webkit.org/show_bug.cgi?id=153451

regressed performance of test bots by ~6% (Requested by dydz
on #webkit).

Reverted changeset:

"WebKitTestRunner: Credential cache is not cleared between
tests"
https://bugs.webkit.org/show_bug.cgi?id=153407
http://trac.webkit.org/changeset/195543

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

5 years agoFailing to upload to flakiness dashboard should not be a hard error
aakash_jain@apple.com [Mon, 25 Jan 2016 22:37:49 +0000 (22:37 +0000)]
Failing to upload to flakiness dashboard should not be a hard error
https://bugs.webkit.org/show_bug.cgi?id=153444
<rdar://problem/22146294>

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._upload_json_files): If JSON file is not generated, do not try to upload it.

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

5 years agoMarking imported/w3c/indexeddb/keyorder-private.html as flaky on mac-wk1
ryanhaddad@apple.com [Mon, 25 Jan 2016 22:35:02 +0000 (22:35 +0000)]
Marking imported/w3c/indexeddb/keyorder-private.html as flaky on mac-wk1
https://bugs.webkit.org/show_bug.cgi?id=153438

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

5 years ago[WK2][NetworkCache] Enable speculative revalidation
cdumez@apple.com [Mon, 25 Jan 2016 22:13:25 +0000 (22:13 +0000)]
[WK2][NetworkCache] Enable speculative revalidation
https://bugs.webkit.org/show_bug.cgi?id=153443
<rdar://problem/23092196>

Reviewed by Antti Koivisto.

Enable speculative revalidation to better evaluate performance and
robustness.

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::registerUserDefaultsIfNeeded):

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

5 years agoMarking imported/w3c/web-platform-tests/XMLHttpRequest/getresponseheader-chunked...
ryanhaddad@apple.com [Mon, 25 Jan 2016 22:07:13 +0000 (22:07 +0000)]
Marking imported/w3c/web-platform-tests/XMLHttpRequest/getresponseheader-chunked-trailer.htm as flaky
on ios-simulator, removing flaky expectation that was incorrectly added for a different WPT LayoutTest.
https://bugs.webkit.org/show_bug.cgi?id=153371

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

5 years agoBuild fix.
bdakin@apple.com [Mon, 25 Jan 2016 21:40:19 +0000 (21:40 +0000)]
Build fix.

* WebView/WebHTMLView.mm:
(-[WebHTMLView initWithFrame:]):
(-[WebHTMLView insertText:]):

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

5 years agoWK1: Handle soft spaces after accepted candidates
bdakin@apple.com [Mon, 25 Jan 2016 21:38:07 +0000 (21:38 +0000)]
WK1: Handle soft spaces after accepted candidates
https://bugs.webkit.org/show_bug.cgi?id=153442
-and corresponding-
rdar://problem/23958418

Reviewed by Tim Horton.

The space at the end of candidates is a soft space. If that space exists,
cache the range of the space in m_softSpaceRange.
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::handleAcceptedCandidate):

New ivar in WebHTMLViewPrivate softSpaceRange keeps track to the NSRange of a
soft space if the last text that was inserted has a soft space at the end.
* WebView/WebHTMLView.mm:
(-[WebHTMLView initWithFrame:]):
(-[WebHTMLView _setSoftSpaceRange:]):

When new text is inserted, find out if it is being inserted right after a
soft space. If it is, then [NSSpellChecker deletesAutospaceBeforeString] will
tell us if the space needs to be removed. If that is the case, then set the
replacementString to the soft space.
(-[WebHTMLView insertText:]):
* WebView/WebHTMLViewInternal.h:

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

5 years ago[Win] Another build fix after r195545
achristensen@apple.com [Mon, 25 Jan 2016 21:12:22 +0000 (21:12 +0000)]
[Win] Another build fix after r195545

* CMakeLists.txt:
r195548 didn't change all the pre-builds back to post-builds.

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

5 years agoRestore CodeBlock jettison code Geoff accidentally removed
akling@apple.com [Mon, 25 Jan 2016 21:04:28 +0000 (21:04 +0000)]
Restore CodeBlock jettison code Geoff accidentally removed
https://bugs.webkit.org/show_bug.cgi?id=151241

Rubber-stamped by Geoffrey Garen.

Geoff meant to add this back in <http://trac.webkit.org/changeset/190827>
but missed.

Then he added it back in, but it was rolled out due to a crash on Animometer.
I can no longer produce a crash on Animometer, either with today's version of
the benchmark, or the one that existed at the time of the rollout.

Given this, let's roll it back in and see how it goes.

* bytecode/CodeBlock.cpp:
(JSC::timeToLive):
(JSC::CodeBlock::shouldJettisonDueToOldAge):

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

5 years agomandreel should run just as fast in FTL B3 as FTL LLVM
fpizlo@apple.com [Mon, 25 Jan 2016 20:47:18 +0000 (20:47 +0000)]
mandreel should run just as fast in FTL B3 as FTL LLVM
https://bugs.webkit.org/show_bug.cgi?id=153394

Reviewed by Gavin Barraclough.

This fixes two performance bugs and one disassembler bug.

- B3 now turns Branches into Jumps when they are dominated by a Check on the same
  condition. This is like the opposite of foldPathConstants() was doing.

- Air now supports adding to 8-bit or 16-bit memory locations on x86. B3 now knows how to
  lower Store8(Add(Load8Z(...))) and various other things to these new instructions.

- Disassembler now knows to print out the instruction's width, whenever it has one.
  Previously, we'd print movb, movw, movl, and movq as "mov", which is unhelpful if
  you're storing an immediate, for example.

This adds a bunch of tests for the new instruction forms. This is a big speed-up on
mandreel. It makes us just as fast as LLVM on that benchmark.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::add32):
(JSC::MacroAssemblerX86Common::add8):
(JSC::MacroAssemblerX86Common::add16):
(JSC::MacroAssemblerX86Common::add32AndSetFlags):
(JSC::MacroAssemblerX86Common::clz32AfterBsr):
* assembler/X86Assembler.h:
(JSC::X86Assembler::addl_rm):
(JSC::X86Assembler::addb_rm):
(JSC::X86Assembler::addw_rm):
(JSC::X86Assembler::addl_ir):
(JSC::X86Assembler::addl_im):
(JSC::X86Assembler::addb_im):
(JSC::X86Assembler::addw_im):
(JSC::X86Assembler::addq_rr):
* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::addr):
(JSC::B3::Air::LowerToAir::loadPromiseAnyOpcode):
(JSC::B3::Air::LowerToAir::loadPromise):
(JSC::B3::Air::LowerToAir::tryAppendStoreBinOp):
(JSC::B3::Air::LowerToAir::lower):
* b3/B3PureCSE.cpp:
(JSC::B3::PureCSE::clear):
(JSC::B3::PureCSE::findMatch):
(JSC::B3::PureCSE::process):
* b3/B3PureCSE.h:
* b3/B3ReduceStrength.cpp:
* b3/air/AirOpcode.opcodes:
* b3/testb3.cpp:
(JSC::B3::testNegPtr):
(JSC::B3::testStoreAddLoad32):
(JSC::B3::testStoreAddLoadImm32):
(JSC::B3::testStoreAddLoad8):
(JSC::B3::testStoreAddLoadImm8):
(JSC::B3::testStoreAddLoad16):
(JSC::B3::testStoreAddLoadImm16):
(JSC::B3::testStoreAddLoad64):
(JSC::B3::testStoreAddLoadImm64):
(JSC::B3::testStoreAddLoad32Index):
(JSC::B3::testStoreAddLoadImm32Index):
(JSC::B3::testStoreAddLoad8Index):
(JSC::B3::testStoreAddLoadImm8Index):
(JSC::B3::testStoreAddLoad16Index):
(JSC::B3::testStoreAddLoadImm16Index):
(JSC::B3::testStoreAddLoad64Index):
(JSC::B3::testStoreAddLoadImm64Index):
(JSC::B3::testStoreSubLoad):
(JSC::B3::run):
(JSC::B3::testStoreAddLoad): Deleted.
* disassembler/udis86/udis86_syn-att.c:
(ud_translate_att):

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

5 years ago[Win] Fix clean build after r195545.
achristensen@apple.com [Mon, 25 Jan 2016 20:37:44 +0000 (20:37 +0000)]
[Win] Fix clean build after r195545.

* CMakeLists.txt:
* PlatformWin.cmake:
I got a little carried away.  WebCore already had a pre-build event.  It was correct before r195545.

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

5 years agoHandle soft spaces after accepted candidates
bdakin@apple.com [Mon, 25 Jan 2016 20:29:53 +0000 (20:29 +0000)]
Handle soft spaces after accepted candidates
https://bugs.webkit.org/show_bug.cgi?id=153331
-and corresponding-
rdar://problem/23958418

Reviewed by Darin Adler.

Source/WebCore:

Candidates now come with built-in spaces, so we should not insert a space for
them.
* editing/Editor.cpp:
(WebCore::Editor::handleAcceptedCandidate):

New SPI to properly handle these soft spaces.
* platform/spi/mac/NSSpellCheckerSPI.h:

Source/WebKit2:

New member variable m_softSpaceRange keeps track to the NSRange of a soft
space if the last text that was inserted has a soft space at the end.
* UIProcess/Cocoa/WebViewImpl.h:
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::WebViewImpl):

The space at the end of candidates is a soft space. If that space exists,
cache the range of the space in m_softSpaceRange.
(WebKit::WebViewImpl::handleAcceptedCandidate):

When new text is inserted, find out if it is being inserted right after a
soft space. If it is, then [NSSpellChecker deletesAutospaceBeforeString] will
tell us if the space needs to be removed. If that is the case, then set the
replacementString to the soft space.
(WebKit::WebViewImpl::insertText):

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

5 years agoMarking inspector/heap/garbageCollected.html as flaky on mac-wk1 debug
ryanhaddad@apple.com [Mon, 25 Jan 2016 20:25:08 +0000 (20:25 +0000)]
Marking inspector/heap/garbageCollected.html as flaky on mac-wk1 debug
https://bugs.webkit.org/show_bug.cgi?id=153039

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

5 years ago[Win] Copy forwarding headers before building a project
achristensen@apple.com [Mon, 25 Jan 2016 20:12:38 +0000 (20:12 +0000)]
[Win] Copy forwarding headers before building a project
https://bugs.webkit.org/show_bug.cgi?id=153434

Reviewed by Brent Fulgham.

Source/JavaScriptCore:

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformWin.cmake:

Source/WebKit:

* PlatformWin.cmake:

Source/WTF:

* wtf/CMakeLists.txt:
* wtf/PlatformWin.cmake:

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

5 years agoWeb Inspector: Reduce unnecessary forced layouts in TimelineOverview
commit-queue@webkit.org [Mon, 25 Jan 2016 19:48:45 +0000 (19:48 +0000)]
Web Inspector: Reduce unnecessary forced layouts in TimelineOverview
https://bugs.webkit.org/show_bug.cgi?id=153392
<rdar://problem/24312344>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-01-25
Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype.layout):
Ignore setting the scrollLeft if we would be setting it to 0.
This helps avoid a forced layout in common cases.

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

5 years agoWebKitTestRunner: Credential cache is not cleared between tests
dbates@webkit.org [Mon, 25 Jan 2016 18:41:27 +0000 (18:41 +0000)]
WebKitTestRunner: Credential cache is not cleared between tests
https://bugs.webkit.org/show_bug.cgi?id=153407
<rdar://problem/24280834>

Reviewed by Brady Eidson.

Source/WebKit2:

Add SPI to call NetworkStorageSession::switchToNewTestingSession() to create a new testing session.
The new testing session will have an empty credential cache.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::switchToNewTestingSession): Added.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in: Added message SwitchToNewTestingSession().
* UIProcess/API/C/WKContext.cpp:
(WKContextResetTestingNetworkSession): Added.
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::resetTestingNetworkSession): Added.
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::switchToNewTestingSession): Added.
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in: Added message SwitchToNewTestingSession().

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues): Reset testing network session
to clear cached credentials.

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

5 years agoMarking http/tests/loading/preload-no-store-frame-src.html as failing on ios-simulator
ryanhaddad@apple.com [Mon, 25 Jan 2016 18:38:41 +0000 (18:38 +0000)]
Marking http/tests/loading/preload-no-store-frame-src.html as failing on ios-simulator
https://bugs.webkit.org/show_bug.cgi?id=152446

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

5 years agoModern IDB: Implement getIndexRecord in the SQLite backing store.
beidson@apple.com [Mon, 25 Jan 2016 18:20:23 +0000 (18:20 +0000)]
Modern IDB: Implement getIndexRecord in the SQLite backing store.
https://bugs.webkit.org/show_bug.cgi?id=153425

Reviewed by Darin Adler.

Source/WebCore:

No new tests (Some failures now pass, other failures progressed closer to passing).

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

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoMedia "ended" event incorrectly fires when currentTime is set
eric.carlson@apple.com [Mon, 25 Jan 2016 17:55:17 +0000 (17:55 +0000)]
Media "ended" event incorrectly fires when currentTime is set
https://bugs.webkit.org/show_bug.cgi?id=150348
<rdar://problem/24247974>

Reviewed by Jer Noble.

Source/WebCore:

Test: media/media-ended-fired-once.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::invalidateCachedTime): Always mark m_cachedTime as invalid.

LayoutTests:

* media/media-ended-fired-once-expected.txt: Added.
* media/media-ended-fired-once.html: Added.

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

5 years agoDo not convert GlyphBufferAdvance to FloatSize
commit-queue@webkit.org [Mon, 25 Jan 2016 17:49:22 +0000 (17:49 +0000)]
Do not convert GlyphBufferAdvance to FloatSize
https://bugs.webkit.org/show_bug.cgi?id=153421

Patch by Konstantin Tokarev <annulen@yandex.ru> on 2016-01-25
Reviewed by Simon Fraser.

No new tests needed.

* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::DrawGlyphs::computeBounds):

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

5 years agodocument.createElement should be able to create a custom element
rniwa@webkit.org [Mon, 25 Jan 2016 17:23:42 +0000 (17:23 +0000)]
document.createElement should be able to create a custom element
https://bugs.webkit.org/show_bug.cgi?id=153173

Reviewed by Darin Adler.

Source/WebCore:

Added the support for constructing a custom element via document.createElement.

Extracted HTMLElementFactory::createKnownElement, which returns nullptr when the specified name doesn't match
any builtin element instead of out of HTMLUnknownElement, out of HTMLElementFactory::createElement.

Test: fast/custom-elements/Document-createElement.html

* bindings/js/JSCustomElementInterface.cpp:
(WebCore::JSCustomElementInterface::constructHTMLElement): Added. Constructs a custom element by invoking its
constructor. We allow exceptions to be thrown by the constructor so the caller is responsible for checking
any exceptions in the ExecState before preceeding if the returned value is null.

* bindings/js/JSCustomElementInterface.h:
(WebCore::JSCustomElementInterface::constructSVGElement): Added.
* bindings/js/JSElementCustom.cpp:
(WebCore::toJSNewlyCreated): Exit early if the element is a custom element as the wrapper had already been
created by super() call inside the custom element'c constructor.

* bindings/js/JSMainThreadExecState.h:
(WebCore::JSMainThreadExecState):
* bindings/js/JSMainThreadExecStateInstrumentation.h:
(WebCore::JSMainThreadExecState::instrumentFunctionInternal): Generalized from instrumentFunctionCall so that
we can use it for both call and construct.
(WebCore::JSMainThreadExecState::instrumentFunctionCall): Specialized the above function for call.
(WebCore::JSMainThreadExecState::instrumentFunctionConstruct): Ditto for construct.

* dom/CustomElementDefinitions.cpp:
(WebCore::CustomElementDefinitions::findInterface): Added.
* dom/CustomElementDefinitions.h:

* dom/Document.cpp:
(WebCore::createHTMLElementWithNameValidation): Extracted from createElement.
(WebCore::Document::createElementForBindings): Renamed from createElement. Specifies
ShouldCreateCustomElement::Create to create a custom element before using fallback elements.
* dom/Document.h:
* dom/Document.idl:

* dom/Node.h:
(WebCore::Node::isCustomElement): Added. This flag is used to identify a custom element.
(WebCore::Node::setIsCustomElement): Added.

* dom/make_names.pl: Extracted createKnownElement from createElement for createHTMLElementWithNameValidation.

* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument): Use qualified name object to instantiate
a style element and set type content attribute.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setNodeName): Use createElementForBindings here since we might be creating an
arbitrary element here. Also use RefPtr instead of raw pointers while mutating DOM for safety.

Source/WebKit/win:

Use createElementForBindings here since this is a C++ binding for Windows.

* DOMCoreClasses.cpp:
(DOMDocument::createElement):

Source/WebKit2:

Use createElementForBindings here since this is for SPI.

* WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
(-[WKDOMDocument createElement:]):
(-[WKDOMDocument createTextNode:]):

LayoutTests:

Add a test for creating a custom elemnet via document.createElement.
The behavior is to be documented later.

* fast/custom-elements/Document-createElement-expected.txt: Added.
* fast/custom-elements/Document-createElement.html: Added.

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

5 years agoREGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773
carlosgc@webkit.org [Mon, 25 Jan 2016 17:13:40 +0000 (17:13 +0000)]
REGRESSION(r192773): [GTK] maps.google.com unresponsive/stalls since r192773
https://bugs.webkit.org/show_bug.cgi?id=153194

Reviewed by Michael Catanzaro.

In r192773 we implemented the JavaScriptCore garbage collector
timers for the GTK+ port. Those timers schedule sources in the
current thread default main context, but JS web worker threads
implementation doesn't use WTF::RunLoop, but its own WorkerRunLoop
class that doesn't create a GMainContext for the new thread. This
means that for web sites using workers, we are now doing garbage
collection of worker VMs in the main thread which ends up in a
deadlock at some point. We need to ensure that worker threads
create a GMainContext and push it as the default one for the
thread before the WorkerGlobalScope is created. This way when the
worker Heap is created, the GC timers use the right context to
schedule their sources. And then we need to check if there are
sources pending in the thread main context on every worker run
loop iteration.

* workers/WorkerRunLoop.cpp:
(WebCore::WorkerRunLoop::runInMode):
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::workerThread):

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

5 years agoWeb Inspector: timelines clear button should be inactive if nothing can be cleared
commit-queue@webkit.org [Mon, 25 Jan 2016 16:19:30 +0000 (16:19 +0000)]
Web Inspector: timelines clear button should be inactive if nothing can be cleared
https://bugs.webkit.org/show_bug.cgi?id=132756

Patch by Johan K. Jensen <jj@johanjensen.dk> on 2016-01-25
Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype.shown):
Enable clear button if timeline is not readonly and contains data, when switching timelines.
(WebInspector.TimelineRecordingContentView.prototype._capturingStarted):
Enable clear button when a capturing starts.
(WebInspector.TimelineRecordingContentView.prototype._recordingReset):
Disable clear button after resetting recording.

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

5 years agoUnreviewed, rolling out r195533.
commit-queue@webkit.org [Mon, 25 Jan 2016 16:18:42 +0000 (16:18 +0000)]
Unreviewed, rolling out r195533.
https://bugs.webkit.org/show_bug.cgi?id=153423

It is again breaking builds of several ports (Requested by
youenn on #webkit).

Reverted changeset:

"WebCoreJSBuiltins do not use to do conditional include"
https://bugs.webkit.org/show_bug.cgi?id=153306
http://trac.webkit.org/changeset/195533

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

5 years agoWeb Inspector: Timelines: "Timer Installed150ms delay" — no space before the delay...
mattbaker@apple.com [Mon, 25 Jan 2016 16:17:40 +0000 (16:17 +0000)]
Web Inspector: Timelines: "Timer Installed150ms delay" — no space before the delay number
https://bugs.webkit.org/show_bug.cgi?id=153416

Reviewed by Timothy Hatcher.

Fix for tree element subtitle rule that regressed in https://bugs.webkit.org/show_bug.cgi?id=153146.

* UserInterface/Views/TreeOutline.css:
(.tree-outline .item .alternate-subtitle::before):
Em dash should be inserted before both subtitle types.

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

5 years agoWebCoreJSBuiltins do not use to do conditional include
youenn.fablet@crf.canon.fr [Mon, 25 Jan 2016 14:06:53 +0000 (14:06 +0000)]
WebCoreJSBuiltins do not use to do conditional include
https://bugs.webkit.org/show_bug.cgi?id=153306

Reviewed by Alex Christensen.

Removing compilation guards as builtin generator adds them in the files themselves.
Fixing MediaDevices.js to generate MEDIA_STREAM compilation guard.

No change in behavior.

* Modules/mediastream/MediaDevices.js: Changing @optional to @conditional.
* bindings/js/WebCoreJSBuiltins.cpp:
* bindings/js/WebCoreJSBuiltins.h:

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

5 years agoUnreviewed, rolling out r195531.
commit-queue@webkit.org [Mon, 25 Jan 2016 11:57:41 +0000 (11:57 +0000)]
Unreviewed, rolling out r195531.
https://bugs.webkit.org/show_bug.cgi?id=153420

It is breaking builds of several ports (Requested by youenn on
#webkit).

Reverted changeset:

"WebCoreJSBuiltins do not use to do conditional include"
https://bugs.webkit.org/show_bug.cgi?id=153306
http://trac.webkit.org/changeset/195531

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

5 years agoWebCoreJSBuiltins do not use to do conditional include
youenn.fablet@crf.canon.fr [Mon, 25 Jan 2016 11:36:14 +0000 (11:36 +0000)]
WebCoreJSBuiltins do not use to do conditional include
https://bugs.webkit.org/show_bug.cgi?id=153306

Reviewed by Alex Christensen.

Removing compilation guards as builtin generator adds them in the files themselves.

No change in behavior.

* bindings/js/WebCoreJSBuiltins.cpp:
* bindings/js/WebCoreJSBuiltins.h:

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

5 years ago[Fetch API] Implement Fetch API Headers
youenn.fablet@crf.canon.fr [Mon, 25 Jan 2016 10:53:53 +0000 (10:53 +0000)]
[Fetch API] Implement Fetch API Headers
https://bugs.webkit.org/show_bug.cgi?id=152384

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/headers/headers-basic-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-basic.html: Added.
* web-platform-tests/fetch/api/headers/headers-casing-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-casing.html: Added.
* web-platform-tests/fetch/api/headers/headers-errors-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-errors.html: Added.
* web-platform-tests/fetch/api/headers/headers-idl-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-idl.html: Added.
* web-platform-tests/fetch/api/headers/headers-nameshake-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-nameshake.html: Added.
* web-platform-tests/fetch/api/headers/headers-normalize-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-normalize.html: Added.
* web-platform-tests/fetch/api/headers/headers-structure-expected.txt: Added.
* web-platform-tests/fetch/api/headers/headers-structure.html: Added.

Source/WebCore:

Adding Fetch Headers API as a wapper around HTTPHeaderMap.

Tests: imported/w3c/web-platform-tests/fetch/api/headers/headers-basic.html
       imported/w3c/web-platform-tests/fetch/api/headers/headers-casing.html
       imported/w3c/web-platform-tests/fetch/api/headers/headers-errors.html
       imported/w3c/web-platform-tests/fetch/api/headers/headers-idl.html
       imported/w3c/web-platform-tests/fetch/api/headers/headers-nameshake.html
       imported/w3c/web-platform-tests/fetch/api/headers/headers-normalize.html
       imported/w3c/web-platform-tests/fetch/api/headers/headers-structure.html

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* Modules/fetch/FetchHeaders.cpp: Added.
(WebCore::FetchHeaders::initializeWith):
(WebCore::isForbiddenHeaderName):
(WebCore::isForbiddenResponseHeaderName):
(WebCore::isSimpleHeader):
(WebCore::canWriteHeader):
(WebCore::FetchHeaders::append):
(WebCore::FetchHeaders::remove):
(WebCore::FetchHeaders::get):
(WebCore::FetchHeaders::has):
(WebCore::FetchHeaders::set):
* Modules/fetch/FetchHeaders.h: Added.
(WebCore::FetchHeaders::create):
(WebCore::FetchHeaders::~FetchHeaders):
(WebCore::FetchHeaders::internalHeaders):
(WebCore::FetchHeaders::FetchHeaders):
* Modules/fetch/FetchHeaders.idl: Added.
* Modules/fetch/FetchHeaders.js: Added.
(initializeFetchHeaders):
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* bindings/js/WebCoreJSBuiltins.cpp:
* bindings/js/WebCoreJSBuiltins.h:
(WebCore::JSBuiltinFunctions::JSBuiltinFunctions):
(WebCore::JSBuiltinFunctions::fetchHeadersBuiltins):
* platform/network/HTTPHeaderMap.cpp:
(WebCore::HTTPHeaderMap::contains):
(WebCore::HTTPHeaderMap::remove):
* platform/network/HTTPHeaderMap.h:

LayoutTests:

* js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* js/dom/global-constructors-attributes-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:
* platform/efl/js/dom/global-constructors-attributes-expected.txt:
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-mavericks/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-yosemite/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/js/dom/global-constructors-attributes-expected.txt:

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

5 years ago[css-grid] grid shorthand must reset gap properties to their initial values
svillar@igalia.com [Mon, 25 Jan 2016 09:24:19 +0000 (09:24 +0000)]
[css-grid] grid shorthand must reset gap properties to their initial values
https://bugs.webkit.org/show_bug.cgi?id=153354

Reviewed by Darin Adler.

Source/WebCore:

Both 'grid-row-gap' & 'grid-column-gap' are considered reset-only subproperties of the
'grid' shorthand meaning that, even thought the shorthand does not offer a way to set
their values, it must in any case reset them to the initial ones.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridShorthand):
* css/CSSPropertyNames.in:

LayoutTests:

* fast/css-grid-layout/grid-shorthand-get-set-expected.txt:
* fast/css-grid-layout/grid-shorthand-get-set.html:

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

5 years agoReduce number of Structures created at startup.
akling@apple.com [Mon, 25 Jan 2016 08:18:11 +0000 (08:18 +0000)]
Reduce number of Structures created at startup.
<https://webkit.org/b/153399>

Reviewed by Darin Adler.

For *Constructor and *Prototype objects that are only created once per JSGlobalObject,
build up the Structures using addPropertyWithoutTransition() helpers to avoid creating
tons of transitions that would just end up floating around and never getting used.

* inspector/JSInjectedScriptHostPrototype.cpp:
(Inspector::JSInjectedScriptHostPrototype::finishCreation):
* inspector/JSJavaScriptCallFramePrototype.cpp:
(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
* runtime/ArrayPrototype.cpp:
(JSC::ArrayPrototype::finishCreation):
* runtime/ConsolePrototype.cpp:
(JSC::ConsolePrototype::finishCreation):
* runtime/DatePrototype.cpp:
(JSC::DatePrototype::finishCreation):
* runtime/JSArrayBufferConstructor.cpp:
(JSC::JSArrayBufferConstructor::finishCreation):
* runtime/JSArrayBufferPrototype.cpp:
(JSC::JSArrayBufferPrototype::finishCreation):
* runtime/JSObject.cpp:
(JSC::JSObject::putDirectNativeFunctionWithoutTransition):
(JSC::JSObject::putDirectBuiltinFunctionWithoutTransition): Deleted.
* runtime/JSObject.h:
* runtime/JSPromiseConstructor.cpp:
(JSC::JSPromiseConstructor::addOwnInternalSlots):
* runtime/JSPromisePrototype.cpp:
(JSC::JSPromisePrototype::addOwnInternalSlots):
* runtime/JSTypedArrayViewConstructor.cpp:
(JSC::JSTypedArrayViewConstructor::finishCreation):
* runtime/JSTypedArrayViewPrototype.cpp:
(JSC::JSTypedArrayViewPrototype::finishCreation):
* runtime/MapIteratorPrototype.cpp:
(JSC::MapIteratorPrototype::finishCreation):
* runtime/MapPrototype.cpp:
(JSC::MapPrototype::finishCreation):
* runtime/NumberPrototype.cpp:
(JSC::NumberPrototype::finishCreation):
* runtime/ObjectConstructor.cpp:
(JSC::ObjectConstructor::finishCreation):
* runtime/ObjectPrototype.cpp:
(JSC::ObjectPrototype::finishCreation):
* runtime/SetIteratorPrototype.cpp:
(JSC::SetIteratorPrototype::finishCreation):
* runtime/SetPrototype.cpp:
(JSC::SetPrototype::finishCreation):
* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation):
* runtime/WeakSetPrototype.cpp:
(JSC::WeakSetPrototype::finishCreation):

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

5 years agoModern IDB: Implement deleteIndex and getCount for the SQLite backing store.
beidson@apple.com [Mon, 25 Jan 2016 07:55:17 +0000 (07:55 +0000)]
Modern IDB: Implement deleteIndex and getCount for the SQLite backing store.
https://bugs.webkit.org/show_bug.cgi?id=153415

Reviewed by Darin Adler.

Source/WebCore:

No new tests (Handful of tests now pass, improvements on a handful of others).

* Modules/indexeddb/server/IDBBackingStore.h:

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

* Modules/indexeddb/server/MemoryObjectStore.cpp:
(WebCore::IDBServer::MemoryObjectStore::takeIndexByIdentifier):
(WebCore::IDBServer::MemoryObjectStore::deleteIndex):
(WebCore::IDBServer::MemoryObjectStore::deleteAllIndexes):
(WebCore::IDBServer::MemoryObjectStore::takeIndexByName): Deleted.
* Modules/indexeddb/server/MemoryObjectStore.h:

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

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

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

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::performDeleteIndex):
(WebCore::IDBServer::UniqueIDBDatabase::didPerformDeleteIndex):
* Modules/indexeddb/server/UniqueIDBDatabase.h:

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

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoReport upload progress to NetworkLoadClient when using NetworkSession
commit-queue@webkit.org [Mon, 25 Jan 2016 07:45:39 +0000 (07:45 +0000)]
Report upload progress to NetworkLoadClient when using NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=153388

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

This fixes http/tests/xmlhttprequest/upload-onload-event.html and a few other tests.

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::didBecomeDownload):
(WebKit::NetworkLoad::didSendData):
(WebKit::NetworkLoad::didReceiveResponseAsync):
* NetworkProcess/NetworkLoad.h:
* NetworkProcess/NetworkSession.h:
(WebKit::NetworkSessionTaskClient::~NetworkSessionTaskClient):
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate initWithNetworkSession:]):
(-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):

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

5 years agoUnreviewed, speculative fix for:
beidson@apple.com [Mon, 25 Jan 2016 07:04:12 +0000 (07:04 +0000)]
Unreviewed, speculative fix for:
Modern IDB: Some IDB tests crash in ~SQLiteIDBBackingStore
https://bugs.webkit.org/show_bug.cgi?id=153418

No new tests.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore): Clear the global object
  before wiping out the VM.

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

5 years agoReduce PassRefPtr uses in dom - 4
gyuyoung.kim@webkit.org [Mon, 25 Jan 2016 06:13:09 +0000 (06:13 +0000)]
Reduce PassRefPtr uses in dom - 4
https://bugs.webkit.org/show_bug.cgi?id=153270

Reviewed by Darin Adler.

As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.

Source/WebCore:

* bindings/js/JSDeviceMotionEventCustom.cpp:
(WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
* dom/DeviceMotionData.cpp:
(WebCore::DeviceMotionData::create):
(WebCore::DeviceMotionData::DeviceMotionData):
* dom/DeviceMotionData.h:
* dom/Document.cpp:
(WebCore::Document::setBodyOrFrameset):
(WebCore::Document::setFocusedElement):
(WebCore::Document::setDecoder):
(WebCore::Document::pushCurrentScript):
* dom/Document.h:
* dom/Event.cpp:
(WebCore::Event::cloneFor):
* dom/Event.h:
* dom/MouseEvent.cpp:
(WebCore::MouseEvent::cloneFor):
* dom/MouseEvent.h:
* dom/NodeIterator.cpp:
(WebCore::NodeIterator::NodePointer::NodePointer):
(WebCore::NodeIterator::NodeIterator):
* dom/NodeIterator.h:
(WebCore::NodeIterator::create):
* html/RadioInputType.cpp:
(WebCore::RadioInputType::handleKeydownEvent):
* platform/ios/DeviceMotionClientIOS.mm:
(WebCore::DeviceMotionClientIOS::motionChanged):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):

Source/WebKit/win:

* Plugins/PluginView.cpp:
(WebCore::PluginView::focusPluginElement):

Source/WebKit2:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::focusPluginElement):

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

5 years ago[Font Loading] General cleanup
mmaxfield@apple.com [Mon, 25 Jan 2016 05:23:49 +0000 (05:23 +0000)]
[Font Loading] General cleanup
https://bugs.webkit.org/show_bug.cgi?id=153403

Reviewed by Darin Adler.

It turns out that CSSFontFaceSource::m_hasExternalSVGFont exactly equals
whether or not CSSFontFaceSource::m_font is a CachedSVGFont. Therefore,
the variable is redundant.

In addition, it was being passed to functions on CSSFontFaceSource::m_font,
which means it was always true inside the CachedSVGFont subclass and
always false for the CachedFont. Therefore, there is no reason pass this
variable to these functions because its value can be determined at
authorship time.

No new tests because there is no behavior change.

* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
(WebCore::CSSFontFaceSource::CSSFontFaceSource): Deleted.
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp:
(WebCore::createFontFace):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createFont):
* loader/cache/CachedFont.h:
* loader/cache/CachedSVGFont.cpp:
(WebCore::CachedSVGFont::createFont):
(WebCore::CachedSVGFont::ensureCustomFontData):
* loader/cache/CachedSVGFont.h:
* platform/network/HTTPParsers.cpp:
(WebCore::isValidHTTPToken):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::uppercaseKnownHTTPMethod):

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

5 years agoWeb Inspector: add support for placing Views in DataGrid column headers
mattbaker@apple.com [Mon, 25 Jan 2016 04:00:36 +0000 (04:00 +0000)]
Web Inspector: add support for placing Views in DataGrid column headers
https://bugs.webkit.org/show_bug.cgi?id=153387
<rdar://problem/24310797>

Reviewed by Timothy Hatcher.

This patch adds a new DataGrid column property, `headerView`, allowing a
custom View object to be placed in a column's header cell. The grid ensures
that the left and right edges of the view are kept in sync as columns are
resized. As most views use absolute positioning and are styled in CSS, the
vertical position and height of the view isn't set by the grid.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.insertColumn):
If the new column includes the `headerView` column data property,
it should take priority over `titleDOMFragment` and title text.
The specified View object is inserted into the DOM under the
column's <th> element, and added as a subview of the data grid.
(WebInspector.DataGrid.prototype.layout):
Update header views after performing default layout.
(WebInspector.DataGrid.prototype._showColumn):
Set `hidden` column property false instead of deleting it.
(WebInspector.DataGrid.prototype._positionHeaderViews):
Update the left and right style positions for all Views embedded in
column header cells, then update their layouts.
(WebInspector.DataGrid.prototype.resizerDragging):
Update header views after column resizers are repositioned.

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

5 years agoUnreviewed, update test after r195497
cdumez@apple.com [Mon, 25 Jan 2016 01:19:06 +0000 (01:19 +0000)]
Unreviewed, update test after r195497

This test did not make much sense as it was, after the behavior change
in r195497.

* fast/dom/Document/document-charset-expected.txt:
* fast/dom/Document/document-charset.html:

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

5 years agoAn XMLDocument interface should be exposed on the global Window object
cdumez@apple.com [Mon, 25 Jan 2016 01:11:35 +0000 (01:11 +0000)]
An XMLDocument interface should be exposed on the global Window object
https://bugs.webkit.org/show_bug.cgi?id=153378
<rdar://problem/24315465>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaseline several W3C DOM and HTML tests now that more checks are
passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/Document-constructor-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Expose an XMLDocument interface on the global Window object, as per:
- https://dom.spec.whatwg.org/#xmldocument

DOMImplementation.createDocument() now returns an XMLDocument instead
of a Document, as per:
- https://dom.spec.whatwg.org/#dom-domimplementation-createdocument

Previously, WebKit would alias XMLDocument to Document which caused
some W3C tests to fail.

Chrome and Firefox already match the specification here.

No new tests, already covered by existing tests.

* CMakeLists.txt:
* DerivedSources.cpp:
* DerivedSources.make:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSBindingsAllInOne.cpp:
* bindings/js/JSDocumentCustom.cpp:
(WebCore::createNewDocumentWrapper):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* dom/DOMImplementation.h:
* dom/DOMImplementation.idl:
* dom/Document.cpp:
(WebCore::Document::cloneDocumentWithoutChildren):
* dom/Document.h:
(WebCore::Document::isXMLDocument):
(WebCore::Document::create): Deleted.
(WebCore::Document::createNonRenderedPlaceholder): Deleted.
* dom/XMLDocument.h: Added.
(WebCore::XMLDocument::create):
(WebCore::XMLDocument::createXHTML):
(WebCore::XMLDocument::XMLDocument):
(isType):
* dom/XMLDocument.idl: Added.
* inspector/DOMPatchSupport.cpp:
(WebCore::DOMPatchSupport::patchDocument):
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::setOuterHTML):
* page/DOMWindow.idl:
* page/PageSerializer.cpp:
(WebCore::SerializerMarkupAccumulator::SerializerMarkupAccumulator):
* svg/SVGDocument.cpp:
(WebCore::SVGDocument::SVGDocument):
* svg/SVGDocument.h:
* svg/SVGDocument.idl:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::responseXML):
* xml/XSLTProcessor.cpp:
(WebCore::XSLTProcessor::createDocumentFromSource):

LayoutTests:

Rebaseline some layout tests now that XMLDocument is exposed.

* fast/dom/DOMImplementation/createDocument-namespace-err-expected.txt:
* fast/dom/DOMImplementation/script-tests/createDocument-namespace-err.js:
* fast/dom/Document/clone-node-expected.txt:
* fast/dom/Document/clone-node.html:
* fast/dom/Document/xml-document-focus-expected.txt:
* fast/dom/Document/xml-document-focus.xml:
* fast/dom/dom-parse-serialize-display-expected.txt:
* fast/dom/dom-parse-serialize-expected.txt:
* fast/dom/wrapper-classes-expected.txt:
* fast/dom/wrapper-classes.html:
* fast/dom/xmlserializer-serialize-to-string-exception-expected.txt:
* fast/xmlhttprequest/xmlhttprequest-bad-mimetype-expected.txt:
* http/tests/xmlhttprequest/supported-xml-content-types-expected.txt:
* platform/mac/fast/dom/Window/window-lookup-precedence-expected.txt:

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

5 years agoWeb Inspector: Highlight timeline range handles on hover
nvasilyev@apple.com [Mon, 25 Jan 2016 00:58:58 +0000 (00:58 +0000)]
Web Inspector: Highlight timeline range handles on hover
https://bugs.webkit.org/show_bug.cgi?id=153395
<rdar://problem/24312364>

Reviewed by Timothy Hatcher.

* UserInterface/Views/TimelineRuler.css:
(.timeline-ruler > .selection-handle.clamped):
Gardening. No need to repeat "1px solid".

(.timeline-ruler > .selection-handle:hover, .timeline-ruler > .selection-handle:active):
":active" pseudo selector is needed to keep the handle highligted while it's being dragged
regardress if the mouse cursor is hovering over it or not.

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

5 years agoNew WK1 baselines.
simon.fraser@apple.com [Sun, 24 Jan 2016 23:43:34 +0000 (23:43 +0000)]
New WK1 baselines.

* platform/mac-wk1/displaylists/extent-includes-shadow-expected.txt:
* platform/mac-wk1/displaylists/extent-includes-transforms-expected.txt:

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

5 years agoModern IDB: Support IDBObjectStore.createIndex in the SQLite backing store.
beidson@apple.com [Sun, 24 Jan 2016 23:42:11 +0000 (23:42 +0000)]
Modern IDB: Support IDBObjectStore.createIndex in the SQLite backing store.
https://bugs.webkit.org/show_bug.cgi?id=153410

Reviewed by Darin Adler.

Source/WebCore:

No new tests (Covered by unskipping many existing tests).

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::~SQLiteIDBBackingStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

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

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

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoMake the dumped display list representation a bit more compact
simon.fraser@apple.com [Sun, 24 Jan 2016 20:39:49 +0000 (20:39 +0000)]
Make the dumped display list representation a bit more compact
https://bugs.webkit.org/show_bug.cgi?id=153409

Reviewed by Zalan Bujtas.
Source/WebCore:

Don't make a group for every display list item.

* platform/graphics/displaylists/DisplayList.cpp:
(WebCore::DisplayList::DisplayList::asText):

LayoutTests:

Updated results.

* displaylists/extent-includes-shadow-expected.txt:
* displaylists/extent-includes-transforms-expected.txt:
* displaylists/layer-dispay-list-expected.txt:
* displaylists/replay-skip-clipped-rect-expected.txt:

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

5 years agoAdd testing for display list replay, and skip clipped-out items on replay
simon.fraser@apple.com [Sun, 24 Jan 2016 20:39:42 +0000 (20:39 +0000)]
Add testing for display list replay, and skip clipped-out items on replay
https://bugs.webkit.org/show_bug.cgi?id=153408

Reviewed by Zalan Bujtas.
Source/WebCore:

Make it possible to save and serialize a DisplayList of Items which were
actually applied on replay, so that replay-time optimizations can be tested.

This exposes internals.setElementTracksDisplayListReplay() and
internals.replayDisplayListForElement().

Do a trivial replay-time optimization, which is to skip items whose extents are
outside the replay clip.

Test: displaylists/replay-skip-clipped-rect.html

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
(WebCore::GraphicsLayer::isTrackingDisplayListReplay):
(WebCore::GraphicsLayer::replayDisplayListAsText):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::layerDisplayListMap): Use a singleton map to store the replay display lists
to avoid bloating GraphicsLayerCA for test-only code. The map stores a pair of the
replay list and a clip rect, which are both dumped. Dumping the clip rect ensures that
we're reporting the replay for the correct tile in a test (since there will be a replay
for each tile).
(WebCore::GraphicsLayerCA::~GraphicsLayerCA):
(WebCore::GraphicsLayerCA::platformCALayerPaintContents):
(WebCore::GraphicsLayerCA::setIsTrackingDisplayListReplay):
(WebCore::GraphicsLayerCA::replayDisplayListAsText):
* platform/graphics/ca/GraphicsLayerCA.h:
* platform/graphics/displaylists/DisplayList.h:
(WebCore::DisplayList::DisplayList::appendItem):
* platform/graphics/displaylists/DisplayListReplayer.cpp:
(WebCore::DisplayList::Replayer::replay): In the unlikely event of tracking replays,
allocate a new DisplayList and append to it items which actually get applied.
* platform/graphics/displaylists/DisplayListReplayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::setIsTrackingDisplayListReplay):
(WebCore::RenderLayerBacking::replayDisplayListAsText):
* rendering/RenderLayerBacking.h:
* testing/Internals.cpp:
(WebCore::Internals::setElementTracksDisplayListReplay):
(WebCore::Internals::replayDisplayListForElement):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Test that a clipped-out rectangle is not painted.

In order to get the rect into the display list, we need to make the target
compositing layer be tiled, and to be clipped by an ancestor so that only the
second tile renders. (This complexity is required because in simpler scenarios,
the rect is clipped out at recording time.)

* displaylists/replay-skip-clipped-rect-expected.txt: Added.
* displaylists/replay-skip-clipped-rect.html: Added.
* displaylists/resources/dump-target-replay-list.js: Added.
(doTest):

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

5 years agoLayout Test displaylists/extent-includes-transforms.html is flaky on mac-wk1
simon.fraser@apple.com [Sun, 24 Jan 2016 20:39:27 +0000 (20:39 +0000)]
Layout Test displaylists/extent-includes-transforms.html is flaky on mac-wk1
https://bugs.webkit.org/show_bug.cgi?id=153308

Reviewed by Dan Bernstein.

Rather than assuming that a zero-delay timer will fire after the next layer flush,
force a flush with testRunner.display(), which fixes flakiness.

* displaylists/resources/dump-target-display-list.js:
(doTest):

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

5 years agoAdded project.xcworkspace and xcuserdata to this project’s svn:ignore.
mitz@apple.com [Sun, 24 Jan 2016 17:06:42 +0000 (17:06 +0000)]
Added project.xcworkspace and xcuserdata to this project’s svn:ignore.

* LayoutTestRelay/LayoutTestRelay.xcodeproj: Added property svn:ignore.

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

5 years agoWeb Inspector: AXI: node-link-list should be collapsible
commit-queue@webkit.org [Sun, 24 Jan 2016 02:47:42 +0000 (02:47 +0000)]
Web Inspector: AXI: node-link-list should be collapsible
https://bugs.webkit.org/show_bug.cgi?id=130911

.:

Added a manual test to test the node list in the Accessibility Inspector

Patch by Aaron Chu <arona.chu@gmail.com> on 2016-01-23
Reviewed by Timothy Hatcher.

* ManualTests/accessibility/collapsible-node-link-list.html: Added.

Source/WebInspectorUI:

Patch by Aaron Chu <arona.chu@gmail.com> on 2016-01-23
Reviewed by Timothy Hatcher.

Accessibility Inspector: for a very long children node list, only the first 5 nodes are shown.
Remaining nodes are hidden by a "# More…" link by which a user can click to reveal the remainder
of the node list.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WebInspector.DOMNodeDetailsSidebarPanel.prototype._refreshAccessibility.linkListForNodeIds):
* UserInterface/Views/Main.css:
(.expand-list-button):
(.node-link-list, .node-link-list li:not([hidden])):
(.node-link-list, .node-link-list li): Deleted.

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

5 years ago[GTK] Fix media controls displaying without controls attribute
commit-queue@webkit.org [Sat, 23 Jan 2016 22:51:40 +0000 (22:51 +0000)]
[GTK] Fix media controls displaying without controls attribute
https://bugs.webkit.org/show_bug.cgi?id=152500

Media controls is not displayed without controls attribute by default
when the video element has text track. It'll be displayed on fullscreen
regardless of controls attribute.

Patch by Wonchul Lee <wonchul.lee@collabora.co.uk> on 2016-01-23
Reviewed by Michael Catanzaro.

Source/WebCore:

* Modules/mediacontrols/mediaControlsGtk.js:
(ControllerGtk.prototype.shouldHaveControls):
(ControllerGtk.prototype.reconnectControls):
(ControllerGtk.prototype.removeControls):
(ControllerGtk.prototype.configureControls): Deleted.

LayoutTests:

* media/video-controls-no-display-with-text-track-expected.txt: Added.
* media/video-controls-no-display-with-text-track.html: Added.

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

5 years agoCMake build fix after r195494.
achristensen@apple.com [Sat, 23 Jan 2016 10:08:26 +0000 (10:08 +0000)]
CMake build fix after r195494.

* PlatformMac.cmake:
WebKit2 needs to be able to find DataDetectors.h.

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

5 years agoUse credentials from a URL with NetworkSession like we did with ResourceHandle
commit-queue@webkit.org [Sat, 23 Jan 2016 09:44:10 +0000 (09:44 +0000)]
Use credentials from a URL with NetworkSession like we did with ResourceHandle
https://bugs.webkit.org/show_bug.cgi?id=153328

Patch by Alex Christensen <achristensen@webkit.org> on 2016-01-23
Reviewed by Alexey Proskuryakov.

Source/WebCore:

This patch fixes at least http/tests/xmlhttprequest/basic-auth-credentials-escaping.html when using NetworkSession.

* platform/network/ProtectionSpaceBase.h:
(WebCore::ProtectionSpaceBase::encodingRequiresPlatformData):
* platform/network/ResourceRequestBase.h:
Add some WEBCORE_EXPORT macros for functions that are now used in WebKit2.

Source/WebKit2:

* NetworkProcess/NetworkLoad.cpp:
(WebKit::NetworkLoad::NetworkLoad):
createDataTaskWithRequest is being removed, so use std::make_unique<NetworkDataTask> directly instead.
Also, create the task even if we are deferring loading.  Don't call resume if we are deferring loading.
* NetworkProcess/NetworkSession.h:
Callbacks are not just used in NetworkSessionTaskClient, so declare them outside.
The NetworkDataTask now takes a ResourceRequest so we can strip its credentials.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
Try credentials stored with the NetworkDataTask before asking the client for credentials.
(WebKit::NetworkSession::~NetworkSession):
(WebKit::NetworkSession::dataTaskForIdentifier):
(WebKit::NetworkSession::takeDownloadID):
(WebKit::NetworkDataTask::NetworkDataTask):
Strip the credentials from the url before creating the task because we do not know the authentication type.
We will use these credentials when a challenge is received.
(WebKit::NetworkDataTask::~NetworkDataTask):
(WebKit::NetworkDataTask::tryPasswordBasedAuthentication):
If we have credentials from the initial URL, try using them if it is appropriate.
(WebKit::NetworkDataTask::cancel):
(WebKit::NetworkSession::createDataTaskWithRequest): Deleted.
* Shared/Authentication/AuthenticationManager.h:

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

5 years agoModern IDB: Implement clearing object stores and opening cursors in the SQLite backend.
beidson@apple.com [Sat, 23 Jan 2016 08:19:12 +0000 (08:19 +0000)]
Modern IDB: Implement clearing object stores and opening cursors in the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=153396

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Some failing tests now pass, others improved).

Copy more LegacyIDB SQLite backend code over to the new SQLite backend.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
(WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoUnreviewed, rolling out r195493.
commit-queue@webkit.org [Sat, 23 Jan 2016 07:13:53 +0000 (07:13 +0000)]
Unreviewed, rolling out r195493.
https://bugs.webkit.org/show_bug.cgi?id=153397

Broke authenticaiton tests (leaks credentials) (Requested by
ap on #webkit).

Reverted changeset:

"LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-
unterminated.html crashing"
https://bugs.webkit.org/show_bug.cgi?id=153250
http://trac.webkit.org/changeset/195493

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

5 years agoFixed a computer error.
mitz@apple.com [Sat, 23 Jan 2016 07:13:03 +0000 (07:13 +0000)]
Fixed a computer error.

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

5 years ago<rdar://problem/24304228> REGRESSION (r184215): Staged XPC services load non-staged...
mitz@apple.com [Sat, 23 Jan 2016 07:07:10 +0000 (07:07 +0000)]
<rdar://problem/24304228> REGRESSION (r184215): Staged XPC services load non-staged shims
https://bugs.webkit.org/show_bug.cgi?id=153389

Reviewed by Alexey Prooskuryakov.

* Configurations/Shim.xcconfig: Don’t override the install name when using a staged install path.

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

5 years agoWeb Inspector: Reduce unnecessary forced layouts in TimelineRuler
commit-queue@webkit.org [Sat, 23 Jan 2016 06:46:56 +0000 (06:46 +0000)]
Web Inspector: Reduce unnecessary forced layouts in TimelineRuler
https://bugs.webkit.org/show_bug.cgi?id=153390
<rdar://problem/24312241>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2016-01-22
Reviewed by Timothy Hatcher.

TimelineRuler's width rarely changes. It should only need to calculate
its width when added to the DOM or if the content view containing it
has resized and the bounds of the ruler may have changed.

Switch everything in TimelineRuler to using a cached width, and add
an explicit method, resize, to update this width. This eliminated
frequent hangs I was seeing while recording timelines.

* UserInterface/Views/OverviewTimelineView.js:
(WebInspector.OverviewTimelineView.prototype.shown):
(WebInspector.OverviewTimelineView.prototype.updateLayoutForResize):
Resize the ruler when the view is shown or resized.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype.shown):
(WebInspector.TimelineOverview.prototype.updateLayoutForResize):
Resize the ruler when the view is shown or resized.

* UserInterface/Views/TimelineRecordingContentView.js:
(WebInspector.TimelineRecordingContentView.prototype.layout):
Inform the current content view of a resize if possible.

* UserInterface/Views/TimelineRuler.js:
(WebInspector.TimelineRuler.prototype.resize):
Update the width.

(WebInspector.TimelineRuler.prototype._recalculate):
(WebInspector.TimelineRuler.prototype._needsMarkerLayout):
(WebInspector.TimelineRuler.prototype._needsSelectionLayout):
(WebInspector.TimelineRuler.prototype._handleMouseMove):
(WebInspector.TimelineRuler.prototype._handleSelectionHandleMouseMove):
Use cached width.

* UserInterface/Views/TimelineRecordBar.js:
(WebInspector.TimelineRecordBar.createCombinedBars): Deleted.
Remove some stale code.

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

5 years agoB3 should strength-reduce division by a constant
fpizlo@apple.com [Sat, 23 Jan 2016 03:24:42 +0000 (03:24 +0000)]
B3 should strength-reduce division by a constant
https://bugs.webkit.org/show_bug.cgi?id=153386

Reviewed by Benjamin Poulain.

You can turn a 32-bit division by a constant into a 64-bit multiplication by a constant
plus some shifts. A book called "Hacker's Delight" has a bunch of math about this. The
hard part is finding the constant by which to multiply, and the amount by which to shift.
The book tells you some theroems, but you still have to turn that into code by thinking
deep thoughts. Luckily I was able to avoid that because it turns out that LLVM already
has code for this. It's called APInt::magic(), where APInt is their class for reasoning
about integers.

The code has a compatible license to ours and we have already in the past taken code from
LLVM. So, that's what this patch does. The LLVM code is localized in
B3ComputeDivisionMagic.h. Then reduceStrength() uses that to construct the multiply+shift
sequence.

This is an enormous speed-up on AsmBench-0.9/bigfib.cpp.js. It makes us as fast on that
test as LLVM. It reduces our deficit on AsmBench to 1.5%. Previously it was 4.5%.

* JavaScriptCore.xcodeproj/project.pbxproj:
* b3/B3ComputeDivisionMagic.h: Added.
(JSC::B3::computeDivisionMagic):
* b3/B3ReduceStrength.cpp:

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

5 years agogenericUnwind might overflow the instructions() vector when catching an FTL exception
sbarati@apple.com [Sat, 23 Jan 2016 02:10:17 +0000 (02:10 +0000)]
genericUnwind might overflow the instructions() vector when catching an FTL exception
https://bugs.webkit.org/show_bug.cgi?id=153383

Reviewed by Benjamin Poulain.

* jit/JITExceptions.cpp:
(JSC::genericUnwind):

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

5 years agoHTMLElement::nodeName should not upper case non-ASCII characters
rniwa@webkit.org [Sat, 23 Jan 2016 02:04:41 +0000 (02:04 +0000)]
HTMLElement::nodeName should not upper case non-ASCII characters
https://bugs.webkit.org/show_bug.cgi?id=153231

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaselined the test now that all test cases pass.

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

Source/WebCore:

Use the newly added convertToASCIIUppercase to generate the string for tagName and nodeName.

Test: fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html

* dom/QualifiedName.cpp:
(WebCore::QualifiedName::localNameUpper): Use convertToASCIIUppercase.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::nodeName): Use convertToASCIIUppercase.

Source/WTF:

Added convertToASCIIUppercase to AtomicString, String, and StringImpl.

* wtf/text/AtomicString.cpp:
(WTF::AtomicString::convertASCIICase): Generalized from convertToASCIILowercase.
(WTF::AtomicString::convertToASCIILowercase):
(WTF::AtomicString::convertToASCIIUppercase):
* wtf/text/AtomicString.h:
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::convertASCIICase): Generalized from convertToASCIILowercase.
(WTF::StringImpl::convertToASCIILowercase):
(WTF::StringImpl::convertToASCIIUppercase):
* wtf/text/StringImpl.h:
* wtf/text/WTFString.cpp:
(WTF::String::convertToASCIIUppercase): Added.
* wtf/text/WTFString.h:

LayoutTests:

Added a regression test since the rebaselined W3C test case is very simple and doesn't all permutations.

* fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document-expected.txt: Added.
* fast/dom/Element/tagName-must-be-ASCII-uppercase-in-HTML-document.html: Added.

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

5 years agoModern IDB: Disable simultaneous transactions in the SQLite backend for now.
beidson@apple.com [Sat, 23 Jan 2016 01:48:39 +0000 (01:48 +0000)]
Modern IDB: Disable simultaneous transactions in the SQLite backend for now.
https://bugs.webkit.org/show_bug.cgi?id=153381

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (This resolves many of the currently crashing/asserting tests).

Right now we're porting the Legacy IDB SQLite backend to Modern IDB.

The way the Legacy backend works is restricted to one transaction at a time.

There's many tricks we can play to resolve this, but that task is better performed
once all of the basic functionality is done.

Fixing this limitation is covered by https://bugs.webkit.org/show_bug.cgi?id=153382

* Modules/indexeddb/server/IDBBackingStore.h: Add a "supports simultaneous transactions" getter.
* Modules/indexeddb/server/MemoryIDBBackingStore.h:
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
(WebCore::IDBServer::UniqueIDBDatabase::deleteBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::openBackingStore):
(WebCore::IDBServer::UniqueIDBDatabase::enqueueTransaction):
(WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction): If the backing store does
  not support simultaneous transactions but there is a transaction in progress, return.
* Modules/indexeddb/server/UniqueIDBDatabase.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoFix internal Windows build
achristensen@apple.com [Sat, 23 Jan 2016 01:32:02 +0000 (01:32 +0000)]
Fix internal Windows build
https://bugs.webkit.org/show_bug.cgi?id=153385
rdar://problem/24310408

Reviewed by Brian Weinstein.

* Source/cmake/WinTools.make:
* Source/cmake/tools/vsprops: Copied from WebKitLibraries/win/tools/vsprops.
These property sheets are needed for some projects that are not in this repository
and don't use CMake in the official build.  We want to leave them unchanged for now.

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

5 years agodocument.charset should be an alias for document.characterSet
cdumez@apple.com [Sat, 23 Jan 2016 01:10:42 +0000 (01:10 +0000)]
document.charset should be an alias for document.characterSet
https://bugs.webkit.org/show_bug.cgi?id=153367

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline existing W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt:
* web-platform-tests/dom/nodes/Document-constructor-expected.txt:
* web-platform-tests/dom/nodes/Node-properties-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

document.charset should be an alias for document.characterSet:
- https://dom.spec.whatwg.org/#dom-document-charset

It should also be read-only.

Chrome matches the specification.

No new tests, already covered by existing tests.

* dom/Document.h:
* dom/Document.idl:

LayoutTests:

Drop outdated tests.

* fast/dom/Document/document-charset-expected.txt:
* fast/dom/document-attribute-js-null-expected.txt:
* fast/dom/document-attribute-js-null.html:
* fast/encoding/css-charset-default-expected.txt:
* fast/encoding/css-charset-default.xhtml:
* fast/encoding/external-script-charset.js: Removed.
* fast/encoding/external-script-charset.xhtml: Removed.

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

5 years agoDocument.open / Document.write should be prevented while the document is being unloaded
cdumez@apple.com [Sat, 23 Jan 2016 01:04:59 +0000 (01:04 +0000)]
Document.open / Document.write should be prevented while the document is being unloaded
https://bugs.webkit.org/show_bug.cgi?id=153255
<rdar://problem/22741293>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Document.open / Document.write should be prevented while the document
is being unloaded, as per the HTML specification:
- https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)
- https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)

This patch is aligning our behavior with the specification and Firefox.
Calling Document.open / Document.write during the document was being
unloaded would cause us to crash as this was unexpected.

Tests: fast/frames/page-hide-document-open.html
       fast/frames/page-unload-document-open.html

* WebCore.xcodeproj/project.pbxproj:
Add new IgnoreOpensDuringUnloadCountIncrementer.h header.

* dom/Document.cpp:
(WebCore::Document::open):
Abort if the document's ignore-opens-during-unload counter is greater
than zero, as per:
https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-open (step 6)

(WebCore::Document::write):
Abort if the insertion point is undefined and the document's
ignore-opens-during-unload counter is greater than zero, as per:
https://html.spec.whatwg.org/multipage/webappapis.html#dom-document-write (step 3)

* dom/Document.h:
Add data member to maintain the document's ignore-opens-during-unload counter:
https://html.spec.whatwg.org/multipage/webappapis.html#ignore-opens-during-unload-counter

* dom/IgnoreOpensDuringUnloadCountIncrementer.h: Added.
Add utility class to increment / decrement a document's
ignore-opens-during-unload counter.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
When a page goes into PageCache, we don't end up calling
FrameLoader::detachChildren() so we need to increment the document's
ignore-opens-during-unload counter before calling stopLoading() on each
subframe.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::detachChildren):
detachChildren() will end up firing the pagehide / unload events in each
child frame so we increment the parent frame's document's
ignore-opens-during-unload counter. This behavior matches the text of:
https://html.spec.whatwg.org/multipage/browsers.html#unload-a-document

As per the spec, the document's ignore-opens-during-unload counter should
be incremented before firing the pagehide / unload events at the document's
Window object. It should be decremented only after firing the pagehide /
unload events in each subframe. This is needed in case a subframe tries to
call document.open / document.write on a parent frame's document, from its
pagehide or unload handler.

(WebCore::FrameLoader::dispatchUnloadEvents):
Increment the document's ignore-opens-during-unload counter before firing
the pagehide / unload events and decrement it after. As per the spec, we
are not supposed to decrement this early. We actually supposed to wait
until the pagehide / unload events have been fired in all the subframes.
For this reason, we take care of re-incrementing the document's
ignore-opens-during-unload in detachChildren(), which will take care of
firing the pagehide / unload in the subframes.

LayoutTests:

Add layout tests that cover calling Document.open / Document.write from
unload and pagehide handlers.

* fast/frames/page-hide-document-open-expected.txt: Added.
* fast/frames/page-hide-document-open.html: Added.
* fast/frames/page-unload-document-open-expected.txt: Added.
* fast/frames/page-unload-document-open.html: Added.
* fast/frames/resources/finish-test.html: Added.
* fast/frames/resources/page-hide-document-open-frame.html: Added.
* fast/frames/resources/page-hide-document-open-win.html: Added.
* fast/frames/resources/page-unload-document-open-frame.html: Added.
* fast/frames/resources/page-unload-document-open-win.html: Added.

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

5 years agoModern IDB: Implement put, get, and delete records for the SQLite backend.
beidson@apple.com [Sat, 23 Jan 2016 00:41:06 +0000 (00:41 +0000)]
Modern IDB: Implement put, get, and delete records for the SQLite backend.
https://bugs.webkit.org/show_bug.cgi?id=153375

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by many existing tests now passing).

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
(WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
(WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
(WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
* Modules/indexeddb/server/SQLiteIDBBackingStore.h:

LayoutTests:

* platform/mac-wk1/TestExpectations:

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

5 years agoAdd support for DataDetectors in WK (iOS).
enrica@apple.com [Sat, 23 Jan 2016 00:24:02 +0000 (00:24 +0000)]
Add support for DataDetectors in WK (iOS).
https://bugs.webkit.org/show_bug.cgi?id=152989
rdar://problem/22855960

Reviewed by Tim Horton.

Source/WebCore:

This patch adds the logic to perform data detection and modify
the DOM by adding data detector links as appropriate.
The data detector results returned by detectContentInRange are
stored in the Frame object.

* editing/cocoa/DataDetection.h:
* editing/cocoa/DataDetection.mm:
(WebCore::resultIsURL):
(WebCore::constructURLStringForResult):
(WebCore::removeResultLinksFromAnchor):
(WebCore::searchForLinkRemovingExistingDDLinks):
(WebCore::dataDetectorTypeForCategory):
(WebCore::buildQuery):
(WebCore::DataDetection::detectContentInRange):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):
* page/Frame.h:
(WebCore::Frame::setDataDetectionResults):
(WebCore::Frame::dataDetectionResults):
* platform/spi/cocoa/DataDetectorsCoreSPI.h:
(DDQueryOffsetCompare):

Source/WebKit2:

* UIProcess/API/Cocoa/WKWebView.mm:
(fromWKDataDetectorTypes): Changed parameter to uint64_t to
successfully compare against WKDataDetectorTypeAll.

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

5 years agoLayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
dbates@webkit.org [Sat, 23 Jan 2016 00:19:02 +0000 (00:19 +0000)]
LayoutTest http/tests/security/xssAuditor/embed-tag-in-path-unterminated.html crashing
https://bugs.webkit.org/show_bug.cgi?id=153250
<rdar://problem/12172843>
And
<rdar://problem/24248040>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Remove an incorrect assertion that the absolute URL associated with a protection space cannot
contain consecutive forward slash (/) characters. A URL can contain consecutive forward slashes.
This also makes the invariants for CredentialStorage::findDefaultProtectionSpaceForURL() symmetric
with the invariants for WebCore::protectionSpaceMapKeyFromURL().

Tests: http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html
       http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html

* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::findDefaultProtectionSpaceForURL):

LayoutTests:

The test case http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html was derived
from a test case written by Yongjun Zhang in <https://bugs.webkit.org/attachment.cgi?id=65189> (bug #44461).

* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Added.
* http/tests/loading/basic-auth-load-URL-with-consecutive-slashes.html: Added.
* http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Added.
* http/tests/xmlhttprequest/basic-auth-load-URL-with-consecutive-slashes.html: Added.
* platform/wk2/http/tests/loading/basic-auth-load-URL-with-consecutive-slashes-expected.txt: Added.

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

5 years agoRebaselining http/tests/security/originHeader/origin-header-for-https.html after...
ryanhaddad@apple.com [Fri, 22 Jan 2016 23:45:13 +0000 (23:45 +0000)]
Rebaselining http/tests/security/originHeader/origin-header-for-https.html after r195477

Unreviewed test gardening.

* http/tests/security/originHeader/origin-header-for-https-expected.txt:

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

5 years agoDOMImplementation.createHTMLDocument("") should append an empty Text Node to the...
cdumez@apple.com [Fri, 22 Jan 2016 23:43:13 +0000 (23:43 +0000)]
DOMImplementation.createHTMLDocument("") should append an empty Text Node to the title Element
https://bugs.webkit.org/show_bug.cgi?id=153374

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline existing W3C DOM tests now that more checks are passing.

* web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt:
* web-platform-tests/dom/ranges/Range-selectNode-expected.txt:

Source/WebCore:

DOMImplementation.createHTMLDocument("") should append an empty Text
Node to the title Element as per the steps at:
- https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument (step 6)

Firefox and Chrome follow the specification here.

Previously, WebKit would rely on HTMLTitleElement.text setter which
does not create a Text Node if the title is the empty string, as per:
- https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text
- https://dom.spec.whatwg.org/#dom-node-textcontent

No new tests, already covered by existing test.

* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createHTMLDocument):

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

5 years agoWe should OSR exit with Int52Overflow when we fail to make an Int52 where we expect...
mark.lam@apple.com [Fri, 22 Jan 2016 23:30:07 +0000 (23:30 +0000)]
We should OSR exit with Int52Overflow when we fail to make an Int52 where we expect one.
https://bugs.webkit.org/show_bug.cgi?id=153379

Reviewed by Filip Pizlo.

In DFG::Graph::addShouldSpeculateMachineInt(), we check
!hasExitSite(add, Int52Overflow) when determining whether it's ok to speculate
that an operand is of type Int52 or not.  However, the Int52Rep code that
converts a double to Int52 will OSR exit with exit kind BadType instead.
This renders the hasExitSite() check in addShouldSpeculateMachineInt() useless.
This patch fixes this by changing Int52Rep to OSR exit with exit kind
Int52Overflow instead when it fails to convert a double to an Int52.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::terminateSpeculativeExecution):
(JSC::DFG::SpeculativeJIT::typeCheck):
(JSC::DFG::SpeculativeJIT::usedRegisters):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::needsTypeCheck):
(JSC::DFG::SpeculativeJIT::speculateStringObjectForStructure):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToLLVM.cpp:
(JSC::FTL::DFG::LowerDFGToLLVM::typeCheck):
(JSC::FTL::DFG::LowerDFGToLLVM::appendTypeCheck):
(JSC::FTL::DFG::LowerDFGToLLVM::doubleToStrictInt52):

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

5 years agoAdd a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClie...
adachan@apple.com [Fri, 22 Jan 2016 23:26:42 +0000 (23:26 +0000)]
Add a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClient::supportsVideoFullscreen().
https://bugs.webkit.org/show_bug.cgi?id=153220

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, just code refactoring.

* Modules/mediacontrols/MediaControlsHost.cpp:
(WebCore::MediaControlsHost::supportsFullscreen):
Just pass in VideoFullscreenModeStandard as this is used for checking the standard fullscreen case.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::enterFullscreen):
Only use the FullScreen API if the mode is VideoFullscreenModeStandard. Call ChromeClient::supportsVideoFullscreen()
with the mode.
(WebCore::HTMLMediaElement::exitFullscreen):
Move the fullscreen element check up so we can use this method to exit picture-in-picture mode.
* html/HTMLMediaElement.h:

* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::supportsFullscreen):
Ditto.
(WebCore::HTMLVideoElement::webkitEnterFullscreen):
Pass in VideoFullscreenModeStandard to supportsFullscreen() as this is used for the standard fullscreen case.
(WebCore::HTMLVideoElement::webkitSupportsFullscreen):
Ditto.
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode):
Pass in the correct VideoFullscreenMode to supportsFullscreen() corresponding to the mode string passed in.
(WebCore::HTMLVideoElement::setFullscreenMode):
Pass in the mode to supportsFullscreen().
* html/HTMLVideoElement.h:

* html/MediaController.h:
* html/MediaControllerInterface.h:
Make supportsFullscreen() take a VideoFullscreenMode.

* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::reset):
Pass in VideoFullscreenModeStandard to supportsFullscreen() here since this is used for the standard
fullscreen button.
* html/shadow/MediaControlsApple.cpp:
(WebCore::MediaControlsApple::reset):
Ditto.

* page/ChromeClient.h:
Make supportsVideoFullscreen() take a VideoFullscreenMode.

* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::mediaSupportsFullscreen):
(WebCore::HitTestResult::toggleMediaFullscreenState):
(WebCore::HitTestResult::enterFullscreenForVideo):
Pass in VideoFullscreenModeStandard in the code relating to the standard fullscreen.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::supportsVideoFullscreen):

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
(WebChromeClient::supportsVideoFullscreen):
* WebCoreSupport/WebChromeClient.h:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen):
* WebProcess/WebCoreSupport/WebChromeClient.h:

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

5 years agoDocument.URL / Document.documentURI should return "about:blank" instead of empty...
cdumez@apple.com [Fri, 22 Jan 2016 23:22:07 +0000 (23:22 +0000)]
Document.URL / Document.documentURI should return "about:blank" instead of empty string / null
https://bugs.webkit.org/show_bug.cgi?id=153363
<rdar://problem/22549736>

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several W3C tests now that more checks are passing.

* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createDocument-expected.txt:
* web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt:
* web-platform-tests/dom/nodes/Document-constructor-expected.txt:
* web-platform-tests/dom/nodes/Node-properties-expected.txt:
* web-platform-tests/html/dom/interfaces-expected.txt:

Source/WebCore:

Document.URL / Document.documentURI should return "about:blank" instead
of empty string / null, as per the specification:
- https://dom.spec.whatwg.org/#dom-document-url
- https://dom.spec.whatwg.org/#concept-document-url

Also, Document.documentURI should be an alias for Document.URL as per:
- https://dom.spec.whatwg.org/#dom-document-url

Firefox matches the specification.

No new tests, already covered by existing W3C tests.

* dom/Document.h:
(WebCore::Document::urlForBindings):
* dom/Document.idl:

LayoutTests:

Drop outdated tests.

* dom/xhtml/level3/core/documentgetdocumenturi02-expected.txt: Removed.
* dom/xhtml/level3/core/documentgetdocumenturi02.js: Removed.
* dom/xhtml/level3/core/documentgetdocumenturi02.xhtml: Removed.
* dom/xhtml/level3/core/documentgetdocumenturi03-expected.txt: Removed.
* dom/xhtml/level3/core/documentgetdocumenturi03.js: Removed.
* dom/xhtml/level3/core/documentgetdocumenturi03.xhtml: Removed.
* dom/xhtml/level3/core/documentsetdocumenturi03-expected.txt: Removed.
* dom/xhtml/level3/core/documentsetdocumenturi03.js: Removed.
* dom/xhtml/level3/core/documentsetdocumenturi03.xhtml: Removed.
* fast/dom/document-attribute-js-null-expected.txt:
* fast/dom/document-attribute-js-null.html:

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