WebKit-https.git
3 years agoWeb Inspector: Picking Snapshot from navigation bar popup does to switch views
commit-queue@webkit.org [Wed, 20 Apr 2016 03:52:42 +0000 (03:52 +0000)]
Web Inspector: Picking Snapshot from navigation bar popup does to switch views
https://bugs.webkit.org/show_bug.cgi?id=156762

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

* UserInterface/Views/TimelineDataGridNodePathComponent.js:
(WebInspector.TimelineDataGridNodePathComponent.prototype.get previousSibling):
(WebInspector.TimelineDataGridNodePathComponent.prototype.get nextSibling):
Wrong represented object provided by TimelineDataGridNodePathComponent.

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

3 years ago2016-04-19 Geoffrey Garen <ggaren@apple.com>
ggaren@apple.com [Wed, 20 Apr 2016 03:08:33 +0000 (03:08 +0000)]
2016-04-19  Geoffrey Garen  <ggaren@apple.com>

        Unreviewed, try to fix an ASSERT seen on the bots.

        * bmalloc/Heap.cpp:
        (bmalloc::Heap::tryAllocateLarge): This ASSERT is supposed to be about
        alignment, not size. Oops.

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

3 years agoAdd a couple UNLIKELY macros in parseMemberExpression
sbarati@apple.com [Wed, 20 Apr 2016 02:41:00 +0000 (02:41 +0000)]
Add a couple UNLIKELY macros in parseMemberExpression
https://bugs.webkit.org/show_bug.cgi?id=156775

Reviewed by Filip Pizlo.

These UNLIKELY macros have to do with the base of the
member expression being 'super'. I think it's safe to
argue that this is truly UNLIKELY. I am seeing speedups
sometimes on Octane codeload. Usually around 0.5%. Sometimes 1%.

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

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

3 years agoallow jsc shell to dump sampling profiler data
sbarati@apple.com [Wed, 20 Apr 2016 02:24:53 +0000 (02:24 +0000)]
allow jsc shell to dump sampling profiler data
https://bugs.webkit.org/show_bug.cgi?id=156725

Reviewed by Benjamin Poulain.

This patch adds a '--reportSamplingProfilerData' option to the
JSC shell which will enable the sampling profiler and dump
its data at the end of execution. The dump will include the
40 hottest functions and the 80 hottest bytecode locations.
If you're using this option to debug, it's easy to just hack
on the code to make it dump more or less information.

* jsc.cpp:
(CommandLine::parseArguments):
(jscmain):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::processUnverifiedStackTraces):
(JSC::SamplingProfiler::stackTracesAsJSON):
(JSC::SamplingProfiler::reportTopFunctions):
(JSC::SamplingProfiler::reportTopBytecodes):
* runtime/SamplingProfiler.h:
(JSC::SamplingProfiler::StackFrame::hasExpressionInfo):
(JSC::SamplingProfiler::StackFrame::hasBytecodeIndex):
(JSC::SamplingProfiler::StackFrame::hasCodeBlockHash):
(JSC::SamplingProfiler::setStopWatch):

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

3 years agoFix CMake build.
achristensen@apple.com [Wed, 20 Apr 2016 01:36:02 +0000 (01:36 +0000)]
Fix CMake build.

* CMakeLists.txt:
Don't compile a file that doesn't exist.
* PlatformMac.cmake:
Put the XPCServices in the right place.

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

3 years agoRemove remaining bits of dynamic <link> rel='icon' loading
bfulgham@apple.com [Wed, 20 Apr 2016 01:33:34 +0000 (01:33 +0000)]
Remove remaining bits of dynamic <link> rel='icon' loading
https://bugs.webkit.org/show_bug.cgi?id=156727

Reviewed by Darin Adler.

Source/WebCore:

Don't call 'shouldLoadLink' for 'icon' link types. It performs no
useful checks for 'icon' types, and emits the non-standard
'onbeforeload' event.

This work finishes up https://webkit.org/b/153151, where we removed
FrameLoaderClient::dispatchDidChangeIcons() and related code.

Test: webarchive/test-link-rel-subresource-beforeload.html

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink): Remove unneeded call to 'shouldLoadLink'.

Tools:

Remove unused test infrastructure. This code never existed in WebKit2
testing since was only used on Windows.

* DumpRenderTree/TestRunner.cpp:
(dumpIconChangesCallback): Deleted.
* DumpRenderTree/TestRunner.h:
(TestRunner::dumpIconChanges): Deleted.
(TestRunner::setDumpIconChanges): Deleted.

LayoutTests:

Rename 'test-link-rel-icon-beforeload.html' to 'test-link-rel-subresource-beforeload.html'.

* fast/dom/icon-url-property-expected.txt: Removed.
* fast/dom/icon-url-property.html: Removed.
* platform/gtk/TestExpectations: Remove references to deleted tests.
* platform/ios-simulator/TestExpectations: Ditto.
* platform/wk2/TestExpectations: Ditto.
* webarchive/test-link-rel-icon-beforeload-expected.webarchive: Removed.
* webarchive/test-link-rel-icon-beforeload.html: Removed.
* webarchive/test-link-rel-subresource-beforeload-expected.webarchive: Copied from LayoutTests/webarchive/test-link-rel-icon-beforeload-expected.webarchive.
* webarchive/test-link-rel-subresource-beforeload.html: Copied from LayoutTests/webarchive/test-link-rel-icon-beforeload.html.

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

3 years agoAudioBufferSourceNode.buffer should be nullable
cdumez@apple.com [Wed, 20 Apr 2016 01:30:11 +0000 (01:30 +0000)]
AudioBufferSourceNode.buffer should be nullable
https://bugs.webkit.org/show_bug.cgi?id=156769

Reviewed by Darin Adler.

Source/WebCore:

AudioBufferSourceNode.buffer should be nullable as per the
specification:
https://webaudio.github.io/web-audio-api/#AudioBufferSourceNode

Our implementation was initially returning null when getting
AudioBufferSourceNode.buffer, which is correct. However, it would
throw a TypeError when trying to set the attribute to null. Our
implementation setter actually supported setting the buffer to
null but the custom bindings for the setter would not.

This patch does the following:
- Get rid of the custom bindings for the AudioBufferSourceNode.buffer
  setter. We can have the bindings generator generate the same code
  by using [StrictTypeChecking]. The custom bindinds were also throwing
  a TypeError if the input AudioBuffer had too many channels but this
  does not seem to be possible.
- Mark AudioBufferSourceNode.buffer as nullable in the IDL so that
  we no longer throw when the JS tries to assign null, but instead
  calls AudioBufferSourceNode::setBuffer(nullptr)

No new test, updated webaudio/audiobuffersource-channels.html

* CMakeLists.txt:
* Modules/webaudio/AudioBufferSourceNode.cpp:
(WebCore::AudioBufferSourceNode::setBuffer):
* Modules/webaudio/AudioBufferSourceNode.h:
* Modules/webaudio/AudioBufferSourceNode.idl:
* Modules/webaudio/AudioContext.h:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAudioBufferSourceNodeCustom.cpp: Removed.

LayoutTests:

Update existing layout test to check that:
- AudioBufferSourceNode.buffer is initially null
- AudioBufferSourceNode.buffer can be set to null
- We cannot create an AudioBuffer that has too many channels

* webaudio/audiobuffersource-channels-expected.txt:
* webaudio/audiobuffersource-channels.html:

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

3 years agoModern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent...
beidson@apple.com [Wed, 20 Apr 2016 01:19:59 +0000 (01:19 +0000)]
Modern IDB: Lots of IDB bindings cleanup (including making IDBVersionChangeEvent constructible).
https://bugs.webkit.org/show_bug.cgi?id=156760

Reviewed by Darin Adler (and looked over by Chris Dumez and Alex Christensen).

Source/WebCore:

Test: storage/indexeddb/modern/idbversionchangeevent-constructor.html

Add WorkerGlobalScopeConstructors to the xcodeproj:
* WebCore.xcodeproj/project.pbxproj:

Remove the completely irrelevant webkit* prefixed constructors from DOMWindow:
* page/DOMWindow.idl:

Remove the poor way most objects were exposed on the WorkerGlobalScope:
* Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl:

Expose most of the objects on the WorkerGlobalScope the correct way:
* Modules/indexeddb/IDBCursor.idl:
* Modules/indexeddb/IDBCursorWithValue.idl:
* Modules/indexeddb/IDBDatabase.idl:
* Modules/indexeddb/IDBFactory.idl:
* Modules/indexeddb/IDBIndex.idl:
* Modules/indexeddb/IDBKeyRange.idl:
* Modules/indexeddb/IDBObjectStore.idl:
* Modules/indexeddb/IDBOpenDBRequest.idl:
* Modules/indexeddb/IDBRequest.idl:
* Modules/indexeddb/IDBTransaction.idl:

Make IDBVersionChangeEvent constructible:
* Modules/indexeddb/IDBVersionChangeEvent.cpp:
(WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
(WebCore::IDBVersionChangeEvent::newVersion): Deleted.
* Modules/indexeddb/IDBVersionChangeEvent.h:
* Modules/indexeddb/IDBVersionChangeEvent.idl:

* bindings/js/JSDictionary.h:
(WebCore::JSDictionary::convertValue): Add a templated form of convertValue that
  handles Optional<>s.

LayoutTests:

* js/dom/global-constructors-attributes-idb-expected.txt: Updated for removed attributes.
* storage/indexeddb/modern/idbversionchangeevent-constructor-expected.txt: Added.
* storage/indexeddb/modern/idbversionchangeevent-constructor.html: Added.

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

3 years ago[EFL] Unskip media tests since r199649
gyuyoung.kim@webkit.org [Wed, 20 Apr 2016 01:05:36 +0000 (01:05 +0000)]
[EFL] Unskip media tests since r199649

Unreviewed EFL gardening.

* platform/efl/TestExpectations: r199649 fixed media test crash as well.

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

3 years agoRe-landing: ES6: Implement RegExp.prototype[@@search].
mark.lam@apple.com [Wed, 20 Apr 2016 00:02:07 +0000 (00:02 +0000)]
Re-landing: ES6: Implement RegExp.prototype[@@search].
https://bugs.webkit.org/show_bug.cgi?id=156331

Reviewed by Keith Miller.

Source/JavaScriptCore:

What changed?
1. Implemented search builtin in RegExpPrototype.js.
   The native path is now used as a fast path.
2. Added DFG support for an IsRegExpObjectIntrinsic (modelled after the
   IsJSArrayIntrinsic).
3. Renamed @isRegExp to @isRegExpObject to match the new IsRegExpObjectIntrinsic.
4. Change the esSpecIsRegExpObject() implementation to check if the object's
   JSType is RegExpObjectType instead of walking the classinfo chain.

* builtins/RegExpPrototype.js:
(search):
* builtins/StringPrototype.js:
(search):
- fixed some indentation.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileIsArrayConstructor):
(JSC::DFG::SpeculativeJIT::compileIsRegExpObject):
(JSC::DFG::SpeculativeJIT::compileCallObjectConstructor):
* dfg/DFGSpeculativeJIT.h:
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileIsFunction):
(JSC::FTL::DFG::LowerDFGToB3::compileIsRegExpObject):
(JSC::FTL::DFG::LowerDFGToB3::compileTypeOf):
(JSC::FTL::DFG::LowerDFGToB3::isExoticForTypeof):
(JSC::FTL::DFG::LowerDFGToB3::isRegExpObject):
(JSC::FTL::DFG::LowerDFGToB3::isType):
* runtime/Intrinsic.h:
- Added IsRegExpObjectIntrinsic.

* runtime/CommonIdentifiers.h:

* runtime/ECMAScriptSpecInternalFunctions.cpp:
(JSC::esSpecIsConstructor):
- Changed to use uncheckedArgument since this is only called from internal code.
(JSC::esSpecIsRegExpObject):
(JSC::esSpecIsRegExp): Deleted.
* runtime/ECMAScriptSpecInternalFunctions.h:
- Changed to check the object for a JSType of RegExpObjectType.

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
- Added split fast path.

* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncSearchFast):
(JSC::regExpProtoFuncSearch): Deleted.
* runtime/RegExpPrototype.h:

* tests/es6.yaml:
* tests/stress/regexp-search.js:
- Rebased test.

LayoutTests:

* js/regress/regexp-prototype-search-observable-side-effects-expected.txt: Added.
* js/regress/regexp-prototype-search-observable-side-effects.html: Added.
* js/regress/regexp-prototype-search-observable-side-effects2-expected.txt: Added.
* js/regress/regexp-prototype-search-observable-side-effects2.html: Added.

* js/regress/script-tests/regexp-prototype-search-observable-side-effects.js: Added.
* js/regress/script-tests/regexp-prototype-search-observable-side-effects2.js: Added.

* js/regress/script-tests/string-prototype-search-observable-side-effects.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects2.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects3.js: Added.
* js/regress/script-tests/string-prototype-search-observable-side-effects4.js: Added.

* js/regress/string-prototype-search-observable-side-effects-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects.html: Added.
* js/regress/string-prototype-search-observable-side-effects2-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects2.html: Added.
* js/regress/string-prototype-search-observable-side-effects3-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects3.html: Added.
* js/regress/string-prototype-search-observable-side-effects4-expected.txt: Added.
* js/regress/string-prototype-search-observable-side-effects4.html: Added.

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

3 years agoWeb Inspector: DataGrid should be virtualized so it only renders visible rows
timothy@apple.com [Tue, 19 Apr 2016 23:41:25 +0000 (23:41 +0000)]
Web Inspector: DataGrid should be virtualized so it only renders visible rows

https://bugs.webkit.org/show_bug.cgi?id=156663
rdar://problem/25765256

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ComputedStyleDetailsPanel.js:
(WebInspector.ComputedStyleDetailsPanel.prototype.set containerRegions):
Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/ConsoleMessageView.js:
(WebInspector.ConsoleMessageView.prototype._formatParameterAsTable):
Set inline and variableHeightRows to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/DOMTreeDataGrid.js:
(WebInspector.DOMTreeDataGrid):
Set inline to true, remove direct classList add.

* UserInterface/Views/DataGrid.css:
(.data-grid td):
(.data-grid table.data):
(.data-grid:not(.variable-height-rows) table.data):
(.data-grid:not(.variable-height-rows) table.data.odd-first-zebra-stripe):
(.data-grid.variable-height-rows table.data tr:nth-child(odd)):
(.data-grid.variable-height-rows table.data tr:nth-child(even)):
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(odd)):
(.data-grid.variable-height-rows.odd-first-zebra-stripe table.data tr:nth-child(even)):
(.data-grid.variable-height-rows table.data tr.filler):
Updated styles to support variable height rows directly and flipping the order of the stripes
when the virtual table starts at an odd row.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid): Added rowHeight and rows.
(WebInspector.DataGrid.prototype.get inline): Added.
(WebInspector.DataGrid.prototype.set inline): Added.
(WebInspector.DataGrid.prototype.get variableHeightRows): Added.
(WebInspector.DataGrid.prototype.set variableHeightRows): Added.
(WebInspector.DataGrid.prototype.layout): Call _updateVisibleRows.
(WebInspector.DataGrid.prototype._noteRowsChanged): Added.
(WebInspector.DataGrid.prototype._updateVisibleRows): Added.
(WebInspector.DataGrid.prototype._sortNodesCallback): Update to not use the DOM.
(WebInspector.DataGridNode.prototype.set hasChildren): Call needsLayout.
(WebInspector.DataGridNode.prototype.collapse): Call needsLayout.
(WebInspector.DataGridNode.prototype.expand): Call needsLayout.
(WebInspector.DataGridNode.prototype._attach): Call _noteRowsChanged.
(WebInspector.DataGridNode.prototype._detach): Call _noteRowsChanged.

* UserInterface/Views/DatabaseUserQuerySuccessView.js:
(WebInspector.DatabaseUserQuerySuccessView):
Set inline to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/DetailsSection.css:
(.details-section > .content .data-grid td.value-column):
(.details-section > .content .data-grid table.data): Deleted.
(.details-section > .content .data-grid tr:nth-child(even)): Deleted.
(.details-section > .content .data-grid tr:nth-child(odd)): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/DetailsSectionDataGridRow.js:
(WebInspector.DetailsSectionDataGridRow.prototype.set dataGrid):
Set inline and variableHeightRows to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/HeapSnapshotInstancesContentView.css:
(.heap-snapshot > .data-grid tr:matches(.selected, :hover) td .go-to-arrow):
(.heap-snapshot .icon):
Remove margin-top to fit inside 20px row instead of 21px.

* UserInterface/Views/IndexedDatabaseObjectStoreContentView.css:
(.content-view.indexed-database-object-store > .data-grid table.data): Deleted.
(.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(even)): Deleted.
(.content-view.indexed-database-object-store > .data-grid table.data tr:nth-child(odd)): Deleted.
(.content-view.indexed-database-object-store > .data-grid table.data tr.filler): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/IndexedDatabaseObjectStoreContentView.js:
(WebInspector.IndexedDatabaseObjectStoreContentView):
Set variableHeightRows to true.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WebInspector.LayerTreeDetailsSidebarPanel.prototype._buildDataGridSection):
Set inline to true, remove direct classList add. Call updateLayoutIfNeeded since we don't use views here.

* UserInterface/Views/LogContentView.css:
(.console-item .data-grid table.data): Deleted.
(.console-item .data-grid table.data tr:nth-child(even)): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/NetworkGridContentView.css:
(.content-view.network-grid > .data-grid td): Deleted.
(.content-view.network-grid > .data-grid table.data): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/ProbeSetDataGrid.js:
(WebInspector.ProbeSetDataGrid):
Set inline to true, remove direct classList add.

* UserInterface/Views/ProfileView.css:
(.profile > .data-grid td .icon):
(.profile > .data-grid tr:matches(.selected, :hover) .go-to-arrow):
Remove margin-top to fit inside 20px row instead of 21px.

* UserInterface/Views/TimelineRecordingContentView.css:
(.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid td): Deleted.
(.content-view.timeline-recording > .content-browser > .content-view-container > .timeline-view > .data-grid table.data): Deleted.
Now handled by DataGrid.css directly.

* UserInterface/Views/Variables.css:
(:root): Added zebra stripe colors.

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

3 years agobmalloc: Merge the large and xlarge allocators
ggaren@apple.com [Tue, 19 Apr 2016 23:36:20 +0000 (23:36 +0000)]
bmalloc: Merge the large and xlarge allocators
https://bugs.webkit.org/show_bug.cgi?id=156734

Reviewed by Andreas Kling.

This give us better defense against worst case memory usage:

                                      Baseline                Patch                    Δ
    Peak Memory:
        nimlang                      198,132kB            181,468kB      ^ 1.09x smaller

It also eliminates inline metadata for large objects, fixing the
regression introduced in r198675, and more:

    run-malloc-benchmarks Baseline:~/OpenSource/WebKitBuildBaseline/Release/ Patch:~/OpenSource/WebKitBuild/Release/

                                                          Baseline                          Patch                              Δ
    Memory at End:
        big                                               10,880kB                        3,328kB                ^ 3.27x smaller
        facebook                                           3,112kB                        2,868kB                ^ 1.09x smaller
        fragment --parallel                                1,848kB                          760kB                ^ 2.43x smaller
        fragment_iterate --parallel                        4,908kB                          776kB                ^ 6.32x smaller
        big --parallel                                    48,076kB                       11,892kB                ^ 4.04x smaller

Overall memory use looks OK:

    run-malloc-benchmarks --memory_warning Baseline:~/OpenSource/WebKitBuildBaseline/Release/ Patch:~/OpenSource/WebKitBuild/Release/

                                                Baseline                               Patch                                   Δ
    Memory at End:
        <arithmetic mean>                       13,992kB                            13,987kB                      ^ 1.0x smaller

Overall throughput looks OK:

    run-malloc-benchmarks Baseline:~/OpenSource/WebKitBuildBaseline/Release/ Patch:~/OpenSource/WebKitBuild/Release/

                                                          Baseline                          Patch                              Δ
    Execution Time:
        <arithmetic mean>                                    103ms                          104ms                 ! 1.01x slower

We're a bit slower on the "all-out large allocations on all cores"
benchmark, but I think that's an OK price to pay:

                                                          Baseline                          Patch                              Δ
    Execution Time:
        big --parallel                                       125ms                          136ms                 ! 1.09x slower

This patch net removes 1.5k lines of code. It turns out that large
allocations are rare, and free memory fragments are also rare, so the
combination is super rare, and a simple O(n) algorithm that ensures good
memory behavior is the best option.

Fun fact: In practice, the odds that the old code would save memory
were *worse* than the odds that it would contain a bug that wasted
memory. :)

* bmalloc.xcodeproj/project.pbxproj:

* bmalloc/Allocator.cpp:
(bmalloc::Allocator::tryAllocate): largeMax is the new xLargeMax since
xLargeMax is gone now.

(bmalloc::Allocator::allocate): I moved the rounding code into allocateLarge,
so we don't have to do it here.

(bmalloc::Allocator::reallocate):
(bmalloc::Allocator::allocateSlowCase):
(bmalloc::Allocator::allocateXLarge): Deleted. No more XLarge case.

* bmalloc/Allocator.h:

* bmalloc/BeginTag.h: Removed.
* bmalloc/BoundaryTag.h: Removed.

* bmalloc/Chunk.h:
(bmalloc::ChunkHash::hash): Added a hash function. The best hash function
is a unique and monotonically increasing integer, and that's exactly what
we typically get from the high bits of a Chunk, since the OS allocates
Chunks at unique and increasing addresses.
(bmalloc::Chunk::boundaryTags): Deleted.
(bmalloc::Chunk::objectType): Deleted.
(bmalloc::Chunk::beginTag): Deleted.
(bmalloc::Chunk::endTag): Deleted.

* bmalloc/Deallocator.cpp:
(bmalloc::Deallocator::deallocateSlowCase): We no longer know for sure,
by looking at its bit pattern, whether a pointer is small or large.
Instead, any pointer with large alignment *might* be large, and when
we occasionally encounter such an object, we have to consult a hash
table in the Heap to find out for sure. This turns out to be just as
cheap in practice.

We don't deallocate large objects on the fast path anymore. We can't,
because large objects have out-of-line metadata now.

(bmalloc::Deallocator::deallocateXLarge): Deleted.

* bmalloc/Deallocator.h:
(bmalloc::Deallocator::deallocateFastCase): See deallocateSlowCase.

* bmalloc/EndTag.h: Removed.
* bmalloc/FreeList.cpp: Removed.
* bmalloc/FreeList.h: Removed.

* bmalloc/Heap.cpp:
(bmalloc::Heap::allocateSmallPage): Be sure to track each chunk in
the object type map, so we can distinguish small vs large objects.

(bmalloc::Heap::deallocateSmallLine): No need to check object type
because we know object type now by virtue of being on the small object
path.

(bmalloc::Heap::splitAndAllocate): Be sure to track each chunk in
the object type map, so we can distinguish small vs large objects. Large
objects can split across chunks, so we need to add each large object's
chunk as it is allocated.

(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::isLarge):
(bmalloc::Heap::largeSize):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge): Merged in existing XLarge logic for
large objects.

(bmalloc::Heap::scavengeXLargeObjects): Deleted.
(bmalloc::Heap::allocateXLarge): Deleted.
(bmalloc::Heap::tryAllocateXLarge): Deleted.
(bmalloc::Heap::xLargeSize): Deleted.
(bmalloc::Heap::shrinkXLarge): Deleted.
(bmalloc::Heap::deallocateXLarge): Deleted.

* bmalloc/Heap.h:
(bmalloc::Heap::LargeObjectHash::hash):

* bmalloc/LargeObject.h: Removed.

* bmalloc/Map.h: Added.
(bmalloc::Map::size):
(bmalloc::Map::capacity):
(bmalloc::Map::get):
(bmalloc::Map::set):
(bmalloc::Map::remove):
(bmalloc::Map::shouldGrow):
(bmalloc::Map::shouldShrink):
(bmalloc::Map::find):
(bmalloc::Hash>::rehash): Simple hash table.

* bmalloc/Object.h:

* bmalloc/ObjectType.cpp:
(bmalloc::objectType):
* bmalloc/ObjectType.h:
(bmalloc::mightBeLarge): See deallocateSlowCase.
(bmalloc::isXLarge): Deleted.

* bmalloc/SegregatedFreeList.cpp: Removed.
* bmalloc/SegregatedFreeList.h: Removed.

* bmalloc/Sizes.h: Upped smallMax to 64kB. Upping to 32kB is pretty
reasonable, since sizes between 16kB and 32kB share page sizes. I went
all the way up to 64kB because the GC uses 64kB blocks, and also just
for extra padding to ensure that large allocations are indeed rare.

* bmalloc/SortedVector.h: Removed.

* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::tryAllocateLargeChunk):
(bmalloc::VMHeap::allocateSmallChunk):
(bmalloc::VMHeap::VMHeap): Deleted.
(bmalloc::VMHeap::allocateChunk): Deleted.
* bmalloc/VMHeap.h:
(bmalloc::VMHeap::deallocateSmallPage):
(bmalloc::VMHeap::allocateLargeObject): Deleted.
(bmalloc::VMHeap::deallocateLargeObject): Deleted. Nixed all the boundary
tag logic since metadata is out of line now.

* bmalloc/VMState.h: Removed. Instead of an abstract state, we track
the precise amount of committed physical pages at the head of a VM
range. This allows us to merge aggressively without triggering an madvise
storm most of the time.

* bmalloc/Vector.h:
(bmalloc::Vector<T>::Vector):
(bmalloc::Vector<T>::insert):
(bmalloc::Vector<T>::remove):
(bmalloc::Vector<T>::resize): Filled out some missing helpers.

* bmalloc/XLargeMap.cpp:
(bmalloc::XLargeMap::remove):
(bmalloc::XLargeMap::add):
(bmalloc::XLargeMap::removePhysical):
(bmalloc::XLargeMap::takeFree): Deleted.
(bmalloc::XLargeMap::addFree): Deleted.
(bmalloc::XLargeMap::addAllocated): Deleted.
(bmalloc::XLargeMap::getAllocated): Deleted.
(bmalloc::XLargeMap::takeAllocated): Deleted.
(bmalloc::XLargeMap::shrinkToFit): Deleted.
(bmalloc::XLargeMap::takePhysical): Deleted.
(bmalloc::XLargeMap::addVirtual): Deleted.
* bmalloc/XLargeMap.h:
(bmalloc::XLargeMap::Allocation::operator<): Deleted. We don't track
object sizes anymore -- just free space. (The Heap tracks object sizes.)
We use plain old linear search for free space. (See intro.)

* bmalloc/XLargeRange.h:
(bmalloc::XLargeRange::physicalSize):
(bmalloc::XLargeRange::setPhysicalSize):
(bmalloc::merge):
(bmalloc::XLargeRange::split):
(bmalloc::XLargeRange::vmState): Deleted.
(bmalloc::XLargeRange::setVMState): Deleted. See VMState.h.

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

3 years agoReplace $vm.printValue() with $vm.value().
mark.lam@apple.com [Tue, 19 Apr 2016 23:31:25 +0000 (23:31 +0000)]
Replace $vm.printValue() with $vm.value().
https://bugs.webkit.org/show_bug.cgi?id=156767

Reviewed by Saam Barati.

When debugging with $vm, this change allows us to do this:

    $vm.print("myObj = " + $vm.value(myObj) + "\n");

... instead of having to do this:

    $vm.print("myObj = ");
    $vm.printValue(myObj);
    $vm.print("\n");

* tools/JSDollarVMPrototype.cpp:
(JSC::JSDollarVMPrototype::printValue):
(JSC::functionValue):
(JSC::JSDollarVMPrototype::finishCreation):
(JSC::functionPrintValue): Deleted.

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

3 years agoRebase test after r199738
achristensen@apple.com [Tue, 19 Apr 2016 21:51:12 +0000 (21:51 +0000)]
Rebase test after r199738

* fast/canvas/webgl/fragment-shader-assertion-expected.txt:
ANGLE gives us a more descriptive error now.  No big deal.
This test was added to make sure it didn't crash in http://trac.webkit.org/changeset/199340
and it still does not crash.

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

3 years agoBuild fix after r199738
achristensen@apple.com [Tue, 19 Apr 2016 21:45:44 +0000 (21:45 +0000)]
Build fix after r199738

Source/ThirdParty/ANGLE:

* CMakeLists.txt:

Source/WebCore:

* platform/graphics/efl/GraphicsContext3DEfl.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
* platform/graphics/win/GraphicsContext3DWin.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):

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

3 years agoObjcInstance::stringValue should not call NSObject's description method
keith_miller@apple.com [Tue, 19 Apr 2016 21:02:15 +0000 (21:02 +0000)]
ObjcInstance::stringValue should not call NSObject's description method
https://bugs.webkit.org/show_bug.cgi?id=156758

Reviewed by Geoffrey Garen.

Source/WebCore:

This patch makes it so that we no longer call NSObject's description method without first
swizzling the implementation for WebScriptObjects. We restore the incomming NSObject's
description method once we have finished generating the string.

Test: platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html

* bridge/objc/objc_instance.mm:
(swizzleNSObjectDescription):
(ObjcInstance::stringValue):

Tools:

Add new methods to ObjCController that expose two Types of WebScriptObjects. The first is
an NSObject and the second is an NSArray of NSObjects. These are used to test that we don't
call the NSObjects description method without first swizzling it.

* DumpRenderTree/mac/ObjCController.m:
(+[ObjCController isSelectorExcludedFromWebScript:]):
(+[ObjCController webScriptNameForSelector:]):
(-[ObjCController testArrayOfObjects]):
(-[ObjCController testObject]):

LayoutTests:

Test that we don't use the NSObject's description method when stringifying a WebScriptObject.

* platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject-expected.txt: Added.
* platform/mac/fast/objc/webScriptObject-does-not-call-description-on-nsobject.html: Added.
* platform/wk2/TestExpectations:

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

3 years agoNew SPI to export a dictionary of runtime features
dino@apple.com [Tue, 19 Apr 2016 20:25:36 +0000 (20:25 +0000)]
New SPI to export a dictionary of runtime features
https://bugs.webkit.org/show_bug.cgi?id=156645
<rdar://problem/23621666>

Reviewed by Anders Carlsson.

Mark the new SPI as WK_MAC_TBA, WK_IOS_TBA.

* UIProcess/API/Cocoa/_WKExperimentalFeature.h:

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

3 years agoCrash under WebKit::PluginView::pluginSnapshotTimerFired
cdumez@apple.com [Tue, 19 Apr 2016 20:20:10 +0000 (20:20 +0000)]
Crash under WebKit::PluginView::pluginSnapshotTimerFired
https://bugs.webkit.org/show_bug.cgi?id=156754
<rdar://problem/22566764>

Reviewed by Beth Dakin.

Add null check for frame() before trying to access the frame settings,
similarly to what is done earlier in this function. This fixes a top
crasher.

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

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

3 years agoBuild fix.
achristensen@apple.com [Tue, 19 Apr 2016 19:57:14 +0000 (19:57 +0000)]
Build fix.

* src/compiler/translator/Intermediate.h: Added.
(TIntermediate::TIntermediate):
* src/compiler/translator/intermediate.h: Removed.
Changed case of Intermediate.h file name for case sensitive file systems.

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

3 years agoUpdate ANGLE
achristensen@apple.com [Tue, 19 Apr 2016 19:46:21 +0000 (19:46 +0000)]
Update ANGLE
https://bugs.webkit.org/show_bug.cgi?id=156755

Reviewed by Dean Jackson.

Source/ThirdParty/ANGLE:

Huge list of changed files omitted.

Source/WebCore:

* CMakeLists.txt:
* platform/graphics/ANGLEWebKitBridge.h:
(WebCore::ANGLEWebKitBridge::getResources):
* platform/graphics/cairo/GraphicsContext3DCairo.cpp:
(WebCore::GraphicsContext3D::GraphicsContext3D):
Continue to compile successfully with new ANGLE.

LayoutTests:

* webgl/1.0.2/conformance/glsl/reserved/webgl_preprocessor_reserved-expected.txt: Removed.
* webgl/1.0.2/conformance/glsl/reserved/webgl_preprocessor_reserved.html: Removed.
Removed invalid test based on https://github.com/KhronosGroup/WebGL/pull/1230

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

3 years agoNew SPI to export a dictionary of runtime features
dino@apple.com [Tue, 19 Apr 2016 19:35:34 +0000 (19:35 +0000)]
New SPI to export a dictionary of runtime features
https://bugs.webkit.org/show_bug.cgi?id=156645
<rdar://problem/23621666>

Post commit follow-up. Darin gave review comments that
I didn't address in my original commit - I was waiting
on some advice.

* UIProcess/WebPreferences.cpp:
(WebKit::WebPreferences::isEnabledForFeature): Change the macro
to generate a static list of function pointers, rather than
a lot of conditional statements.
(WebKit::WebPreferences::setEnabledForFeature): Ditto.

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

3 years agoimported/w3c/web-platform-tests/streams/readable-streams/general.https.html is a...
youenn.fablet@crf.canon.fr [Tue, 19 Apr 2016 19:06:47 +0000 (19:06 +0000)]
imported/w3c/web-platform-tests/streams/readable-streams/general.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=155760

Reviewed by Alexey Proskuryakov.

LayoutTests/imported/w3c:

Flakiness was coming from a callback being called after a timeout.
Timeout was set so that a double promise resolution (promise resolved
in another promise resolution callback) is done before calling the callback.
On some slow bots, the timeout was not big enough.

* web-platform-tests/streams/readable-streams/general.js: Increased the callback delay.

LayoutTests:

* TestExpectations: removed flaky expectation.

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

3 years agoMark more classes as WTF_MAKE_FAST_ALLOCATED
cdumez@apple.com [Tue, 19 Apr 2016 18:39:09 +0000 (18:39 +0000)]
Mark more classes as WTF_MAKE_FAST_ALLOCATED
https://bugs.webkit.org/show_bug.cgi?id=156732

Reviewed by Darin Adler.

Source/WebCore:

* css/CSSImageGeneratorValue.h:
* css/DocumentRuleSets.h:
* css/MediaQueryMatcher.h:
* css/RuleFeature.h:
* css/StyleResolver.h:
* dom/ActiveDOMCallbackMicrotask.h:
* dom/DocumentSharedObjectPool.h:
* dom/MutationObserver.cpp:
* dom/MutationObserverInterestGroup.h:
* dom/MutationObserverRegistration.h:
* dom/ScriptExecutionContext.cpp:
* dom/SlotAssignment.h:
* html/HTMLCollection.h:
* html/canvas/CanvasRenderingContext2D.cpp:
* html/parser/HTMLToken.h:
* html/parser/XSSAuditorDelegate.h:
* loader/FrameLoader.cpp:
* loader/SubframeLoader.h:
* page/AutoscrollController.h:
* page/csp/ContentSecurityPolicySource.h:
* platform/cf/RunLoopObserver.h:
* platform/graphics/FloatQuad.h:
* platform/graphics/FloatRoundedRect.h:
* platform/graphics/IntSize.h:
* platform/graphics/cg/GraphicsContextPlatformPrivateCG.h:
* platform/graphics/cg/ImageDecoderCG.h:
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/displaylists/DisplayList.h:
* platform/graphics/mac/ComplexTextController.h:
* platform/graphics/mac/FontCustomPlatformData.h:
* platform/mac/PowerObserverMac.h:
* platform/network/DataURLDecoder.cpp:
* platform/text/PlatformLocale.h:
* rendering/TextAutosizer.h:
* style/StyleUpdate.h:
* xml/XMLHttpRequestUpload.h:

Source/WebKit2:

* NetworkProcess/Downloads/Download.h:
* NetworkProcess/Downloads/PendingDownload.h:
* NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
* Shared/API/Cocoa/RemoteObjectInvocation.h:

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

3 years agoEnable separated heap by default on ios
oliver@apple.com [Tue, 19 Apr 2016 18:34:13 +0000 (18:34 +0000)]
Enable separated heap by default on ios
https://bugs.webkit.org/show_bug.cgi?id=156720

Reviewed by ggaren.

* runtime/Options.cpp:
(JSC::recomputeDependentOptions):

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

3 years agoContext menu items related to fullscreen should be specific to standard fullscreen
adachan@apple.com [Tue, 19 Apr 2016 17:58:57 +0000 (17:58 +0000)]
Context menu items related to fullscreen should be specific to standard fullscreen
https://bugs.webkit.org/show_bug.cgi?id=156723
<rdar://problem/25452632>

Reviewed by Darin Adler.

Introduce HTMLMediaElement::isStandardFullscreen() that the HitTestResult code can use
when handling the validation and selection of fullscreen-related context menu items.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::isStandardFullscreen):
(WebCore::HTMLMediaElement::toggleStandardFullscreenState):
Renamed to make it clear that it's for toggling standard fullscreen. Call the new
HTMLMediaElement::isStandardFullscreen().
* html/HTMLMediaElement.h:
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::mediaIsInFullscreen):
Use HTMLMediaElement::isStandardFullscreen().
(WebCore::HitTestResult::toggleMediaFullscreenState):
Call the renamed HTMLMediaElement::toggleStandardFullscreenState().

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

3 years agoBuild fix.
achristensen@apple.com [Tue, 19 Apr 2016 17:46:48 +0000 (17:46 +0000)]
Build fix.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob):
result is unused.

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

3 years agoRe-landing: ES6: Implement String.prototype.split and RegExp.prototype[@@split].
mark.lam@apple.com [Tue, 19 Apr 2016 17:25:20 +0000 (17:25 +0000)]
Re-landing: ES6: Implement String.prototype.split and RegExp.prototype[@@split].
https://bugs.webkit.org/show_bug.cgi?id=156013

Reviewed by Keith Miller.

Source/JavaScriptCore:

* CMakeLists.txt:
* JavaScriptCore.xcodeproj/project.pbxproj:
* builtins/GlobalObject.js:
(speciesConstructor):
* builtins/PromisePrototype.js:
- refactored to use the @speciesConstructor internal function.

* builtins/RegExpPrototype.js:
(advanceStringIndex):
- refactored from @advanceStringIndexUnicode() to be match the spec.
  Benchmarks show that there's no advantage in doing the unicode check outside
  of the advanceStringIndexUnicode part.  So, I simplified the code to match the
  spec (especially since @@split needs to call advanceStringIndex from more than
  1 location).
(match):
- Removed an unnecessary call to @Object because it was already proven above.
- Changed to use advanceStringIndex instead of advanceStringIndexUnicode.
  Again, there's no perf regression for this.
(regExpExec):
(hasObservableSideEffectsForRegExpSplit):
(split):
(advanceStringIndexUnicode): Deleted.

* builtins/StringPrototype.js:
(split):
- Modified to use RegExp.prototype[@@split].

* bytecode/BytecodeIntrinsicRegistry.cpp:
(JSC::BytecodeIntrinsicRegistry::BytecodeIntrinsicRegistry):
(JSC::BytecodeIntrinsicRegistry::lookup):
* bytecode/BytecodeIntrinsicRegistry.h:
- Added the @@split symbol.

* runtime/CommonIdentifiers.h:
* runtime/ECMAScriptSpecInternalFunctions.cpp: Added.
(JSC::esSpecIsConstructor):
(JSC::esSpecIsRegExp):
* runtime/ECMAScriptSpecInternalFunctions.h: Added.

* runtime/JSGlobalObject.cpp:
(JSC::getGetterById):
(JSC::JSGlobalObject::init):

* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setDescriptor):
- Removed an assert that is no longer valid.

* runtime/RegExpObject.h:
- Made advanceStringUnicode() public so that it can be re-used by the regexp split
  fast path.

* runtime/RegExpPrototype.cpp:
(JSC::RegExpPrototype::finishCreation):
(JSC::regExpProtoFuncExec):
(JSC::regExpProtoFuncSearch):
(JSC::advanceStringIndex):
(JSC::regExpProtoFuncSplitFast):
* runtime/RegExpPrototype.h:

* runtime/StringObject.h:
(JSC::jsStringWithReuse):
(JSC::jsSubstring):
- Hoisted some utility functions from StringPrototype.cpp so that they can be
  reused by the regexp split fast path.

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::stringProtoFuncSplitFast):
(JSC::stringProtoFuncSubstr):
(JSC::builtinStringSubstrInternal):
(JSC::stringProtoFuncSubstring):
(JSC::stringIncludesImpl):
(JSC::stringProtoFuncIncludes):
(JSC::builtinStringIncludesInternal):
(JSC::jsStringWithReuse): Deleted.
(JSC::jsSubstring): Deleted.
(JSC::stringProtoFuncSplit): Deleted.
* runtime/StringPrototype.h:

* tests/es6.yaml:

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/dom/string-prototype-properties-expected.txt:

* js/regress/regexp-prototype-split-observable-side-effects-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects2-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects2.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-flags-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-flags.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-global-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-global.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-ignoreCase-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-ignoreCase.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-multiline-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-multiline.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-sticky-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-sticky.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-unicode-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects3-unicode.html: Added.
* js/regress/regexp-prototype-split-observable-side-effects4-expected.txt: Added.
* js/regress/regexp-prototype-split-observable-side-effects4.html: Added.

* js/regress/script-tests/regexp-prototype-split-observable-side-effects.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects2.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-flags.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-global.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-ignoreCase.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-multiline.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-sticky.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects3-unicode.js: Added.
* js/regress/script-tests/regexp-prototype-split-observable-side-effects4.js: Added.

* js/regress/script-tests/string-prototype-split-observable-side-effects.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects2.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-flags.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-global.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-ignoreCase.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-multiline.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-sticky.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects3-unicode.js: Added.
* js/regress/script-tests/string-prototype-split-observable-side-effects4.js: Added.

* js/regress/string-prototype-split-observable-side-effects-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects.html: Added.
* js/regress/string-prototype-split-observable-side-effects2-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects2.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-flags-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-flags.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-global-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-global.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-ignoreCase-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-ignoreCase.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-multiline-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-multiline.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-sticky-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-sticky.html: Added.
* js/regress/string-prototype-split-observable-side-effects3-unicode-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects3-unicode.html: Added.
* js/regress/string-prototype-split-observable-side-effects4-expected.txt: Added.
* js/regress/string-prototype-split-observable-side-effects4.html: Added.

* js/script-tests/Object-getOwnPropertyNames.js:
* sputnik/Conformance/15_Native_Objects/15.5_String/15.5.4/15.5.4.14_String.prototype.split/S15.5.4.14_A1_T3-expected.txt:

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

3 years agoModern IDB: ObjectStore Blob Support.
beidson@apple.com [Tue, 19 Apr 2016 16:58:17 +0000 (16:58 +0000)]
Modern IDB: ObjectStore Blob Support.
https://bugs.webkit.org/show_bug.cgi?id=143193

Reviewed by Alex Christensen.

Source/WebCore:

Tests: imported/blink/storage/indexeddb/blob-basics-metadata.html
       imported/blink/storage/indexeddb/blob-delete-objectstore-db.html
       imported/blink/storage/indexeddb/blob-valid-after-deletion.html
       imported/blink/storage/indexeddb/blob-valid-before-commit.html
       imported/blink/storage/indexeddb/empty-blob-file.html
       storage/indexeddb/modern/blob-simple.html

Most of the work has been done already.

Besides a handful of tweaks to that work, all this really does is remove the clause
that prevents blob URLs from going into the database.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::putOrAdd): Only disallow blobs if private browsing is enabled
  (Making that work is already covered by another bug)

* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::putOrAddOnServer):

* Modules/indexeddb/IDBValue.cpp:
(WebCore::IDBValue::IDBValue):

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

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

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):

* platform/sql/SQLiteFileSystem.cpp:
(WebCore::SQLiteFileSystem::deleteDatabaseFile): Delete all database-related files
  now that we use WAL mode.

Source/WebKit2:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Don't ASSERT that
  this is the first we've heard of this path - The Connection now remembers all extensions.
(WebKit::NetworkConnectionToWebProcess::getBlobDataFileReferenceForPath): Don't take - Just get.

LayoutTests:

Note: The blob-basics-metadata.html test has some failure lines in it because we don't support the
File constructor.

Once support is added, that test will start failing with the correct results, at which point we
can update expectations.

* imported/blink/storage/indexeddb/blob-basics-metadata-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-basics-metadata.html: Added.
* imported/blink/storage/indexeddb/blob-delete-objectstore-db-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-delete-objectstore-db.html: Added.
* imported/blink/storage/indexeddb/blob-valid-after-deletion-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-valid-after-deletion.html: Added.
* imported/blink/storage/indexeddb/blob-valid-before-commit-expected.txt: Added.
* imported/blink/storage/indexeddb/blob-valid-before-commit.html: Added.
* imported/blink/storage/indexeddb/empty-blob-file-expected.txt: Added.
* imported/blink/storage/indexeddb/empty-blob-file.html: Added.
* imported/blink/storage/indexeddb/resources/empty.txt: Added.
* imported/blink/storage/indexeddb/resources/shared.js: Added.
* imported/blink/storage/indexeddb/resources/test-data.html: Added.
* imported/blink/storage/indexeddb/resources/test-data.txt: Added.

* platform/wk2/TestExpectations:

* storage/indexeddb/modern/blob-simple-expected.txt: Added.
* storage/indexeddb/modern/blob-simple.html: Added.
* storage/indexeddb/modern/resources/blob-simple.js: Added.

* storage/indexeddb/noblobs-expected.txt: Removed.
* storage/indexeddb/noblobs-private-expected.txt: Removed.
* storage/indexeddb/noblobs-private.html: Removed.
* storage/indexeddb/noblobs.html: Removed.
* storage/indexeddb/resources/noblobs.js: Removed.

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

3 years agoUnreviewed, rolling out r199726.
commit-queue@webkit.org [Tue, 19 Apr 2016 16:29:54 +0000 (16:29 +0000)]
Unreviewed, rolling out r199726.
https://bugs.webkit.org/show_bug.cgi?id=156748

WebKit tests crash on Windows 32 (Requested by msaboff on
#webkit).

Reverted changeset:

"iTunes crashing JavaScriptCore.dll"
https://bugs.webkit.org/show_bug.cgi?id=156647
http://trac.webkit.org/changeset/199726

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

3 years ago[css-grid] Use the margin box for non-auto minimum sizes
svillar@igalia.com [Tue, 19 Apr 2016 15:48:00 +0000 (15:48 +0000)]
[css-grid] Use the margin box for non-auto minimum sizes
https://bugs.webkit.org/show_bug.cgi?id=156711

Reviewed by Darin Adler.

Source/WebCore:

When computing the min-size of items with non-auto minimum height/width we are incorrectly
returning the size of the border box, and thus incorrectly ignoring the margins of the item.

This is a follow up patch of r199153 were we added the missing border and paddings for
heights. Contrary to that, we were not including margins for both axis.

This CL requires 3 different interrelated changes:
- Add the margins to the min-size returned by minSizeForChild (might require a layout).
- Refactor and extract width computations from logicalHeightForChild(); not totally
mandatory but pretty logical and helpful.
- Use a new update function to isolate the computation of the override width.

Test: fast/css-grid-layout/min-width-margin-box.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeInlineDirectionMargins): Added const to a parameter.
* rendering/RenderBox.h:
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeTrackSizesForDirection): Initialize the sizingOperation.
(WebCore::RenderGrid::computeIntrinsicLogicalWidths): Ditto.
(WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
(WebCore::RenderGrid::logicalHeightForChild): Renamed from logicalContentHeightForChild as
it no longer returns the content size but the outer size.
(WebCore::RenderGrid::minSizeForChild):
(WebCore::RenderGrid::updateOverrideContainingBlockContentLogicalWidthForChild): Extracted
from logicalHeightForChild().
(WebCore::RenderGrid::minContentForChild): Update override width if needed.
(WebCore::RenderGrid::maxContentForChild): Ditto.
(WebCore::RenderGrid::computeMarginLogicalSizeForChild): Generalized from
computeMarginLogicalHeightForChild(), it can now compute also margins for the inline
direction.
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
(WebCore::RenderGrid::logicalContentHeightForChild): Deleted.
(WebCore::RenderGrid::computeMarginLogicalHeightForChild): Deleted.
* rendering/RenderGrid.h:

LayoutTests:

* fast/css-grid-layout/min-height-border-box.html:
* fast/css-grid-layout/min-width-margin-box-expected.txt: Added.
* fast/css-grid-layout/min-width-margin-box.html: Added.

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

3 years ago[Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
carlosgc@webkit.org [Tue, 19 Apr 2016 15:10:36 +0000 (15:10 +0000)]
[Cairo] GraphicsContext::drawFocusRing methods are not consistent to each other
https://bugs.webkit.org/show_bug.cgi?id=156742

Reviewed by Martin Robinson.

We are rendering the focus ring differently depending on whether a path is used or a vector of rectangles. This
is causing that some reftests fail because they assume we always render the focus ring the same way. For example
fast/images/image-map-outline-in-positioned-container.html, when rendering the test
GraphicsContext::drawFocusRing is called with a path, and when rendering the reference it's called with a vector
of rectangles, producing different results.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawFocusRing): When receiving a vector of rectangles, build a Path from the given
rectangles and call drawFocusRing() with the built path to ensure consistency.

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

3 years agoiTunes crashing JavaScriptCore.dll
msaboff@apple.com [Tue, 19 Apr 2016 14:11:19 +0000 (14:11 +0000)]
iTunes crashing JavaScriptCore.dll
https://bugs.webkit.org/show_bug.cgi?id=156647

Reviewed by Saam Barati.

Source/JavaScriptCore:

Given that there there are only 128 FLS indices compared to over a 1000 for TLS, I
eliminated the thread specific m_threadSpecificForThread and instead we look for the
current thread in m_registeredThreads list when we need it.  In most cases there
will only be one thread.

* heap/MachineStackMarker.cpp:
(JSC::MachineThreads::MachineThreads):
(JSC::MachineThreads::~MachineThreads):
(JSC::MachineThreads::addCurrentThread):
(JSC::MachineThreads::machineThreadForCurrentThread):
(JSC::MachineThreads::removeThread):
* heap/MachineStackMarker.h:

Source/WTF:

If a thread was created without using the WTF thread apis and that thread uses
a JavaScript VM and that thread exits with the VM still around, JSC won't know
that the thread has exited.  Currently, we use ThreadSpecificThreadExit() to
clean up any thread specific keys.  Cleaning up these keys is how JSC is
notified of a thread exit.  We only call ThreadSpecificThreadExit() from
wtfThreadEntryPoint() when the thread entry point function returns.
This mechanism was put in place for Windows because we layer the WTF::ThreadSpecific
functionality on top of TLS (Thread Local Storage), but TLS doesn't have
a thread exiting callback the way that pthread_create_key.

The fix is to change from using TLS to using FLS (Fiber Local Storage).  Although
Windows allows multiple fibers per thread, WebKit is not designed to work with a
multiple fibers per thread.  When there is only one fiber per thread, FLS works just
like TLS, but it has the destroy callback.

I restructured the Windows version of WTF::ThreadSpecific to be almost the same
as the pthread version.

* wtf/ThreadSpecific.h:
(WTF::threadSpecificKeyCreate):
(WTF::threadSpecificKeyDelete):
(WTF::threadSpecificSet):
(WTF::threadSpecificGet):
(WTF::ThreadSpecific<T>::ThreadSpecific):
(WTF::ThreadSpecific<T>::~ThreadSpecific):
(WTF::ThreadSpecific<T>::get):
(WTF::ThreadSpecific<T>::set):
(WTF::ThreadSpecific<T>::destroy):
Restructured to use FLS.  Renamed TLS* to FLS*.

* wtf/ThreadSpecificWin.cpp:
(WTF::flsKeyCount):
(WTF::flsKeys):
Renamed from tlsKey*() to flsKey*().

(WTF::destructorsList): Deleted.
(WTF::destructorsMutex): Deleted.
(WTF::PlatformThreadSpecificKey::PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::~PlatformThreadSpecificKey): Deleted.
(WTF::PlatformThreadSpecificKey::setValue): Deleted.
(WTF::PlatformThreadSpecificKey::value): Deleted.
(WTF::PlatformThreadSpecificKey::callDestructor): Deleted.
(WTF::tlsKeyCount): Deleted.
(WTF::tlsKeys): Deleted.
(WTF::threadSpecificKeyCreate): Deleted.
(WTF::threadSpecificKeyDelete): Deleted.
(WTF::threadSpecificSet): Deleted.
(WTF::threadSpecificGet): Deleted.
(WTF::ThreadSpecificThreadExit): Deleted.

* wtf/ThreadingWin.cpp:
(WTF::wtfThreadEntryPoint): Eliminated call to ThreadSpecificThreadExit.

LayoutTests:

Disabled fast/workers/dedicated-worker-lifecycle.html as it creates
more workers that we have ThreadSpecific keys.  We need at least one
key per JSC VM we create.  I didn't want to weaken the test for other
platforms.

* platform/win/TestExpectations:

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

3 years ago[INTL] Use @thisNumberValue instead of `instanceof @Number`
utatane.tea@gmail.com [Tue, 19 Apr 2016 13:34:02 +0000 (13:34 +0000)]
[INTL] Use @thisNumberValue instead of `instanceof @Number`
https://bugs.webkit.org/show_bug.cgi?id=156680

Reviewed by Saam Barati.

Source/JavaScriptCore:

Use @thisNumberValue instead of `instanceof @Number`.
`instanceof @Number` is not enough;
For example, given 2 realms, the object created in one realm does not
inherit the Number of another realm.
Another example is that the object which does not inherit Number.

```
var number = new Number(42);
number.__proto__ = null;
```

* builtins/NumberPrototype.js:
(toLocaleString):
* runtime/CommonIdentifiers.h:
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncValueOf):
* runtime/NumberPrototype.h:
* tests/stress/number-to-locale-string-should-accept-strange-number-objects.js: Added.
(shouldBe):

LayoutTests:

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

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

3 years agoUnreviewed, rolling out r199712.
gskachkov@gmail.com [Tue, 19 Apr 2016 13:29:54 +0000 (13:29 +0000)]
Unreviewed, rolling out r199712.
https://bugs.webkit.org/show_bug.cgi?id=156741

It caused a serious regression on 32 bit platform (Requested
by gskachkov on #webkit).

Reverted changeset:

"calling super() a second time in a constructor should throw"
https://bugs.webkit.org/show_bug.cgi?id=151113
http://trac.webkit.org/changeset/199712

Patch by Commit Queue <commit-queue@webkit.org> on 2016-04-19

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

3 years agoTry to fix iOS build.
antti@apple.com [Tue, 19 Apr 2016 13:29:25 +0000 (13:29 +0000)]
Try to fix iOS build.

* UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:

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

3 years agoMove FontSelectorClient to a file of its own
antti@apple.com [Tue, 19 Apr 2016 13:03:32 +0000 (13:03 +0000)]
Move FontSelectorClient to a file of its own
https://bugs.webkit.org/show_bug.cgi?id=156738

Reviewed by Carlos Garcia Campos.

So modifying FontSelector does not trigger world rebuild via Document.h.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSFontSelector.cpp:
* dom/Document.h:
* html/canvas/CanvasRenderingContext2D.h:
* platform/graphics/FontSelector.h:
(WebCore::FontSelectorClient::~FontSelectorClient): Deleted.
* platform/graphics/FontSelectorClient.h: Added.
(WebCore::FontSelectorClient::~FontSelectorClient):

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

3 years agoREGRESSION (r199635) Web Inspector: Percentages in Heap Allocations view are too...
commit-queue@webkit.org [Tue, 19 Apr 2016 12:34:33 +0000 (12:34 +0000)]
REGRESSION (r199635) Web Inspector: Percentages in Heap Allocations view are too large
https://bugs.webkit.org/show_bug.cgi?id=156729
<rdar://problem/25796002>

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

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WebInspector.HeapSnapshotInstanceDataGridNode.prototype.createCellContent):
Fix callsite that failed to be updated once percentageString
required 0..1 input instead of 0..100.

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

3 years agoUnreviewed GTK+ gardening. Update CSP tests.
carlosgc@webkit.org [Tue, 19 Apr 2016 12:22:58 +0000 (12:22 +0000)]
Unreviewed GTK+ gardening. Update CSP tests.

Rebaseline http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics.html after r197118 and
remove specific expectations of http/tests/security/contentSecurityPolicy/source-list-parsing-10.html.

* platform/gtk/http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-basics-expected.txt:
* platform/gtk/http/tests/security/contentSecurityPolicy/source-list-parsing-10-expected.txt: Removed.

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

3 years agoUnreviewed GTK+ gardening. Rebaseline fast/events/updateLayoutForHitTest.html after...
carlosgc@webkit.org [Tue, 19 Apr 2016 11:35:09 +0000 (11:35 +0000)]
Unreviewed GTK+ gardening. Rebaseline fast/events/updateLayoutForHitTest.html after r195263.

* platform/gtk/fast/events/updateLayoutForHitTest-expected.txt:

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

3 years agoUnreviewed GTK+ gardening. Rebaseline fast/transforms/bounding-rect-zoom.html after...
carlosgc@webkit.org [Tue, 19 Apr 2016 11:10:12 +0000 (11:10 +0000)]
Unreviewed GTK+ gardening. Rebaseline fast/transforms/bounding-rect-zoom.html after r197450.

* platform/gtk/fast/transforms/bounding-rect-zoom-expected.txt:

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

3 years agoUnreviewed GTK+ gardening. Rebaseline tests after r199659.
carlosgc@webkit.org [Tue, 19 Apr 2016 10:59:28 +0000 (10:59 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r199659.

We are now using the theme colors for the menu lists text.

* platform/gtk/fast/forms/basic-selects-expected.txt:
* platform/gtk/fast/forms/disabled-select-change-index-expected.txt:
* platform/gtk/fast/forms/menulist-style-color-expected.txt:
* platform/gtk/fast/forms/select-baseline-expected.txt:
* platform/gtk/fast/forms/select-disabled-appearance-expected.txt:

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

3 years agoUnreviewed GTK+ gardening. Rebaseline tests after r199034.
carlosgc@webkit.org [Tue, 19 Apr 2016 10:32:13 +0000 (10:32 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r199034.

* platform/gtk/fast/block/float/016-expected.txt:
* platform/gtk/fast/css/bidi-override-in-anonymous-block-expected.txt:
* platform/gtk/media/video-zoom-controls-expected.txt:
* platform/gtk/svg/zoom/page/zoom-replaced-intrinsic-ratio-001-expected.txt:
* platform/gtk/tables/mozilla_expected_failures/bugs/bug1055-2-expected.txt:

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

3 years ago[GTK] accessibility/gtk/entry-and-password.html is failing since r194847
jdiggs@igalia.com [Tue, 19 Apr 2016 09:50:26 +0000 (09:50 +0000)]
[GTK] accessibility/gtk/entry-and-password.html is failing since r194847
https://bugs.webkit.org/show_bug.cgi?id=153062

Reviewed by Carlos Garcia Campos.

Source/WebCore:

The changes in r194847 include using WebCore's rendering for the CapsLock indicator.
As a side effect, password inputs gained a TextControlInnerTextElement child from
the Shadow DOM. If we include that child in the accessibility tree, the child will
emit focus and text notifications that suggest the user is no longer in the control.
This can be especially problematic for screen reader users with key echo enabled
when typing in a password input. To fix this, prune TextControlInnerTextElement
children from the accessibility tree for ATK.

No new tests as existing coverage caught this regression. Also modified the
auto-fill-crash.html test whose expectations include the children count for
a text input.

* accessibility/atk/AccessibilityObjectAtk.cpp:
(WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):

LayoutTests:

The auto-fill-crash.html test has expectations which include the children
count for the text input. These expectations were incorrect for ATK where
accessible text inputs lack accessible text children.

* accessibility/auto-fill-crash.html: Modified to take platform into account.
* platform/gtk/TestExpectations: Unskipped entry-and-password.html.
* platform/gtk/accessibility/auto-fill-crash-expected.txt: Added.

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

3 years agoUnreviewed GTK+ gardening. Rebaseline tests after r190840.
carlosgc@webkit.org [Tue, 19 Apr 2016 09:22:53 +0000 (09:22 +0000)]
Unreviewed GTK+ gardening. Rebaseline tests after r190840.

* platform/gtk/fast/html/details-remove-summary-1-and-click-expected.txt:
* platform/gtk/fast/html/details-remove-summary-4-and-click-expected.txt:

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

3 years ago[GTK] Use Generic WorkQueue instead of WorkQueueGLib
utatane.tea@gmail.com [Tue, 19 Apr 2016 09:16:40 +0000 (09:16 +0000)]
[GTK] Use Generic WorkQueue instead of WorkQueueGLib
https://bugs.webkit.org/show_bug.cgi?id=156721

Reviewed by Benjamin Poulain.

WorkQueueGLib includes platform-dependent part only for WorkQueue::dispatchAfter.
However, its code is related to RunLoopGLib rather than WorkQueueGLib.
In this patch, we move the code from WorkQueueGLib to RunLoopGLib, drop WorkQueueGLib
and use WorkQueueGeneric.

* wtf/PlatformGTK.cmake:
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/glib/RunLoopGLib.cpp:
(WTF::DispatchAfterContext::DispatchAfterContext):
(WTF::DispatchAfterContext::dispatch):
(WTF::RunLoop::dispatchAfter):
* wtf/glib/WorkQueueGLib.cpp: Removed.
(WTF::WorkQueue::platformInitialize): Deleted.
(WTF::WorkQueue::platformInvalidate): Deleted.
(WTF::WorkQueue::dispatch): Deleted.
(WTF::DispatchAfterContext::DispatchAfterContext): Deleted.
(WTF::DispatchAfterContext::~DispatchAfterContext): Deleted.
(WTF::DispatchAfterContext::dispatch): Deleted.
(WTF::WorkQueue::dispatchAfter): Deleted.

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

3 years agocalling super() a second time in a constructor should throw
gskachkov@gmail.com [Tue, 19 Apr 2016 08:47:44 +0000 (08:47 +0000)]
calling super() a second time in a constructor should throw
https://bugs.webkit.org/show_bug.cgi?id=151113

Reviewed by Saam Barati and Keith Miller.

Source/JavaScriptCore:

Currently, our implementation checks if 'super()' was called in a constructor more
than once and raises a RuntimeError before the second call. According to the spec
we need to raise an error just after the second super() is finished and before
the new 'this' is assigned https://esdiscuss.org/topic/duplicate-super-call-behaviour.
To implement this behavior this patch adds a new op code, op_is_empty, that is used
to check if 'this' is empty.

* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::dumpBytecode):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitIsEmpty):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::FunctionCallValueNode::emitBytecode):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileIsEmpty):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_is_empty):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_is_empty):
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* tests/stress/class-syntax-double-constructor.js: Added.

LayoutTests:

* js/class-syntax-super-expected.txt:
* js/script-tests/class-syntax-super.js:

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

3 years agoUnreviewed, rolling out r199658.
commit-queue@webkit.org [Tue, 19 Apr 2016 07:21:46 +0000 (07:21 +0000)]
Unreviewed, rolling out r199658.
https://bugs.webkit.org/show_bug.cgi?id=156736

It broke all EFL layout tests (Requested by KaL on #webkit).

Reverted changeset:

"[UNIX] Initialize WebKit before the platform initializations"
https://bugs.webkit.org/show_bug.cgi?id=156622
http://trac.webkit.org/changeset/199658

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

3 years ago[JSC] Fix some overhead affecting small codegen
commit-queue@webkit.org [Tue, 19 Apr 2016 06:54:25 +0000 (06:54 +0000)]
[JSC] Fix some overhead affecting small codegen
https://bugs.webkit.org/show_bug.cgi?id=156728

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

* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::AbstractMacroAssembler):
(JSC::AbstractMacroAssembler::random):
cryptographicallyRandomNumber() is very costly.
We only need it in lowering some very particular cases
of non-trusted immediates. No inline cache needs that.

* assembler/LinkBuffer.h:
(JSC::LinkBuffer::link):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::addSlowCase):
Do not copy the JumpList to access its elements.

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

3 years agoBuild fix after r199700
achristensen@apple.com [Tue, 19 Apr 2016 06:33:05 +0000 (06:33 +0000)]
Build fix after r199700

* PlatformMac.cmake:

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

3 years agoModern IDB (Blob support): When reading Blobs from the database, grant the Networking...
beidson@apple.com [Tue, 19 Apr 2016 06:02:04 +0000 (06:02 +0000)]
Modern IDB (Blob support): When reading Blobs from the database, grant the Networking process sandbox access to the files.
https://bugs.webkit.org/show_bug.cgi?id=156640

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (No change in behavior, as blobs in IDB are not yet enabled,
              but when they are enabled testing will cover this).

* Modules/indexeddb/shared/IDBResultData.h: Export some stuff

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked): Account for
  BlobRegistry change described below.

* platform/network/BlobRegistry.h: Change registerBlobURLOptionallyFileBacked to take a
  BlobDataFileReference instead of a raw path, to allow WK2 to include a sandbox extension.

* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL): Account for BlobRegistry change described above.
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked): Use the passed in
  BlobDataFileHandle, and also register the BlobResourceHandle constructor.
* platform/network/BlobRegistryImpl.h:

Source/WebKit2:

* DatabaseProcess/DatabaseProcess.cpp:
(WebKit::DatabaseProcess::getSandboxExtensionsForBlobFiles): Utility function to ask the UI process for
  SandboxExtensions for a list of files.
(WebKit::DatabaseProcess::didGetSandboxExtensionsForBlobFiles): Take the SandboxExtensions from the UI process
  and pass them along to the completion handler.
* DatabaseProcess/DatabaseProcess.h:
* DatabaseProcess/DatabaseProcess.messages.in:

* DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
(WebKit::WebIDBConnectionToClient::didGetRecord): If the value returned from the database doesn't have Blob files,
  pass the result directly on to WebCore. If it does, ask the UI process for SandboxExtensions first.

* NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
(WebKit::NetworkBlobRegistry::registerBlobURLOptionallyFileBacked): Grab the BlobDataFileReference from the
  NetworkConnectionToWebProcess to pass along to the BlobRegistry.

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::preregisterSandboxExtensionsForOptionallyFileBackedBlob): Add this message
  so the WebProcess can preflight the creation of some blob URLs by passing along the SandboxExtensions for their files.
(WebKit::NetworkConnectionToWebProcess::takeBlobDataFileReferenceForPath):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:

* UIProcess/Databases/DatabaseProcessProxy.cpp:
(WebKit::DatabaseProcessProxy::getSandboxExtensionsForBlobFiles): Create SandboxExtensions for the passed in files and
  return them to the DatabaseProcess.
* UIProcess/Databases/DatabaseProcessProxy.h:
* UIProcess/Databases/DatabaseProcessProxy.messages.in:

* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
(WebKit::WebIDBConnectionToServer::didGetRecordWithSandboxExtensions): New form of "didGetRecord" that handles passing
  the SandboxExtensions to the Networking process before they are needed.
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
* WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:

* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURLOptionallyFileBacked):
* WebProcess/FileAPI/BlobRegistryProxy.h:

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

3 years agoFix iOS build after r199701
achristensen@apple.com [Tue, 19 Apr 2016 05:08:53 +0000 (05:08 +0000)]
Fix iOS build after r199701

* platform/ios/WebAVPlayerController.mm:

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

3 years agoUpdated binding test result to reflect the change to not use Deprecated::ScriptValue.
darin@apple.com [Tue, 19 Apr 2016 05:05:42 +0000 (05:05 +0000)]
Updated binding test result to reflect the change to not use Deprecated::ScriptValue.

* bindings/scripts/test/JS/JSTestObj.cpp: Regenerated with new script.

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

3 years agoFixed building with old Xcode.
mitz@apple.com [Tue, 19 Apr 2016 04:05:30 +0000 (04:05 +0000)]
Fixed building with old Xcode.

* TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:
(TEST):

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

3 years agoRemove all use of Deprecated::ScriptValue in generated bindings
darin@apple.com [Tue, 19 Apr 2016 02:58:44 +0000 (02:58 +0000)]
Remove all use of Deprecated::ScriptValue in generated bindings
https://bugs.webkit.org/show_bug.cgi?id=156706

Reviewed by Brady Eidson.

* Modules/indexeddb/IDBCursor.idl: Removed unneeded [ImplementationReturnType=JSValue].
* Modules/indexeddb/IDBCursorWithValue.idl: Ditto.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::lowerValue): Deleted.
(WebCore::IDBKeyRange::upperValue): Deleted.
(WebCore::IDBKeyRange::only): Changed to take ExecState since the old code just used
the ScriptExecutionContext to get back to the (potentially wrong) ExecState. Also kept
one overload that takes ScriptExecutionContext because I could not change all callers.
(WebCore::IDBKeyRange::lowerBound): Ditto.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.

* Modules/indexeddb/IDBKeyRange.h: Updated for above.

* Modules/indexeddb/IDBKeyRange.idl: Use [ImplementationReturnType=IDBKey].
Use ScriptState instead of ScriptExecutionContext.

* Modules/streams/ReadableStreamSource.h: Take JSValue instead of Deprecated::ScriptValue
for the ignored argument to the cancel function.

* bindings/js/IDBBindingUtilities.cpp:
(WebCore::toJS): Renamed idbKeyToJSValue to this, the traditional name used in the
bindings generator for all these functions. Also changed to take references.
(WebCore::injectIDBKeyIntoScriptValue): Updated to call with the new name and types.
(WebCore::idbKeyDataToScriptValue): Ditto.

* bindings/js/IDBBindingUtilities.h: Added declaration of toJS for IDBKey.

* bindings/scripts/CodeGeneratorJS.pm: Use JSC::JSValue instead of Deprecated::ScriptValue
for the "any" type.
(JSValueToNative): Just return the value with no transformation when type is "any".
(NativeToJSValue): Changed default behavior for "any" to just pass the value as is with
no transfomration. Removed unused ImplementationReturnType case for inside Document.
Removed JSValue case since it's the default now. Added IDBKey case that matches the
IDBKeyPath case (still wondering if we can do those without an attribute). Removed bogus
second check for type "any".

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

3 years ago[GTK] Possible off-by-one in hyphenation code
commit-queue@webkit.org [Tue, 19 Apr 2016 02:33:24 +0000 (02:33 +0000)]
[GTK] Possible off-by-one in hyphenation code
https://bugs.webkit.org/show_bug.cgi?id=156661

Patch by Martin Robinson <mrobinson@igalia.com> on 2016-04-18
Reviewed by Michael Catanzaro.

Source/WebCore:

No new tests. This is covered by older tests.

* platform/text/hyphen/HyphenationLibHyphen.cpp:
(WebCore::lastHyphenLocation): Fix an off by one error in hyphen location.

LayoutTests:

* platform/gtk/TestExpectations: Unskip a test that is now passing.
* platform/gtk/fast/text/hyphenate-character-expected.png:
* platform/gtk/fast/text/hyphenate-character-expected.txt:
* platform/gtk/fast/text/hyphenate-first-word-expected.png:
* platform/gtk/fast/text/hyphenate-first-word-expected.txt:
* platform/gtk/fast/text/hyphenate-limit-before-after-expected.png:
* platform/gtk/fast/text/hyphenate-limit-before-after-expected.txt:
* platform/gtk/fast/text/hyphenate-limit-lines-expected.png:
* platform/gtk/fast/text/hyphenate-limit-lines-expected.txt:
* platform/gtk/fast/text/hyphenate-locale-expected.png:
* platform/gtk/fast/text/hyphenate-locale-expected.txt:

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

3 years agoNew SPI to export a dictionary of runtime features
dino@apple.com [Tue, 19 Apr 2016 02:18:45 +0000 (02:18 +0000)]
New SPI to export a dictionary of runtime features
https://bugs.webkit.org/show_bug.cgi?id=156645
<rdar://problem/23621666>

Trying to fix GTK and EFL builds. I forgot to add files
to CMake.

* CMakeLists.txt:
* PlatformMac.cmake:

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

3 years ago[OSX] AVKit is not available on all systems
eric.carlson@apple.com [Tue, 19 Apr 2016 01:52:24 +0000 (01:52 +0000)]
[OSX] AVKit is not available on all systems
https://bugs.webkit.org/show_bug.cgi?id=156724
<rdar://problem/25501587>

Reviewed by Dean Jackson.

* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: Add _OPTIONAL to all
  AVKit softlink macros.
* platform/ios/WebAVPlayerController.mm: Ditto.
* platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Ditto.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm: Ditto.
* platform/mac/WebPlaybackSessionInterfaceMac.mm: Ditto.
* platform/mac/WebVideoFullscreenInterfaceMac.mm: Ditto.

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

3 years agoNew SPI to export a dictionary of runtime features
dino@apple.com [Tue, 19 Apr 2016 01:46:48 +0000 (01:46 +0000)]
New SPI to export a dictionary of runtime features
https://bugs.webkit.org/show_bug.cgi?id=156645
<rdar://problem/23621666>

Reviewed by Darin Adler.

Source/WebKit2:

Add a new type of Preference for experimental features so that we
can dynamically toggle them from a WebKit2 host. These are special
keys that are tied to runtime flags. The host process can ask WebKit
for the list of keys, each with a small description, in order to
display UI.

- Add HumanReadableName and HumanReadableDescription parameters to our
  macros, which are used when building a ExperimentalFeature.
  These are both empty strings for the existing preferences. At some
  point we should probably move all this to code generation rather
  than macros, so that we don't have to carry around unused parameters.

- I've included two sample experimental features: WebGL2 and ShadowDOM.
  They are not actually hooked up to the runtime settings yet, but its
  pretty clear how that will happen. Note that these are new preferences
  that have an "Experimental" prefix. This is so toggling an experimental
  feature to off won't cause the feature to not work once it becomes
  stable enough to enable by default. In other words, when it moves
  out of the experimental stage, the experimental feature flag will be
  removed, and you'll no longer check for values with that key.

- The ExperimentalFeature object is what the host process
  will read in order to show some UI. It contains the human readable info,
  as well as the actual key that can be used to query and toggle the
  experimental feature.

* Shared/API/APIObject.h: Add the ExperimentalFeature.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject): Exposes a wrapper around a _WKExperimentalFeature ObjC type.

* Shared/WebPreferencesDefinitions.h: Change all the existing macros to take the new
parameters, and add the initial experimental keys.

* Shared/WebPreferencesKeys.cpp: Add new parameters to existing macros.
* Shared/WebPreferencesKeys.h: Ditto.
* Shared/WebPreferencesStore.cpp: Ditto.
(WebKit::defaults):

* UIProcess/API/APIExperimentalFeature.cpp: The API side of the ExperimentalFeature.
(API::ExperimentalFeature::create):
(API::ExperimentalFeature::ExperimentalFeature):
(API::ExperimentalFeature::~ExperimentalFeature):
* UIProcess/API/APIExperimentalFeature.h:

* UIProcess/API/Cocoa/WKPreferences.mm: The actual implementation of the SPI.
(+[WKPreferences _experimentalFeatures]): Create and return a list of feature descriptors.
(-[WKPreferences _isEnabledForFeature:]): Get the value.
(-[WKPreferences _setEnabled:forFeature:]): Set the value.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

* UIProcess/API/Cocoa/_WKExperimentalFeature.h: The ObjC version.
* UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
(-[_WKExperimentalFeature dealloc]):
(-[_WKExperimentalFeature description]):
(-[_WKExperimentalFeature name]):
(-[_WKExperimentalFeature key]):
(-[_WKExperimentalFeature details]):
(-[_WKExperimentalFeature _apiObject]):
* UIProcess/API/Cocoa/_WKExperimentalFeatureInternal.h: Implementation of the wrapper.
(WebKit::wrapper):

* UIProcess/WebPreferences.cpp: The C++ implementation that provides the data for the ObjC API.
(WebKit::globalExperimentalFeatures):
(WebKit::WebPreferences::ExperimentalFeatures):
(WebKit::WebPreferences::isEnabledForFeature):
(WebKit::WebPreferences::setEnabledForFeature):
* UIProcess/WebPreferences.h:

* UIProcess/mac/WebPreferencesMac.mm: Update some macros.
(WebKit::WebPreferences::platformInitializeStore):
* WebProcess/WebPage/WebPage.cpp: Ditto
(WebKit::WebPage::updatePreferences):

* WebKit2.xcodeproj/project.pbxproj: Add the new files.

Tools:

Test the experimental features SPI on WKPreferences.

* TestWebKitAPI/Tests/WebKit2Cocoa/Preferences.mm:

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

3 years agoimplement dynamic scope accesses in the DFG/FTL
sbarati@apple.com [Tue, 19 Apr 2016 01:38:30 +0000 (01:38 +0000)]
implement dynamic scope accesses in the DFG/FTL
https://bugs.webkit.org/show_bug.cgi?id=156567

Reviewed by Geoffrey Garen.

This patch adds dynamic scope operations to the DFG/FTL.
This patch adds three new DFG nodes: ResolveScope, PutDynamicVar and GetDynamicVar.
When we encounter a Dynamic/UnresolvedProperty/UnresolvedPropertyWithVarInjectionChecks
resolve type, we will compile dynamic scope resolution nodes. When we encounter
a resolve type that needs var injection checks and the var injection
watchpoint has already been fired, we will compile dynamic scope resolution
nodes.

This patch also adds a new value to the InitializationMode enum: ConstInitialization.
There was a subtle bug where we used to never compile the var injection variant of the
resolve type for an eval that injected a var where there was also a global lexical variable with the same name.
For example, the store compiled in this eval("var foo = 20;") wouldn't be compiled
with var injection checks if there was global let/const variable named "foo".
So there was the potential for the injected var to store to the GlobalLexicalObject.
I found this bug because my initial implementation in the DFG/FTL ran into it.
The reason this bug existed is because when we compile a const initialization,
we never need a var injections check. The const initialization always
knows where to store its value. This same logic leaked into the above eval's
"var foo = 20" store. This new enum value allows us to distinguish const
initialization stores from non-const initialization stores.

(I also changed InitializationMode to be an enum class instead of an enum).

* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::finishCreation):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::generate):
(JSC::BytecodeGenerator::BytecodeGenerator):
(JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
(JSC::BytecodeGenerator::initializeBlockScopedFunctions):
(JSC::BytecodeGenerator::hoistSloppyModeFunctionIfNecessary):
(JSC::BytecodeGenerator::prepareLexicalScopeForNextForLoopIteration):
(JSC::BytecodeGenerator::emitGetFromScope):
(JSC::BytecodeGenerator::initializeVariable):
(JSC::BytecodeGenerator::emitInstanceOf):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::pushScopedControlFlowContext):
(JSC::BytecodeGenerator::emitPutNewTargetToArrowFunctionContextScope):
(JSC::BytecodeGenerator::emitPutDerivedConstructorToArrowFunctionContextScope):
(JSC::BytecodeGenerator::emitPutThisToArrowFunctionContextScope):
* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitResolve):
(JSC::PrefixNode::emitResolve):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::initializationModeForAssignmentContext):
(JSC::AssignResolveNode::emitBytecode):
(JSC::EmptyLetExpression::emitBytecode):
(JSC::ForInNode::emitLoopHeader):
(JSC::ForOfNode::emitBytecode):
(JSC::ClassExprNode::emitBytecode):
(JSC::BindingNode::bindValue):
(JSC::AssignmentElementNode::bindValue):
(JSC::RestParameterNode::emit):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::noticeArgumentsUse):
(JSC::DFG::ByteCodeParser::promoteToConstant):
(JSC::DFG::ByteCodeParser::needsDynamicLookup):
(JSC::DFG::ByteCodeParser::planLoad):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasIdentifier):
(JSC::DFG::Node::identifierNumber):
(JSC::DFG::Node::hasGetPutInfo):
(JSC::DFG::Node::getPutInfo):
(JSC::DFG::Node::hasAccessorAttributes):
* dfg/DFGNodeType.h:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePutGetterSetterById):
(JSC::DFG::SpeculativeJIT::compileResolveScope):
(JSC::DFG::SpeculativeJIT::compileGetDynamicVar):
(JSC::DFG::SpeculativeJIT::compilePutDynamicVar):
(JSC::DFG::SpeculativeJIT::compilePutAccessorByVal):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compare):
(JSC::FTL::DFG::LowerDFGToB3::compileResolveScope):
(JSC::FTL::DFG::LowerDFGToB3::compileGetDynamicVar):
(JSC::FTL::DFG::LowerDFGToB3::compilePutDynamicVar):
(JSC::FTL::DFG::LowerDFGToB3::compareEqObjectOrOtherToObject):
* jit/CCallHelpers.h:
(JSC::CCallHelpers::setupArgumentsWithExecState):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emitSlow_op_put_to_scope):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_to_scope):
(JSC::JIT::emitSlow_op_put_to_scope):
* llint/LLIntData.cpp:
(JSC::LLInt::Data::performAssertions):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/GetPutInfo.h:
(JSC::resolveModeName):
(JSC::initializationModeName):
(JSC::isInitialization):
(JSC::makeType):
(JSC::GetPutInfo::GetPutInfo):
* runtime/JSScope.cpp:
(JSC::abstractAccess):

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

3 years agoUnreviewed test fix after r199696.
bfulgham@apple.com [Tue, 19 Apr 2016 00:25:12 +0000 (00:25 +0000)]
Unreviewed test fix after r199696.

* inspector/console/x-frame-options-message-expected.txt: Rebaseline.):

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

3 years agoWebKit should adopt journal_mode=wal for all SQLite databases.
barraclough@apple.com [Tue, 19 Apr 2016 00:21:20 +0000 (00:21 +0000)]
WebKit should adopt journal_mode=wal for all SQLite databases.
https://bugs.webkit.org/show_bug.cgi?id=133496

Reviewed by Brady Eidson.

Enabling sqlite3 WAL mode on iOS causes a test failure, but appears just be something that should fail still failing, only in a different way.
Enabling & marking test as failing for now. Tracking test failure here:
    https://bugs.webkit.org/show_bug.cgi?id=156718

Source/WebCore:

* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::open):
    - enable on iOS.

LayoutTests:

* platform/ios-simulator/TestExpectations:
    - storage/websql/alter-to-info-table.html [ Failure ]

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

3 years agoSource/WebCore:
bfulgham@apple.com [Mon, 18 Apr 2016 23:07:54 +0000 (23:07 +0000)]
Source/WebCore:
Remove support for X-Frame-Options in `<meta>`
https://bugs.webkit.org/show_bug.cgi?id=156625
<rdar://problem/25748714>

Rubberstamped by Darin Adler.

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv): Revise messaging based on Darin's comments.

LayoutTests:
Crash in ElementDescendantIterator::operator--() when calling m_ancestorSiblingStack.last()
https://bugs.webkit.org/show_bug.cgi?id=156715
<rdar://problem/25750864>

Patch by Chris Dumez <cdumez@apple.com> on 2016-04-18
Reviewed by Antti Koivisto.

Add regression test that reproduced the crash.

* fast/dom/collection-backward-traversal-crash-expected.txt: Added.
* fast/dom/collection-backward-traversal-crash.html: Added.

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

3 years agoSwipe view gesture should be reversed in right-to-left contexts
timothy_horton@apple.com [Mon, 18 Apr 2016 23:00:29 +0000 (23:00 +0000)]
Swipe view gesture should be reversed in right-to-left contexts
https://bugs.webkit.org/show_bug.cgi?id=156714

Reviewed by Anders Carlsson.

* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/UserInterfaceLayoutDirection.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::userInterfaceLayoutDirection):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::userInterfaceLayoutDirection):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::userInterfaceLayoutDirection):
Plumb RTL-ness through to WebPageProxy.
We look at the WK(Web)View's UI layout direction.
For other platforms, we just assume LTR.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
Decide which way to swipe (and which way to look for back-forward items)
based on the WebPageProxy's reported RTLness.

(WebKit::ViewGestureController::isPhysicallySwipingLeft):
"Back" means "swiping left" in LTR and "swiping right" in RTL.

(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
Make things that were equating "back" with "left" instead check isPhysicallySwipingLeft.

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

3 years ago[JSCOnly] Implement RunLoop and remove glib dependency
utatane.tea@gmail.com [Mon, 18 Apr 2016 22:59:31 +0000 (22:59 +0000)]
[JSCOnly] Implement RunLoop and remove glib dependency
https://bugs.webkit.org/show_bug.cgi?id=155706

Reviewed by Michael Catanzaro.

.:

* Source/cmake/OptionsJSCOnly.cmake:

Source/WTF:

Add missing RunLoop and WorkQueue platform code for JSCOnly port.
The implementation does not use platform specific things. Instead, we
implement them on WTF framework; using condition variables to construct
the run loop and timers.

Since the fallback is implemented, it is not necessary for JSCOnly port
to depend on GLib's RunLoop abstraction. So this patch removes its
dependency. As a result, now, JSCOnly port removes dependencies except for the system ICU.

We clean up event loop ifdefs by introducing USE_XXX_EVENT_LOOP flags.
USE(XXX_EVENT_LOOP) is exclusive to each other. So from now, we do not need to take care
of the order of if-defs for the event loops. (For example, USE(GLIB) should have lead before
OS(DARWIN) in WorkQueue.h for WebKitGTK on Darwin.)

EVENT_LOOP determination is done in Platform.h. This follows the style of WTF PLATFORM.

* wtf/Platform.h:
* wtf/PlatformJSCOnly.cmake:
* wtf/RunLoop.h:
* wtf/WorkQueue.h:
* wtf/generic/MainThreadGeneric.cpp: Renamed from Source/WTF/wtf/none/MainThreadNone.cpp.
(WTF::initializeMainThreadPlatform):
(WTF::scheduleDispatchFunctionsOnMainThread):
* wtf/generic/RunLoopGeneric.cpp: Added.
(WTF::RunLoop::TimerBase::ScheduledTask::create):
(WTF::RunLoop::TimerBase::ScheduledTask::ScheduledTask):
(WTF::RunLoop::TimerBase::ScheduledTask::fired):
(WTF::RunLoop::TimerBase::ScheduledTask::scheduledTimePoint):
(WTF::RunLoop::TimerBase::ScheduledTask::updateReadyTime):
(WTF::RunLoop::TimerBase::ScheduledTask::EarliestSchedule::operator()):
(WTF::RunLoop::TimerBase::ScheduledTask::isActive):
(WTF::RunLoop::TimerBase::ScheduledTask::deactivate):
(WTF::RunLoop::RunLoop):
(WTF::RunLoop::~RunLoop):
(WTF::RunLoop::populateTasks):
(WTF::RunLoop::runImpl):
(WTF::RunLoop::run):
(WTF::RunLoop::iterate):
(WTF::RunLoop::stop):
(WTF::RunLoop::wakeUp):
(WTF::RunLoop::schedule):
(WTF::RunLoop::scheduleAndWakeUp):
(WTF::RunLoop::dispatchAfter):
(WTF::RunLoop::TimerBase::TimerBase):
(WTF::RunLoop::TimerBase::~TimerBase):
(WTF::RunLoop::TimerBase::start):
(WTF::RunLoop::TimerBase::stop):
(WTF::RunLoop::TimerBase::isActive):
* wtf/generic/WorkQueueGeneric.cpp: Added.
(WorkQueue::platformInitialize):
(WorkQueue::platformInvalidate):
(WorkQueue::dispatch):
(WorkQueue::dispatchAfter):
* wtf/none/MainThreadNone.cpp:
(WTF::initializeMainThreadPlatform): Deleted.
(WTF::scheduleDispatchFunctionsOnMainThread): Deleted.
* wtf/none/RunLoopNone.cpp:
(WTF::RunLoop::RunLoop): Deleted.
(WTF::RunLoop::~RunLoop): Deleted.
(WTF::RunLoop::run): Deleted.
(WTF::RunLoop::stop): Deleted.
(WTF::RunLoop::wakeUp): Deleted.
(WTF::RunLoop::TimerBase::TimerBase): Deleted.
(WTF::RunLoop::TimerBase::~TimerBase): Deleted.
(WTF::RunLoop::TimerBase::start): Deleted.
(WTF::RunLoop::TimerBase::stop): Deleted.
(WTF::RunLoop::TimerBase::isActive): Deleted.
* wtf/none/WorkQueueNone.cpp:
(WorkQueue::platformInitialize): Deleted.
(WorkQueue::platformInvalidate): Deleted.
(WorkQueue::dispatch): Deleted.
(WorkQueue::dispatchAfter): Deleted.

Tools:

Add TestWTF to JSCOnly port to test WorkQueue and RunLoop.
Platform specific ones locate under jsconly directory since
it is not `generic` (Since it includes the GLIB event loop case).

* CMakeLists.txt:
* TestWebKitAPI/PlatformJSCOnly.cmake: Added.
* TestWebKitAPI/PlatformUtilities.h:
* TestWebKitAPI/Tests/WTF/RunLoop.cpp:
(TestWebKitAPI::TEST):
* TestWebKitAPI/config.h:
* TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp: Renamed from Source/WTF/wtf/none/RunLoopNone.cpp.
(TestWebKitAPI::Util::run):
(TestWebKitAPI::Util::sleep):
* TestWebKitAPI/jsconly/main.cpp: Renamed from Source/WTF/wtf/none/WorkQueueNone.cpp.
(main):

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

3 years agoCrash in ElementDescendantIterator::operator--() when calling m_ancestorSiblingStack...
cdumez@apple.com [Mon, 18 Apr 2016 22:36:18 +0000 (22:36 +0000)]
Crash in ElementDescendantIterator::operator--() when calling m_ancestorSiblingStack.last()
https://bugs.webkit.org/show_bug.cgi?id=156715
<rdar://problem/25750864>

Reviewed by Antti Koivisto.

Source/WebCore:

Fix correctness of ElementDescendantIterator::operator--(). The last element
in the m_ancestorSiblingStack stack is nullptr. However, if our parent does
not have a sibling, m_current->nextSibling() == m_ancestorSiblingStack.last()
would be true and we would end up removing the nullptr element from
m_ancestorSiblingStack. We would crash on a follow-up call to operator--()
because m_ancestorSiblingStack.last() would do an out-of-bound access, given
that m_ancestorSiblingStack is empty.

Test: fast/dom/collection-backward-traversal-crash.html

* dom/ElementDescendantIterator.h:
(WebCore::ElementDescendantIterator::operator--):

LayoutTests:

Add regression test that reproduced the crash.

* fast/dom/collection-backward-traversal-crash-expected.txt: Added.
* fast/dom/collection-backward-traversal-crash.html: Added.

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

3 years agoFix build with newer versions of clang.
andersca@apple.com [Mon, 18 Apr 2016 22:29:48 +0000 (22:29 +0000)]
Fix build with newer versions of clang.
rdar://problem/25749769

Source/WebCore:

Forward declare performClose:.

* platform/mac/WebCoreFullScreenWindow.mm:

Source/WebKit/mac:

* WebCoreSupport/WebContextMenuClient.mm:
* WebView/WebHTMLView.mm:
Forward declare some AppKit IPI.

Source/WebKit2:

* UIProcess/Cocoa/WebViewImpl.mm:
* UIProcess/mac/WebPageProxyMac.mm:
Forward declare some AppKit IPI.

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

3 years agoSource/WebCore:
commit-queue@webkit.org [Mon, 18 Apr 2016 22:28:33 +0000 (22:28 +0000)]
Source/WebCore:
Declare a virtual function in PluginStrategy to be implemented by subclasses.
https://bugs.webkit.org/show_bug.cgi?id=156540

Patch by Tina Liu <iting_liu@apple.com> on 2016-04-18
Reviewed by Anders Carlsson.

* plugins/PluginStrategy.h:

Source/WebKit/mac:
Overrode a virtual function of WebCore::PluginStrategy
https://bugs.webkit.org/show_bug.cgi?id=156540

Patch by Tina Liu <iting_liu@apple.com> on 2016-04-18
Reviewed by Anders Carlsson.

* WebCoreSupport/WebPlatformStrategies.h:
* WebCoreSupport/WebPlatformStrategies.mm:
(WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):

Source/WebKit2:
Implement functions to set plug-in load policies for private browsing mode
https://bugs.webkit.org/show_bug.cgi?id=156540

Patch by Tina Liu <iting_liu@apple.com> on 2016-04-18
Reviewed by Anders Carlsson.

This patch implements API and wrappers for clients to set policies to use when using
private browsing. WebPlatformStrategies would return which policies to use depending
on whether the page is in private browsing mode.

* Shared/WebProcessCreationParameters.h:
Add a hash map for plug-in load policies for private browsing.
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode):
(WebKit::WebProcessCreationParameters::decode):

* UIProcess/API/C/mac/WKContextPrivateMac.h:
* UIProcess/API/C/mac/WKContextPrivateMac.mm:
(WKContextSetPrivateBrowsingPluginLoadClientPolicy):
Add a wrapper.

* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::createNewWebProcess):
Set the WebProcessCreationParameters's pluginLoadClientPoliciesForPrivateBrowsing.
(WebKit::WebProcessPool::setPluginLoadClientPolicyForBrowsingMode):
A helper function that sets plug-in policies to the corresponding instance variable:
m_pluginLoadClientPolicies for general browsing and m_pluginLoadClientPoliciesForPrivateBrowsing
for private browsing. The logic is extracted from the original setPluginLoadClientPolicy.
While we are here, get rid of the .contains() lookup as .get() will just return a
constructed object if the key is not found.
(WebKit::WebProcessPool::setPluginLoadClientPolicy):
Switch to use the helper function to set policies.
(WebKit::WebProcessPool::setPrivateBrowsingPluginLoadClientPolicy):
Ditto. Also send a message to the WebProcess for setting policies for private browsing.
(WebKit::WebProcessPool::clearPluginClientPolicies):
Clear plug-ins' private browsing policies.

* WebProcess/WebCoreSupport/WebPlatformStrategies.h:
* WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicyForBrowsingMode):
Ditto as WebProcessPool::setPluginLoadClientPolicyForBrowsingMode.
(WebKit::WebPlatformStrategies::setPluginLoadClientPolicy):
Switch to use setPluginLoadClientPolicyForBrowsingMode to set policies.
(WebKit::WebPlatformStrategies::setPrivateBrowsingPluginLoadClientPolicy):
Use setPluginLoadClientPolicyForBrowsingMode to set policies for private browsing.
(WebKit::WebPlatformStrategies::clearPluginClientPolicies):
Clear plug-ins' private browsing policies.
(WebKit::WebPlatformStrategies::longestMatchedWildcardHostForHost):
Add an argument for private browsing. Read from the corresponding ivar.
(WebKit::WebPlatformStrategies::replaceHostWithMatchedWildcardHost):
Ditto.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHost): Deleted.
Renamed this function as pluginLoadClientPolicyForHostForBrowsingMode.
(WebKit::WebPlatformStrategies::pluginLoadClientPolicyForHostForBrowsingMode):
Ditto.
(WebKit::WebPlatformStrategies::populatePluginCache):
Get the plug-in load policies for a specific host based on the page's session status. If the page
is using ephemeral session, use the private browsing policies.

* WebProcess/WebProcess.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
Switch to call the helper function setPluginLoadClientPolicyFromCreationParameters.
(WebKit::WebProcess::setPluginLoadClientPolicies):
Logic moved from initializeWebProcess. Call PluginStrategy::setPluginLoadClientPolicy or
PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy depending on the input argument.
(WebKit::WebProcess::setPrivateBrowsingPluginLoadClientPolicy):
Add a wrapper to call PluginStrategy::setPrivateBrowsingPluginLoadClientPolicy.

* WebProcess/WebProcess.messages.in:
Declare an entry for setPrivateBrowsingPluginLoadClientPolicy.

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

3 years agoDisable AVX.
fpizlo@apple.com [Mon, 18 Apr 2016 22:09:27 +0000 (22:09 +0000)]
Disable AVX.

Rubber stampted by Benjamin Poulain.

AVX is silly. If you use it and some of your other code isn't careful with float register bits, you
will run 10x slower. We could fix the underlying issue, but it's better to stay away from this odd
instruction subset.

This fixes a massive regression on some real code.

* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::supportsAVX):
(JSC::MacroAssemblerX86Common::updateEax1EcxFlags):

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

3 years agoUnreviewed revert accidental ChangeLog modifications.
joepeck@webkit.org [Mon, 18 Apr 2016 21:53:02 +0000 (21:53 +0000)]
Unreviewed revert accidental ChangeLog modifications.

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

3 years agoWeb Inspector: sourceMappingURL not used when sourceURL is set
joepeck@webkit.org [Mon, 18 Apr 2016 21:50:24 +0000 (21:50 +0000)]
Web Inspector: sourceMappingURL not used when sourceURL is set
https://bugs.webkit.org/show_bug.cgi?id=156021
<rdar://problem/25438417>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

Clean up Debugger.sourceParsed to separately include:

    - url ("resource URL", "source url" in JSC APIs)
    - sourceURL - //# sourceURL directive

By always having the resource URL the Web Inspector frontend
can better match this Script to a Resource of the same URL,
and decide to use the sourceURL if it is available when
appropriate.

* inspector/protocol/Debugger.json:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::setBreakpointByUrl):
(Inspector::InspectorDebuggerAgent::didParseSource):
Send the new sourceParsed parameters.

Source/WebInspectorUI:

Previously Debugger.sourceParsed only providing the sourceURL, and
wiping out the resourceURL, meant that a Script from a Resource that
set a sourceURL directive would fail to be associated with its Resource.

This would result in duplicated tree elements in the Resources Sidebar,
one for the Resource, and one for the Script. With the Script getting
ultimately getting the SourceMap resources. However, since the frontend
prefers Resources over Scripts when possible, an error that generated
from the script would point to a location in the Resource, not following
source maps.

By always providing the resource URL in Debugger.sourceParsed, a Script
can better be associated with its Resource. The result is now a single
shared tree element in the Resources Sidebar, and the Resource getting
the SourceMap resources. Now the script error goes through the Resource
to its SourceMap resources as we would expect.

* UserInterface/Protocol/DebuggerObserver.js:
(WebInspector.DebuggerObserver):
(WebInspector.DebuggerObserver.prototype.scriptParsed):
We now have to handle two different signatures of scriptParsed. One
for legacy, and one for non-legacy. Cache that value early on, since
scriptParsed happens a lot.

* UserInterface/Protocol/InspectorBackend.js:
(InspectorBackend.Agent.prototype.hasEventParameter):
Runtime check a protocol event to see if it has a parameter. This
is used to check if Debugger.sourceParsed is legacy or not based
on if it has the legacy "hasSourceURL" parameter.

* UserInterface/Models/Script.js:
(WebInspector.Script):
(WebInspector.Script.prototype.get sourceURL):
Treat sourceURL and url separately.

(WebInspector.Script.prototype.get displayName):
Handle both the url and sourceURL in displayName.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype.get knownNonResourceScripts):
(WebInspector.DebuggerManager.prototype.debuggerDidPause):
(WebInspector.DebuggerManager.prototype.scriptDidParse):
* UserInterface/Protocol/RemoteObject.js:
(WebInspector.RemoteObject.prototype.findFunctionSourceCodeLocation):
Update code that checks the sourceURL to explicitly use sourceURL.

* UserInterface/Controllers/SourceMapManager.js:
(WebInspector.SourceMapManager.prototype.downloadSourceMap):
For legacy backends, or in case we get a resource that has an incomplete
baseURL, attempt to get an absolute URL based on the main resource.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._addScript):
* UserInterface/Views/ResourceSidebarPanel.js:
(WebInspector.ResourceSidebarPanel.prototype._scriptWasAdded):
Ignore scripts without a url or sourceURL.

LayoutTests:

* inspector/debugger/scriptParsed.html:
* inspector/debugger/search-scripts.html:
* inspector/debugger/setBreakpointByUrl-sourceURL.html:
* inspector/debugger/sourceURLs.html:
Update tests that need to handle sourceURL separately.

* inspector/model/resources/relationship-named.js: Added.
* inspector/model/resources/relationship-normal.js: Added.
* inspector/model/script-resource-relationship-expected.txt: Added.
* inspector/model/script-resource-relationship.html: Added.
Tests for Script and Resource relationships.

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

3 years ago[iOS] don't toggle playback when media engine rate changes
eric.carlson@apple.com [Mon, 18 Apr 2016 20:50:07 +0000 (20:50 +0000)]
[iOS] don't toggle playback when media engine rate changes
https://bugs.webkit.org/show_bug.cgi?id=156705
<rdar://problem/25779175>

Reviewed by Jer Noble.

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::rateChanged): Don't send the play/pause command
  unless the player item state is >= MediaPlayerAVPlayerItemStatusPlaybackBufferFull and
  the rate change is unexpected.

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

3 years agoToThis should have a fast path based on type info flags
fpizlo@apple.com [Mon, 18 Apr 2016 20:33:47 +0000 (20:33 +0000)]
ToThis should have a fast path based on type info flags
https://bugs.webkit.org/show_bug.cgi?id=156712

Reviewed by Geoffrey Garen.

Prior to this change, if we couldn't nail down the type of ToThis to something easy, we'd emit code
that would take slow path if the argument was not a final object. We'd end up taking that slow path
a lot.

This adds a type info flag for ToThis having non-obvious behavior and changes the DFG and FTL paths
to test this flag. This is a sub-1% speed-up on SunSpider and Octane.

* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileToThis):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::create):
* runtime/JSLexicalEnvironment.h:
(JSC::JSLexicalEnvironment::create):
* runtime/JSString.h:
* runtime/JSTypeInfo.h:
(JSC::TypeInfo::overridesGetOwnPropertySlot):
(JSC::TypeInfo::interceptsGetOwnPropertySlotByIndexEvenWhenLengthIsNotZero):
(JSC::TypeInfo::structureIsImmortal):
(JSC::TypeInfo::overridesToThis):
(JSC::TypeInfo::overridesGetPropertyNames):
(JSC::TypeInfo::prohibitsPropertyCaching):
(JSC::TypeInfo::getOwnPropertySlotIsImpure):
* runtime/StrictEvalActivation.h:
(JSC::StrictEvalActivation::create):
* runtime/Symbol.h:

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

3 years agoCheck to see how the perf bots react to megamorphic load being disabled.
fpizlo@apple.com [Mon, 18 Apr 2016 20:28:51 +0000 (20:28 +0000)]
Check to see how the perf bots react to megamorphic load being disabled.

Rubber stamped by Chris Dumez.

* runtime/Options.h:

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

3 years agoUnreviewed, fix iOS9 build after r199682.
cdumez@apple.com [Mon, 18 Apr 2016 20:26:12 +0000 (20:26 +0000)]
Unreviewed, fix iOS9 build after r199682.

* platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
(WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):

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

3 years agoWe should support delete in the DFG
keith_miller@apple.com [Mon, 18 Apr 2016 20:02:24 +0000 (20:02 +0000)]
We should support delete in the DFG
https://bugs.webkit.org/show_bug.cgi?id=156607

Reviewed by Benjamin Poulain.

This patch adds support for the delete in the DFG as it appears that
some major frameworks use the operation in particularly hot functions.
As a result, even if the function rarely ever calls delete we would never
tier up to the DFG. This patch also changes operationDeleteById to take a
UniquedStringImpl and return a size_t.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasIdentifier):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
(JSC::DFG::PredictionPropagationPhase::propagate):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileDeleteById):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/JIT.h:
* jit/JITInlines.h:
(JSC::JIT::callOperation):
* jit/JITOperations.cpp:
* jit/JITOperations.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_del_by_id):
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_del_by_id):

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

3 years ago[WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context...
cdumez@apple.com [Mon, 18 Apr 2016 18:49:56 +0000 (18:49 +0000)]
[WK2][iOS] Only adjust network responses' MIME type for QuickLook in the context of a main resource load
https://bugs.webkit.org/show_bug.cgi?id=156639
<rdar://problem/25765848>

Reviewed by Alex Christensen.

Source/WebCore:

Only adjust network responses' MIME type for QuickLook in the context of a main
resource load since we can only preview main resources with QuickLook. This
avoids doing unnecessary work during page load. Also, this makes it a lot less
likely to dlopen() the QuickLook library during page load since we now only
adjust MIME type for QuickLook for main resources, and main resources usually
have the well-known 'text/html' MIME type for which we know we will not use
QuickLook.

After this change, we no longer need to dlopen() the QuickLook library in the
NetworkProcess in the context of the PLT. We would previously dlopen() the
library during the first page load, thus significantly slowing it down. As a
result, we see a ~22% speed up in the PLT's first page load and a 0.9-1% overall
PLT progression.

* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.

* platform/network/ios/WebCoreURLResponseIOS.mm:
(WebCore::adjustMIMETypeIfNecessary):
Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.

* platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
(-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
Only adjust the MIME type for QuickLook if the isMainResourceLoad parameter is true.

* platform/network/mac/WebCoreURLResponse.h:
* platform/network/mac/WebCoreURLResponse.mm:
(WebCore::adjustMIMETypeIfNecessary):

Source/WebKit2:

* NetworkProcess/NetworkDataTask.h:
(WebKit::NetworkDataTask::firstRequest):
Add getter to return the first request.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
Pass flag to adjustMIMETypeIfNecessary() indicated if this is a main resource load.

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

3 years agoUpdate Animometer plan.
jonlee@apple.com [Mon, 18 Apr 2016 18:41:33 +0000 (18:41 +0000)]
Update Animometer plan.
https://bugs.webkit.org/show_bug.cgi?id=156652

Reviewed by Darin Adler.

* Scripts/webkitpy/benchmark_runner/data/plans/animometer.plan: Update to r199616.

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

3 years agoWeb Automation: provide detailed error messages when an automation command fails
bburg@apple.com [Mon, 18 Apr 2016 17:46:01 +0000 (17:46 +0000)]
Web Automation: provide detailed error messages when an automation command fails
https://bugs.webkit.org/show_bug.cgi?id=156635
<rdar://problem/25754051>

Reviewed by Darin Adler and Timothy Hatcher.

Fill in lots of missing error message details now that the remote end knows
how to parse error strings with predefined error names and details.

* UIProcess/Automation/WebAutomationSession.cpp:
Rearrange the error message macros. Make it possible to pass a ErrorMessage
variable or just the enum value name and get out an encoded error message
that optionally includes a free-form details string. The predefined error
name and the details string are joined together with a semicolon.

(WebKit::WebAutomationSession::getBrowsingContext):
(WebKit::WebAutomationSession::createBrowsingContext):
(WebKit::WebAutomationSession::closeBrowsingContext):
(WebKit::WebAutomationSession::switchToBrowsingContext):
(WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
(WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
(WebKit::WebAutomationSession::navigateBrowsingContext):
(WebKit::WebAutomationSession::goBackInBrowsingContext):
(WebKit::WebAutomationSession::goForwardInBrowsingContext):
(WebKit::WebAutomationSession::reloadBrowsingContext):
(WebKit::WebAutomationSession::evaluateJavaScriptFunction):
(WebKit::WebAutomationSession::didEvaluateJavaScriptFunction):
(WebKit::WebAutomationSession::resolveChildFrameHandle):
(WebKit::WebAutomationSession::didResolveChildFrame):
(WebKit::WebAutomationSession::resolveParentFrameHandle):
(WebKit::WebAutomationSession::didResolveParentFrame):
(WebKit::WebAutomationSession::computeElementLayout):
(WebKit::WebAutomationSession::didComputeElementLayout):
(WebKit::WebAutomationSession::isShowingJavaScriptDialog):
(WebKit::WebAutomationSession::dismissCurrentJavaScriptDialog):
(WebKit::WebAutomationSession::acceptCurrentJavaScriptDialog):
(WebKit::WebAutomationSession::messageOfCurrentJavaScriptDialog):
(WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
(WebKit::WebAutomationSession::getAllCookies):
(WebKit::WebAutomationSession::didGetCookiesForFrame):
(WebKit::WebAutomationSession::deleteSingleCookie):
(WebKit::WebAutomationSession::didDeleteCookie):
(WebKit::WebAutomationSession::addSingleCookie):
(WebKit::WebAutomationSession::deleteAllCookies):
(WebKit::WebAutomationSession::performMouseInteraction):
(WebKit::WebAutomationSession::performKeyboardInteractions):
(WebKit::WebAutomationSession::takeScreenshot):
(WebKit::WebAutomationSession::didTakeScreenshot):
Audit almost all early exits and provide a relevant error details message
if the error itself is ambiguous. Make sure to format asynchronous errors.

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

3 years agoUnreviewed, rolling out r199621.
commit-queue@webkit.org [Mon, 18 Apr 2016 17:30:36 +0000 (17:30 +0000)]
Unreviewed, rolling out r199621.
https://bugs.webkit.org/show_bug.cgi?id=156708

made windows tests crash (Requested by alexchristensen on
#webkit).

Reverted changeset:

"iTunes crashing JavaScriptCore.dll"
https://bugs.webkit.org/show_bug.cgi?id=156647
http://trac.webkit.org/changeset/199621

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

3 years agoWeb Inspector: NavigationSidebarPanel does a lot of style recalc and layout on busy...
timothy@apple.com [Mon, 18 Apr 2016 17:28:40 +0000 (17:28 +0000)]
Web Inspector: NavigationSidebarPanel does a lot of style recalc and layout on busy sites

https://bugs.webkit.org/show_bug.cgi?id=156704
rdar://problem/25778744

Reviewed by Brian Burg.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel):
(WebInspector.NavigationSidebarPanel.prototype._treeElementDisclosureDidChange):
Use _updateContentOverflowShadowVisibilitySoon in more places so the style recalc
and layout changes are coalesced into one action after all rapid fire calls.

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

3 years agoWeb Inspector: Database query result DataGrids have misaligned header columns
timothy@apple.com [Mon, 18 Apr 2016 17:28:38 +0000 (17:28 +0000)]
Web Inspector: Database query result DataGrids have misaligned header columns

https://bugs.webkit.org/show_bug.cgi?id=156701
rdar://problem/25778310

Reviewed by Brian Burg.

* UserInterface/Views/DataGrid.js:
(WebInspector.DataGrid.prototype.autoSizeColumns): Set the width on the <col> element
for the body table to match the <col> in the header.

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

3 years agoWeb Inspector: Fix the debounce function
timothy@apple.com [Mon, 18 Apr 2016 17:28:36 +0000 (17:28 +0000)]
Web Inspector: Fix the debounce function

https://bugs.webkit.org/show_bug.cgi?id=156696
rdar://problem/25778133

Reviewed by Brian Burg.

* UserInterface/Base/Utilities.js:
(Function.prototype.debounce): Store the timeout on the original function instead
of the bound function. Also simplify the implementation with arrow functions
and eliminate the bind altogether.

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

3 years agoFTL should pin the tag registers at inline caches
fpizlo@apple.com [Mon, 18 Apr 2016 17:13:33 +0000 (17:13 +0000)]
FTL should pin the tag registers at inline caches
https://bugs.webkit.org/show_bug.cgi?id=156678

Reviewed by Saam Barati.

This is a long-overdue fix to our inline caches. Back when we had LLVM, we couldn't rely on the tags
being pinned to any registers. So, if the inline caches needed tags, they'd have to materialize them.

This removes those materializations. This should reduce the amount of code generated in inline caches
and it should make inline caches faster. The effect appears to be small.

It may be that after this change, we'll even be able to kill the
HaveTagRegisters/DoNotHaveTagRegisters logic.

* bytecode/PolymorphicAccess.cpp:
(JSC::AccessCase::generateWithGuard):
(JSC::AccessCase::generateImpl):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compilePutById):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToB3::compileTailCall):
(JSC::FTL::DFG::LowerDFGToB3::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToB3::compileIn):
(JSC::FTL::DFG::LowerDFGToB3::getById):
* jit/Repatch.cpp:
(JSC::readCallTarget):
(JSC::linkPolymorphicCall):
* jit/ThunkGenerators.cpp:
(JSC::virtualThunkFor):

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

3 years agosvn-apply: add option for ignoring changes to ChangeLog files
dburkart@apple.com [Mon, 18 Apr 2016 17:13:04 +0000 (17:13 +0000)]
svn-apply: add option for ignoring changes to ChangeLog files
https://bugs.webkit.org/show_bug.cgi?id=156618

Reviewed by Darin Adler.

This change adds a new option to svn-apply, --skip-changelogs, which short-circuits out of
patch() if the file in question is a ChangeLog.

* Scripts/svn-apply:
(patch):

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

3 years agoSource/WebCore:
bfulgham@apple.com [Mon, 18 Apr 2016 16:45:35 +0000 (16:45 +0000)]
Source/WebCore:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* loader/EmptyClients.h:
* loader/FrameLoaderClient.h:
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLink):

Source/WebKit/mac:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.

Source/WebKit/win:
CSP: Make dynamically-added favicons (via link rel="icon") obey Content-Security-Policy
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKit2:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidChangeIcons): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:
CSP: Remove stubs for dynamically-added favicons (via link rel="icon")
https://bugs.webkit.org/show_bug.cgi?id=153151
<rdar://problem/24383176>

Reviewed by Darin Adler.

Remove the unused dynamic favicon code and tests.

* TestExpectations:
* http/tests/security/contentSecurityPolicy/icon-allowed-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/icon-allowed.html: Removed.
* http/tests/security/contentSecurityPolicy/icon-blocked-expected.txt: Removed.
* http/tests/security/contentSecurityPolicy/icon-blocked.html: Removed.

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

3 years ago[Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
jer.noble@apple.com [Mon, 18 Apr 2016 16:14:36 +0000 (16:14 +0000)]
[Mac][EME] Protected content over HLS is not notified when a HDCP violation occurs.
https://bugs.webkit.org/show_bug.cgi?id=156633

Reviewed by Eric Carlson.

Pass through the existing "outputObscuredDueToInsufficientExternalProtection" status as an
error, similarly to what we do for CDMSessionMediaSourceAVFObjC.

* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
(WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC): Deleted.
* platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(SOFT_LINK_CLASS):
(-[WebCDMSessionAVFoundationObjCListener initWithParent:player:]):
(-[WebCDMSessionAVFoundationObjCListener invalidate]):
(-[WebCDMSessionAVFoundationObjCListener observeValueForKeyPath:ofObject:change:context:]):
(WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::~CDMSessionAVFoundationObjC):
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
(WebCore::MediaPlayerPrivateAVFoundationObjC::avPlayer):

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

3 years agoREGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClie...
jer.noble@apple.com [Mon, 18 Apr 2016 16:04:07 +0000 (16:04 +0000)]
REGRESSION( r199603): Pandora crashes WebKit in WebPlaybackSessionManager::removeClientForContext
https://bugs.webkit.org/show_bug.cgi?id=156648

Reviewed by Darin Adler.

Follow up patch to r199615; avoid a double hash lookup by using a .find() pattern instead of
.contains() & .get().

* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):

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

3 years ago[l10n] Updated Greek translation of WebKitGTK+
mcatanzaro@igalia.com [Mon, 18 Apr 2016 15:54:50 +0000 (15:54 +0000)]
[l10n] Updated Greek translation of WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=156677

Patch by Tom Tryfonidis <tomtryf@gmail.com> on 2016-04-18
Rubber-stamped by Michael Catanzaro.

* el.po:

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

3 years agoUnreviewed, rolling out r199644.
cdumez@apple.com [Mon, 18 Apr 2016 15:36:34 +0000 (15:36 +0000)]
Unreviewed, rolling out r199644.

Seems to have caused a 1-2% regression on warm PLT

Reverted changeset:

"[WK2][iOS] Do not dlopen() QuickLook in the NetworkProcess"
https://bugs.webkit.org/show_bug.cgi?id=156639
http://trac.webkit.org/changeset/199644

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

3 years agoGet rid of IDBAny
darin@apple.com [Mon, 18 Apr 2016 15:33:30 +0000 (15:33 +0000)]
Get rid of IDBAny
https://bugs.webkit.org/show_bug.cgi?id=156681

Reviewed by Brady Eidson.

IDBAny is not part of the public interface of Indexed Database.
It was an implementation technique used to help create language bindings for
functions that have to deal with types that aren't easly expressed with the
normal IDL and C++ type system.

What was particularly dangerous about IDBAny is that it can be used to store
arbitrary JavaScript objects and it's not easy to handle garbage collection and
reference cycles when they are hidden behind this class's abstraction. It's also
a needless extra layer, a reference counted object just to carry the types from
the bindings to the C++ DOM implementation.

Ths patch also does many small style tweaks.

* CMakeLists.txt: Removed IDBAny source files. Added JSIDBRequestCustom.cpp.
* DerivedSources.cpp: Ditto.
* DerivedSources.make: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.

* Modules/indexeddb/IDBAny.cpp: Removed.
* Modules/indexeddb/IDBAny.h: Removed.
* Modules/indexeddb/IDBAny.idl: Removed.

* Modules/indexeddb/IDBCursor.cpp: Added includes needed now that headers don't
include as much.
(WebCore::IDBCursor::stringToDirection): Removed unneeded IDBCursor namespacing.
(WebCore::IDBCursor::directionToString): Ditto.
(WebCore::IDBCursor::IDBCursor): Removed creation of IDBAny object.
(WebCore::IDBCursor::direction): Removed unneeded IDBCursor namespacing.
(WebCore::IDBCursor::key): Moved this function to the header.
(WebCore::IDBCursor::primaryKey): Ditto.
(WebCore::IDBCursor::value): Ditto.
(WebCore::IDBCursor::source): Deleted this function; replaced with multiple
type-specific functions; all but one will return null.
(WebCore::IDBCursor::update): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBCursor::advance): Take unsigned instead of unsigned long.
Fell prey to the confusion because "unsigned long" in IDL means "unsigned" in C++.
(WebCore::IDBCursor::continueFunction): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBCursor::uncheckedIterateCursor): Take unsigned instead of unsigned long.
(WebCore::IDBCursor::setGetResult): Rewrote to get the VM pointer from the
ScriptExecutionContext here instead of inside the binding utilities functions.

* Modules/indexeddb/IDBCursor.h: Removed many unneeded includes.
Changed key, primaryKey, and value to no longer take an unneeded ExecState.
Made more functions private.

* Modules/indexeddb/IDBCursor.idl: Changed type of "source" to "any", which matches
the IDB specification, rather than "IDBAny". Added [CustomGetter] so we can write the
getter that understands the multiple possible values. Removed unneeded
[CallWith=ScriptState] from key and primaryKey attributes.

* Modules/indexeddb/IDBCursorWithValue.h: Marked the class final.
* Modules/indexeddb/IDBCursorWithValue.idl: Removed unneeded [CallWith=ScriptState]
from the value attribute.

* Modules/indexeddb/IDBDatabase.cpp: Added now-needed include.
* Modules/indexeddb/IDBDatabase.h: Removed this header's include of itself!

* Modules/indexeddb/IDBFactory.cpp: Added some now-needed includes.
(WebCore::IDBFactory::~IDBFactory): Moved this out of the header file.
(WebCore::IDBFactory::getDatabaseNames): Removed function that always returns nullptr.
(WebCore::IDBFactory::open): Removed unneeded release() calls when returning a RefPtr.
(WebCore::IDBFactory::cmp): Take JSValue instead of Deprecated::ScriptValue.
Also removed unneeded typecast.

* Modules/indexeddb/IDBFactory.h: Removed many unneeded includes.
Removed the getDatabaseNames function. We still need a solution here, but there is
no reason to keep the placeholder function that returns nullptr here.

* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::keyPathAny): Removed.
(WebCore::IDBIndex::openCursor): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBIndex::count): Ditto.
(WebCore::IDBIndex::openKeyCursor): Ditto.
(WebCore::IDBIndex::get): Ditto.
(WebCore::IDBIndex::getKey): Ditto.

* Modules/indexeddb/IDBIndex.h: Removed many unneeded includes, including this file
including itself. Marked class final. Updated for above changes.

* Modules/indexeddb/IDBIndex.idl: Changed type of "keyPath" to "any", which matches
the IDB specification, rather than "IDBAny". Specified [ImplementationReturnType=IDBKeyPath]
so the code generator creates the appropriate code to convert from an IDBKeyPath.
In the future, we may find a way to do this without an explicit attribute in the IDL
file but this is fine for now.

* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::create): Moved this here from the header. Use booleans instead
of enums because all the call sites outside this class are using booleans.
(WebCore::IDBKeyRange::IDBKeyRange): Updated to use booleans.
(WebCore::IDBKeyRange::~IDBKeyRange): Moved here from the header.
(WebCore::IDBKeyRange::lowerValue): Removed now-unneeded get().
(WebCore::IDBKeyRange::upperValue): Ditto.
(WebCore::IDBKeyRange::only): Take JSValue instead of Deprecated::ScriptValue.
(WebCore::IDBKeyRange::lowerBound): Updated for above changes.
(WebCore::IDBKeyRange::upperBound): Ditto.
(WebCore::IDBKeyRange::bound): Ditto.
(WebCore::IDBKeyRange::isOnlyKey): Removed assertions that lower and upper are not null;
there is no real guarantee of this! Rewrote and streamlined and it handles the null case now.

* Modules/indexeddb/IDBKeyRange.h: Removed unneeded includes. Changed class to use booleans
instead of enums for m_isLowerOpen and m_isUpperOpen. Moved functions into the cpp file.

* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::maybeCreateIDBKeyRange): Updated to use booleans instead of enums.

* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::name): Changed return type to const String& to cut down on
reference count churn.
(WebCore::IDBObjectStore::keyPathAny): Deleted.
(WebCore::IDBObjectStore::keyPath): Changed return type to const IDBKeyPath& to cut down on
unnecessary copies.
(WebCore::IDBObjectStore::openCursor): Take JSValue instead of Deprecated::SCriptValue.
(WebCore::IDBObjectStore::get): Ditto.
(WebCore::IDBObjectStore::putOrAdd): Ditto. Removed peculiar adoptRef/leakRef that was not needed.
(WebCore::IDBObjectStore::deleteFunction): Ditto.
(WebCore::IDBObjectStore::modernDelete): Ditto. Use releaseNonNull for better efficiency.
(WebCore::IDBObjectStore::count): Ditto.

* Modules/indexeddb/IDBObjectStore.h: Removed unneeded includes and changed types as mentioned
above in the cpp file function descriptions.

* Modules/indexeddb/IDBObjectStore.idl: Changed type of "keyPath" to "any" and
specified [ImplementationReturnType=IDBKeyPath] as above in IDBIndex.idl.

* Modules/indexeddb/IDBOpenDBRequest.cpp: Added now-needed includes.
(WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit): Removed unneeded assertions
that depend on how m_result is implemented, which changed.
(WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion): Call setResultToUndefined
instead of setting m_result directly.
(WebCore::IDBOpenDBRequest::onSuccess): Call setResult instead of setting m_result and
m_readyState directly.
(WebCore::IDBOpenDBRequest::onUpgradeNeeded):: Ditto. Also use WTFMove to set
m_transaction instead of peculiar adoptRef/leakRef.
(WebCore::IDBOpenDBRequest::onDeleteDatabaseSuccess): Call setResultToUndefined
instead of setting m_result directly.

* Modules/indexeddb/IDBOpenDBRequest.h: Marked the class final. Removed some unneeded headers
and made more things private.

* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::IDBRequest): Don't initialize m_source any more. Instead initialize
m_objectStoreSource and m_indexSource, preserving the old behavior and not setting m_cursorSource
even when passed an IDBCursor.
(WebCore::IDBRequest::~IDBRequest): Simplify the code that calls clearRequest on the result
if it's a cursor. The logic is now simply a null check.
(WebCore::IDBRequest::result): Deleted. The logic is now in a custom binding.
(WebCore::IDBRequest::error): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::source): Deleted. The logic is now in a custom binding.
(WebCore::IDBRequest::setSource): Set m_objectStoreSource, m_indexSource, and m_cursorSource
instead of setting m_source.
(WebCore::IDBRequest::readyState): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::sourceObjectStoreIdentifier): Use m_objectStoreSource and
m_indexSource instead of using m_source. To preserve current behavior, this this does not
use m_cursorSource since the old code did not handle IDBCursor.
(WebCore::IDBRequest::sourceIndexIdentifier): Use m_indexSource instead of m_source, preserving
current behavior.
(WebCore::IDBRequest::requestedIndexRecordType): Ditto.
(WebCore::IDBRequest::dispatchEvent): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::setResult): Rewrote to use the clearResult function so we don't
have to repeat the code to clear result pointers. Also take a reference.
(WebCore::IDBRequest::setResultToStructuredClone): Ditto.
(WebCore::IDBRequest::clearResult): Clear out m_scriptResult, m_cursorResult, and m_databaseResult
instead of m_result.
(WebCore::IDBRequest::setResultToUndefined): Set m_scriptResult instead of m_result.
(WebCore::IDBRequest::resultCursor): Use m_cursorResult instead of m_result.
(WebCore::IDBRequest::willIterateCursor): Updated to use m_isDone instead of m_readyState.
Also call setResultToUndefined instead of setting m_result.
(WebCore::IDBRequest::didOpenOrIterateCursor): Call setResultToUndefined and set m_cursorResult
instead of setting m_result.
(WebCore::IDBRequest::requestCompleted): Updated to use m_isDone instead of m_readyState.
(WebCore::IDBRequest::setResult): Added for use by the derived class; sets m_databaseResult.

* Modules/indexeddb/IDBRequest.h: Removed unneeded includes. Removed unused IDBRequestReadyState,
since that's now done with strings. Added cursorResult, databaseResult, scriptResult,
objectStoreSource, indexSource, and cursorSource function members and corresponding data members.
Later we might re-cast this as some sort of union, but for now these separate functions seem fine.
Removed unused modernResult function. Made more things private.

* Modules/indexeddb/IDBRequest.idl: Use "any" instead of "IDBAny" for "result" and "source".

* Modules/indexeddb/IDBTransaction.cpp: Added now-needed includes.
(WebCore::IDBTransaction::didGetRecordOnServer): Updated to call the version of setResult that takes
a reference.
(WebCore::IDBTransaction::didPutOrAddOnServer): Ditto.
* Modules/indexeddb/IDBTransaction.h: Removed unneeded includes, derive privately from ActiveDOMObject.
Removed some unneeded WebCore prefixes.

* Modules/indexeddb/server/MemoryIndex.h: Added now-needed include.

* Modules/indexeddb/server/MemoryObjectStore.cpp: Added now-needed includes.
(WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord): Remove unneeded get() call.
(WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): Ditto.

* Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: Added now-needed includes.
(WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord): Remove unneeded get() call.
(WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord): Ditto.

* Modules/indexeddb/server/SQLiteIDBCursor.cpp: Added now-needed include.

* Modules/indexeddb/server/UniqueIDBDatabase.cpp: Added now-needed includes.
(WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): Updated to use JSValue.

* Modules/indexeddb/server/UniqueIDBDatabase.h: Added now-needed forward declaration of JSC::VM.

* bindings/js/IDBBindingUtilities.cpp: Added now-needed includes.
(WebCore::deserializeIDBValueToJSValue): Return JSValue instead of Strong<Unknown>.
(WebCore::deserializeIDBValueDataToJSValue): Ditto.
(WebCore::idbKeyDataToScriptValue): Ditto.
(WebCore::toJS): Added an overload of toJS for IDBKeyPath here. Moved here from JSIDBAnyCustom.cpp.

* bindings/js/IDBBindingUtilities.h: Removed unneeded include. Changed return types to JSValue.
Added the toJS function for IDBKeyPath.

* bindings/js/JSIDBAnyCustom.cpp: Removed.

* bindings/js/JSIDBCursorCustom.cpp: Added some now-needed includes.
(WebCore::JSIDBCursor::visitAdditionalChildren): Removed ann unneeded type cast.
(WebCore::JSIDBCursor::source): Added. Converts either the index source or the object source into
a JSValue.

* bindings/js/JSIDBRequestCustom.cpp: Added.
(WebCore::JSIDBRequest::result): Added. Throws an exception if isDone is false and then converts
cursor result, database result, or script result into a JSValue.
(WebCore::JSIDBRequest::source): Added. Converts the cursor source, index source, or object store
source into a JSValue.

* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Tweaked the code for array slightly. Added an ImplementationReturnType case
for IDBKeyPath. The code that's generated is pretty generic, just a call to toJS with the conventional
arguments, so at some point we may be able to do this with C++ overloading and not require a
special case in the code generator.

* inspector/InspectorIndexedDBAgent.cpp: Put #if 0 around the getDatabaseNames code, which was
dormant and not working.
(WebCore::OpenDatabaseCallback::handleEvent): Changed this to use IDBOpenDBRequest::databaseResult
instead of calling the result function checking for an exception and then doing type checking.
(WebCore::idbKeyRangeFromKeyRange): Updated to use booleans for key range bound open state.
(WebCore::OpenCursorCallback::handleEvent): Same kind of change as for OpenDatabaseCallback above.
Also use simpler interface to key, primaryKey, and value.
(WebCore::InspectorIndexedDBAgent::requestDatabaseNames): Put #if 0 around the getDatabaseNames
code, which was dormant and not working. Needs to be re-implemented.

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

3 years agoMedia element "user gesture for fullscreen" restriction is never lifted
eric.carlson@apple.com [Mon, 18 Apr 2016 15:24:47 +0000 (15:24 +0000)]
Media element "user gesture for fullscreen" restriction is never lifted
https://bugs.webkit.org/show_bug.cgi?id=156547
<rdar://problem/25707814>

Reviewed by Jer Noble.

Source/WebCore:

Test: media/video-fullscreen-restriction-removed.html

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted): Check fullscreenPermitted rather than
  checking for a user gesture because the restriction can be removed.

LayoutTests:

* media/video-fullscreen-restriction-removed-expected.txt: Added.
* media/video-fullscreen-restriction-removed.html: Added.

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

3 years agoMark script-height reftest as ImageOnlyFailure on iOS
fred.wang@free.fr [Mon, 18 Apr 2016 15:23:45 +0000 (15:23 +0000)]
Mark script-height reftest as ImageOnlyFailure on iOS
https://bugs.webkit.org/show_bug.cgi?id=153918

Unreviewed test gardening.

* platform/ios-simulator/TestExpectations:

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

3 years agoRefactor RenderMathMLScripts layout to avoid using flexbox
fred.wang@free.fr [Mon, 18 Apr 2016 14:45:00 +0000 (14:45 +0000)]
Refactor RenderMathMLScripts layout to avoid using flexbox
https://bugs.webkit.org/show_bug.cgi?id=153917

Patch by Frederic Wang <fwang@igalia.com> on 2016-04-18
Reviewed by Martin Robinson.

Source/WebCore:

Tests: mathml/mathml-in-html5/subsup-parameters-1.html
       mathml/opentype/large-operators-italic-correction.html

Reimplement RenderMathMLScripts without any flexbox or anonymous.
We also rely on parameters from the MATH table to improve rendering.

* css/mathml.css:
(msub > * + * + *, msup > * + * + *, msubsup > * + * + * + *, msub > mprescripts, msup > mprescripts, msubsup > mprescripts, msub > none, msup > none, msubsup > none, mmultiscripts > mprescripts ~ mprescripts, mmultiscripts > mprescripts ~ mprescripts ~ *): Deleted.
Invalid markup for scripts is now just hidden.
* rendering/mathml/RenderMathMLOperator.h: ditto.
* rendering/mathml/RenderMathMLScripts.cpp:
(WebCore::RenderMathMLScripts::unembellishedOperator): Reimplemented.
(WebCore::RenderMathMLScripts::getBaseAndScripts): Helper function to verify whether the
child list is valid and retrieve pointers on important children.
(WebCore::RenderMathMLScripts::spaceAfterScript): Helper function to get the
space after a script.
(WebCore::RenderMathMLScripts::italicCorrection): Helper function to read the
italic correction of a largeop base.
(WebCore::RenderMathMLScripts::computePreferredLogicalWidths): Implement this function.
(WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded): Helper function to get
the maximum ascent/descent of all the scripts and determine the minimal
sub/sup shifts to apply.
(WebCore::RenderMathMLScripts::mirrorIfNeeded): Helper function to calculate the horizontal
offset depending on the directionality.
(WebCore::RenderMathMLScripts::layoutBlock): Implement this function.
(WebCore::RenderMathMLScripts::firstLineBaseline): Implement this function.
(WebCore::RenderMathMLScripts::paintChildren): Implement this function.
(WebCore::RenderMathMLScripts::RenderMathMLScripts): Deleted.
(WebCore::RenderMathMLScripts::base): Deleted.
(WebCore::RenderMathMLScripts::fixAnonymousStyleForSubSupPair): Deleted.
(WebCore::RenderMathMLScripts::fixAnonymousStyles): Deleted.
(WebCore::RenderMathMLScripts::addChildInternal): Deleted.
(WebCore::RenderMathMLScripts::removeChildInternal): Deleted.
(WebCore::RenderMathMLScripts::addChild): Deleted.
(WebCore::RenderMathMLScripts::removeChild): Deleted.
(WebCore::RenderMathMLScripts::styleDidChange): Deleted.
(WebCore::RenderMathMLScripts::layout): Deleted.
(WebCore::RenderMathMLScriptsWrapper::createAnonymousWrapper): Deleted.
(WebCore::RenderMathMLScriptsWrapper::addChildInternal): Deleted.
(WebCore::RenderMathMLScriptsWrapper::addChild): Deleted.
(WebCore::RenderMathMLScriptsWrapper::removeChildInternal): Deleted.
(WebCore::RenderMathMLScriptsWrapper::removeChild): Deleted.
* rendering/mathml/RenderMathMLScripts.h: Update definitions and remove classes
for anonymous wrappers.

LayoutTests:

We import tests from the MathML in HTML5 test suite to verify various OpenType MATH parameters.
We also add a test for the italic correction of large operators (bug 130325).
Finally, we adjust some tests and expectations to take into account the new rendering.

* imported/mathml-in-html5/LICENSE: Added.
* imported/mathml-in-html5/README.md: Added.
* imported/mathml-in-html5/fonts/math/scripts-spaceafterscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-spaceafterscript3000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscriptbaselinedropmin9000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptbaselinedropmin9000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscriptshiftdown6000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscriptshiftdown6000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subscripttopmax4000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subscripttopmax4000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000-superscriptbottommaxwithsubscript3000.woff.
* imported/mathml-in-html5/fonts/math/scripts-subsuperscriptgapmin11000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-subsuperscriptgapmin11000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptbaselinedropmax10000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbaselinedropmax10000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptbottommin8000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptbottommin8000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptshiftup7000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftup7000.woff.
* imported/mathml-in-html5/fonts/math/scripts-superscriptshiftupcramped5000.woff: Renamed from LayoutTests/mathml/mathml-in-html5/fonts/scripts-superscriptshiftupcramped5000.woff.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1-expected.txt: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1-expected.txt.
* imported/mathml-in-html5/mathml/presentation-markup/scripts/subsup-parameters-1.html: Renamed from LayoutTests/mathml/mathml-in-html5/subsup-parameters-1.html.
* mathml/msubsup-fuzz-expected.txt: Test adjustment: Update the reference now that nothing
is displayed for invalid markup.
* accessibility/mac/mathml-multiscript-expected.txt: ditto.
* mathml/opentype/large-operators-italic-correction.html: Added. This test verifies that the
italic correction from the MATH table is used for positioning subscripts of large operators.
* mathml/opentype/large-operators-italic-correction-expected.txt: Added.
* mathml/presentation/bug95015.html: Test adjustment: move down a bit the covering red
rectangle, since the script is slightly lower.
* mathml/presentation/bug95015-expected.html: ditto
* mathml/presentation/multiscripts-positions.html: Test adjustment: Modify the expected
vertical positions of scripts now that we follow Gecko's behavior.
* mathml/presentation/multiscripts-positions-expected.html: ditto.
* mathml/presentation/multiscripts-noscripts-expected.html: There seem to be small errors in
the ascent of mmultiscripts, probably due to the conversions between firstLineBaseline (int)
and LayoutUnit (fractional pixel). For now, let's tweak the tests.
* mathml/presentation/multiscripts-noscripts.html: ditto.
* mathml/presentation/scripts-height-expected.html: ditto
* mathml/presentation/scripts-height.html: ditto
* mathml/presentation/scripts-horizontal-alignment.html: Modify the test to make it work
with the new layout rules.
* mathml/presentation/scripts-horizontal-alignment-expected.html: ditto.
* platform/gtk/accessibility/math-multiscript-attributes-expected.txt: Test adjustment:
Update reference to take into account a small shift.
* platform/mac/accessibility/math-multiscript-attributes-expected.txt: ditto.
* platform/gtk/mathml/presentation/roots-expected.png: Test adjustment: Update reference to
take into account small rendering changes.
* platform/gtk/mathml/presentation/roots-expected.txt: ditto.
* platform/ios-simulator/mathml/presentation/roots-expected.txt: ditto.
* platform/mac/TestExpectations: Mark some tests for scripts as failing on mac. MATH fonts
are really needed to make them reliable.
* platform/ios-simulator/TestExpectations: Ditto

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

3 years agoPending API Request URL is wrong after reloading
carlosgc@webkit.org [Mon, 18 Apr 2016 10:36:29 +0000 (10:36 +0000)]
Pending API Request URL is wrong after reloading
https://bugs.webkit.org/show_bug.cgi?id=139342

Reviewed by Darin Adler.

Source/WebKit2:

It happens when reloading a web view loaded with anything but a
URL, because the bf list is not updated for those cases and
WebPageProxy::reload() is setting the current bf list item URL as
pending API request URL. This also causes that progress is
reported wrongly, because
WebPageProxy::decidePolicyForNavigationAction() resets the pending
API request URL when it's different than the requested URL. The
page load transaction causes the progress to be changed, reporting
1.0 (the previous one), but later something < 1.0 is reported
again by the progress tracker.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reload): Use the current active URL as
pending API request URL, falling back to the current bf list item
URL when empty.

Tools:

Update test case to check that the active URL should remain the
same after a reload.

* TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp:
(TestWebKitAPI::TEST):

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

3 years agoPending API request URL no set when loading Data, Alternate HTML or plain text
carlosgc@webkit.org [Mon, 18 Apr 2016 10:01:45 +0000 (10:01 +0000)]
Pending API request URL no set when loading Data, Alternate HTML or plain text
https://bugs.webkit.org/show_bug.cgi?id=136916

Reviewed by Darin Adler.

Source/WebKit2:

Set pending API request URL for all load methods in
WebPageProxy. This ensures that right after calling those methods,
the active URL is the requested one and that
PageLoadState::isLoading() returns true.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):

Tools:

Add new test to check that active URL is the requested one right
after calling WKPage load methods.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::loadPlainText): Remove FIXME.
(WebViewTest::loadBytes): Ditto.
(WebViewTest::loadAlternateHTML): Ditto.

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

3 years agoUnreviewed, rolling out r199660.
commit-queue@webkit.org [Mon, 18 Apr 2016 09:48:33 +0000 (09:48 +0000)]
Unreviewed, rolling out r199660.
https://bugs.webkit.org/show_bug.cgi?id=156691

It broke the iOS build (Requested by KaL on #webkit).

Reverted changeset:

"Pending API request URL no set when loading Data, Alternate
HTML or plain text"
https://bugs.webkit.org/show_bug.cgi?id=136916
http://trac.webkit.org/changeset/199660

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

3 years ago[css-grid] Use grid-template-areas to determine the explicit grid
rego@igalia.com [Mon, 18 Apr 2016 09:45:30 +0000 (09:45 +0000)]
[css-grid] Use grid-template-areas to determine the explicit grid
https://bugs.webkit.org/show_bug.cgi?id=156575

Reviewed by Darin Adler.

Source/WebCore:

From the spec (https://drafts.csswg.org/css-grid/#grid-definition):
"The size of the explicit grid is determined by the larger of the number
of rows/columns defined by grid-template-areas and the number
of rows/columns sized by grid-template-rows/grid-template-columns."

So we need to take into account the rows/columns defined by
grid-template-areas to determine the size of the explicit grid.

Test: fast/css-grid-layout/explicit-grid-size.html

* rendering/style/GridPositionsResolver.cpp:
(WebCore::GridPositionsResolver::explicitGridColumnCount):
(WebCore::GridPositionsResolver::explicitGridRowCount):

LayoutTests:

Created new test to check the right behavior.

* fast/css-grid-layout/explicit-grid-size-expected.txt: Added.
* fast/css-grid-layout/explicit-grid-size.html: Added.
* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt:
Small modification as now the columns defined by
grid-tempalte-areas are in the explicit grid.
* fast/css-grid-layout/grid-template-shorthand-get-set.html:
Ditto.

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

3 years agoPending API request URL no set when loading Data, Alternate HTML or plain text
carlosgc@webkit.org [Mon, 18 Apr 2016 08:50:21 +0000 (08:50 +0000)]
Pending API request URL no set when loading Data, Alternate HTML or plain text
https://bugs.webkit.org/show_bug.cgi?id=136916

Reviewed by Darin Adler.

Source/WebKit2:

Set pending API request URL for all load methods in
WebPageProxy. This ensures that right after calling those methods,
the active URL is the requested one and that
PageLoadState::isLoading() returns true.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::loadAlternateHTMLString):
(WebKit::WebPageProxy::loadPlainTextString):
(WebKit::WebPageProxy::loadWebArchiveData):

Tools:

Add new test to check that active URL is the requested one right
after calling WKPage load methods.

* TestWebKitAPI/PlatformEfl.cmake:
* TestWebKitAPI/PlatformGTK.cmake:
* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2/PendingAPIRequestURL.cpp: Added.
(TestWebKitAPI::TEST):
* TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp:
(WebViewTest::loadPlainText): Remove FIXME.
(WebViewTest::loadBytes): Ditto.
(WebViewTest::loadAlternateHTML): Ditto.

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

3 years ago[GTK] Menu list button doesn't use the text color from the theme
carlosgc@webkit.org [Mon, 18 Apr 2016 08:44:55 +0000 (08:44 +0000)]
[GTK] Menu list button doesn't use the text color from the theme
https://bugs.webkit.org/show_bug.cgi?id=118234

Reviewed by Darin Adler.

.:

* ManualTests/gtk/theme.html: Add a disabled combo test.

Source/WebCore:

Set the combo box color accroding to the theme when adjusting the menu list style like Mac port does.

* rendering/RenderThemeGtk.cpp:
(WebCore::menuListColor):
(WebCore::RenderThemeGtk::adjustMenuListStyle):

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

3 years ago[UNIX] Initialize WebKit before the platform initializations
carlosgc@webkit.org [Mon, 18 Apr 2016 08:31:11 +0000 (08:31 +0000)]
[UNIX] Initialize WebKit before the platform initializations
https://bugs.webkit.org/show_bug.cgi?id=156622

Reviewed by Michael Catanzaro.

The platform specific initialization might use something that would require WebKit2 to be initialized. For
example, in debug mode, the GTK+ port uses WTF::sleep that requires the threading to be initialized.

* Shared/unix/ChildProcessMain.h:
(WebKit::ChildProcessMain): Move InitializeWebKit2() before platformInitialize().

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